Rhino C++ API  9.0
Public Member Functions | Public Attributes | Friends | List of all members
CRhinoSectionStyleTable Class Reference

#include <rhinoSdkSectionStyle.h>

Inheritance diagram for CRhinoSectionStyleTable:
ON_SimpleArray< CRhinoSectionStyle * >

Public Member Functions

const ON_ComponentManifestItemAddSectionStyle ()
 
const ON_ComponentManifestItemAddSectionStyle (const ON_SectionStyle &section_style, bool bReference)
 
const ON_ComponentManifestItemCreateSectionStyle (const ON_SectionStyle &section_style, unsigned int worksession_ref_model_sn, unsigned int linked_idef_sn)
 
bool DeleteSectionStyle (const ON_ComponentManifestItem &item, bool bQuiet)
 
bool DeleteSectionStyle (int section_style_index, bool bQuiet)
 
int DeleteSectionStyles (int section_style_count, const int *section_style_indices, bool bQuiet)
 
int DeleteSectionStyles (int section_style_count, const int *section_style_indices, bool bQuiet, int delete_warning)
 
CRhinoDocDocument () const
 
void GetSortedList (ON_SimpleArray< const CRhinoSectionStyle * > &sorted_list, bool bIgnoreDeleted, bool bIgnoreReference) const
 
void GetSortedList (ON_SimpleArray< const CRhinoSectionStyle * > &sorted_list, bool bIgnoreDeleted=false) const
 
void GetUnusedSectionStyleName (const wchar_t *root_name, ON_wString &unused_section_style_name) const
 
void GetUnusedSectionStyleName (ON_wString &unused_section_style_name) const
 
bool InSectionStyleTable (const ON_SectionStyle *section_style) const
 
bool InUse (int section_style_index) const
 
bool InUse (int section_style_index, int *idef_count, int *object_count, int *layer_count) const
 
bool IsValidSectionStyleTableIndex (int section_style_index) const
 
bool ModifySectionStyle (const ON_SectionStyle &section_style, const ON_ComponentManifestItem &item, bool bQuiet)
 
bool ModifySectionStyle (const ON_SectionStyle &section_style, int section_style_index, bool bQuiet)
 
const CRhinoSectionStyleoperator[] (int section_style_index) const
 
const CRhinoSectionStyleSectionStyle (const ON_ComponentManifestItem &section_style_manifest_item) const
 
const CRhinoSectionStyleSectionStyle (const ON_ComponentManifestItem &section_style_manifest_item, const CRhinoSectionStyle *not_found) const
 
int SectionStyleCount () const
 
const CRhinoSectionStyleSectionStyleFromId (ON_UUID section_style_id, bool bSearchDeletedSectionStyles) const
 
const CRhinoSectionStyleSectionStyleFromIndex (int section_style_index, bool bSearchDeletedSectionStyles) const
 
const CRhinoSectionStyleSectionStyleFromName (const wchar_t *section_style_name) const
 
const ON_ComponentManifestItemSectionStyleManifestItemFromId (ON_UUID section_style_id, bool bSearchDeletedSectionStyles) const
 
const ON_ComponentManifestItemSectionStyleManifestItemFromIndex (int section_style_index, bool bSearchDeletedSectionStyles) const
 
const ON_ComponentManifestItemSectionStyleManifestItemFromName (const wchar_t *section_style_name) const
 
void SetRemapIndex (int section_style_index, int remap_index)
 
void Sort (int(*compar)(const CRhinoSectionStyle *, const CRhinoSectionStyle *, void *), int(*cull)(const CRhinoSectionStyle *, void *), void *ptr)
 
const class CRhinoDocTableReferenceTableReference () const
 
bool UndeleteSectionStyle (int section_style_index)
 
bool UndoModifySectionStyle (int section_style_index, unsigned int undo_record_sn)
 

Public Attributes

const CRhinoSectionStyleDefault
 index = -1, id set, unique, and persistent More...
 

Friends

class CRhDocSdkExtension
 
class CRhinoDoc
 

Detailed Description

CRhinoSectionStyleTable

Member Function Documentation

◆ AddSectionStyle() [1/2]

const ON_ComponentManifestItem& CRhinoSectionStyleTable::AddSectionStyle ( )

Description: Adds a new unset section style to the table. Returns: index for the section style on success

◆ AddSectionStyle() [2/2]

const ON_ComponentManifestItem& CRhinoSectionStyleTable::AddSectionStyle ( const ON_SectionStyle section_style,
bool  bReference 
)

Description: Adds a new section style to the table. Parameters: section_style - [in] The section style to add. bReference - [in] true if this section style is a reference section style. / Reference section styles are not saved in files. Returns: index for the section style on success. ON_UNSET_INT_INDEX if input is not valid.

◆ CreateSectionStyle()

const ON_ComponentManifestItem& CRhinoSectionStyleTable::CreateSectionStyle ( const ON_SectionStyle section_style,
unsigned int  worksession_ref_model_sn,
unsigned int  linked_idef_sn 
)

Description: Basic tool used to create a new section style with specified definition to the section style table. The AddSectionStyle() functions all use CreateSectionStyle() when a new section style needs to be added to the section style table. Parameters: section_style - [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: index of new section style on success. ON_UNSET_INT_INDEX on failuer

◆ DeleteSectionStyle() [1/2]

bool CRhinoSectionStyleTable::DeleteSectionStyle ( const ON_ComponentManifestItem item,
bool  bQuiet 
)

◆ DeleteSectionStyle() [2/2]

bool CRhinoSectionStyleTable::DeleteSectionStyle ( int  section_style_index,
bool  bQuiet 
)

Description: Delete a section style. Parameters: section_style_index [in] - Zero based index of section style to delete. Must be in the range 0 <= index < SectionStyleCount(). bQuiet [in] - Set true to disable any warning or error messages. Returns: true if successful, or false if index is out of range or the section style cannot be deleted.

◆ DeleteSectionStyles() [1/2]

int CRhinoSectionStyleTable::DeleteSectionStyles ( int  section_style_count,
const int *  section_style_indices,
bool  bQuiet 
)

Description: Delete multiple section styles. Parameters: section_style_count - [in] length of section_style_indices[] array. section_style_indices - [in] array zero based indices of section style to delete. The indices must be in the range 0 <= index < SectionStyleCount(). bQuiet - [in] If true, no warning message box appears if a section style cannot be deleted because it is in use. Returns: Number of section styles that were deleted. If this is < section_style_count, you can dig through the section style table and check which ones were not deleted.

◆ DeleteSectionStyles() [2/2]

int CRhinoSectionStyleTable::DeleteSectionStyles ( int  section_style_count,
const int *  section_style_indices,
bool  bQuiet,
int  delete_warning 
)

Description: Delete multiple section styles. Parameters: section_style_count - [in] length of section_style_indices[] array. section_style_indices - [in] array zero based indices of section style to delete. The indices must be in the range 0 <= index < SectionStyleCount(). bQuiet - [in] If true, no warning message box appears if a section style cannot be deleted because it is in use. delete_warning - [in] Action to take when multiple delete warnings occur, where: 0 == No to all, 1 == Yes to all, 2 == Ask the user. Returns: Number of section styles that were deleted. If this is < section_style_count, you can dig through the section style table and check which ones were not deleted.

◆ Document()

CRhinoDoc& CRhinoSectionStyleTable::Document ( ) const

◆ GetSortedList() [1/2]

void CRhinoSectionStyleTable::GetSortedList ( ON_SimpleArray< const CRhinoSectionStyle * > &  sorted_list,
bool  bIgnoreDeleted,
bool  bIgnoreReference 
) const

Description: Gets an array of pointers to section styles that is sorted by the values of CRhinoSectionStyle::Name(). Parameters: sorted_list [out] - this array is returned with length HatchPatternCount() and is sorted by the values of CRhinoSectionStyle::Name(). bIgnoreDeleted [in] - set true to ignore deleted section styles. bIgnoreReference [in] - set true to ignore reference section styles. Remarks: Use Sort() to set the values of CRhinoSectionStyle::m_sort_index.

◆ GetSortedList() [2/2]

void CRhinoSectionStyleTable::GetSortedList ( ON_SimpleArray< const CRhinoSectionStyle * > &  sorted_list,
bool  bIgnoreDeleted = false 
) const

Description: Gets an array of pointers to section styles that is sorted by the values of CRhinoSectionStyle::Name(). Parameters: sorted_list [out] - this array is returned with length HatchPatternCount() and is sorted by the values of CRhinoSectionStyle::Name(). bIgnoreDeleted [in] - set true to ignore deleted section styles. Remarks: Use Sort() to set the values of CRhinoSectionStyle::m_sort_index.

◆ GetUnusedSectionStyleName() [1/2]

void CRhinoSectionStyleTable::GetUnusedSectionStyleName ( const wchar_t *  root_name,
ON_wString unused_section_style_name 
) const

Description: Gets an unused section style name. Parameters: root_name [in] - the root name for the new section style name. unused_section_style_name [out] - an unused section style index.

◆ GetUnusedSectionStyleName() [2/2]

void CRhinoSectionStyleTable::GetUnusedSectionStyleName ( ON_wString unused_section_style_name) const

Description: Gets an unused section style name. Parameters: unused_section_style_name [out] - an unused section style index.

◆ InSectionStyleTable()

bool CRhinoSectionStyleTable::InSectionStyleTable ( const ON_SectionStyle section_style) const

Returns: true if the section style is an element in this table.

◆ InUse() [1/2]

bool CRhinoSectionStyleTable::InUse ( int  section_style_index) const

Description: Returns true if a section style is use by an object, layer, or instance definition. Parameters: hatch_pattern_index - [in] index of section style to query. Returns: true if successful.

◆ InUse() [2/2]

bool CRhinoSectionStyleTable::InUse ( int  section_style_index,
int *  idef_count,
int *  object_count,
int *  layer_count 
) const

◆ IsValidSectionStyleTableIndex()

bool CRhinoSectionStyleTable::IsValidSectionStyleTableIndex ( int  section_style_index) const

Returns: true if the section style index is a valid index of a section style element in this table.

◆ ModifySectionStyle() [1/2]

bool CRhinoSectionStyleTable::ModifySectionStyle ( const ON_SectionStyle section_style,
const ON_ComponentManifestItem item,
bool  bQuiet 
)

◆ ModifySectionStyle() [2/2]

bool CRhinoSectionStyleTable::ModifySectionStyle ( const ON_SectionStyle section_style,
int  section_style_index,
bool  bQuiet 
)

Description: Change section style settings Parameters: section_style [in] - New settings. This information is copied. section_style_index [in] - Zero based index of section style to modify. bQuiet [in] - Set true to disable any warning or error messages. Returns: true if successful. false otherwise.

◆ operator[]()

const CRhinoSectionStyle* CRhinoSectionStyleTable::operator[] ( int  section_style_index) const

Description: Conceptually, the section style table is an array of SectionStyleCount() section styles. The operator[] can be used to get individual section styles. A section style is either active or deleted and this state is reported by CRhinoSectionStyle::IsDeleted(). Parameters: section_style_index [in] - zero based array index Returns: If successful, a pointer to the section style is returned. If not successful or if the index is out-of-range, nullptr is returned. Note, this pointer may become invalid after AddSectionStyle() is called.

◆ SectionStyle() [1/2]

const CRhinoSectionStyle* CRhinoSectionStyleTable::SectionStyle ( const ON_ComponentManifestItem section_style_manifest_item) const

Description: Gets a section style by component manifest. Parameters: section_style_manifest_item [in] - the component manifest item. Returns: If successful, a pointer to the section style is returned. If not successful, nullptr is returned.

◆ SectionStyle() [2/2]

const CRhinoSectionStyle* CRhinoSectionStyleTable::SectionStyle ( const ON_ComponentManifestItem section_style_manifest_item,
const CRhinoSectionStyle not_found 
) const

Description: Gets a section style by component manifest. Parameters: section_style_manifest_item [in] - the component manifest item. Returns: If successful, a pointer to the section style is returned. If not successful, not_found is returned is specified. Otherwise, nullptr is returned.

◆ SectionStyleCount()

int CRhinoSectionStyleTable::SectionStyleCount ( ) const

Returns: Number of section styles in the table.

◆ SectionStyleFromId()

const CRhinoSectionStyle* CRhinoSectionStyleTable::SectionStyleFromId ( ON_UUID  section_style_id,
bool  bSearchDeletedSectionStyles 
) const

Description: Gets a section style by section style id. Parameters: section_style_id [in] - the section style id. bSearchDeletedSectionStyles [in] - set true to search for deleted section styles. Returns: If successful, a pointer to the section style is returned. If not successful, nullptr is returned.

◆ SectionStyleFromIndex()

const CRhinoSectionStyle* CRhinoSectionStyleTable::SectionStyleFromIndex ( int  section_style_index,
bool  bSearchDeletedSectionStyles 
) const

Description: Gets a section style by section style index. Parameters: section_style_index [in] - the section style index. bSearchDeletedSectionStyles [in] - set true to search for deleted section styles. Returns: If successful, a pointer to the section style is returned. If not successful, nullptr is returned.

◆ SectionStyleFromName()

const CRhinoSectionStyle* CRhinoSectionStyleTable::SectionStyleFromName ( const wchar_t *  section_style_name) const

Description: Gets a section style by section style name. Parameters: section_style_name [in] - the section style name. Returns: If successful, a pointer to the section style is returned. If not successful, nullptr is returned.

◆ SectionStyleManifestItemFromId()

const ON_ComponentManifestItem& CRhinoSectionStyleTable::SectionStyleManifestItemFromId ( ON_UUID  section_style_id,
bool  bSearchDeletedSectionStyles 
) const

Description: Gets a component manifest item by section style id. Parameters: section_style_id [in] - the section style id. bSearchDeletedSectionStyles [in] - set true to search for deleted section styles. Returns: If successful, a ON_ModelComponent::Type::SectionStyle component manifest item. If not successful, ON_ComponentManifestItem::UnsetItem is returned.

◆ SectionStyleManifestItemFromIndex()

const ON_ComponentManifestItem& CRhinoSectionStyleTable::SectionStyleManifestItemFromIndex ( int  section_style_index,
bool  bSearchDeletedSectionStyles 
) const

Description: Gets a component manifest item by section style index. Parameters: section_style_index [in] - the section style index. bSearchDeletedSectionStyles [in] - set true to search for deleted section styles. Returns: If successful, a ON_ModelComponent::Type::SectionStyle component manifest item. If not successful, ON_ComponentManifestItem::UnsetItem is returned.

◆ SectionStyleManifestItemFromName()

const ON_ComponentManifestItem& CRhinoSectionStyleTable::SectionStyleManifestItemFromName ( const wchar_t *  section_style_name) const

Description: Gets a component manifest item by section style name. Parameters: section_style_name [in] - the section style name. Returns: If successful, a ON_ModelComponent::Type::SectionStyle component manifest item. If not successful, ON_ComponentManifestItem::UnsetItem is returned.

◆ SetRemapIndex()

void CRhinoSectionStyleTable::SetRemapIndex ( int  section_style_index,
int  remap_index 
)

◆ Sort()

void CRhinoSectionStyleTable::Sort ( int(*)(const CRhinoSectionStyle *, const CRhinoSectionStyle *, void *)  compar,
int(*)(const CRhinoSectionStyle *, void *)  cull,
void *  ptr 
)

Description: Use this to set CRhinoSectionStyle::m_sort_index so that the values of CRhinoSectionStyle::m_sort_index run from 0 to SectionStyleCount() - 1 and compare(CRhinoSectionStyleTable[i],CRhinoSectionStyleTable[j]) < 0) implies CRhinoSectionStyleTable[i].m_sort_index < CRhinoSectionStyleTable[j].m_sort_index. Parameters: compare [in] - Compare function that returns <0 if arg1<arg2, 0 if arg1=arg2, and >0 if arg1>arg2. cull [in] - optional filter function with prototype that returns true if the section style should be ignored when sorting. Section styles that are ignored are not included in the list returned by GetSortedList(). Pass nullptr if you do not need to cull section style. ptr [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 CRhinoSectionStyle pointers. Sort() and GetSortedList() do not modify the order or persistent information in the table. They are intended to be used to get sorted lists for dialogs, etc.

◆ TableReference()

const class CRhinoDocTableReference& CRhinoSectionStyleTable::TableReference ( ) const

◆ UndeleteSectionStyle()

bool CRhinoSectionStyleTable::UndeleteSectionStyle ( int  section_style_index)

Description: Undeletes a section style that has been deleted by DeleteSectionStyle(). Parameters: section_style_index [in] - Zero based index of section style to delete. Must be in the range 0 <= index < SectionStyleCount(). Returns: true if successful, false otherwise.

◆ UndoModifySectionStyle()

bool CRhinoSectionStyleTable::UndoModifySectionStyle ( int  section_style_index,
unsigned int  undo_record_sn 
)

Description: If the section style has been modified and the modification can be undone, then UndoModifySectionStyle() will restore the section style to its previous state. Returns: True if the section style had been modified and the modifications were undone.

Friends And Related Function Documentation

◆ CRhDocSdkExtension

friend class CRhDocSdkExtension
friend

◆ CRhinoDoc

friend class CRhinoDoc
friend

Member Data Documentation

◆ Default

const CRhinoSectionStyle& CRhinoSectionStyleTable::Default

index = -1, id set, unique, and persistent

Built-in section styles. Localized names, id set, unique, and persistent