1 #ifndef COIN_SOSUBACTION_H 2 #define COIN_SOSUBACTION_H 38 #include <Inventor/SbString.h> 39 #include <Inventor/actions/SoAction.h> 40 #endif // COIN_INTERNAL 45 #define SO_ACTION_ADD_METHOD(_nodeclass_, _method_) \ 47 addMethod(_nodeclass_::getClassTypeId(), (SoActionMethod)_method_); \ 52 #define SO_ACTION_CONSTRUCTOR(_classname_) \ 54 _classname_::traversalMethods = this->methods; \ 59 #define SO_ACTION_HEADER(_classname_) \ 61 virtual SoType getTypeId(void) const; \ 62 static SoType getClassTypeId(void); \ 64 static void addMethod(const SoType type, SoActionMethod method); \ 66 static void enableElement(const SoType type, const int stackindex); \ 69 virtual const SoEnabledElementsList & getEnabledElements(void) const; \ 73 static SoEnabledElementsList * getClassEnabledElements(void); \ 74 static SoActionMethodList * getClassActionMethods(void); \ 81 static void atexit_cleanup(void); \ 82 static SoEnabledElementsList * enabledElements; \ 83 static SoActionMethodList * methods; \ 84 static SoType classTypeId 88 #define SO_ACTION_SOURCE(_classname_) \ 89 SoEnabledElementsList * _classname_::enabledElements = NULL; \ 90 SoActionMethodList * _classname_::methods = NULL; \ 91 SoEnabledElementsList * _classname_::getClassEnabledElements(void) { return _classname_::enabledElements; } \ 92 SoActionMethodList * _classname_::getClassActionMethods(void) { return _classname_::methods; } \ 93 SoType _classname_::classTypeId STATIC_SOTYPE_INIT; \ 94 SoType _classname_::getClassTypeId(void) { return _classname_::classTypeId; } \ 95 SoType _classname_::getTypeId(void) const { return _classname_::classTypeId; } \ 96 const SoEnabledElementsList & _classname_::getEnabledElements(void) const \ 98 assert(_classname_::enabledElements); \ 99 return *_classname_::enabledElements; \ 102 _classname_::addMethod(const SoType type, SoActionMethod method) \ 104 assert(_classname_::methods); \ 105 _classname_::methods->addMethod(type, method); \ 108 _classname_::enableElement(const SoType type, const int stackindex) \ 110 assert(_classname_::enabledElements); \ 111 _classname_::enabledElements->enable(type, stackindex); \ 114 _classname_::atexit_cleanup(void) \ 116 delete _classname_::enabledElements; \ 117 _classname_::enabledElements = NULL; \ 118 delete _classname_::methods; \ 119 _classname_::methods = NULL; \ 120 _classname_::classTypeId STATIC_SOTYPE_INIT; \ 125 #define SO_ACTION_INIT_CLASS(_classname_, _parentclassname_) \ 127 assert(_classname_::getClassTypeId() == SoType::badType()); \ 128 assert(_parentclassname_::getClassTypeId() != SoType::badType()); \ 129 _classname_::classTypeId = SoType::createType(_parentclassname_::getClassTypeId(), SO__QUOTE(_classname_)); \ 130 _classname_::enabledElements = new SoEnabledElementsList(_parentclassname_::getClassEnabledElements()); \ 131 _classname_::methods = new SoActionMethodList(_parentclassname_::getClassActionMethods()); \ 132 cc_coin_atexit_static_internal(reinterpret_cast<coin_atexit_f *>(_classname_::atexit_cleanup)); \ 137 #endif // !COIN_SOSUBACTION_H
Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated for Coin by Doxygen