1 #ifndef COIN_SOSUBELEMENT_H 2 #define COIN_SOSUBELEMENT_H 48 #include <Inventor/SbBasic.h> 49 #include <Inventor/SbName.h> 53 #include <Inventor/elements/SoElement.h> 57 #define SO_ELEMENT_ABSTRACT_HEADER(_class_) \ 59 static SoType getClassTypeId(void); \ 60 static int getClassStackIndex(void); \ 68 static int classStackIndex; \ 69 static SoType classTypeId; \ 70 static void cleanupClass(void) { SoType::removeType(_class_::classTypeId.getName()); _class_::classTypeId STATIC_SOTYPE_INIT; } 74 #define SO_ELEMENT_HEADER(_class_) \ 75 SO_ELEMENT_ABSTRACT_HEADER(_class_); \ 77 static void * createInstance(void) 81 #define PRIVATE_SOELEMENT_VARIABLES(_class_) \ 82 int _class_::classStackIndex; \ 83 SoType _class_::classTypeId STATIC_SOTYPE_INIT; \ 84 SoType _class_::getClassTypeId(void) { return _class_::classTypeId; } \ 85 int _class_::getClassStackIndex(void) { return _class_::classStackIndex; } 88 #define SO_ELEMENT_ABSTRACT_SOURCE(_class_) \ 89 PRIVATE_SOELEMENT_VARIABLES(_class_) \ 90 _class_::_class_(void) { } 92 #define SO_ELEMENT_SOURCE(_class_) \ 93 PRIVATE_SOELEMENT_VARIABLES(_class_) \ 94 _class_::_class_(void) { this->setTypeId(_class_::classTypeId); \ 95 this->setStackIndex(_class_::classStackIndex); } \ 97 void * _class_::createInstance(void) { return static_cast<void *>(new _class_); } 102 #define SO_ELEMENT_CUSTOM_CONSTRUCTOR_SOURCE(_class_) \ 103 PRIVATE_SOELEMENT_VARIABLES(_class_) \ 105 void * _class_::createInstance(void) { return static_cast<void *>(new _class_); } 109 #define PRIVATE_SOELEMENT_INIT(_class_, _parent_, _instantiate_) \ 111 assert(_class_::classTypeId == SoType::badType()); \ 112 assert(_parent_::getClassTypeId() != SoType::badType()); \ 113 _class_::classTypeId = SoType::createType(_parent_::getClassTypeId(), \ 114 SO__QUOTE(_class_), \ 116 if (_parent_::getClassStackIndex() < 0) _class_::classStackIndex = _class_::createStackIndex(_class_::classTypeId); \ 117 else _class_::classStackIndex = _parent_::getClassStackIndex(); \ 118 cc_coin_atexit_static_internal(reinterpret_cast<coin_atexit_f*>(_class_::cleanupClass)); \ 122 #define SO_ELEMENT_INIT_ABSTRACT_CLASS(_class_, _parent_) \ 123 PRIVATE_SOELEMENT_INIT(_class_, _parent_, NULL) 125 #define SO_ELEMENT_INIT_CLASS(_class_, _parent_) \ 126 PRIVATE_SOELEMENT_INIT(_class_, _parent_, &_class_::createInstance) 130 #endif // !COIN_SOSUBELEMENT_H
Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated for Coin by Doxygen