Rhino C++ API  8.6
Public Member Functions | List of all members
CRhRdkContentArray Class Reference

#include <RhRdkContent.h>

Inheritance diagram for CRhRdkContentArray:
ON_SimpleArray< const CRhRdkContent * > CRhRdkEditableContentArray

Public Member Functions

virtual bool CommonKind (bool bTopLevel, OUT CRhRdkContent::Kinds &kind) const
 
virtual bool ContentKindDescription (OUT ON_wString &sDescOut) const
 
bool ContentNameList (bool bAbbreviate, OUT ON_wString &sNames) const
 
virtual int CountVisible (void) const
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)
 
bool Explode (void)
 
bool ExplodeFirst (void)
 
virtual bool MakeUndoString (const ON_wString &sIn, ON_wString &sOut) const
 
bool operator!= (const CRhRdkContentArray &a)
 
bool operator== (const CRhRdkContentArray &a)
 
void SetIsCombineable (bool)
 
- Public Member Functions inherited from ON_SimpleArray< const CRhRdkContent * >
 ON_SimpleArray () ON_NOEXCEPT
 construction //////////////////////////////////////////////////////// More...
 
 ON_SimpleArray (const ON_SimpleArray< const CRhRdkContent * > &)
 Copy constructor. More...
 
 ON_SimpleArray (size_t)
 size_t parameter = initial capacity More...
 
virtual ~ON_SimpleArray ()
 
void Append (const const CRhRdkContent * &)
 
void Append (int, const const CRhRdkContent * *)
 Append copy of an array T[count]. More...
 
const CRhRdkContent * & AppendNew ()
 array operations //////////////////////////////////////////////////// More...
 
const CRhRdkContent * * Array ()
 The Array() function return the. More...
 
const const CRhRdkContent * * Array () const
 m_a pointer value. More...
 
const CRhRdkContent * * At (int)
 At(index) returns nullptr if index < 0 or index >= count. More...
 
const const CRhRdkContent * * At (int) const
 
const CRhRdkContent * * At (ON__INT64)
 
const const CRhRdkContent * * At (ON__INT64) const
 
const CRhRdkContent * * At (ON__UINT64)
 
const const CRhRdkContent * * At (ON__UINT64) const
 
const CRhRdkContent * * At (unsigned int)
 
const const CRhRdkContent * * At (unsigned int) const
 
int BinarySearch (const const CRhRdkContent * *, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *)) const
 See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T> More...
 
int BinarySearch (const const CRhRdkContent * *, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *), int) const
 
const const CRhRdkContent * * BinarySearchPtr (const const CRhRdkContent * *, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *)) const
 
const const CRhRdkContent * * BinarySearchPtr (const const CRhRdkContent * *, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *), int) const
 
int Capacity () const
 capacity of array More...
 
int Count () const
 query /////////////////////////////////////////////////////////////// More...
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
void Destroy ()
 onfree any memory and set count and capacity to zero More...
 
void EmergencyDestroy (void)
 emergency bailout /////////////////////////////////////////////////// More...
 
void Empty ()
 Sets count to 0, leaves capacity untouched. More...
 
const CRhRdkContent * * First ()
 
const const CRhRdkContent * * First () const
 returns nullptr if count = 0 More...
 
bool HeapSort (int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *))
 
void Insert (int, const const CRhRdkContent * &)
 
int InsertInSortedList (const const CRhRdkContent * &, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *))
 
int InsertInSortedList (const const CRhRdkContent * &, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *), int)
 
const CRhRdkContent * * KeepArray ()
 
const CRhRdkContent * * Last ()
 
const const CRhRdkContent * * Last () const
 returns nullptr if count = 0 More...
 
void MemSet (unsigned char)
 
int NewCapacity () const
 
 operator const const CRhRdkContent * * () const
 
 operator const CRhRdkContent ** ()
 The cast operators return a pointer. More...
 
ON_SimpleArray< const CRhRdkContent * > & operator= (const ON_SimpleArray< const CRhRdkContent * > &)
 
const CRhRdkContent * & operator[] (int)
 
const const CRhRdkContent * & operator[] (int) const
 
const CRhRdkContent * & operator[] (ON__INT64)
 
const const CRhRdkContent * & operator[] (ON__INT64) const
 
const CRhRdkContent * & operator[] (ON__UINT64)
 
const const CRhRdkContent * & operator[] (ON__UINT64) const
 
const CRhRdkContent * & operator[] (unsigned int)
 
const const CRhRdkContent * & operator[] (unsigned int) const
 
bool Permute (const int *)
 
void Prepend (int, const const CRhRdkContent * *)
 Prepend copy of an array T[count]. More...
 
bool QuickSort (int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *))
 See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T> More...
 
bool QuickSortAndRemoveDuplicates (int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *))
 See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T> More...
 
virtual const CRhRdkContent * * Realloc (const CRhRdkContent * *, int)
 low level memory management ////////////////////////////////////////// More...
 
void Remove ()
 
virtual void Remove (int)
 
void RemoveIf (bool predicate(const const CRhRdkContent * &key))
 
void RemoveValue (const const CRhRdkContent * &)
 
const CRhRdkContent * * Reserve (size_t)
 memory management //////////////////////////////////////////////////// More...
 
void Reverse ()
 reverse order More...
 
int Search (const const CRhRdkContent * &) const
 
int Search (const const CRhRdkContent * *, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *)) const
 See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T> More...
 
void SetArray (const CRhRdkContent * *)
 
void SetArray (const CRhRdkContent * *, int, int)
 
const CRhRdkContent * * SetCapacity (size_t)
 
void SetCount (int)
 low level memory management ////////////////////////////////////////// More...
 
void SetRange (int from, int count, const CRhRdkContent *)
 
void Shrink ()
 remove unused capacity More...
 
unsigned int SizeOfArray () const
 amount of memory in the m_a[] array More...
 
unsigned int SizeOfElement () const
 amount of memory in an m_a[] array element More...
 
bool Sort (ON::sort_algorithm sort_algorithm, int *, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *)) const
 
bool Sort (ON::sort_algorithm sort_algorithm, int *, int(*)(const const CRhRdkContent * *, const const CRhRdkContent * *, void *), void *) const
 
void Swap (int, int)
 swap elements i and j More...
 
unsigned int UnsignedCount () const
 
void Zero ()
 

Additional Inherited Members

- Protected Member Functions inherited from ON_SimpleArray< const CRhRdkContent * >
void Move (int, int, int)
 implementation ////////////////////////////////////////////////////// More...
 
- Protected Attributes inherited from ON_SimpleArray< const CRhRdkContent * >
const CRhRdkContent * * m_a
 pointer to array memory More...
 
int m_capacity
 actual length of m_a[] More...
 
int m_count
 0 <= m_count <= m_capacity More...
 

Detailed Description

Encapsulates a collection of pointers to contents and provides some useful functions that can be performed on them.

Member Function Documentation

◆ CommonKind()

virtual bool CRhRdkContentArray::CommonKind ( bool  bTopLevel,
OUT CRhRdkContent::Kinds kind 
) const
virtual

Gets the common kind shared by all contents in the collection.

Note
If the collection is empty, the method will fail.
Parameters
bTopLevelforces only top-level contents to be considered.
kindaccepts the common kind if the method returns true.
Returns
true if all contents in the collection are of the same kind, else false.

◆ ContentKindDescription()

virtual bool CRhRdkContentArray::ContentKindDescription ( OUT ON_wString sDescOut) const
virtual

Gets a localized textual description of the content kinds in the collection.

Note
If the collection is empty, the method will fail.
Parameters
sDescOutaccepts the description (e.g., "1 material, 2 textures").
Returns
true if successful, else false.

◆ ContentNameList()

bool CRhRdkContentArray::ContentNameList ( bool  bAbbreviate,
OUT ON_wString sNames 
) const

Gets a localized textual list of the content names in the collection.

Note
If the collection is empty, the method will fail.
Parameters
bAbbreviateis true if the list should be abbreviated using text such as "and 2 others", else false.
sNamesaccepts the name list (e.g., "Custom Material, Gem Material").
Returns
true if successful, else false.

◆ CountVisible()

virtual int CRhRdkContentArray::CountVisible ( void  ) const
virtual

Counts the number of contents that will be shown in a UI. This is usually the same as Count(), but when the array contains contents that have been hidden by auto-delete, it will be different.

◆ EVF()

virtual void* CRhRdkContentArray::EVF ( const wchar_t *  wszFunc,
void *  pvData 
)
virtual

Emergency virtual function for future expansion.

◆ Explode()

bool CRhRdkContentArray::Explode ( void  )

If the array contains aggregate contents (e.g., Texture Proxies), then those aggregates are removed from the array and replaced with their members. Otherwise the function returns false.

◆ ExplodeFirst()

bool CRhRdkContentArray::ExplodeFirst ( void  )

If the array contains aggregate contents (e.g., Texture Proxies), then those aggregates are removed from the array and replaced with the first member of the first proxy. Otherwise the function returns false.

◆ MakeUndoString()

virtual bool CRhRdkContentArray::MakeUndoString ( const ON_wString sIn,
ON_wString sOut 
) const
virtual

Makes a localized string that can be used as an undo string.

Note
If the collection is empty, the method will fail.
Parameters
sInis the base undo string (e.g., "Delete").
sOutaccepts the complete undo string (e.g., "Delete (Custom 001)" or "Delete (5 materials)").
Returns
true if successful, else false.

◆ operator!=()

bool CRhRdkContentArray::operator!= ( const CRhRdkContentArray a)
Returns
true if the arrays do not contain the same content pointers.

◆ operator==()

bool CRhRdkContentArray::operator== ( const CRhRdkContentArray a)
Returns
true if the arrays contain the same content pointers.

◆ SetIsCombineable()

void CRhRdkContentArray::SetIsCombineable ( bool  )