#include <Inventor/VRMLnodes/SoVRMLInterpolator.h>
#include <Inventor/VRMLnodes/SoVRMLInterpOutputData.h>
#include <Inventor/errors/SoDebugError.h>
#include <Inventor/fields/SoFieldData.h>
Go to the source code of this file.
#define SO__INTERPOLATOR_ABSTRACT_METHODS | ( | className | ) |
#define SO__INTERPOLATOR_ABSTRACT_VARS | ( | className | ) |
SoType className::classTypeId; \ SbBool className::isBuiltIn = FALSE; \ const SoFieldData **className::parentInputData = NULL; \ const SoVRMLInterpOutputData **className::parentOutputData = NULL; \ SoFieldData * className::inputData = NULL; \ SoVRMLInterpOutputData * className::outputData = NULL; \ SbBool className::firstInstance=TRUE
#define SO__INTERPOLATOR_CHECK_CONSTRUCT | ( | where | ) | { } |
#define SO__INTERPOLATOR_CHECK_INIT | ( | className | ) | { } |
#define SO__INTERPOLATOR_INIT_ABSTRACT_CLASS | ( | className, | |||
classPrintName, | |||||
parent | ) | SO__INTERPOLATOR_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parent); |
#define SO__INTERPOLATOR_INIT_ABSTRACT_CLASS_INTERNAL | ( | className, | |||
classPrintName, | |||||
parentClass | ) |
SO_INTERPOLATOR_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType(parentClass::getClassTypeId(), \ classPrintName); \ parentInputData = parentClass::getInputDataPtr(); \ parentOutputData = parentClass::getOutputDataPtr()
#define SO__INTERPOLATOR_INIT_CLASS | ( | className, | |||
classPrintName, | |||||
parentClass | ) | SO__INTERPOLATOR_INIT_CLASS_INTERNAL(className, classPrintName, parentClass) |
#define SO__INTERPOLATOR_INIT_CLASS_INTERNAL | ( | className, | |||
classPrintName, | |||||
parentClass | ) |
SO_INTERPOLATOR_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType(parentClass::getClassTypeId(), \ classPrintName, \ &className::createInstance, \ (short)SoNode::getNextActionMethodIndex()); \ parentInputData = parentClass::getInputDataPtr(); \ parentOutputData = parentClass::getOutputDataPtr()
#define SO__INTERPOLATOR_METHODS | ( | className | ) |
\ SO__INTERPOLATOR_ABSTRACT_METHODS(className) \ \ void * \ className::createInstance(SoType*) \ { \ return (void *)(new className); \ }
#define SO_INTERPOLATOR_ABSTRACT_HEADER | ( | className | ) |
public: \ static SoType getClassTypeId() ; \ virtual SoType getTypeId() const; /* Returns type id */ \ public: \ virtual const SoFieldData * getFieldData() const; \ virtual const SoVRMLInterpOutputData * getOutputData() const; \ private: \ virtual SbBool getIsBuiltIn() const ; \ private: \ static const SoFieldData ** getInputDataPtr() ; \ static const SoVRMLInterpOutputData ** 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 SoVRMLInterpOutputData *outputData; /* Info on outputs */ \ static const SoFieldData **parentInputData; /* parent's fields */ \ static const SoVRMLInterpOutputData **parentOutputData
#define SO_INTERPOLATOR_ABSTRACT_SOURCE | ( | className | ) |
#define SO_INTERPOLATOR_ADD_EVENTIN | ( | inputName | ) |
{ \ SO__INTERPOLATOR_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ inputData->addField(this, SO__QUOTE(inputName), &this->inputName); \ this->inputName.setContainer(this); \ this->inputName.setFieldType(SoField::EVENTIN_FIELD); \ }
#define SO_INTERPOLATOR_ADD_EXPOSEDINPUT | ( | inputName, | |||
defValue | ) |
{ \ SO__INTERPOLATOR_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ inputData->addField(this, SO__QUOTE(inputName), &this->inputName); \ this->inputName.setValue defValue; \ this->inputName.setContainer(this); \ this->inputName.setFieldType(SoField::EXPOSED_FIELD); \ }
#define SO_INTERPOLATOR_ADD_HIDDEN_FIELD | ( | inputName, | |||
defValue | ) |
{ \ SO__INTERPOLATOR_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ inputData->addField(this, SO__QUOTE(inputName), &this->inputName); \ this->inputName.setValue defValue; \ this->inputName.setContainer(this); \ this->inputName.setFieldType(SoField::INTERNAL_FIELD); \ }
#define SO_INTERPOLATOR_ADD_INPUT | ( | inputName, | |||
defValue | ) |
{ \ SO__INTERPOLATOR_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ inputData->addField(this, SO__QUOTE(inputName), \ &this->inputName); \ this->inputName.setValue defValue; \ this->inputName.setContainer(this); \ }
#define SO_INTERPOLATOR_ADD_OUTPUT | ( | outputName, | |||
type | ) |
{ \ SO__INTERPOLATOR_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) { \ outputData->addOutput(this, SO__QUOTE(outputName), \ &this->outputName, \ type::getClassTypeId()); \ } \ this->outputName.setContainer(this); \ }
#define SO_INTERPOLATOR_CONSTRUCTOR | ( | className | ) |
{ \ SO__INTERPOLATOR_CHECK_INIT(className); \ if (inputData == NULL) { \ inputData = new SoFieldData(parentInputData ? \ *parentInputData : NULL); \ outputData = new SoVRMLInterpOutputData(parentOutputData ? \ *parentOutputData : NULL); \ } \ else { \ firstInstance = FALSE; \ } \ isBuiltIn = FALSE; \ }
#define SO_INTERPOLATOR_DEFINE_ENUM_VALUE | ( | enumType, | |||
enumValue | ) |
{ \ SO__INTERPOLATOR_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ inputData->addEnumValue(SO__QUOTE(enumType), \ SO__QUOTE(enumValue), enumValue); \ }
#define SO_INTERPOLATOR_EXIT_CLASS | ( | className | ) |
SoType::removeType(classTypeId.getName()); \ classTypeId = SoType::badType(); \ if (inputData) { \ delete inputData; \ inputData = NULL; \ } \ if (outputData) { \ delete outputData; \ outputData = NULL; \ } \ parentInputData = NULL; \ parentOutputData = NULL; \ firstInstance = TRUE
#define SO_INTERPOLATOR_HEADER | ( | className | ) |
\ SO_INTERPOLATOR_ABSTRACT_HEADER(className); \ \ private: \ static void *createInstance(SoType* dynamicType = NULL)
#define SO_INTERPOLATOR_INIT_ABSTRACT_CLASS | ( | className, | |||
parentClass, | |||||
parentPrintClass | ) | SO_INTERPOLATOR_INIT_ABSTRACT_CLASS_INTERNAL(className,parentClass,parentPrintClass); |
#define SO_INTERPOLATOR_INIT_ABSTRACT_CLASS_INTERNAL | ( | className, | |||
parentClass, | |||||
parentPrintClass | ) |
SO_INTERPOLATOR_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType(SoType::fromName(parentPrintClass), SO__QUOTE(className)); \ parentInputData = parentClass::getInputDataPtr(); \ parentOutputData = parentClass::getOutputDataPtr()
#define SO_INTERPOLATOR_INIT_CLASS | ( | className, | |||
parentClass, | |||||
parentPrintClass | ) | SO_INTERPOLATOR_INIT_CLASS_INTERNAL(className,parentClass,parentPrintClass); |
#define SO_INTERPOLATOR_INIT_CLASS_CHECK_PARENT | ( | className, | |||
parentClass | ) |
if (parentClass::getClassTypeId().isBad()) \ parentClass::initClass()
#define SO_INTERPOLATOR_INIT_CLASS_INTERNAL | ( | className, | |||
parentClass, | |||||
parentPrintClass | ) |
SO_INTERPOLATOR_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_INTERPOLATOR_IS_FIRST_INSTANCE | ( | ) | (firstInstance == TRUE) |
#define SO_INTERPOLATOR_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_INTERPOLATOR_SOURCE | ( | className | ) |