#include <Inventor/engines/SoEngine.h>
#include <Inventor/engines/SoOutputData.h>
#include <Inventor/errors/SoDebugError.h>
#include <Inventor/fields/SoFieldData.h>
Go to the source code of this file.
Defines | |
#define | SO__ENGINE_CHECK_INIT(className) |
#define | SO__ENGINE_CHECK_CONSTRUCT(where) |
#define | SO_ENGINE_ABSTRACT_HEADER(className) |
#define | SO_ENGINE_HEADER(className) |
#define | SO__ENGINE_ABSTRACT_VARS(className) |
#define | SO__ENGINE_VARS(className) SO__ENGINE_ABSTRACT_VARS(className) |
#define | SO__ENGINE_ABSTRACT_METHODS(className) |
#define | SO__ENGINE_METHODS(className) |
#define | SO_ENGINE_SOURCE(className) |
#define | SO_ENGINE_ABSTRACT_SOURCE(className) |
#define | SO_ENGINE_INIT_CLASS_CHECK_PARENT(className, parentClass) |
#define | SO__ENGINE_INIT_CLASS_INTERNAL(className, classPrintName, parentClass) |
#define | SO__ENGINE_INIT_CLASS(className, classPrintName, parentClass) SO__ENGINE_INIT_CLASS_INTERNAL(className, classPrintName, parentClass); |
#define | SO__ENGINE_INIT_ABSTRACT_CLASS_INTERNAL(className, classPrintName, parentClass) |
#define | SO__ENGINE_INIT_ABSTRACT_CLASS(className, classPrintName, parent) SO__ENGINE_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parent); |
#define | SO_ENGINE_INIT_CLASS_INTERNAL(className, parentClass, parentPrintClass) |
#define | SO_ENGINE_INIT_CLASS(className, parentClass, parentPrintClass) SO_ENGINE_INIT_CLASS_INTERNAL(className,parentClass,parentPrintClass); |
#define | SO_ENGINE_INIT_ABSTRACT_CLASS_INTERNAL(className, parentClass, parentPrintClass) |
#define | SO_ENGINE_INIT_ABSTRACT_CLASS(className, parent, parentPrintClass) SO_ENGINE_INIT_ABSTRACT_CLASS_INTERNAL(className,parent,parentPrintClass); |
#define | SO_ENGINE_EXIT_CLASS(className) |
#define | SO_ENGINE_CONSTRUCTOR(className) |
#define | SO_ENGINE_IS_FIRST_INSTANCE() (firstInstance == TRUE) |
#define | SO_ENGINE_ADD_INPUT(inputName, defValue) |
#define | SO_ENGINE_ADD_OUTPUT(outputName, type) |
#define | SO_ENGINE_DEFINE_ENUM_VALUE(enumType, enumValue) |
#define | SO_ENGINE_OUTPUT(outputName, type, code) |
#define SO__ENGINE_ABSTRACT_METHODS | ( | className | ) |
#define SO__ENGINE_ABSTRACT_VARS | ( | className | ) |
SoType className::classTypeId; \ SbBool className::isBuiltIn = FALSE; \ SbBool className::firstInstance = TRUE; \ SoEngineOutputData *className::outputData = NULL; \ SoFieldData * className::inputData = NULL; \ const SoEngineOutputData **className::parentOutputData = NULL; \ const SoFieldData ** className::parentInputData = NULL
#define SO__ENGINE_CHECK_CONSTRUCT | ( | where | ) |
if (inputData == NULL) { \ inputData = new SoFieldData(parentInputData ? *parentInputData : NULL); \ outputData = new SoEngineOutputData(parentOutputData ? *parentOutputData : NULL); \ }
#define SO__ENGINE_CHECK_INIT | ( | className | ) |
if (classTypeId.isBad()) { \ className::initClass(); \ }
#define SO__ENGINE_INIT_ABSTRACT_CLASS | ( | className, | |||
classPrintName, | |||||
parent | ) | SO__ENGINE_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parent); |
#define SO__ENGINE_INIT_ABSTRACT_CLASS_INTERNAL | ( | className, | |||
classPrintName, | |||||
parentClass | ) |
{ \ SO_ENGINE_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType(parentClass::getClassTypeId(), \ classPrintName); \ parentInputData = parentClass::getInputDataPtr(); \ parentOutputData = parentClass::getOutputDataPtr(); \ }
#define SO__ENGINE_INIT_CLASS | ( | className, | |||
classPrintName, | |||||
parentClass | ) | SO__ENGINE_INIT_CLASS_INTERNAL(className, classPrintName, parentClass); |
#define SO__ENGINE_INIT_CLASS_INTERNAL | ( | className, | |||
classPrintName, | |||||
parentClass | ) |
{ \ SO_ENGINE_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType( parentClass::getClassTypeId(), \ classPrintName, \ &className::createInstance); \ parentInputData = parentClass::getInputDataPtr(); \ parentOutputData = parentClass::getOutputDataPtr(); \ }
#define SO__ENGINE_METHODS | ( | className | ) |
\ SO__ENGINE_ABSTRACT_METHODS(className) \ \ void * \ className::createInstance(SoType* ) \ { \ return (void *)(new className); \ }
#define SO_ENGINE_ABSTRACT_HEADER | ( | className | ) |
public: \ \ static SoType getClassTypeId(); \ \ virtual SoType getTypeId() const; \ private: \ virtual SbBool getIsBuiltIn() const; \ \ virtual const SoFieldData * getFieldData() const; \ \ virtual const SoEngineOutputData * getOutputData() const; \ private: \ static const SoFieldData ** getInputDataPtr(); \ static const SoEngineOutputData ** getOutputDataPtr(); \ private: \ static SoType classTypeId; /* Type id */ \ static SbBool isBuiltIn; \ static SbBool firstInstance; /* True for first ctor call */ \ static SoFieldData *inputData; /* Info on input fields */ \ static SoEngineOutputData *outputData; /* Info on outputs */ \ static const SoFieldData **parentInputData; /* parent's fields */ \ static const SoEngineOutputData **parentOutputData
#define SO_ENGINE_ABSTRACT_SOURCE | ( | className | ) |
#define SO_ENGINE_ADD_INPUT | ( | inputName, | |||
defValue | ) |
{ \ SO__ENGINE_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ inputData->addField(this, SO__QUOTE(inputName), \ &this->inputName); \ this->inputName.setValue defValue; \ this->inputName.setContainer(this); \ }
#define SO_ENGINE_ADD_OUTPUT | ( | outputName, | |||
type | ) |
{ \ SO__ENGINE_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ outputData->addOutput(this, SO__QUOTE(outputName), \ &this->outputName, \ type::getClassTypeId()); \ this->outputName.setContainer(this); \ }
#define SO_ENGINE_CONSTRUCTOR | ( | className | ) |
SoBaseInitializer sbi(this); \ SO__ENGINE_CHECK_INIT(className); \ if (inputData == NULL) { \ inputData = new SoFieldData(parentInputData ? *parentInputData : NULL); \ outputData = new SoEngineOutputData(parentOutputData ? *parentOutputData : NULL); \ } \ else { \ firstInstance = FALSE; \ }
#define SO_ENGINE_DEFINE_ENUM_VALUE | ( | enumType, | |||
enumValue | ) |
{ \ SO__ENGINE_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ inputData->addEnumValue(SO__QUOTE(enumType), \ SO__QUOTE(enumValue), enumValue); \ }
#define SO_ENGINE_EXIT_CLASS | ( | className | ) |
SoType::removeType(classTypeId.getName()); \ classTypeId = SoType::badType(); \ if (inputData) \ { \ delete inputData; \ inputData = NULL;\ } \ if (outputData) \ { \ delete outputData;\ outputData = NULL; \ }\ firstInstance = TRUE
#define SO_ENGINE_HEADER | ( | className | ) |
\ SO_ENGINE_ABSTRACT_HEADER(className); \ \ private: \ /* Creates and returns instance */ \ static void *createInstance(SoType* dynamicType = NULL)
Returns the type identifier for this class.
Returns the type identifier for this specific instance. Returns SoFieldData Returns the SoEngineOutputData
#define SO_ENGINE_INIT_ABSTRACT_CLASS | ( | className, | |||
parent, | |||||
parentPrintClass | ) | SO_ENGINE_INIT_ABSTRACT_CLASS_INTERNAL(className,parent,parentPrintClass); |
#define SO_ENGINE_INIT_ABSTRACT_CLASS_INTERNAL | ( | className, | |||
parentClass, | |||||
parentPrintClass | ) |
{ \ SO_ENGINE_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType(SoType::fromName(parentPrintClass), \ SO__QUOTE(className)); \ parentInputData = parentClass::getInputDataPtr(); \ parentOutputData = parentClass::getOutputDataPtr(); \ }
#define SO_ENGINE_INIT_CLASS | ( | className, | |||
parentClass, | |||||
parentPrintClass | ) | SO_ENGINE_INIT_CLASS_INTERNAL(className,parentClass,parentPrintClass); |
#define SO_ENGINE_INIT_CLASS_CHECK_PARENT | ( | className, | |||
parentClass | ) |
if (parentClass::getClassTypeId().isBad()) \
parentClass::initClass()
#define SO_ENGINE_INIT_CLASS_INTERNAL | ( | className, | |||
parentClass, | |||||
parentPrintClass | ) |
{ \ SO_ENGINE_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType(SoType::fromName(parentPrintClass), \ SO__QUOTE(className), \ &className::createInstance); \ parentInputData = parentClass::getInputDataPtr(); \ parentOutputData = parentClass::getOutputDataPtr(); \ }
#define SO_ENGINE_IS_FIRST_INSTANCE | ( | ) | (firstInstance == TRUE) |
#define SO_ENGINE_OUTPUT | ( | outputName, | |||
type, | |||||
code | ) |
{ \ if (outputName.isEnabled()) { \ for (int _eng_out_i = 0; \ _eng_out_i < outputName.getNumConnections(); \ _eng_out_i++) { \ type *_eng_out_temp = (type *) outputName[_eng_out_i]; \ if (!_eng_out_temp->isReadOnly()) { \ _eng_out_temp->code; \ } \ } \ } \ }
#define SO_ENGINE_SOURCE | ( | className | ) |