Rhino C++ API  8.14
Public Member Functions | List of all members
CRhRdkEditableContentArray Class Reference

#include <RhRdkContent.h>

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

Public Member Functions

 CRhRdkEditableContentArray (bool bAllowUpdatePreview, IRhinoUiDataSourceHost &host)
 
 CRhRdkEditableContentArray (class CRhRdkCustomContentUI &ccui, bool bForWrite, bool bAutoChangeBracket=true)
 
 CRhRdkEditableContentArray (class IRhinoUiDataSourceHost &host, bool bForWrite, bool bAutoChangeBracket=true)
 
 CRhRdkEditableContentArray (int, IRhinoUiDataSourceHost &host)
 
virtual ~CRhRdkEditableContentArray ()
 
void Cancel (void)
 
void ChangeContentType (const UUID &uuidType)
 
void Initialize (void)
 
- Public Member Functions inherited from CRhRdkContentArray
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
 
void Dump (const CRhRdkContent::DumpContext &dc, unsigned int gds_flags) 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

A collection of pointers to contents enhanced for use in content UIs. This array automatically populates itself from a data source host (which is usually a controller).

Example usage from a content UI section:

Reading:

const auto con = Controller();
if (!con)
return;
CRhRdkEditableContentArray aContent(*con, false);
for (int i = 0; i < aContent.Count(); i++)
{
const auto pMaterial = dynamic_cast<const CMyMaterial*>(aContent[i]);
if (nullptr != pMaterial)
{
...
}
}

Writing:

const auto con = Controller();
if (!con)
return;
CRhRdkEditableContentArray aContent(*con, true);
for (int i = 0; i < aContent.Count(); i++)
{
const auto pMaterial = dynamic_cast<const CMyMaterial*>(aContent[i]);
if (nullptr != pMaterial)
{
m().SetSomething(value);
}
}

Constructor & Destructor Documentation

◆ CRhRdkEditableContentArray() [1/4]

CRhRdkEditableContentArray::CRhRdkEditableContentArray ( class IRhinoUiDataSourceHost host,
bool  bForWrite,
bool  bAutoChangeBracket = true 
)

◆ CRhRdkEditableContentArray() [2/4]

CRhRdkEditableContentArray::CRhRdkEditableContentArray ( class CRhRdkCustomContentUI ccui,
bool  bForWrite,
bool  bAutoChangeBracket = true 
)

◆ ~CRhRdkEditableContentArray()

virtual CRhRdkEditableContentArray::~CRhRdkEditableContentArray ( )
virtual

◆ CRhRdkEditableContentArray() [3/4]

CRhRdkEditableContentArray::CRhRdkEditableContentArray ( bool  bAllowUpdatePreview,
IRhinoUiDataSourceHost host 
)

◆ CRhRdkEditableContentArray() [4/4]

CRhRdkEditableContentArray::CRhRdkEditableContentArray ( int  ,
IRhinoUiDataSourceHost host 
)

Member Function Documentation

◆ Cancel()

void CRhRdkEditableContentArray::Cancel ( void  )

Call this method if the user cancels the operation.

◆ ChangeContentType()

void CRhRdkEditableContentArray::ChangeContentType ( const UUID &  uuidType)

Change the type of all contents in the collection. This provides a safe way to change content types from a UI.

Parameters
uuidTypeis the new type id.

◆ Initialize()

void CRhRdkEditableContentArray::Initialize ( void  )
UI
enum RHRDK_SDK enum RHRDK_SDK UI
Definition: RhRdkDefinitions.h:132
CRhRdkContent::Change
Definition: RhRdkContent.h:349
CRhRdkEditableContentArray
Definition: RhRdkContent.h:1904