Rhino C++ API  8.7
Public Member Functions | Friends | List of all members
CRhinoGroupTable Class Reference

#include <rhinoSdkGroup.h>

Inheritance diagram for CRhinoGroupTable:
ON_SimpleArray< CRhinoGroup * >

Public Member Functions

int AddGroup ()
 
int AddGroup (const ON_Group &group)
 
int AddGroup (const ON_Group &group, ON_SimpleArray< const CRhinoObject * > &group_members)
 
int AddGroup (ON_SimpleArray< const CRhinoObject * > &group_members)
 
int CreateGroup (const ON_Group &group, ON_SimpleArray< const CRhinoObject * > &group_members, unsigned int worksession_ref_model_sn, unsigned int linked_idef_sn)
 
int CreateGroup (const ON_Group &group, unsigned int worksession_ref_model_sn, unsigned int linked_idef_sn)
 
bool DeleteGroup (int)
 
CRhinoDocDocument () const
 
int FindGroupFromId (ON_UUID group_id, bool bSearchDeletedGroups) const
 
int FindGroupFromName (const wchar_t *group_name) const
 
void GetUnusedGroupName (const wchar_t *root_name, ON_wString &unused_group_name)
 
void GetUnusedGroupName (ON_wString &unused_group_name)
 
int GroupCount () const
 
bool InGroupTable (const ON_Group *group) const
 
bool IsValidGroupTableIndex (int group_index) const
 
void ListTable (ON_TextLog &text_log, unsigned int level_of_detail) const
 
bool ModifyGroup (const ON_Group &group, int group_index, bool bQuiet=false)
 
const CRhinoGroupoperator[] (int group_index) const
 
void SetRemapIndex (int, int)
 
void SetUnusedGroupName (const wchar_t *root_name, ON_Group &group_to_name)
 
void SetUnusedGroupName (ON_Group &group_to_name)
 
void Sort (int(*compare)(const CRhinoGroup *, const CRhinoGroup *, void *p), int(*cull)(const CRhinoGroup *, void *), void *p=0)
 
const class CRhinoDocTableReferenceTableReference () const
 
bool UndeleteGroup (int group_index)
 

Friends

class CRhinoDoc
 

Member Function Documentation

◆ AddGroup() [1/4]

int CRhinoGroupTable::AddGroup ( )

Description: Adds a new group to the group table. Returns: @untitled table >=0 index of new group ON_UNSET_INT_INDEX group not added because input is not valid. Description: Adds a new group to the group table. Parameters: group - [in] The name and id are used as candidates. If they are in use, a new name or id is created. Returns: @untitled table >=0 index of new group ON_UNSET_INT_INDEX group not added because input is not valid.

◆ AddGroup() [2/4]

int CRhinoGroupTable::AddGroup ( const ON_Group group)

◆ AddGroup() [3/4]

int CRhinoGroupTable::AddGroup ( const ON_Group group,
ON_SimpleArray< const CRhinoObject * > &  group_members 
)

◆ AddGroup() [4/4]

int CRhinoGroupTable::AddGroup ( ON_SimpleArray< const CRhinoObject * > &  group_members)

Description: Adds a new group to the group table. Parameters: group - [in] The name and id are used as candidates. If they are in use, a new name or id is created. group_members - [in] list of objects to add to the group. Returns: @untitled table >=0 index of new group ON_UNSET_INT_INDEX group not added because input is not valid.

◆ CreateGroup() [1/2]

int CRhinoGroupTable::CreateGroup ( const ON_Group group,
ON_SimpleArray< const CRhinoObject * > &  group_members,
unsigned int  worksession_ref_model_sn,
unsigned int  linked_idef_sn 
)

◆ CreateGroup() [2/2]

int CRhinoGroupTable::CreateGroup ( const ON_Group group,
unsigned int  worksession_ref_model_sn,
unsigned int  linked_idef_sn 
)

Description: Basic tool used to create a new group with specified definition to the group table. The AddGroup() functions all use CreateGroup() when a new group needs to be added to the group table.

Parameters: group - [in] The name and id are used as candidates. If they are in use, a new name or id is created.

worksession_ref_model_sn - [in] 0: not from a reference model 1: not saved in files but not part of a worksession reference file 2-1000: reserved for future use >1000: worksession reference file serial number

linked_idef_sn - [in] 0: not from a liked instance definition 1-1000: reserved for future use >1000: group instance definition serial number

Returns: @untitled table >=0 index of new grpup ON_UNSET_INT_INDEX group not added

◆ DeleteGroup()

bool CRhinoGroupTable::DeleteGroup ( int  )

Description: Deletes group

Parameters: group_index - [in] zero based index of group to delete. This must be in the range 0 <= group_index < GroupCount(). bQuiet - [in] If TRUE, no warning message box appears if a group the group cannot be deleted because it is the current group or it contains active geometry.

Returns: TRUE if successful. FALSE if group_index is out of range or the the group cannot be deleted because it is the current group or because it group contains active geometry.

◆ Document()

CRhinoDoc& CRhinoGroupTable::Document ( ) const

Description: Group tables store the list of groups in a Rhino document.

Returns: CRhinoDocument that owns this group table.

◆ FindGroupFromId()

int CRhinoGroupTable::FindGroupFromId ( ON_UUID  group_id,
bool  bSearchDeletedGroups 
) const

Description: Finds the group with a given id.

Parameters: group_id - [in] bSearchDeletedGroups - [in] not_found_return_value - [in]

Returns: >=0 CRhinoDoc runtime group index of the group with id = group_id ON_UNSET_INT_INDEX no group has the id

◆ FindGroupFromName()

int CRhinoGroupTable::FindGroupFromName ( const wchar_t *  group_name) const

Description: Finds the group with a given name.

Parameters: group_name - [in] Case is ignored. not_found_return_value - [in]

Returns: >=0 CRhinoDoc runtime group index of the group with name = group_name ON_UNSET_INT_INDEX no group has the name

◆ GetUnusedGroupName() [1/2]

void CRhinoGroupTable::GetUnusedGroupName ( const wchar_t *  root_name,
ON_wString unused_group_name 
)

◆ GetUnusedGroupName() [2/2]

void CRhinoGroupTable::GetUnusedGroupName ( ON_wString unused_group_name)

◆ GroupCount()

int CRhinoGroupTable::GroupCount ( ) const

Returns: Number of groups in the group table

◆ InGroupTable()

bool CRhinoGroupTable::InGroupTable ( const ON_Group group) const

Returns: true The group is an element in this group table.

◆ IsValidGroupTableIndex()

bool CRhinoGroupTable::IsValidGroupTableIndex ( int  group_index) const

Returns: true The group_index is a valid index of a group element in this group table.

◆ ListTable()

void CRhinoGroupTable::ListTable ( ON_TextLog text_log,
unsigned int  level_of_detail 
) const

◆ ModifyGroup()

bool CRhinoGroupTable::ModifyGroup ( const ON_Group group,
int  group_index,
bool  bQuiet = false 
)

Description: Change group settings

Parameters: group - [in] new settings. This information is copied. group_index - [in] zero based index of group to set. This can be in the range 0 <= group_index <= GroupCount(). If group_index==GroupCount(), a new group is added. bQuiet - [in] TRUE to disable message boxes when illegal names are used.

Returns: TRUE if successful. FALSE if group_index is out of range or the settings attempt to lock or hide the current group.

◆ operator[]()

const CRhinoGroup* CRhinoGroupTable::operator[] ( int  group_index) const

Description: Conceptually, the group table is an array of GroupCount() groups. The operator[] can be used to get individual groups. A group is either active or deleted and this state is reported by CRhinoGroup::IsDeleted().

Parameters: group_index - zero based array index

Returns: Pointer to the group. If group_index is out of range, a NULL pointer is returned. Note that this pointer may become invalid after AddGroup() is called.

◆ SetRemapIndex()

void CRhinoGroupTable::SetRemapIndex ( int  ,
int   
)

◆ SetUnusedGroupName() [1/2]

void CRhinoGroupTable::SetUnusedGroupName ( const wchar_t *  root_name,
ON_Group group_to_name 
)

◆ SetUnusedGroupName() [2/2]

void CRhinoGroupTable::SetUnusedGroupName ( ON_Group group_to_name)

Parameters:

group_to_name - [out] Name is set to an unused group name.

◆ Sort()

void CRhinoGroupTable::Sort ( int(*)(const CRhinoGroup *, const CRhinoGroup *, void *p)  compare,
int(*)(const CRhinoGroup *, void *)  cull,
void *  p = 0 
)

Description: Use this to set CRhinoGroup::m_sort_index so that the values of m_sort_index run from 0 to GroupCount()-1 and compare(group_table[i],group_table[j]) < 0 ) implies group_table[i].m_sort_index < group_table[j].m_sort_index.

Parameters: compare - [in] compare function with prototype int compare(const CRhinoGroup* arg1,const CRhinoGroup* arg2,void* p). that returns <0 if arg1<arg2, 0 if arg1=arg2, and >0 if arg1>arg2. cull - [in] optional filter function with prototype BOOL32 cull(const CRhinoGroup* arg,void* p). that returns TRUE if the group should be ignored when sorting. Groups that are ignored are not included in the list returned by GetSortedList(). Pass 0 if you do not need to cull the list. p - [in] pointer passed as last argument to compare() and cull().

Remarks: After calling Sort(), you can repeatedly call GetSortedList() to get a sorted list of CRhinoGroup pointers. Sort() and GetSortedList() do not modify the order or persistent information in the group table. They are intended to be used to get sorted lists of groups for dialogs, etc.

◆ TableReference()

const class CRhinoDocTableReference& CRhinoGroupTable::TableReference ( ) const

◆ UndeleteGroup()

bool CRhinoGroupTable::UndeleteGroup ( int  group_index)

Description: Undeletes a group that has been deleted by DeleteGroup().

Parameters: group_index - [in] zero based index of group to undelete. This must be in the range 0 <= group_index < GroupCount().

Returns: TRUE if successful.

Friends And Related Function Documentation

◆ CRhinoDoc

friend class CRhinoDoc
friend