The ON_ModelComponent class is a base class for all components in a model and manages the index, id and other information common to all components in a model. More...
#include <opennurbs_model_component.h>
Public Member Functions | |
ON_ModelComponent () ON_NOEXCEPT | |
ON_ModelComponent (const ON_ModelComponent &source) | |
ON_ModelComponent (ON_ModelComponent::Type component_type) ON_NOEXCEPT | |
Sets and locks the component type attribute. More... | |
ON_ModelComponent (ON_ModelComponent::Type component_type, const ON_ModelComponent &source) ON_NOEXCEPT | |
Locked status of source attributes is not copied to permit copy and modify operations. More... | |
~ON_ModelComponent ()=default | |
bool | ChangeName (const wchar_t *new_name, class ON_ComponentManifest *manifest) |
Change the name of a component and optionally update a manifest. More... | |
bool | ClearComponentType () |
Set the model serial number value to the ON_ModelComponent::Unset.Type() and change the state so TypeIsSet() returns false. More... | |
bool | ClearId () |
Set the component id value to the ON_ModelComponent::Unset.ModelComponentId() and change the state so ModelComponentIdIsSet() returns false. More... | |
bool | ClearIndex () |
Set the component index value to the ON_ModelComponent::Unset.ModelComponentIndex() and change the state so ModelComponentIndexIsSet() returns false. More... | |
unsigned int | ClearModelComponentAttributes (unsigned int attributes_filter) |
Writes the attributes identified by the component_filter parameter. More... | |
bool | ClearModelComponentStatus () |
bool | ClearModelSerialNumber () |
Sets the model serial number, reference model serial number and instance definition model serial number values to 0 and flags these values as unset. More... | |
bool | ClearName () |
Set the component name value to the ON_ModelComponent::Unset.Name() and change the state so NameIsSet() and DeletedNameIsSet() both return false. More... | |
bool | ClearParentId () |
int | CompareName (const ON_UUID &other_parent_id, const wchar_t *other_name) const |
int | CompareName (const wchar_t *other_name) const |
int | CompareNameExact (const ON_UUID &other_parent_id, const wchar_t *other_name) const |
int | CompareNameExact (const wchar_t *other_name) const |
ON_ModelComponent::Type | ComponentType () const |
bool | ComponentTypeIsLocked () const |
bool | ComponentTypeIsSet () const |
ON__UINT64 | ContentVersionNumber () const |
Whenever an attribute is changed, the content version number is incremented. The ContentVersionNumber() is commonly used by consumers of the model component attributes to trigger updates when needed. More... | |
unsigned int | CopyFrom (const ON_ModelComponent &src, unsigned int attributes_filter) |
ON__UINT32 | DataCRC (ON__UINT32 current_remainder) const override |
Returns a CRC calculated from the information that defines the object. This CRC can be used as a quick way to see if two objects are not identical. More... | |
const ON_wString | DeletedName () const |
const ON_NameHash & | DeletedNameHash () const |
bool | DeletedNameIsSet () const |
bool | DeleteName () |
If NameIsSet() is true, then the name is deleted in a waty that can be undone by calling UndeleteName() and the DeletedNameIsSet() property is changed to true. More... | |
void | Dump (ON_TextLog &) const override |
Creates a text dump of the object. More... | |
bool | EraseIdentification (bool bIgnoreLocks) |
const wchar_t * | GetName (ON_wString &component_name) const |
const ON_UUID & | Id () const |
bool | IdIsLocked () const |
bool | IdIsNil () const |
bool | IdIsNotNil () const |
bool | IdIsSet () const |
const ON_UUID & | IfIdIsNilSetId () |
If the it is nil, call SetId(). More... | |
int | Index () const |
int | Index (int unset_index_value) const |
bool | IndexIsLocked () const |
bool | IndexIsSet () const |
unsigned int | InstanceDefinitionModelSerialNumber () const |
bool | IsDeleted () const |
bool | IsHidden () const |
bool | IsLocked () const |
bool | IsReferenceComponent () const |
bool | IsSystemComponent () const |
bool | IsValid (class ON_TextLog *text_log=nullptr) const override |
Tests an object to see if its data members are correctly initialized. More... | |
void | LockAllSettingsExceptName () |
void | LockComponentType () |
Calling LockType() will prhibit future changes to the Type attribute. More... | |
void | LockId () |
Calling LockModelComponentId() will prhibit future changes to the ModelComponentId attribute. More... | |
void | LockIndex () |
Calling LockModelComponentIndex() will prhibit future changes to the ModelComponentIndex attribute. More... | |
void | LockModelComponentStatus () |
void | LockModelSerialNumber () |
Calling LockModelSerialNumber() will prohibit future changes to the ModelSerialNumber(), ReferenceModelSerialNumber(), and InstanceDefinitionModelSerialNumber() attributes. More... | |
void | LockName () |
Calling LockName() will prohibit future changes to the Name attribute. More... | |
void | LockParentId () |
ON_ComponentStatus | ModelComponentStatus () const |
bool | ModelComponentStatusIsLocked () const |
bool | ModelComponentStatusIsSet () const |
ON_UUID | ModelObjectId () const override |
All objects in an opennurbs model have an id ( ON_Layer.m_layer_id, ON_Font.m_font_id, ON_Material.m_material_id, ON_3dmObjectAttributes.m_uuid ). More... | |
unsigned int | ModelSerialNumber () const |
bool | ModelSerialNumberIsLocked () const |
bool | ModelSerialNumberIsSet () const |
const ON_wString | Name () const |
const wchar_t * | NameAsPointer () const |
Expert user function that gets a pointer to the name. More... | |
const ON_NameHash & | NameHash () const |
Get a platform independent hash of the name suitable for equality testing and binary searching. When testing for equality or doing binary searches, using ON_NameHash values is faster than using the CompareName or ON_wString::CompareAttributeName. More... | |
bool | NameIsEmpty () const |
bool | NameIsLocked () const |
bool | NameIsNotEmpty () const |
bool | NameIsSet () const |
const ON_NameHash | NewNameHash (const wchar_t *new_name) const |
ON_ModelComponent & | operator= (const ON_ModelComponent &source) |
const ON_UUID & | ParentId () const |
bool | ParentIdIsLocked () const |
bool | ParentIdIsNil () const |
bool | ParentIdIsNotNil () const |
bool | ParentIdIsSet () const |
bool | ReadModelComponentAttributes (class ON_BinaryArchive &archive) |
unsigned int | ReferenceModelSerialNumber () const |
ON__UINT64 | RuntimeSerialNumber () const |
const ON_UUID & | SetAndLockId () |
Sets the id to a new value created by ON_CreateUuid() and locks the id attribute so it cannot be changed. More... | |
bool | SetAsSystemComponent () |
bool | SetAsUnsetSystemComponent () |
bool | SetComponentType (ON_ModelComponent::Type component_component_type) |
bool | SetDeletedModelComponentState (bool bDeleted, class ON_ComponentManifest *manifest) |
void | SetHiddenModelComponentState (bool bHidden) |
bool | SetId (const ON_UUID &component_id) |
const ON_UUID & | SetId () |
Sets the id to a new value created by ON_CreateUuid(). More... | |
bool | SetIdentification (const class ON_ComponentManifestItem &manifest_item, const wchar_t *manifest_name, bool bSetId, bool bParentId, bool bSetName, bool bSetIndex) |
Set a component's id, name and index to the manifest_item values. More... | |
bool | SetIndex (int component_index) |
bool | SetLocalizedSystemComponentName (const wchar_t *system_component_localized_name) |
void | SetLockedModelComponentState (bool bLocked) |
bool | SetModelComponentStatus (ON_ComponentStatus component_status) |
bool | SetModelSerialNumber (unsigned int model_serial_number) |
Specify the model that is managing this component. More... | |
bool | SetModelSerialNumber (unsigned int model_serial_number, unsigned int reference_model_serial_number, unsigned int instance_definition_model_serial_number) |
Specify the model that is managing this component. More... | |
bool | SetName (const wchar_t *component_name) |
bool | SetParentId (const ON_UUID &parent_id) |
unsigned int | SizeOf () const override |
bool | UndeleteName () |
bool | WriteModelComponentAttributes (class ON_BinaryArchive &archive, unsigned int attributes_filter) const |
Public Member Functions inherited from ON_Object | |
ON_Object () ON_NOEXCEPT | |
ON_Object (const ON_Object &) | |
virtual | ~ON_Object () |
virtual ON_AggregateComponentStatus | AggregateComponentStatus () const |
Call whenever a component status setting is modifed by directly changing it on a component in a way that will result in any saved information about the parent object's aggretate component status becoming invalid. More... | |
bool | AttachUserData (class ON_UserData *pUserData) |
Attach user data to an object. More... | |
unsigned int | ClearAllComponentStates () const |
Set all active level component states to ON_ComponentStatus::NoneSet. More... | |
virtual unsigned int | ClearComponentStates (ON_ComponentStatus states_to_clear) const |
Clear the specified states on every component. More... | |
virtual unsigned int | ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const |
Clear states on an individual component. More... | |
unsigned int | CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution) |
Expert user tool that copies user data items with positive values of ON_UserData.m_userdata_copycount from source_object to "this. More... | |
void | CopyUserData (const ON_Object &source_object) |
Calls CopyUserData(source_object,ON_Object::UserDataConflictResolution::source_object). More... | |
virtual bool | DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count) |
Delete the portions of the object identified in ci_list[]. More... | |
virtual void | DestroyRuntimeCache (bool bDelete=true) |
Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. More... | |
bool | DetachUserData (class ON_UserData *pUserData) |
Remove user data from an object. More... | |
void | EmergencyDestroy () |
Sets m_user_data_list = 0. More... | |
class ON_UserData * | FirstUserData () const |
User data is stored as a linked list of ON_UserData classes. FirstUserData gets the first item in the linked list. This is the most recent item attached using AttachUserData(). Remark: To iterate through all the user data on an object, call FirstUserData() and then use ON_UserData::Next() to traverse the list. More... | |
virtual unsigned int | GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const |
class ON_UserData * | GetUserData (const ON_UUID &userdata_uuid) const |
Get a pointer to user data. More... | |
bool | GetUserString (const wchar_t *key, ON_wString &string_value) const |
Get user string from the object. More... | |
int | GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const |
Get a list of all user string keys on the object. More... | |
int | GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const |
Get a list of all user strings on the object. More... | |
bool | IsKindOf (const ON_ClassId *pClassId) const |
Low level tool to test if an object is derived from a specified class. More... | |
virtual void | MarkAggregateComponentStatusAsNotCurrent () const |
Call whenever a component status setting is modifed by directly changing it on a component in a way that will result in any saved information about the parent object's aggretate component status becoming invalid. More... | |
virtual void | MemoryRelocate () |
The MemoryRelocate() function is called when an object's location in memory is changed. For example, if an object resides in a chunk of memory that is grown by calling a realloc that has to allocate a new chunk and copy the contents of the old chunk to the new chunk, then the location of the object's memory changes. In practice this happens when classes derived from ON_Object are stored in dynamic arrays, like the default implementation of ON_ObjectArray<>'s that use realloc to grow the dynamic array. More... | |
unsigned int | MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems) |
Expert user tool that moves user data items from source_object to "this. More... | |
void | MoveUserData (ON_Object &source_object) |
Calls MoveUserData(source_object,ON_Object::UserDataConflictResolution::source_object,true). More... | |
virtual ON::object_type | ObjectType () const |
Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on. More... | |
ON_Object & | operator= (const ON_Object &) |
void | PurgeUserData () |
PurgeUserData() removes all user data from object. More... | |
virtual bool | Read (ON_BinaryArchive &binary_archive) |
Low level archive writing tool used by ON_BinaryArchive::ReadObject(). More... | |
virtual unsigned int | SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const |
Set states on an individual component. More... | |
virtual unsigned int | SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const |
Copy status settings to an individual component. More... | |
bool | SetUserString (const wchar_t *key, const wchar_t *string_value) |
Attach a user string to the object. This information will perisist through copy construction, operator=, and file IO. More... | |
int | SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace) |
Append entries to the user string list More... | |
void | TransformUserData (const class ON_Xform &xform) |
Objects derived from ON_Geometry must call TransformUserData() in their Transform() member function. More... | |
virtual bool | UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map) |
Uses the destination_manifest to update references to other components. This is typically done when a component's references came from a "source" context and are being updated to the "destination" context. For example, inserting one model into another when index, id, and name conflicts need to be resolved at the time of insertion. More... | |
int | UserStringCount () const |
virtual bool | Write (ON_BinaryArchive &binary_archive) const |
Low level archive writing tool used by ON_BinaryArchive::WriteObject(). More... | |
Static Public Member Functions | |
static int | CompareId (const ON_ModelComponent &a, const ON_ModelComponent &b) |
static int | CompareIdAndName (const ON_ModelComponent &a, const ON_ModelComponent &b) |
static int | CompareName (const ON_ModelComponent &a, const ON_ModelComponent &b) |
static int | CompareNameAndId (const ON_ModelComponent &a, const ON_ModelComponent &b) |
static int | CompareNameExact (const ON_ModelComponent &a, const ON_ModelComponent &b) |
static ON_ModelComponent::Type | ComponentTypeFromUnsigned (unsigned int component_type_as_unsigned) |
static bool | ComponentTypeIsValid (ON_ModelComponent::Type component_type) |
static bool | ComponentTypeIsValidAndNotMixed (ON_ModelComponent::Type component_type) |
static const ON_wString | ComponentTypeToString (ON_ModelComponent::Type) |
static bool | IndexRequired (ON_ModelComponent::Type component_type) |
static unsigned int | Internal_SystemComponentHelper () |
For internal use. Never call this function. More... | |
static const wchar_t * | IsNamePathSeparator (const wchar_t *s) |
Test a string to see if its beginning matches the string returned by ON_ModelComponent::NamePathSeparator. More... | |
*</code > *</example > *static const wchar_t * | IsReferencePrefixDelimiter (const wchar_t *s) |
Test a string to see if its beginning matches the string returned by ON_ModelComponent::NameReferenceDelimiter. More... | |
static const wchar_t * | IsReferencePrefixSeparator (const wchar_t *s) |
Test a string to see if its beginning matches the string returned by ON_ModelComponent::NameReferenceSeparator. More... | |
static bool | IsValidComponentName (const wchar_t *candidate_component_name) |
static bool | IsValidComponentName (const ON_wString &candidate_component_name) |
static bool | IsValidComponentName (size_t length, const wchar_t *candidate_component_name) |
static bool | IsValidComponentName (const class ON_ComponentManifest &model_manfest, const ON_ModelComponent &model_component, bool bPermitReferencePrefix, ON_wString &valid_name) |
static bool | IsValidComponentNameFirstCodePoint (ON__UINT32 unicode_code_point) |
static bool | IsValidComponentNameFirstCodePoint (int length, const wchar_t *candidate_component_name) |
static const ON_wString | NameLeaf (const wchar_t *name) |
static const ON_wString | NameParent (const wchar_t *name, bool bIncludeReference) |
static const ON_wString | NameReferencePrefix (const wchar_t *name) |
static const ON_wString | RemoveAllReferencePrefixDelimiters (const wchar_t *name) |
Remove all occurances of ON::NameReferenceDelimiter() from name. More... | |
static const ON_wString | RemoveReferencePrefix (const wchar_t *name) |
static const ON_wString | RemoveTrailingNamePathSeparator (const wchar_t *name) |
Remove any trailing occurance of ON_ModelComponent::NamePathSeparator from name. More... | |
static const ON_wString | RemoveTrailingReferencePrefixDelimiter (const wchar_t *name) |
Remove any trailing occurance of ON_ModelComponent::NameReferenceDelimiter from name. More... | |
static const ON_wString | RemoveTrailingReferencePrefixSeparator (const wchar_t *name) |
Remove any trailing occurance of ON_ModelComponent::NameReferenceSeparator from name. More... | |
static void | SplitName (const wchar_t *name, ON_wString &reference_prefix, ON_wString &name_parent, ON_wString &name_leaf) |
static bool | UniqueNameIgnoresCase (ON_ModelComponent::Type component_type) |
static bool | UniqueNameIncludesParent (ON_ModelComponent::Type component_type) |
static bool | UniqueNameRequired (ON_ModelComponent::Type component_type) |
Static Public Attributes | |
static const ON_wString | NamePathSeparator |
Returns the string "::". This is the string Rhino uses in layer full path names to separate the names of individual layers. More... | |
static const ON_wString | ReferencePrefixDelimiter |
Returns the string " : ". This is the string Rhino uses to separate the reference file names from and model component names read from those files. More... | |
static const ON_wString | ReferencePrefixSeparator |
Returns the string ">". This is the string Rhino uses to separate the block definition name and linked file name in grandparent layers. More... | |
static const ON_ModelComponent | Unset |
*static const ON_wString WorksessionReferencePrefix *const | wchar_t |
Protected Member Functions | |
void | IncrementContentVersionNumber () const |
The ON_ModelComponent class is a base class for all components in a model and manages the index, id and other information common to all components in a model.
enum ON_ModelComponent::Attributes : unsigned int |
|
strong |
The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values.
ON_ModelComponent::ON_ModelComponent | ( | ) |
|
default |
ON_ModelComponent::ON_ModelComponent | ( | const ON_ModelComponent & | source | ) |
ON_ModelComponent::ON_ModelComponent | ( | ON_ModelComponent::Type | component_type | ) |
Sets and locks the component type attribute.
component_type | [in] |
ON_ModelComponent::ON_ModelComponent | ( | ON_ModelComponent::Type | component_type, |
const ON_ModelComponent & | source | ||
) |
Locked status of source attributes is not copied to permit copy and modify operations.
bool ON_ModelComponent::ChangeName | ( | const wchar_t * | new_name, |
class ON_ComponentManifest * | manifest | ||
) |
Change the name of a component and optionally update a manifest.
new_name | [in] New name for the component. |
manifest | [in] nullptr or a manifest with an item for the component. |
bool ON_ModelComponent::ClearComponentType | ( | ) |
Set the model serial number value to the ON_ModelComponent::Unset.Type() and change the state so TypeIsSet() returns false.
bool ON_ModelComponent::ClearId | ( | ) |
Set the component id value to the ON_ModelComponent::Unset.ModelComponentId() and change the state so ModelComponentIdIsSet() returns false.
bool ON_ModelComponent::ClearIndex | ( | ) |
Set the component index value to the ON_ModelComponent::Unset.ModelComponentIndex() and change the state so ModelComponentIndexIsSet() returns false.
unsigned int ON_ModelComponent::ClearModelComponentAttributes | ( | unsigned int | attributes_filter | ) |
Writes the attributes identified by the component_filter parameter.
attributes_filter | [in] A bitfield that determines which attributes will be cleared. |
bool ON_ModelComponent::ClearModelComponentStatus | ( | ) |
bool ON_ModelComponent::ClearModelSerialNumber | ( | ) |
Sets the model serial number, reference model serial number and instance definition model serial number values to 0 and flags these values as unset.
bool ON_ModelComponent::ClearName | ( | ) |
Set the component name value to the ON_ModelComponent::Unset.Name() and change the state so NameIsSet() and DeletedNameIsSet() both return false.
bool ON_ModelComponent::ClearParentId | ( | ) |
|
static |
|
static |
int ON_ModelComponent::CompareName | ( | const ON_UUID & | other_parent_id, |
const wchar_t * | other_name | ||
) | const |
other_name | [in] |
CompareName() is the correct tool to use when looking up objects by name.
int ON_ModelComponent::CompareName | ( | const wchar_t * | other_name | ) | const |
|
static |
a | [in] |
b | [in] |
CompareName() is the correct tool to use when looking up objects by name.
|
static |
int ON_ModelComponent::CompareNameExact | ( | const ON_UUID & | other_parent_id, |
const wchar_t * | other_name | ||
) | const |
other_name | [in] |
CompareNameExact() is the correct tool to use when detecting changes in case are important. Use CompareName() when searching for components by name.
int ON_ModelComponent::CompareNameExact | ( | const wchar_t * | other_name | ) | const |
|
static |
a | [in] |
b | [in] |
CompareNameExact() is the correct tool to use when detecting changes in case are important. Use CompareName() when searching for components by name.
ON_ModelComponent::Type ON_ModelComponent::ComponentType | ( | ) | const |
If the component is in a model, then the component_type is unique for all components of identical type in the model and is locked.
|
static |
bool ON_ModelComponent::ComponentTypeIsLocked | ( | ) | const |
bool ON_ModelComponent::ComponentTypeIsSet | ( | ) | const |
|
static |
component_type | [in] |
|
static |
component_type | [in] |
|
static |
ON__UINT64 ON_ModelComponent::ContentVersionNumber | ( | ) | const |
Whenever an attribute is changed, the content version number is incremented. The ContentVersionNumber() is commonly used by consumers of the model component attributes to trigger updates when needed.
The ContentVersionNumber value is copied by the copy constructor and operator=. The value is not saved in .3dm archives.
unsigned int ON_ModelComponent::CopyFrom | ( | const ON_ModelComponent & | src, |
unsigned int | attributes_filter | ||
) |
|
overridevirtual |
Returns a CRC calculated from the information that defines the object. This CRC can be used as a quick way to see if two objects are not identical.
current_remainder | [in]; |
Reimplemented from ON_Object.
const ON_wString ON_ModelComponent::DeletedName | ( | ) | const |
const ON_NameHash& ON_ModelComponent::DeletedNameHash | ( | ) | const |
bool ON_ModelComponent::DeletedNameIsSet | ( | ) | const |
At most one of NameIsSet() and DeletedNameIsSet() is true.
bool ON_ModelComponent::DeleteName | ( | ) |
If NameIsSet() is true, then the name is deleted in a waty that can be undone by calling UndeleteName() and the DeletedNameIsSet() property is changed to true.
If NameIsSet() is false or NameIsLocked() is true, then nothing is changed.
Note that a name can be set to the empty string and there is a difference between a name being set to the empty string and a name being unset. If you want to make the name attribute unset, call ClearName().
|
overridevirtual |
Creates a text dump of the object.
Dump() is intended for debugging and is not suitable for creating high quality text descriptions of an object.
The default implementations of this virtual function prints the class's name.
Reimplemented from ON_Object.
Reimplemented in ON_TextureMapping, ON_TextStyle, ON_HistoryRecord, and ON_ModelGeometryComponent.
bool ON_ModelComponent::EraseIdentification | ( | bool | bIgnoreLocks | ) |
const wchar_t* ON_ModelComponent::GetName | ( | ON_wString & | component_name | ) | const |
component_name | [out] |
const ON_UUID& ON_ModelComponent::Id | ( | ) | const |
If the component is in a model, then the id is unique for all components in the model and is locked.
bool ON_ModelComponent::IdIsLocked | ( | ) | const |
bool ON_ModelComponent::IdIsNil | ( | ) | const |
bool ON_ModelComponent::IdIsNotNil | ( | ) | const |
bool ON_ModelComponent::IdIsSet | ( | ) | const |
|
protected |
int ON_ModelComponent::Index | ( | ) | const |
If the component is in a model, then the index is unique for all components of identical type in the model and is locked. If the index has not been set, ON_UNSET_INT_INDEX is returned. The Index() value can change when saved in an archive (.3dm file). Use the Id() when you need to reference model compoenents in an archive.
int ON_ModelComponent::Index | ( | int | unset_index_value | ) | const |
unset_index_value | [in] Value to return if the index has not been set. ON_UNSET_INT_INDEX or indices of default components are often used for this parameter. |
If the component is in a model, then the index is unique for all components of identical type in the model and is locked.
bool ON_ModelComponent::IndexIsLocked | ( | ) | const |
bool ON_ModelComponent::IndexIsSet | ( | ) | const |
|
static |
unsigned int ON_ModelComponent::InstanceDefinitionModelSerialNumber | ( | ) | const |
Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is copied by the copy constructor and operator=. This value is not saved in .3dm archives.
In Rhino, this value is a linked instance definition runtime serial number and these values are used.. 0: Active model component. 1-1000: reserved for future use >1000: linked instance defintion serial number
|
static |
For internal use. Never call this function.
bool ON_ModelComponent::IsDeleted | ( | ) | const |
Deleted components can be undeleted.
bool ON_ModelComponent::IsHidden | ( | ) | const |
This is a user interface hidden state and does not effect changing the component values.
bool ON_ModelComponent::IsLocked | ( | ) | const |
This is a user interface locked state and does not effect changing the component values.
Test a string to see if its beginning matches the string returned by ON_ModelComponent::NamePathSeparator.
s | [in]; string to test. |
bool ON_ModelComponent::IsReferenceComponent | ( | ) | const |
|
static |
Test a string to see if its beginning matches the string returned by ON_ModelComponent::NameReferenceDelimiter.
s | [in]; string to test. |
Test a string to see if its beginning matches the string returned by ON_ModelComponent::NameReferenceSeparator.
s | [in]; string to test. |
bool ON_ModelComponent::IsSystemComponent | ( | ) | const |
An incomplete list of system constant model compoenents is below:
ON_ModelComponent::Unset ON_InstanceDefinition::Empty ON_Linetype::Unset ON_Linetype::Continuous ON_Linetype::ByLayer ON_Linetype::ByParent ON_Layer::Unset ON_Layer::Default ON_TextStyle::Unset ON_TextStyle::Default ON_TextStyle::ByLayer ON_TextStyle::ByParent ON_DimStyle::Unset ON_DimStyle::Default ON_DimStyle::DefaultInchDecimal ON_DimStyle::DefaultInchFractional ON_DimStyle::DefaultFootInchArchitecture ON_DimStyle::DefaultMillimeterSmall ON_DimStyle::DefaultMillimeterLarge ON_DimStyle::DefaultMillimeterArchitecture
|
overridevirtual |
Tests an object to see if its data members are correctly initialized.
text_log | [in] if the object is not valid and text_log is not nullptr, then a brief englis description of the reason the object is not valid is appened to the log. The information appended to text_log is suitable for |
low | level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. |
Reimplemented from ON_Object.
Reimplemented in ON_TextureMapping, ON_TextStyle, and ON_HistoryRecord.
|
static |
|
static |
|
static |
|
static |
model_component | [in] |
model_manfest | [in] current model contents |
valid_name | [in] Valid name for this component in a model with the specified manifest. |
|
static |
Component names cannot begin with a (, ), [, ], {, }, or space. These brackets can be the second or later code points. A space can be an interior code point.
|
static |
length | [in] number of wchar_t elements in candidate_component_name[] or -1 if it is a null terminated string. |
candidate_component_name | [in] The first code point is decoded from this string and passed to ON_ModelComponent::IsValidComponentNameFirstCodePoint(). |
Component names cannot begin with a (, ), [, ], {, }, or space. These brackets can be the second or later code points. A space can be an interior code point.
void ON_ModelComponent::LockAllSettingsExceptName | ( | ) |
void ON_ModelComponent::LockComponentType | ( | ) |
Calling LockType() will prhibit future changes to the Type attribute.
void ON_ModelComponent::LockId | ( | ) |
Calling LockModelComponentId() will prhibit future changes to the ModelComponentId attribute.
void ON_ModelComponent::LockIndex | ( | ) |
Calling LockModelComponentIndex() will prhibit future changes to the ModelComponentIndex attribute.
void ON_ModelComponent::LockModelComponentStatus | ( | ) |
void ON_ModelComponent::LockModelSerialNumber | ( | ) |
Calling LockModelSerialNumber() will prohibit future changes to the ModelSerialNumber(), ReferenceModelSerialNumber(), and InstanceDefinitionModelSerialNumber() attributes.
void ON_ModelComponent::LockName | ( | ) |
Calling LockName() will prohibit future changes to the Name attribute.
void ON_ModelComponent::LockParentId | ( | ) |
ON_ComponentStatus ON_ModelComponent::ModelComponentStatus | ( | ) | const |
bool ON_ModelComponent::ModelComponentStatusIsLocked | ( | ) | const |
bool ON_ModelComponent::ModelComponentStatusIsSet | ( | ) | const |
|
overridevirtual |
All objects in an opennurbs model have an id ( ON_Layer.m_layer_id, ON_Font.m_font_id, ON_Material.m_material_id, ON_3dmObjectAttributes.m_uuid ).
Reimplemented from ON_Object.
unsigned int ON_ModelComponent::ModelSerialNumber | ( | ) | const |
If the component is being managed by a model, this value identifies the model. In Rhino, this value is the document runtime serial number. Typically this value is set and locked by the code that adds a component to a model. This value is copied by the copy constructor and operator=. This value is not saved in .3dm archives.
bool ON_ModelComponent::ModelSerialNumberIsLocked | ( | ) | const |
bool ON_ModelComponent::ModelSerialNumberIsSet | ( | ) | const |
const ON_wString ON_ModelComponent::Name | ( | ) | const |
If the component is in a model, then the name is unique among all components in the model. Names are formatted as reference : parent::leaf. For example in "A.3dm : Z", "A.3dm" is the reference and "Z" is the leaf. For a layer full path "X::Y::Z", "X::Y" is the parent and "Z" is the leaf. For most models, only the leaf is present in the name. The reference portion appears when a model component originates in a reference file (a linked instance definition with reference component names or a worksession reference). Components with a tree hierarchy, like layers, can have a parent and leaf.
const wchar_t* ON_ModelComponent::NameAsPointer | ( | ) | const |
Expert user function that gets a pointer to the name.
About the only good use for this function is when a model compoenent is peristent and the name is needed for a formatted string. For any other use, call the Name() function and store the result in an ON_wString. This function is dangerous because the returned pointer will be invalid if SetName() is called.
const ON_NameHash& ON_ModelComponent::NameHash | ( | ) | const |
Get a platform independent hash of the name suitable for equality testing and binary searching. When testing for equality or doing binary searches, using ON_NameHash values is faster than using the CompareName or ON_wString::CompareAttributeName.
bool ON_ModelComponent::NameIsEmpty | ( | ) | const |
bool ON_ModelComponent::NameIsLocked | ( | ) | const |
bool ON_ModelComponent::NameIsNotEmpty | ( | ) | const |
bool ON_ModelComponent::NameIsSet | ( | ) | const |
At most one of NameIsSet() and DeletedNameIsSet() is true. A name can be set to the empty string.
|
static |
|
static |
name | [in] |
bIncludeReference | [in] |
|
static |
name | [in] |
const ON_NameHash ON_ModelComponent::NewNameHash | ( | const wchar_t * | new_name | ) | const |
new_name | [in] |
This function trims leading and trailing white space, includes the parent id when ON_ModelComponent::UniqueNameIncludesParent(ComponentType()) is true, and uses ON_ModelComponent::IsValidComponentName() to determine if a non-empty name is valid.
ON_ModelComponent& ON_ModelComponent::operator= | ( | const ON_ModelComponent & | source | ) |
operator= will not change locked destination attributes. Locked status of source attributes is not copied to permit copy and modify operations.
const ON_UUID& ON_ModelComponent::ParentId | ( | ) | const |
bool ON_ModelComponent::ParentIdIsLocked | ( | ) | const |
bool ON_ModelComponent::ParentIdIsNil | ( | ) | const |
bool ON_ModelComponent::ParentIdIsNotNil | ( | ) | const |
bool ON_ModelComponent::ParentIdIsSet | ( | ) | const |
bool ON_ModelComponent::ReadModelComponentAttributes | ( | class ON_BinaryArchive & | archive | ) |
unsigned int ON_ModelComponent::ReferenceModelSerialNumber | ( | ) | const |
Reference components are not saved in .3dm archives. Typically this value is set and locked by the code that adds a component to a model. This value is copied by the copy constructor and operator=. This value is not saved in .3dm archives.
In Rhino, this value is a worksession model runtime serial number and these values are used. 0: not from a worksession reference model 1: from an unidentified reference model 2-1000: reserved for future use >1000: worksession reference model serial number
|
static |
Remove all occurances of ON::NameReferenceDelimiter() from name.
|
static |
name | [in] |
|
static |
Remove any trailing occurance of ON_ModelComponent::NamePathSeparator from name.
|
static |
Remove any trailing occurance of ON_ModelComponent::NameReferenceDelimiter from name.
|
static |
Remove any trailing occurance of ON_ModelComponent::NameReferenceSeparator from name.
ON__UINT64 ON_ModelComponent::RuntimeSerialNumber | ( | ) | const |
const ON_UUID& ON_ModelComponent::SetAndLockId | ( | ) |
Sets the id to a new value created by ON_CreateUuid() and locks the id attribute so it cannot be changed.
bool ON_ModelComponent::SetAsSystemComponent | ( | ) |
bool ON_ModelComponent::SetAsUnsetSystemComponent | ( | ) |
bool ON_ModelComponent::SetComponentType | ( | ON_ModelComponent::Type | component_component_type | ) |
component_component_type | [in] |
bool ON_ModelComponent::SetDeletedModelComponentState | ( | bool | bDeleted, |
class ON_ComponentManifest * | manifest | ||
) |
bDeleted | [in] |
manifest | [in/out] optional manifest to update |
void ON_ModelComponent::SetHiddenModelComponentState | ( | bool | bHidden | ) |
bool ON_ModelComponent::SetId | ( | const ON_UUID & | component_id | ) |
component_id | [in] |
const ON_UUID& ON_ModelComponent::SetId | ( | ) |
Sets the id to a new value created by ON_CreateUuid().
bool ON_ModelComponent::SetIdentification | ( | const class ON_ComponentManifestItem & | manifest_item, |
const wchar_t * | manifest_name, | ||
bool | bSetId, | ||
bool | bParentId, | ||
bool | bSetName, | ||
bool | bSetIndex | ||
) |
Set a component's id, name and index to the manifest_item values.
manifest_item | [in] |
manifest_name | [in] |
bSetId | [in] Set the component id to manifest_item.m_manifest_id. |
bSetParentId | [in] Use manifest_item.NameHash().ParentId() |
bSetName | [in] Set the component name to manifest_name. |
bSetIndex | [in] Set the component index to manifest_item.m_manifest_index. |
bool ON_ModelComponent::SetIndex | ( | int | component_index | ) |
component_index | [in] |
bool ON_ModelComponent::SetLocalizedSystemComponentName | ( | const wchar_t * | system_component_localized_name | ) |
void ON_ModelComponent::SetLockedModelComponentState | ( | bool | bLocked | ) |
bool ON_ModelComponent::SetModelComponentStatus | ( | ON_ComponentStatus | component_status | ) |
bool ON_ModelComponent::SetModelSerialNumber | ( | unsigned int | model_serial_number | ) |
Specify the model that is managing this component.
model_serial_number | [in] In Rhino, this is the document runtime serial number. |
bool ON_ModelComponent::SetModelSerialNumber | ( | unsigned int | model_serial_number, |
unsigned int | reference_model_serial_number, | ||
unsigned int | instance_definition_model_serial_number | ||
) |
Specify the model that is managing this component.
model_serial_number | [in] In Rhino, this is the document runtime serial number. |
reference_model_serial_number | [in] In Rhino, this is the worksession reference model serial number. |
instance_definition_model_serial_number | [in] In Rhino, this is the linked instance definition model serial number. |
bool ON_ModelComponent::SetName | ( | const wchar_t * | component_name | ) |
component_name | [in] Leading and trailing nonzero unicode code points with values <= ON_wString::Space are ignored. |
If component_name is nullptr or the emtpy string, the NameIsSet() state will still be true.
bool ON_ModelComponent::SetParentId | ( | const ON_UUID & | parent_id | ) |
|
overridevirtual |
Reimplemented from ON_Object.
Reimplemented in ON_TextureMapping.
|
static |
bool ON_ModelComponent::UndeleteName | ( | ) |
|
static |
component_type | [in] |
Currently all other component types except for groups ignore case when testing for equality.
|
static |
component_type | [in] |
Currently, layers are the only object type where this property is true.
|
static |
component_type | [in] |
In general, component names ignore case and parent when testing for equality. However, there are exceptions. Use ON_ModelComponent::UniqueNameIncludesParent() and ON_ModelComponent::UniqueNameIgnoresCase() to test for exceptions.
bool ON_ModelComponent::WriteModelComponentAttributes | ( | class ON_BinaryArchive & | archive, |
unsigned int | attributes_filter | ||
) | const |
|
static |
Returns the string "::". This is the string Rhino uses in layer full path names to separate the names of individual layers.
<seealso cref="ON_ModelComponent::ReferencePrefixDelimiter = " : ""/>
""/> <seealso cref="ON_ModelComponent::NamePathSeparator = "::""/>
|
static |
Returns the string " : ". This is the string Rhino uses to separate the reference file names from and model component names read from those files.
<seealso cref="ON_ModelComponent::ReferencePrefixDelimiter = " : ""/>
""/> <seealso cref="ON_ModelComponent::NamePathSeparator = "::""/>
|
static |
Returns the string ">". This is the string Rhino uses to separate the block definition name and linked file name in grandparent layers.
<seealso cref="ON_ModelComponent::ReferencePrefixDelimiter = " : ""/>
""/> <seealso cref="ON_ModelComponent::NamePathSeparator = "::""/>
|
static |
|
static |
reference_prefix | [in] |