Inventor/engines/SoSubEngine.h File Reference

#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 Documentation

#define SO__ENGINE_ABSTRACT_METHODS ( className   ) 
#define SO__ENGINE_ABSTRACT_VARS ( className   ) 
Value:
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   ) 
Value:
if (inputData == NULL) {                 \
    inputData = new SoFieldData(parentInputData ? *parentInputData : NULL);             \
    outputData = new SoEngineOutputData(parentOutputData ? *parentOutputData : NULL);   \
  }
#define SO__ENGINE_CHECK_INIT ( className   ) 
Value:
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   ) 
Value:
{  \
  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   ) 
Value:
{         \
  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   ) 
Value:
\
    SO__ENGINE_ABSTRACT_METHODS(className)                                    \
                                                                              \
    void *                                                                    \
    className::createInstance(SoType* )                                       \
    {                                                                         \
        return (void *)(new className);                                       \
    }
#define SO__ENGINE_VARS ( className   )     SO__ENGINE_ABSTRACT_VARS(className)
#define SO_ENGINE_ABSTRACT_HEADER ( className   ) 
Value:
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   ) 
Value:
{                            \
  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   ) 
Value:
{                                      \
  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   ) 
Value:
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   ) 
Value:
{                     \
  SO__ENGINE_CHECK_CONSTRUCT(__FILE__);                               \
  if (firstInstance)                                                  \
    inputData->addEnumValue(SO__QUOTE(enumType),                      \
                            SO__QUOTE(enumValue), enumValue);         \
}
#define SO_ENGINE_EXIT_CLASS ( className   ) 
Value:
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   ) 
Value:
\
    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   ) 
Value:
{ \
  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   ) 
Value:
if (parentClass::getClassTypeId().isBad())                                          \
    parentClass::initClass()
#define SO_ENGINE_INIT_CLASS_INTERNAL ( className,
parentClass,
parentPrintClass   ) 
Value:
{        \
  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   ) 
Value:
{                                      \
  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   ) 

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/