QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
opennurbs_object.h File Reference

Go to the source code of this file.

Classes

class  ON_ClassId
 
class  ON_Object
 
class  ON_UserString
 
struct  ON_Vtable
 

Macros

#define ON__SET__THIS__PTR(ptr)   if (ptr) *((void**)this) = ptr
 
#define ON_CLASS_ID(cls)   ON_ClassId::ClassId( #cls )
 
#define ON_OBJECT_DECLARE(cls)
 
#define ON_OBJECT_IMPLEMENT(cls, basecls, uuid)
 
#define ON_VIRTUAL_OBJECT_IMPLEMENT(cls, basecls, uuid)
 

Typedefs

typedef int(* ON_Vtable_func) (void)
 

Functions

ON_DECL struct ON_VtableON_ClassVtable (void *p)
 
ON_DECL ON_UUID ON_GetMostRecentClassIdCreateUuid ()
 

Macro Definition Documentation

◆ ON__SET__THIS__PTR

#define ON__SET__THIS__PTR ( ptr)    if (ptr) *((void**)this) = ptr

◆ ON_CLASS_ID

#define ON_CLASS_ID ( cls)    ON_ClassId::ClassId( #cls )

◆ ON_OBJECT_DECLARE

#define ON_OBJECT_DECLARE ( cls)
Value:
protected: \
static void* m_s_##cls##_ptr; \
public: \
static const ON_ClassId m_##cls##_class_id; \
/*record used for ON_Object runtime type information*/ \
\
static cls * Cast( ON_Object* ); \
/*Description: Similar to C++ dynamic_cast*/ \
/*Returns: object on success. NULL on failure*/ \
\
static const cls * Cast( const ON_Object* ); \
/*Description: Similar to C++ dynamic_cast*/ \
/*Returns: object on success. NULL on failure*/ \
\
virtual const ON_ClassId* ClassId() const; \
/*Description:*/ \
\
private: \
virtual ON_Object* DuplicateObject() const; \
/*used by Duplicate to create copy of an object.*/ \
\
static bool Copy##cls( const ON_Object*, ON_Object* ); \
/* used by ON_Object::CopyFrom copy object into this. */ \
/* In V6 Copy##cls will vanish and be replaced with */ \
/* virtual bool CopyFrom( const ON_Object* src ) */ \
\
public: \
cls * Duplicate() const; \
/*Description: Expert level tool - no support available.*/ \
/*If this class is derived from CRhinoObject, use CRhinoObject::DuplicateRhinoObject instead*/
Copies the current selection to the clipboard.
Definition Copy.js:12
Copies the current selection to the clipboard.
Definition Duplicate.js:12
Definition opennurbs_object.h:42
Definition opennurbs_object.h:393

◆ ON_OBJECT_IMPLEMENT

#define ON_OBJECT_IMPLEMENT ( cls,
basecls,
uuid )
Value:
void* cls::m_s_##cls##_ptr = 0;\
static ON_Object* CreateNew##cls() {return new cls();} \
const ON_ClassId cls::m_##cls##_class_id(#cls,#basecls,CreateNew##cls,cls::Copy##cls,uuid);\
cls * cls::Cast( ON_Object* p) {return(cls *)Cast((const ON_Object*)p);} \
const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_id))?(const cls *)p:0;} \
const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_id;} \
ON_Object* cls::DuplicateObject() const {cls* p = new cls(); if (p) *p=*this; return p;} \
bool cls::Copy##cls( const ON_Object* src, ON_Object* dst ){cls* d;const cls* s;if (0!=(s=cls::Cast(src))&&0!=(d=cls::Cast(dst))) {d->cls::operator=(*s);return true;}return false;} \
cls * cls::Duplicate() const {return static_cast<cls *>(DuplicateObject());}
ON_BOOL32 IsKindOf(const ON_ClassId *pClassId) const
Definition opennurbs_object.cpp:1606
char s
Definition opennurbs_string.cpp:32

◆ ON_VIRTUAL_OBJECT_IMPLEMENT

#define ON_VIRTUAL_OBJECT_IMPLEMENT ( cls,
basecls,
uuid )
Value:
void* cls::m_s_##cls##_ptr = 0;\
const ON_ClassId cls::m_##cls##_class_id(#cls,#basecls,0,0,uuid);\
cls * cls::Cast( ON_Object* p) {return(cls *)Cast((const ON_Object*)p);} \
const cls * cls::Cast( const ON_Object* p) {return(p&&p->IsKindOf(&cls::m_##cls##_class_id))?(const cls *)p:0;} \
const ON_ClassId* cls::ClassId() const {return &cls::m_##cls##_class_id;} \
ON_Object* cls::DuplicateObject() const {return 0;} \
bool cls::Copy##cls( const ON_Object*, ON_Object* ) {return false;} \
cls * cls::Duplicate() const {return static_cast<cls *>(DuplicateObject());}

Typedef Documentation

◆ ON_Vtable_func

typedef int(* ON_Vtable_func) (void)

Function Documentation

◆ ON_ClassVtable()

ON_DECL struct ON_Vtable * ON_ClassVtable ( void * p)

◆ ON_GetMostRecentClassIdCreateUuid()

ON_DECL ON_UUID ON_GetMostRecentClassIdCreateUuid ( )