23 #if !defined(OPENNURBS_OBJECT_INC_) 24 #define OPENNURBS_OBJECT_INC_ 58 const char* sClassName,
59 const char* sBaseClassName,
75 const char* sClassName
98 static int IncrementMark();
99 static int CurrentMark();
124 static int Purge(
int mark);
125 static bool PurgeAfter(
const ON_ClassId* pClassId);
137 const char* ClassName()
const;
141 const char* BaseClassName()
const;
180 unsigned int ClassIdVersion()
const;
188 char m_sClassName[80];
189 char m_sBaseClassName[80];
204 void ConstructorHelper(
205 const char* sClassName,
206 const char* sBaseClassName,
215 unsigned int m_class_id_version;
234 #define ON_CLASS_RTTI( cls ) cls::m_##cls##_class_rtti 244 #define ON_CLASS_ID( cls ) ON_CLASS_RTTI( cls ).Uuid() 258 ON_UUID ON_GetMostRecentClassIdCreateUuid();
261 #define ON_OBJECT_DECLARE_VIRTUAL 262 #define ON_OBJECT_DECLARE_OVERRIDE override 278 #define ON_OBJECT_DECLARE( cls ) \ 280 static void* m_s_##cls##_ptr; \ 284 static const ON_ClassId m_##cls##_class_rtti; \ 287 static cls * Cast( ON_Object* ); \ 290 static const cls * Cast( const ON_Object* ); \ 293 ON_OBJECT_DECLARE_VIRTUAL const ON_ClassId* ClassId() const ON_OBJECT_DECLARE_OVERRIDE; \ 304 cls * Duplicate() const; \ 311 ON_OBJECT_DECLARE_VIRTUAL bool CopyFrom(const ON_Object*) ON_OBJECT_DECLARE_OVERRIDE; \ 315 ON_OBJECT_DECLARE_VIRTUAL ON_Object* Internal_DeepCopy() const ON_OBJECT_DECLARE_OVERRIDE \ 329 #define ON_VIRTUAL_OBJECT_IMPLEMENT( cls, basecls, uuid ) \ 330 void* cls::m_s_##cls##_ptr = nullptr; \ 331 const ON_ClassId cls::m_##cls##_class_rtti(#cls,#basecls,0,uuid);\ 332 cls * cls::Cast( ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast< cls *>(p):nullptr;} \ 333 const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast<const cls *>(p):nullptr;} \ 334 const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_rtti;} \ 335 bool cls::CopyFrom(const ON_Object*) {return false;} \ 336 cls * cls::Duplicate() const {return static_cast< cls *>(this->Internal_DeepCopy());} \ 337 ON_Object* cls::Internal_DeepCopy() const {return nullptr;} 347 #define ON_OBJECT_IMPLEMENT( cls, basecls, uuid ) \ 348 void* cls::m_s_##cls##_ptr = nullptr; \ 349 static ON_Object* CreateNew##cls() {return new cls();} \ 350 const ON_ClassId cls::m_##cls##_class_rtti(#cls,#basecls,CreateNew##cls,uuid);\ 351 cls * cls::Cast( ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast< cls *>(p):nullptr;} \ 352 const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast<const cls *>(p):nullptr;} \ 353 const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_rtti;} \ 354 bool cls::CopyFrom( const ON_Object* src){const cls * s=cls::Cast(src); if ( nullptr != this && nullptr != s) {*this = *s; return true;}return false;} \ 355 cls * cls::Duplicate() const {return static_cast< cls *>(this->Internal_DeepCopy());} \ 356 ON_Object* cls::Internal_DeepCopy() const {return new cls (*this);} 367 #define ON_OBJECT_IMPLEMENT_NO_COPYCTOR( cls, basecls, uuid ) \ 368 void* cls::m_s_##cls##_ptr = nullptr; \ 369 static ON_Object* CreateNew##cls() {return new cls();} \ 370 const ON_ClassId cls::m_##cls##_class_rtti(#cls,#basecls,CreateNew##cls,uuid);\ 371 cls * cls::Cast( ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast< cls *>(p):nullptr;} \ 372 const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast<const cls *>(p):nullptr;} \ 373 const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_rtti;} \ 374 bool cls::CopyFrom( const ON_Object* src){const cls* s=cls::Cast(src); if ( 0 != this && 0 != s) {*this = *s; return true;}return false;} \ 375 cls * cls::Duplicate() const {return static_cast< cls *>(this->Internal_DeepCopy());} \ 376 ON_Object* cls::Internal_DeepCopy() const { cls* p = new cls();if (p) {*p = *this; return p;}return nullptr;} 386 #define ON_OBJECT_IMPLEMENT_NO_COPY( cls, basecls, uuid ) \ 387 void* cls::m_s_##cls##_ptr = nullptr; \ 388 static ON_Object* CreateNew##cls() {return new cls();} \ 389 const ON_ClassId cls::m_##cls##_class_rtti(#cls,#basecls,CreateNew##cls,uuid);\ 390 cls * cls::Cast( ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast< cls *>(p):nullptr;} \ 391 const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_rtti))?static_cast<const cls *>(p):nullptr;} \ 392 const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_rtti;} \ 393 bool cls::CopyFrom( const ON_Object* src){return false;} \ 394 cls * cls::Duplicate() const {return nullptr;} \ 395 ON_Object* cls::Internal_DeepCopy() const { return nullptr;} 397 #define ON__SET__THIS__PTR(ptr) if (ptr) *((void**)this) = ptr 399 class ON_CLASS ON_UserString
412 #if defined(ON_DLL_TEMPLATE) 426 bool ON_IsNotValid();
435 #undef ON_OBJECT_DECLARE_VIRTUAL 436 #undef ON_OBJECT_DECLARE_OVERRIDE 437 #define ON_OBJECT_DECLARE_VIRTUAL virtual 438 #define ON_OBJECT_DECLARE_OVERRIDE 442 #undef ON_OBJECT_DECLARE_VIRTUAL 443 #undef ON_OBJECT_DECLARE_OVERRIDE 444 #define ON_OBJECT_DECLARE_VIRTUAL 445 #define ON_OBJECT_DECLARE_OVERRIDE override 453 #if defined(ON_HAS_RVALUEREF) 471 void EmergencyDestroy();
489 void MemoryRelocate();
540 virtual bool IsValid(
class ON_TextLog* text_log =
nullptr )
const;
561 unsigned int SizeOf()
const;
574 ON__UINT32 DataCRC(ON__UINT32 current_remainder)
const;
631 ON::object_type ObjectType()
const;
665 const wchar_t* string_value
683 int SetUserStrings(
int count,
const ON_UserString* user_strings,
bool bReplace );
721 int GetUserStringKeys(
729 int UserStringCount()
const;
808 void PurgeUserData();
830 void TransformUserData(
846 destination_object = 0,
848 source_copycount_gt = 2,
849 source_copycount_ge = 3,
850 destination_copycount_gt = 4,
851 destination_copycount_ge = 5,
874 unsigned int CopyUserData(
876 ON_UUID source_userdata_item_id,
901 unsigned int MoveUserData(
903 ON_UUID source_userdata_item_id,
905 bool bDeleteAllSourceItems
958 virtual bool UpdateReferencedComponents(
977 unsigned int ClearAllComponentStates()
const;
989 unsigned int ClearComponentStates(
1013 unsigned int GetComponentsWithSetStates(
1015 bool bAllEqualStates,
1033 unsigned int SetComponentStates(
1034 ON_COMPONENT_INDEX component_index,
1052 unsigned int ClearComponentStates(
1053 ON_COMPONENT_INDEX component_index,
1069 unsigned int SetComponentStatus(
1070 ON_COMPONENT_INDEX component_index,
1102 void MarkAggregateComponentStatusAsNotCurrent()
const;
1117 bool DeleteComponents(
1118 const ON_COMPONENT_INDEX* ci_list,
1143 virtual void DestroyRuntimeCache(
bool bDelete =
true );
1150 bool bPerformConflictCheck,
ON_UUID is a 16 byte universally unique identifier.
Definition: opennurbs_uuid.h:32
ON_ManifestIdentificationMap is used to record a map from a source manifest to a destination manifest...
Definition: opennurbs_archive.h:1464
Definition: opennurbs_array.h:36
Definition: opennurbs_string.h:2020
UserDataConflictResolution
When a userdata item is copied or moved from a source object to a destination object, the ON_Object::UserDataConflictResolution enum values specify how conficts are resolved. Remark: A userdata item "conflict" occurs when both the destination and source object have a user data item with the same value of ON_UserData::m_userdata_uuid.
Definition: opennurbs_object.h:861
Definition: opennurbs_compstat.h:396
OpenNURBS classes derived from ON_Object use ON_ClassId to store run-time type information ...
Definition: opennurbs_object.h:43
Definition: opennurbs_archive.h:478
Definition: opennurbs_compstat.h:88
Pure virtual base class for all classes that must provide runtime class id or support object level 3D...
Definition: opennurbs_object.h:460
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
Definition: opennurbs_userdata.h:20