Rhino C++ API  7.18
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
ON_ModelComponent Class Reference

#include <opennurbs_model_component.h>

Inheritance diagram for ON_ModelComponent:
ON_Object ON_Bitmap ON_DimStyle ON_Group ON_HatchPattern ON_HistoryRecord ON_InstanceDefinition ON_Layer ON_Linetype ON_Material ON_ModelGeometryComponent ON_TextStyle ON_TextureMapping

Public Types

enum  Attributes : unsigned int {
  NoAttributes = 0U, ComponentSerialNumberAttribute = 0x0001U, TypeAttribute = 0x0002U, ModelSerialNumberAttribute = 0x0004U,
  IdAttribute = 0x0008U, IndexAttribute = 0x0010U, NameAttribute = 0x0020U, ParentIdAttribute = 0x0040U,
  DeletedNameAttribute = 0x0080U, ComponentStatusAttribute = 0x0100U, BinaryArchiveAttributes = 0x78U, AllAttributes = 0x1FFU,
  SystemComponentAttribute = 0x8000U
}
 
enum  Type : unsigned char {
  Type::Unset = 0, Type::Image = 1, Type::TextureMapping = 2, Type::RenderMaterial = 3,
  Type::LinePattern = 4, Type::Layer = 5, Type::Group = 6, Type::TextStyle = 7,
  Type::DimStyle = 8, Type::RenderLight = 9, Type::HatchPattern = 10, Type::InstanceDefinition = 11,
  Type::ModelGeometry = 12, Type::HistoryRecord = 13, Type::Mixed = 0xFE
}
 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. /summary> More...
 
- Public Types inherited from ON_Object
enum  UserDataConflictResolution : unsigned char {
  UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3,
  UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6
}
 

Public Member Functions

 ON_ModelComponent () ON_NOEXCEPT
 
 ON_ModelComponent (const ON_ModelComponent &source)
 
 ON_ModelComponent (ON_ModelComponent::Type component_type) ON_NOEXCEPT
 
 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)
 
bool ClearComponentType ()
 
bool ClearId ()
 
bool ClearIndex ()
 
unsigned int ClearModelComponentAttributes (unsigned int attributes_filter)
 
bool ClearModelComponentStatus ()
 
bool ClearModelSerialNumber ()
 
bool ClearName ()
 
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
 
unsigned int CopyFrom (const ON_ModelComponent &src, unsigned int attributes_filter)
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const override
 
const ON_wString DeletedName () const
 
const ON_NameHashDeletedNameHash () const
 
bool DeletedNameIsSet () const
 
bool DeleteName ()
 
void Dump (ON_TextLog &) const override
 
bool EraseIdentification (bool bIgnoreLocks)
 
const wchar_tGetName (ON_wString &component_name) const
 
const ON_UUIDId () const
 
bool IdIsLocked () const
 
bool IdIsNil () const
 
bool IdIsNotNil () const
 
bool IdIsSet () const
 
const ON_UUIDIfIdIsNilSetId ()
 
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
 
void LockAllSettingsExceptName ()
 
void LockComponentType ()
 
void LockId ()
 
void LockIndex ()
 
void LockModelComponentStatus ()
 
void LockModelSerialNumber ()
 
void LockName ()
 
void LockParentId ()
 
ON_ComponentStatus ModelComponentStatus () const
 
bool ModelComponentStatusIsLocked () const
 
bool ModelComponentStatusIsSet () const
 
ON_UUID ModelObjectId () const override
 
unsigned int ModelSerialNumber () const
 
bool ModelSerialNumberIsLocked () const
 
bool ModelSerialNumberIsSet () const
 
const ON_wString Name () const
 
const wchar_tNameAsPointer () const
 
const ON_NameHashNameHash () const
 
bool NameIsEmpty () const
 
bool NameIsLocked () const
 
bool NameIsNotEmpty () const
 
bool NameIsSet () const
 
const ON_NameHash NewNameHash (const wchar_t *new_name) const
 
ON_ModelComponentoperator= (const ON_ModelComponent &source)
 
const ON_UUIDParentId () 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_UUIDSetAndLockId ()
 
bool SetAsSystemComponent ()
 
bool SetAsUnsetSystemComponent ()
 
bool SetComponentType (ON_ModelComponent::Type component_component_type)
 
bool SetDeletedModelComponentState (bool bDeleted, class ON_ComponentManifest *manifest)
 
void SetHiddenModelComponentState (bool bHidden)
 
const ON_UUIDSetId ()
 
bool SetId (const ON_UUID &component_id)
 
bool SetIdentification (const class ON_ComponentManifestItem &manifest_item, const wchar_t *manifest_name, bool bSetId, bool bParentId, bool bSetName, bool bSetIndex)
 
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)
 
bool SetModelSerialNumber (unsigned int model_serial_number, unsigned int reference_model_serial_number, unsigned int instance_definition_model_serial_number)
 
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
 
bool AttachUserData (class ON_UserData *pUserData)
 
unsigned int ClearAllComponentStates () const
 
virtual unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const
 
virtual unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) const
 
void CopyUserData (const ON_Object &source_object)
 
unsigned int CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution)
 
virtual bool DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
 
virtual void DestroyRuntimeCache (bool bDelete=true)
 
bool DetachUserData (class ON_UserData *pUserData)
 
void EmergencyDestroy ()
 
class ON_UserDataFirstUserData () const
 
virtual unsigned int GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const
 
class ON_UserDataGetUserData (const ON_UUID &userdata_uuid) const
 
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
 
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
 
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
 
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
 
bool IsKindOf (const ON_ClassId *pClassId) const
 
virtual void MarkAggregateComponentStatusAsNotCurrent () const
 
virtual void MemoryRelocate ()
 
void MoveUserData (ON_Object &source_object)
 
unsigned int MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems)
 
virtual ON::object_type ObjectType () const
 
ON_Objectoperator= (const ON_Object &)
 
void PurgeUserData ()
 
virtual bool Read (ON_BinaryArchive &binary_archive)
 
virtual unsigned int SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
 
virtual unsigned int SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
 
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
 
int SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace)
 
bool ThisIsNullptr (bool bSilentError) const
 
void TransformUserData (const class ON_Xform &xform)
 
virtual bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
 
int UserStringCount () const
 
virtual bool Write (ON_BinaryArchive &binary_archive) const
 

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_tIsNamePathSeparator (const wchar_t *s)
 
*static const wchar_tIsReferencePrefixDelimiter (const wchar_t *s)
 
static const wchar_tIsReferencePrefixSeparator (const wchar_t *s)
 
static bool IsValidComponentName (const class ON_ComponentManifest &model_manfest, const ON_ModelComponent &model_component, bool bPermitReferencePrefix, ON_wString &valid_name)
 
static bool IsValidComponentName (const ON_wString &candidate_component_name)
 
static bool IsValidComponentName (const wchar_t *candidate_component_name)
 
static bool IsValidComponentName (size_t length, const wchar_t *candidate_component_name)
 
static bool IsValidComponentNameFirstCodePoint (int length, const wchar_t *candidate_component_name)
 
static bool IsValidComponentNameFirstCodePoint (ON__UINT32 unicode_code_point)
 
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 ON__UINT64 NextRuntimeSerialNumber ()
 
static const ON_wString RemoveAllReferencePrefixDelimiters (const wchar_t *name)
 
static const ON_wString RemoveReferencePrefix (const wchar_t *name)
 
static const ON_wString RemoveTrailingNamePathSeparator (const wchar_t *name)
 
static const ON_wString RemoveTrailingReferencePrefixDelimiter (const wchar_t *name)
 
static const ON_wString RemoveTrailingReferencePrefixSeparator (const wchar_t *name)
 
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
 
static const ON_wString ReferencePrefixDelimiter
 
static const ON_wString ReferencePrefixSeparator
 
static const ON_ModelComponent Unset
 
*static const ON_wString WorksessionReferencePrefix *const wchar_t
 

Protected Member Functions

void IncrementContentVersionNumber () const
 

Detailed Description

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
/ For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: 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.

Member Enumeration Documentation

◆ Attributes

enum ON_ModelComponent::Attributes : unsigned int

The ON_ModelComponent::Attributes enum is used to set bits that identify model component attributes.

Enumerator
NoAttributes 
ComponentSerialNumberAttribute 
TypeAttribute 
ModelSerialNumberAttribute 
IdAttribute 
IndexAttribute 
NameAttribute 
ParentIdAttribute 
DeletedNameAttribute 
ComponentStatusAttribute 
BinaryArchiveAttributes 

Default model attributes saved in binary archives. Id, ParentId, Name, Index Do not include SystemComponentAttribute in BinaryArchiveAttributes

AllAttributes 

Do not include SystemComponentAttribute in AllAttributes.

SystemComponentAttribute 

◆ Type

enum ON_ModelComponent::Type : unsigned char
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. /summary>

Enumerator
Unset 

summary>No value set.

summary>Embedded image (bitmap) components.

Image 

summary>Texture mapping.

TextureMapping 

summary>Render material.

RenderMaterial 

summary>Line pattern (linetype).

LinePattern 

summary>Layer.

Layer 

summary>Group.

Group 

summary>Text style.

TextStyle 

summary>AnnotationDimension style.

DimStyle 

summary>Render light.

RenderLight 

summary>Hatch pattern.

HatchPattern 

summary>Instance definition.

InstanceDefinition 

summary>Model objects (points, curves, surfaces, ..., annotation, page details, ...), including objects referenced by instance definitions.

ModelGeometry 

summary>History record.

HistoryRecord 

summary>Multiple component types. Used when a component type filter must include all explicit component types. /summary>

Mixed 

Constructor & Destructor Documentation

◆ ON_ModelComponent() [1/4]

ON_ModelComponent::ON_ModelComponent ( )

◆ ~ON_ModelComponent()

ON_ModelComponent::~ON_ModelComponent ( )
default

◆ ON_ModelComponent() [2/4]

ON_ModelComponent::ON_ModelComponent ( const ON_ModelComponent source)

Locked status of source attributes is not copied to permit copy and modify operations. Runtime serial number and content version number are not copied.

◆ ON_ModelComponent() [3/4]

ON_ModelComponent::ON_ModelComponent ( ON_ModelComponent::Type  component_type)

Description: Sets and locks the component type attribute. Parameters: component_type - [in]

◆ ON_ModelComponent() [4/4]

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.

Member Function Documentation

◆ ChangeName()

bool ON_ModelComponent::ChangeName ( const wchar_t new_name,
class ON_ComponentManifest manifest 
)

Description: Change the name of a component and optionally update a manifest. Parameters: new_name - [in] New name for the component. manifest - [in] nullptr or a manifest with an item for the component.

◆ ClearComponentType()

bool ON_ModelComponent::ClearComponentType ( )

Description: Set the model serial number value to the ON_ModelComponent::Unset.Type() and change the state so TypeIsSet() returns false.

◆ ClearId()

bool ON_ModelComponent::ClearId ( )

Description: Set the component id value to the ON_ModelComponent::Unset.ModelComponentId() and change the state so ModelComponentIdIsSet() returns false.

◆ ClearIndex()

bool ON_ModelComponent::ClearIndex ( )

Description: Set the component index value to the ON_ModelComponent::Unset.ModelComponentIndex() and change the state so ModelComponentIndexIsSet() returns false.

◆ ClearModelComponentAttributes()

unsigned int ON_ModelComponent::ClearModelComponentAttributes ( unsigned int  attributes_filter)

General attributes interface Description: Writes the attributes identified by the component_filter parameter. Parameters: attributes_filter - [in] A bitfield that determines which attributes will be cleared. Returns: a bitfield indicating which attributes were cleared. (Locked attributes cannot be cleared.)

◆ ClearModelComponentStatus()

bool ON_ModelComponent::ClearModelComponentStatus ( )

◆ ClearModelSerialNumber()

bool ON_ModelComponent::ClearModelSerialNumber ( )

Description: Sets the model serial number, reference model serial number and instance definition model serial number values to 0 and flags these values as unset.

◆ ClearName()

bool ON_ModelComponent::ClearName ( )

Description: Set the component name value to the ON_ModelComponent::Unset.Name() and change the state so NameIsSet() and DeletedNameIsSet() both return false.

◆ ClearParentId()

bool ON_ModelComponent::ClearParentId ( )

◆ CompareId()

static int ON_ModelComponent::CompareId ( const ON_ModelComponent a,
const ON_ModelComponent b 
)
static

◆ CompareIdAndName()

static int ON_ModelComponent::CompareIdAndName ( const ON_ModelComponent a,
const ON_ModelComponent b 
)
static

Description Call ON_ModelComponent::Id()and then ON_ModelComponent::CompareName(). When used for sorting, will be sorted by id and then by name.

◆ CompareName() [1/3]

static int ON_ModelComponent::CompareName ( const ON_ModelComponent a,
const ON_ModelComponent b 
)
static

Parameters: a -[in] b -[in] Returns: ON_wString::CompareAttributeName(a.Name(), b.Name() ) Remarks: CompareName() is the correct tool to use when looking up objects by name.

◆ CompareName() [2/3]

int ON_ModelComponent::CompareName ( const ON_UUID other_parent_id,
const wchar_t other_name 
) const

Parameters: other_name -[in] Returns: ON_wString::CompareAttributeName(this->Name(), other_name) Remarks: CompareName() is the correct tool to use when looking up objects by name.

◆ CompareName() [3/3]

int ON_ModelComponent::CompareName ( const wchar_t other_name) const

◆ CompareNameAndId()

static int ON_ModelComponent::CompareNameAndId ( const ON_ModelComponent a,
const ON_ModelComponent b 
)
static

Description Call ON_ModelComponent::CompareName() and then ON_ModelComponent::CompareId(). When used for sorting, will be sorted by name and then by id.

◆ CompareNameExact() [1/3]

static int ON_ModelComponent::CompareNameExact ( const ON_ModelComponent a,
const ON_ModelComponent b 
)
static

Parameters: a -[in] b -[in] Returns: int rc = ON_wString::CompareAttributeName(a.Name(), b.Name()); return (0 != rc) ? rc : ON_wString::CompareOrdinal(a.Name(), b.Name(), false); Remarks: CompareNameExact() is the correct tool to use when detecting changes in case are important. Use CompareName() when searching for components by name.

◆ CompareNameExact() [2/3]

int ON_ModelComponent::CompareNameExact ( const ON_UUID other_parent_id,
const wchar_t other_name 
) const

Parameters: other_name -[in] Returns: int rc = ON_wString::CompareAttributeName(this->Name(), other_name); return (0 != rc) ? rc : ON_wString::CompareOrdinal(this->Name(), other_name, false); Remarks: CompareNameExact() is the correct tool to use when detecting changes in case are important. Use CompareName() when searching for components by name.

◆ CompareNameExact() [3/3]

int ON_ModelComponent::CompareNameExact ( const wchar_t other_name) const

◆ ComponentType()

ON_ModelComponent::Type ON_ModelComponent::ComponentType ( ) const

Type interface Returns: Value of the Type attribute. Remarks: 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.

◆ ComponentTypeFromUnsigned()

static ON_ModelComponent::Type ON_ModelComponent::ComponentTypeFromUnsigned ( unsigned int  component_type_as_unsigned)
static

◆ ComponentTypeIsLocked()

bool ON_ModelComponent::ComponentTypeIsLocked ( ) const

Returns: True if the Type attribute is locked.

◆ ComponentTypeIsSet()

bool ON_ModelComponent::ComponentTypeIsSet ( ) const

Returns: True if the Type attribute is set.

◆ ComponentTypeIsValid()

static bool ON_ModelComponent::ComponentTypeIsValid ( ON_ModelComponent::Type  component_type)
static

Parameters: component_type - [in] Returns: True if component_type is a valid enum value, and not equal to ON_ModelComponent::Type::Unset.

◆ ComponentTypeIsValidAndNotMixed()

static bool ON_ModelComponent::ComponentTypeIsValidAndNotMixed ( ON_ModelComponent::Type  component_type)
static

Parameters: component_type - [in] Returns: True if component_type is a valid enum value, and not equal to ON_ModelComponent::Type::Unset, and not equal to ON_ModelComponent::Type::Mixed.

◆ ComponentTypeToString()

static const ON_wString ON_ModelComponent::ComponentTypeToString ( ON_ModelComponent::Type  )
static

◆ ContentVersionNumber()

ON__UINT64 ON_ModelComponent::ContentVersionNumber ( ) const

Description: 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. Remarks: The ContentVersionNumber value is copied by the copy constructor and operator=. The value is not saved in .3dm archives.

◆ CopyFrom()

unsigned int ON_ModelComponent::CopyFrom ( const ON_ModelComponent src,
unsigned int  attributes_filter 
)

◆ DataCRC()

ON__UINT32 ON_ModelComponent::DataCRC ( ON__UINT32  current_remainder) const
overridevirtual

Description: 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. Parameters: current_remainder - [in]; Returns: CRC of the information the defines the object.

Reimplemented from ON_Object.

◆ DeletedName()

const ON_wString ON_ModelComponent::DeletedName ( ) const

◆ DeletedNameHash()

const ON_NameHash& ON_ModelComponent::DeletedNameHash ( ) const

◆ DeletedNameIsSet()

bool ON_ModelComponent::DeletedNameIsSet ( ) const

Returns: True if the deleted name attribute is set. Remarks: At most one of NameIsSet() and DeletedNameIsSet() is true.

◆ DeleteName()

bool ON_ModelComponent::DeleteName ( )

Description: 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().

◆ Dump()

void ON_ModelComponent::Dump ( ON_TextLog ) const
overridevirtual

Description: Creates a text dump of the object. Remarks: 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_ModelGeometryComponent, CRhinoInstanceDefinition, ON_TextureMapping, ON_TextStyle, and ON_HistoryRecord.

◆ EraseIdentification()

bool ON_ModelComponent::EraseIdentification ( bool  bIgnoreLocks)

◆ GetName()

const wchar_t* ON_ModelComponent::GetName ( ON_wString component_name) const

Parameters: component_name - [out] Returns: A pointer to the string in component_name.

◆ Id()

const ON_UUID& ON_ModelComponent::Id ( ) const

Id interface

The component id is intended to be unique in the context of a model. Returns: Value of the Id attribute. Remarks: If the component is in a model, then the id is unique for all components in the model and is locked.

◆ IdIsLocked()

bool ON_ModelComponent::IdIsLocked ( ) const

Returns: True if the ModelComponentId attribute is locked.

◆ IdIsNil()

bool ON_ModelComponent::IdIsNil ( ) const

◆ IdIsNotNil()

bool ON_ModelComponent::IdIsNotNil ( ) const

◆ IdIsSet()

bool ON_ModelComponent::IdIsSet ( ) const

Returns: True if the ModelComponentId attribute is set.

◆ IfIdIsNilSetId()

const ON_UUID& ON_ModelComponent::IfIdIsNilSetId ( )

Description: If the it is nil, call SetId().

◆ IncrementContentVersionNumber()

void ON_ModelComponent::IncrementContentVersionNumber ( ) const
protected

Classes derived from ON_ModelComponent should have private data members and call IncrementContentVersionNumber() when the data member value changes.

◆ Index() [1/2]

int ON_ModelComponent::Index ( ) const

Index interface

When a component is managed by a model, the component index is identifies the component within the context of that model. Returns: Value of the runtime model component index attribute. Remarks: 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.

◆ Index() [2/2]

int ON_ModelComponent::Index ( int  unset_index_value) const

Returns: Value of the model component index attribute. Parameters: 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. Returns: IndexIsSet() ? Index() : unset_index_value; Remarks: If the component is in a model, then the index is unique for all components of identical type in the model and is locked.

◆ IndexIsLocked()

bool ON_ModelComponent::IndexIsLocked ( ) const

Returns: True if the ModelComponentIndex attribute is locked.

◆ IndexIsSet()

bool ON_ModelComponent::IndexIsSet ( ) const

Returns: True if the ModelComponentIndex attribute is set.

◆ IndexRequired()

static bool ON_ModelComponent::IndexRequired ( ON_ModelComponent::Type  component_type)
static

◆ InstanceDefinitionModelSerialNumber()

unsigned int ON_ModelComponent::InstanceDefinitionModelSerialNumber ( ) const

Returns: When a component is in a model as part of the information required for a linked instance definition, this value identifies the the linked instance definition reference model. Remarks: 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

◆ Internal_SystemComponentHelper()

static unsigned int ON_ModelComponent::Internal_SystemComponentHelper ( )
static

For internal use. Never call this function.

◆ IsDeleted()

bool ON_ModelComponent::IsDeleted ( ) const

Returns: The component's deleted state. Remarks: Deleted components can be undeleted.

◆ IsHidden()

bool ON_ModelComponent::IsHidden ( ) const

Returns: The component's user interface hidden state. Remarks: This is a user interface hidden state and does not effect changing the component values.

◆ IsLocked()

bool ON_ModelComponent::IsLocked ( ) const

Returns: The component's user interface locked state. Remarks: This is a user interface locked state and does not effect changing the component values.

◆ IsNamePathSeparator()

static const wchar_t* ON_ModelComponent::IsNamePathSeparator ( const wchar_t s)
static

Description: Test a string to see if its beginning matches the string returned by ON_ModelComponent::NamePathSeparator. Parameters: s - [in]; string to test. Returns: null: The beginning of the string does not match ON_ModelComponent::NamePathSeparator. non-null: The beginning of the string matches ON_ModelComponent::NamePathSeparator. The returned pointer is the first character in s after the last character of the delimiter. Put another way, if the beginning of s matches the string ON_ModelComponent::NamePathSeparator, then the returned pointer is s + ON_ModelComponent::NamePathSeparator.Length().

◆ IsReferenceComponent()

bool ON_ModelComponent::IsReferenceComponent ( ) const

◆ IsReferencePrefixDelimiter()

* static const wchar_t* ON_ModelComponent::IsReferencePrefixDelimiter ( const wchar_t s)
static

Description: Test a string to see if its beginning matches the string returned by ON_ModelComponent::NameReferenceDelimiter. Parameters: s - [in]; string to test. Returns: null: The beginning of the string does not match ON_ModelComponent::NameReferenceDelimiter. non-null: The beginning of the string matches ON_ModelComponent::NameReferenceDelimiter. The returned pointer is the first character in s after the last character of the delimiter. Put another way, if the beginning of s matches the string ON_ModelComponent::NameReferenceDelimiter, then the returned pointer is s + ON_ModelComponent::NameReferenceDelimiter.Length().

◆ IsReferencePrefixSeparator()

static const wchar_t* ON_ModelComponent::IsReferencePrefixSeparator ( const wchar_t s)
static

Description: Test a string to see if its beginning matches the string returned by ON_ModelComponent::NameReferenceSeparator. Parameters: s - [in]; string to test. Returns: null: The beginning of the string does not match ON_ModelComponent::NameReferenceSeparator. non-null: The beginning of the string matches ON_ModelComponent::NameReferenceSeparator. The returned pointer is the first character in s after the last character of the delimiter. Put another way, if the beginning of s matches the string ON_ModelComponent::NameReferenceSeparator, then the returned pointer is s + ON_ModelComponent::NameReferenceSeparator.Length().

◆ IsSystemComponent()

bool ON_ModelComponent::IsSystemComponent ( ) const

Returns: True if this model component is a system constant.
Remarks: 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::DefaultFootInchArchitectural ON_DimStyle::DefaultMillimeterSmall ON_DimStyle::DefaultMillimeterLarge ON_DimStyle::DefaultMillimeterArchitectural

◆ IsValid()

bool ON_ModelComponent::IsValid ( class ON_TextLog text_log = nullptr) const
overridevirtual

Description: Tests an object to see if its data members are correctly initialized. Parameters: 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. Returns: @untitled table true object is valid false object is invalid, uninitialized, etc.

Reimplemented from ON_Object.

Reimplemented in ON_TextureMapping, ON_TextStyle, and ON_HistoryRecord.

◆ IsValidComponentName() [1/4]

static bool ON_ModelComponent::IsValidComponentName ( const class ON_ComponentManifest model_manfest,
const ON_ModelComponent model_component,
bool  bPermitReferencePrefix,
ON_wString valid_name 
)
static

Parameters: model_component - [in] model_manfest - [in] current model contents valid_name - [in] Valid name for this component in a model with the specified manifest. Returns: true: model_component.Name() is valid false: model_component.Name() is not valid

◆ IsValidComponentName() [2/4]

static bool ON_ModelComponent::IsValidComponentName ( const ON_wString candidate_component_name)
static

◆ IsValidComponentName() [3/4]

static bool ON_ModelComponent::IsValidComponentName ( const wchar_t candidate_component_name)
static

Parameters: candidate_component_name - [in] A null terminated string that is UTF-16 or UTF-32 encoded. When sizeof(wchar_t) >= 4, both UTF-16 surrogate pairs and UTF-32 code point values > 0xFFFF are valid and can appear in the same string. Returns: True if candidate_component_name is a valid component name. Remarks: 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.

◆ IsValidComponentName() [4/4]

static bool ON_ModelComponent::IsValidComponentName ( size_t  length,
const wchar_t candidate_component_name 
)
static

Parameters: length - [in] > 0. The expected number of elements before the null terminator in candidate_component_name[]. candidate_component_name - [in] A null terminated string that is UTF-16 or UTF-32 encoded. When sizeof(wchar_t) >= 4, both UTF-16 surrogate pairs and UTF-32 code point values > 0xFFFF are valid and can appear in the same string. The capacity of candidate_component_name[] must be >= length+1. This validity test fails if candidate_component_name[length] is not zero or if a null terminator appears before candidate_component_name[length]. Returns: True if candidate_component_name is a valid component name. Remarks: 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.

◆ IsValidComponentNameFirstCodePoint() [1/2]

static bool ON_ModelComponent::IsValidComponentNameFirstCodePoint ( int  length,
const wchar_t candidate_component_name 
)
static

Parameters: 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(). Returns: True if a componenent name can begin with the first code point. Remarks: 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.

◆ IsValidComponentNameFirstCodePoint() [2/2]

static bool ON_ModelComponent::IsValidComponentNameFirstCodePoint ( ON__UINT32  unicode_code_point)
static

Returns: True if a componenent name can begin with the first code point. Remarks: 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.

◆ LockAllSettingsExceptName()

void ON_ModelComponent::LockAllSettingsExceptName ( )

◆ LockComponentType()

void ON_ModelComponent::LockComponentType ( )

Description: Calling LockType() will prhibit future changes to the Type attribute.

◆ LockId()

void ON_ModelComponent::LockId ( )

Description: Calling LockModelComponentId() will prhibit future changes to the ModelComponentId attribute.

◆ LockIndex()

void ON_ModelComponent::LockIndex ( )

Description: Calling LockModelComponentIndex() will prhibit future changes to the ModelComponentIndex attribute.

◆ LockModelComponentStatus()

void ON_ModelComponent::LockModelComponentStatus ( )

◆ LockModelSerialNumber()

void ON_ModelComponent::LockModelSerialNumber ( )

Description: Calling LockModelSerialNumber() will prohibit future changes to the ModelSerialNumber(), ReferenceModelSerialNumber(), and InstanceDefinitionModelSerialNumber() attributes.

◆ LockName()

void ON_ModelComponent::LockName ( )

Description: Calling LockName() will prohibit future changes to the Name attribute.

◆ LockParentId()

void ON_ModelComponent::LockParentId ( )

◆ ModelComponentStatus()

ON_ComponentStatus ON_ModelComponent::ModelComponentStatus ( ) const

Model component locked, hidden, deleted, selected, highlights, damaged, ... status interface

◆ ModelComponentStatusIsLocked()

bool ON_ModelComponent::ModelComponentStatusIsLocked ( ) const

◆ ModelComponentStatusIsSet()

bool ON_ModelComponent::ModelComponentStatusIsSet ( ) const

◆ ModelObjectId()

ON_UUID ON_ModelComponent::ModelObjectId ( ) const
overridevirtual

Description: 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 ). Returns: The id used to identify the object in the openurbs model.

Reimplemented from ON_Object.

◆ ModelSerialNumber()

unsigned int ON_ModelComponent::ModelSerialNumber ( ) const

Returns: A value identifing the model that manages this component. Remarks: 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.

◆ ModelSerialNumberIsLocked()

bool ON_ModelComponent::ModelSerialNumberIsLocked ( ) const

◆ ModelSerialNumberIsSet()

bool ON_ModelComponent::ModelSerialNumberIsSet ( ) const

◆ Name()

const ON_wString ON_ModelComponent::Name ( ) const

Name interface Returns: Value of the Name attribute. Remarks: 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.

◆ NameAsPointer()

const wchar_t* ON_ModelComponent::NameAsPointer ( ) const

Description: Expert user function that gets a pointer to the name. Returns: A pointer to the string that contains the name. This pointer must be used immediately and then discarded before any code can possibly call SetName() or the ON_ModelComponent destructor could be called. Remarks: About the only good use for this function is when a model compoenent is persistent 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.

◆ NameHash()

const ON_NameHash& ON_ModelComponent::NameHash ( ) const

Description: 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.

◆ NameIsEmpty()

bool ON_ModelComponent::NameIsEmpty ( ) const

Returns: true if the name is unset or is set to the empty string.

◆ NameIsLocked()

bool ON_ModelComponent::NameIsLocked ( ) const

Returns: True if the Name attribute is locked.

◆ NameIsNotEmpty()

bool ON_ModelComponent::NameIsNotEmpty ( ) const

Returns: true if the name is set and the value is not the empty string.

◆ NameIsSet()

bool ON_ModelComponent::NameIsSet ( ) const

Returns: True if the name attribute is set. Remarks: At most one of NameIsSet() and DeletedNameIsSet() is true. A name can be set to the empty string.

◆ NameLeaf()

static const ON_wString ON_ModelComponent::NameLeaf ( const wchar_t name)
static

Example: If the name is "A.3dm>B.3dm : X::Y::Z", then name_leaf = "Z" is returned.

◆ NameParent()

static const ON_wString ON_ModelComponent::NameParent ( const wchar_t name,
bool  bIncludeReference 
)
static

Parameters: name - [in] bIncludeReference - [in] Example: If the name is "A.3dm>B.3dm : X::Y::Z" and bIncludeReference is true, then "A.3dm>B.3dm : X::Y" is returned. If the name is "A.3dm>B.3dm : X::Y::Z" and bIncludeReference is false, then "X::Y" is returned.

◆ NameReferencePrefix()

static const ON_wString ON_ModelComponent::NameReferencePrefix ( const wchar_t name)
static

Parameters: name - [in] Example: If the name is "A.3dm : X", then "A.3dm" is returned.

◆ NewNameHash()

const ON_NameHash ON_ModelComponent::NewNameHash ( const wchar_t new_name) const

Parameters: new_name - [in]
Returns: If new_name is empty or a valid component name, then name hash this component would have if SetName(new_name) were called. If new_name is not valid, then ON_NameHash::UnsetNameHash is returned. Remarks: 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.

◆ NextRuntimeSerialNumber()

static ON__UINT64 ON_ModelComponent::NextRuntimeSerialNumber ( )
static

Returns: The next ON_ModelComponent instance will have runtime serial number >= ON_ModelComponent::NextRuntimeSerialNumber();

◆ operator=()

ON_ModelComponent& ON_ModelComponent::operator= ( const ON_ModelComponent source)

Remarks: operator= will not change locked destination attributes. Locked status of source attributes is not copied to permit copy and modify operations.

◆ ParentId()

const ON_UUID& ON_ModelComponent::ParentId ( ) const

Parent object interface

◆ ParentIdIsLocked()

bool ON_ModelComponent::ParentIdIsLocked ( ) const

◆ ParentIdIsNil()

bool ON_ModelComponent::ParentIdIsNil ( ) const

◆ ParentIdIsNotNil()

bool ON_ModelComponent::ParentIdIsNotNil ( ) const

◆ ParentIdIsSet()

bool ON_ModelComponent::ParentIdIsSet ( ) const

◆ ReadModelComponentAttributes()

bool ON_ModelComponent::ReadModelComponentAttributes ( class ON_BinaryArchive archive)

◆ ReferenceModelSerialNumber()

unsigned int ON_ModelComponent::ReferenceModelSerialNumber ( ) const

Returns: When a compoent is in a model for reference, this value identifies the reference model. Remarks: 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

◆ RemoveAllReferencePrefixDelimiters()

static const ON_wString ON_ModelComponent::RemoveAllReferencePrefixDelimiters ( const wchar_t name)
static

Description: Remove all occurances of ON::NameReferenceDelimiter() from name.

◆ RemoveReferencePrefix()

static const ON_wString ON_ModelComponent::RemoveReferencePrefix ( const wchar_t name)
static

Parameters: name - [in] Example: If the name is "A.3dm : X", then "X" is returned.

◆ RemoveTrailingNamePathSeparator()

static const ON_wString ON_ModelComponent::RemoveTrailingNamePathSeparator ( const wchar_t name)
static

Description: Remove any trailing occurance of ON_ModelComponent::NamePathSeparator from name.

◆ RemoveTrailingReferencePrefixDelimiter()

static const ON_wString ON_ModelComponent::RemoveTrailingReferencePrefixDelimiter ( const wchar_t name)
static

Description: Remove any trailing occurance of ON_ModelComponent::NameReferenceDelimiter from name. Example: "A.3dm" = ON_ModelComponent::RemoveTrailingRemoveReferencePrefixDelimiter("A.3dm : ");

◆ RemoveTrailingReferencePrefixSeparator()

static const ON_wString ON_ModelComponent::RemoveTrailingReferencePrefixSeparator ( const wchar_t name)
static

Description: Remove any trailing occurance of ON_ModelComponent::NameReferenceSeparator from name.

◆ RuntimeSerialNumber()

ON__UINT64 ON_ModelComponent::RuntimeSerialNumber ( ) const

Returns: The runtime serial number.
This value is unique for every instance of an ON_ModelComponent class.
This value is never saved in .3dm archives.

◆ SetAndLockId()

const ON_UUID& ON_ModelComponent::SetAndLockId ( )

Description: Sets the id to a new value created by ON_CreateUuid() and locks the id attribute so it cannot be changed. Returns: ON_nil_uuid: Id is locked. Otherwise the value of the new id.

◆ SetAsSystemComponent()

bool ON_ModelComponent::SetAsSystemComponent ( )

◆ SetAsUnsetSystemComponent()

bool ON_ModelComponent::SetAsUnsetSystemComponent ( )

◆ SetComponentType()

bool ON_ModelComponent::SetComponentType ( ON_ModelComponent::Type  component_component_type)

Parameters: component_component_type - [in] Returns: true if the component_type value was changed to component_component_type or is already equal to component_component_type. false if the component_type value is locked and component_component_type != locked value.

◆ SetDeletedModelComponentState()

bool ON_ModelComponent::SetDeletedModelComponentState ( bool  bDeleted,
class ON_ComponentManifest manifest 
)

Parameters: bDeleted - [in] manifest - [in/out] optional manifest to update Returns: True if the component's deleted state was changed from !bDeleted to bDeleted and all other name and manifest information was updated as expected.

◆ SetHiddenModelComponentState()

void ON_ModelComponent::SetHiddenModelComponentState ( bool  bHidden)

◆ SetId() [1/2]

const ON_UUID& ON_ModelComponent::SetId ( )

Description: Sets the id to a new value created by ON_CreateUuid(). Returns: ON_nil_uuid: Id is locked. Otherwise the value of the new id.

◆ SetId() [2/2]

bool ON_ModelComponent::SetId ( const ON_UUID component_id)

Parameters: component_id - [in] Returns: true if the id value was changed to component_id or is already equal to component_id. false if the id value is locked and component_id != locked value.

◆ SetIdentification()

bool ON_ModelComponent::SetIdentification ( const class ON_ComponentManifestItem manifest_item,
const wchar_t manifest_name,
bool  bSetId,
bool  bParentId,
bool  bSetName,
bool  bSetIndex 
)

Description: Set a component's id, name and index to the manifest_item values. Parameters: 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.

◆ SetIndex()

bool ON_ModelComponent::SetIndex ( int  component_index)

Parameters: component_index - [in] Returns: true if the index value was changed to component_index or is already equal to component_index. false if the index value is locked and component_index != locked value.

◆ SetLocalizedSystemComponentName()

bool ON_ModelComponent::SetLocalizedSystemComponentName ( const wchar_t system_component_localized_name)

◆ SetLockedModelComponentState()

void ON_ModelComponent::SetLockedModelComponentState ( bool  bLocked)

◆ SetModelComponentStatus()

bool ON_ModelComponent::SetModelComponentStatus ( ON_ComponentStatus  component_status)

◆ SetModelSerialNumber() [1/2]

bool ON_ModelComponent::SetModelSerialNumber ( unsigned int  model_serial_number)

Model Serial Number interface

The ModelSerialNumber() identifies the model that manages the component. If the component is from some type of reference model, then one or both of the reference model serial number and InstanceDefinitionModelSerialNumber() identify the source model. Description: Specify the model that is managing this component. Parameters: model_serial_number - [in] In Rhino, this is the document runtime serial number. Returns: true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number. false if the model_serial_number value is locked and component_model_serial_number != locked value.

◆ SetModelSerialNumber() [2/2]

bool ON_ModelComponent::SetModelSerialNumber ( unsigned int  model_serial_number,
unsigned int  reference_model_serial_number,
unsigned int  instance_definition_model_serial_number 
)

Description: Specify the model that is managing this component. Parameters: 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. Returns: true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number. false if the model_serial_number value is locked and component_model_serial_number != locked value.

◆ SetName()

bool ON_ModelComponent::SetName ( const wchar_t component_name)

Parameters: component_name - [in] Leading and trailing nonzero unicode code points with values <= ON_wString::Space are ignored. Returns: true if the name attribute was changed to component_name or is already equal to component_name. false False is returned and no changes are made if the name attribute is locked and component_name != locked value or component_name is not empty and ON_ModelComponent::IsValidComponentName(component_name) is false. Remarks: If component_name is nullptr or the emtpy string, the NameIsSet() state will still be true.

◆ SetParentId()

bool ON_ModelComponent::SetParentId ( const ON_UUID parent_id)

◆ SizeOf()

unsigned int ON_ModelComponent::SizeOf ( ) const
overridevirtual

Returns: An estimate of the amount of memory the class uses in bytes.

Reimplemented from ON_Object.

Reimplemented in ON_TextureMapping, and CRhinoInstanceDefinition.

◆ SplitName()

static void ON_ModelComponent::SplitName ( const wchar_t name,
ON_wString reference_prefix,
ON_wString name_parent,
ON_wString name_leaf 
)
static

Example: If a full layer name is "A.3dm : X::Y::Z", then reference_prefix = "A.3dm" name_parent = "X::Y" name_leaf = "Z"

◆ UndeleteName()

bool ON_ModelComponent::UndeleteName ( )

◆ UniqueNameIgnoresCase()

static bool ON_ModelComponent::UniqueNameIgnoresCase ( ON_ModelComponent::Type  component_type)
static

Parameters: component_type - [in] Returns: True if component name ignores case when testing for equality. Remarks: Currently all other component types except for groups ignore case when testing for equality. This function should be called "NameIgnoresCase" because it also applies to components like materials and geometry objects that are not reqired to have a unique name.

◆ UniqueNameIncludesParent()

static bool ON_ModelComponent::UniqueNameIncludesParent ( ON_ModelComponent::Type  component_type)
static

Parameters: component_type - [in] Returns: True if objects with the same name and different parents are considered to have a unique name. This typically means the user interface for the object names is some type of tree. Remarks: Currently, layers are the only object type where this property is true. This function should be called "NameIncludesParent" because it also applies to components like materials and geometry objects that are not reqired to have a unique name.

◆ UniqueNameRequired()

static bool ON_ModelComponent::UniqueNameRequired ( ON_ModelComponent::Type  component_type)
static

Parameters: component_type - [in] Returns: True if component's of the specified type require uniquen names. Remarks: 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.

◆ WriteModelComponentAttributes()

bool ON_ModelComponent::WriteModelComponentAttributes ( class ON_BinaryArchive archive,
unsigned int  attributes_filter 
) const

Member Data Documentation

◆ NamePathSeparator

const ON_wString ON_ModelComponent::NamePathSeparator
static

Description: Returns the string "::". This is the string Rhino uses in layer full path names to separate the names of individual layers.

Example: If a model has layers A B C then the full path names are "A", "A::B", "A::B::C".

See Also: ON_ModelComponent::ReferencePrefixDelimiter = " : " ON_ModelComponent::ReferencePrefixSeparator = ">" ON_ModelComponent::NamePathSeparator = "::"

◆ ReferencePrefixDelimiter

const ON_wString ON_ModelComponent::ReferencePrefixDelimiter
static

Description: Returns the string " : ". This is the string Rhino uses to separate the reference file names from and model component names read from those files.

Example: File A.3dm contains a layer "alpha", dimstyle "a1", an embedded block "A_blk", and a linked block "X" referencing B.3dm with reference component names. File B.3dm contains a layer "beta", dimstyle "b1", an embedded block "B_blk", and linked block "Y" referencing C.3dm. File C.3dm contains a layer gamma, dimstyle "c1", an embedded block "C_blk", and linked block "Z" referencing D.3dm. File D.3dm contains a layer "delta", dimstyle "d1", and an embedded block "D_blk".

Reading file A.3dm will craete the following components: Layers: alpha X>B.3dm beta (full layer path "X>B.3dm::beta") Y>C.3dm gamma (full layer path "Y>C.3dm::gamma") Z>D.3dm delta (full layer path "Z>D.3dm::delta") Blocks: X A_blk Y B.3dm : B_blk Z C.3dm : C_blk D.3dm : D_blk Annotation styles a1 B.3dm : b1 C.3dm : c1 D.3dm : d1

See Also: ON_ModelComponent::ReferencePrefixDelimiter = " : " ON_ModelComponent::ReferencePrefixSeparator = ">" ON_ModelComponent::NamePathSeparator = "::"

◆ ReferencePrefixSeparator

const ON_wString ON_ModelComponent::ReferencePrefixSeparator
static

Description: Returns the string ">". This is the string Rhino uses to separate the block definition name and linked file name in grandparent layers.

Example: File A.3dm contains a layer "alpha", dimstyle "a1", an embedded block "A_blk", and a linked block "X" referencing B.3dm with reference component names. File B.3dm contains a layer "beta", dimstyle "b1", an embedded block "B_blk", and linked block "Y" referencing C.3dm. File C.3dm contains a layer gamma, dimstyle "c1", an embedded block "C_blk", and linked block "Z" referencing D.3dm. File D.3dm contains a layer "delta", dimstyle "d1", and an embedded block "D_blk".

Reading file A.3dm will craete the following components: Layers: alpha X>B.3dm beta (full layer path "X>B.3dm::beta") Y>C.3dm gamma (full layer path "Y>C.3dm::gamma") Z>D.3dm delta (full layer path "Z>D.3dm::delta") Blocks: X A_blk Y B.3dm : B_blk Z C.3dm : C_blk D.3dm : D_blk Annotation styles a1 B.3dm : b1 C.3dm : c1 D.3dm : d1

See Also: ON_ModelComponent::ReferencePrefixDelimiter = " : " ON_ModelComponent::ReferencePrefixSeparator = ">" ON_ModelComponent::NamePathSeparator = "::"

◆ Unset

const ON_ModelComponent ON_ModelComponent::Unset
static

◆ wchar_t

* static const ON_wString WorksessionReferencePrefix * const ON_ModelComponent::wchar_t
static