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

#include <rhinoSdkMarkup.h>

Inheritance diagram for CRhinoMarkupTable:
ON_SimpleArray< CRhinoMarkup * >

Public Member Functions

const ON_ComponentManifestItemAddMarkup ()
 
const ON_ComponentManifestItemAddMarkup (const ON_Markup &markup, bool bReference)
 
const ON_ComponentManifestItemCreateMarkup (const ON_Markup &markup, unsigned int worksession_ref_model_sn, unsigned int linked_idef_sn)
 
bool DeleteMarkup (const ON_ComponentManifestItem &item, bool bQuiet)
 
bool DeleteMarkup (int markup_index, bool bQuiet)
 
int DeleteMarkups (int markup_count, const int *markup_indices, bool bQuiet)
 
int DeleteMarkups (int markup_count, const int *markup_indices, bool bQuiet, int delete_warning)
 
CRhinoDocDocument () const
 
void GetSortedList (ON_SimpleArray< const CRhinoMarkup * > &sorted_list, bool bIgnoreDeleted, bool bIgnoreReference) const
 
void GetSortedList (ON_SimpleArray< const CRhinoMarkup * > &sorted_list, bool bIgnoreDeleted=false) const
 
void GetUnusedMarkupName (const wchar_t *root_name, ON_wString &unused_markup_name) const
 
void GetUnusedMarkupName (ON_wString &unused_markup_name) const
 
bool InMarkupTable (const ON_Markup *markup) const
 
bool IsValidMarkupTableIndex (int index) const
 
const CRhinoMarkupMarkup (const ON_ComponentManifestItem &markup_manifest_item) const
 
const CRhinoMarkupMarkup (const ON_ComponentManifestItem &markup_manifest_item, const CRhinoMarkup *not_found) const
 
int MarkupCount () const
 
const CRhinoMarkupMarkupFromId (ON_UUID markup_id, bool bSearchDeletedMarkups) const
 
const CRhinoMarkupMarkupFromIndex (int markup_index, bool bSearchDeletedMarkups) const
 
const CRhinoMarkupMarkupFromName (const wchar_t *markup_name) const
 
const ON_ComponentManifestItemMarkupManifestItemFromId (ON_UUID markup_id, bool bSearchDeletedMarkups) const
 
const ON_ComponentManifestItemMarkupManifestItemFromIndex (int markup_index, bool bSearchDeletedMarkups) const
 
const ON_ComponentManifestItemMarkupManifestItemFromName (const wchar_t *markup_name) const
 
bool ModifyMarkup (const ON_Markup &markup, const ON_ComponentManifestItem &item, bool bQuiet)
 
bool ModifyMarkup (const ON_Markup &markup, int markup_index, bool bQuiet)
 
const CRhinoMarkupoperator[] (int markup_index) const
 
void SetRemapIndex (int markup_index, int remap_index)
 
void Sort (int(*compar)(const CRhinoMarkup *, const CRhinoMarkup *, void *), int(*cull)(const CRhinoMarkup *, void *), void *ptr)
 
const class CRhinoDocTableReferenceTableReference () const
 
bool UndeleteMarkup (int markup_index)
 
bool UndoModifyMarkup (int markup_index, unsigned int undo_record_sn)
 

Public Attributes

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

Friends

class CRhDocSdkExtension
 
class CRhinoDoc
 

Detailed Description

CRhinoMarkupTable

Member Function Documentation

◆ AddMarkup() [1/2]

const ON_ComponentManifestItem& CRhinoMarkupTable::AddMarkup ( )

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

◆ AddMarkup() [2/2]

const ON_ComponentManifestItem& CRhinoMarkupTable::AddMarkup ( const ON_Markup markup,
bool  bReference 
)

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

◆ CreateMarkup()

const ON_ComponentManifestItem& CRhinoMarkupTable::CreateMarkup ( const ON_Markup markup,
unsigned int  worksession_ref_model_sn,
unsigned int  linked_idef_sn 
)

Description: Basic tool used to create a new markup with specified definition to the markup table. The AddMarkup() functions all use CreateMarkup() when a new markup needs to be added to the table. Parameters: markup - [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 markup on success. ON_UNSET_INT_INDEX on failure

◆ DeleteMarkup() [1/2]

bool CRhinoMarkupTable::DeleteMarkup ( const ON_ComponentManifestItem item,
bool  bQuiet 
)

◆ DeleteMarkup() [2/2]

bool CRhinoMarkupTable::DeleteMarkup ( int  markup_index,
bool  bQuiet 
)

Description: Delete a markup. Parameters: markup_index [in] - Zero based index of markup to delete. Must be in the range 0 <= index < MarkupCount(). 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 markup cannot be deleted.

◆ DeleteMarkups() [1/2]

int CRhinoMarkupTable::DeleteMarkups ( int  markup_count,
const int *  markup_indices,
bool  bQuiet 
)

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

◆ DeleteMarkups() [2/2]

int CRhinoMarkupTable::DeleteMarkups ( int  markup_count,
const int *  markup_indices,
bool  bQuiet,
int  delete_warning 
)

Description: Delete multiple markups. Parameters: markup_count - [in] length of markup_indices[] array. markup_indices - [in] array zero based indices of markup to delete. The indices must be in the range 0 <= index < MarkupCount(). bQuiet - [in] If true, no warning message box appears if a markup 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 markups that were deleted. If this is < markup_count, you can dig through the table and check which ones were not deleted.

◆ Document()

CRhinoDoc& CRhinoMarkupTable::Document ( ) const

◆ GetSortedList() [1/2]

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

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

◆ GetSortedList() [2/2]

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

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

◆ GetUnusedMarkupName() [1/2]

void CRhinoMarkupTable::GetUnusedMarkupName ( const wchar_t *  root_name,
ON_wString unused_markup_name 
) const

Description: Gets an unused markup name. Parameters: root_name [in] - the root name for the new markup name. unused_markup_name [out] - an unused markup name.

◆ GetUnusedMarkupName() [2/2]

void CRhinoMarkupTable::GetUnusedMarkupName ( ON_wString unused_markup_name) const

Description: Gets an unused markup name. Parameters: unused_markup_name [out] - an unused markup name.

◆ InMarkupTable()

bool CRhinoMarkupTable::InMarkupTable ( const ON_Markup markup) const

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

◆ IsValidMarkupTableIndex()

bool CRhinoMarkupTable::IsValidMarkupTableIndex ( int  index) const

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

◆ Markup() [1/2]

const CRhinoMarkup* CRhinoMarkupTable::Markup ( const ON_ComponentManifestItem markup_manifest_item) const

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

◆ Markup() [2/2]

const CRhinoMarkup* CRhinoMarkupTable::Markup ( const ON_ComponentManifestItem markup_manifest_item,
const CRhinoMarkup not_found 
) const

Description: Gets a markup by component manifest. Parameters: markup_manifest_item [in] - the component manifest item. not_found [in] - the value to return if not found. Returns: If successful, a pointer to the markup is returned. If not successful, not_found is returned is specified. Otherwise, nullptr is returned.

◆ MarkupCount()

int CRhinoMarkupTable::MarkupCount ( ) const

Returns: Number of markups in the table.

◆ MarkupFromId()

const CRhinoMarkup* CRhinoMarkupTable::MarkupFromId ( ON_UUID  markup_id,
bool  bSearchDeletedMarkups 
) const

Description: Gets a markup by markup id. Parameters: markup_id [in] - the markup id. bSearchDeletedMarkups [in] - set true to search for deleted markups. Returns: If successful, a pointer to the markup is returned. If not successful, nullptr is returned.

◆ MarkupFromIndex()

const CRhinoMarkup* CRhinoMarkupTable::MarkupFromIndex ( int  markup_index,
bool  bSearchDeletedMarkups 
) const

Description: Gets a markup by index. Parameters: markup_index [in] - the markup index. bSearchDeletedMarkups [in] - set true to search for deleted markups. Returns: If successful, a pointer to the markup is returned. If not successful, nullptr is returned.

◆ MarkupFromName()

const CRhinoMarkup* CRhinoMarkupTable::MarkupFromName ( const wchar_t *  markup_name) const

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

◆ MarkupManifestItemFromId()

const ON_ComponentManifestItem& CRhinoMarkupTable::MarkupManifestItemFromId ( ON_UUID  markup_id,
bool  bSearchDeletedMarkups 
) const

Description: Gets a component manifest item by markup id. Parameters: markup_id [in] - the markup id. bSearchDeletedSectionStyles [in] - set true to search for deleted markups. Returns: If successful, a ON_ModelComponent::Type::Markup component manifest item. If not successful, ON_ComponentManifestItem::UnsetItem is returned.

◆ MarkupManifestItemFromIndex()

const ON_ComponentManifestItem& CRhinoMarkupTable::MarkupManifestItemFromIndex ( int  markup_index,
bool  bSearchDeletedMarkups 
) const

Description: Gets a component manifest item by markup index. Parameters: markup_index [in] - the markup index. bSearchDeletedMarkups [in] - set true to search for deleted markups. Returns: If successful, a ON_ModelComponent::Type::Markup component manifest item. If not successful, ON_ComponentManifestItem::UnsetItem is returned.

◆ MarkupManifestItemFromName()

const ON_ComponentManifestItem& CRhinoMarkupTable::MarkupManifestItemFromName ( const wchar_t *  markup_name) const

Description: Gets a component manifest item by markup name. Parameters: markup_name [in] - the markup name. Returns: If successful, a ON_ModelComponent::Type::Markup component manifest item. If not successful, ON_ComponentManifestItem::UnsetItem is returned.

◆ ModifyMarkup() [1/2]

bool CRhinoMarkupTable::ModifyMarkup ( const ON_Markup markup,
const ON_ComponentManifestItem item,
bool  bQuiet 
)

◆ ModifyMarkup() [2/2]

bool CRhinoMarkupTable::ModifyMarkup ( const ON_Markup markup,
int  markup_index,
bool  bQuiet 
)

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

◆ operator[]()

const CRhinoMarkup* CRhinoMarkupTable::operator[] ( int  markup_index) const

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

◆ SetRemapIndex()

void CRhinoMarkupTable::SetRemapIndex ( int  markup_index,
int  remap_index 
)

◆ Sort()

void CRhinoMarkupTable::Sort ( int(*)(const CRhinoMarkup *, const CRhinoMarkup *, void *)  compar,
int(*)(const CRhinoMarkup *, void *)  cull,
void *  ptr 
)

Description: Use this to set CRhinoMarkup::m_sort_index so that the values of CRhinoMarkup::m_sort_index run from 0 to MarkupCount() - 1 and compare(CRhinoMarkupTable[i],CRhinoMarkupTable[j]) < 0) implies CRhinoMarkupTable[i].m_sort_index < CRhinoMarkupTable[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 markup should be ignored when sorting. Markups 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 CRhinoMarkup 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& CRhinoMarkupTable::TableReference ( ) const

◆ UndeleteMarkup()

bool CRhinoMarkupTable::UndeleteMarkup ( int  markup_index)

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

◆ UndoModifyMarkup()

bool CRhinoMarkupTable::UndoModifyMarkup ( int  markup_index,
unsigned int  undo_record_sn 
)

Description: If the markup has been modified and the modification can be undone, then UndoModifyMarkup() will restore the markup to its previous state. Returns: True if the markup 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 CRhinoMarkup& CRhinoMarkupTable::Default

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

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