Inventor/nodes/SoSubNode.h File Reference

#include <Inventor/errors/SoDebugError.h>
#include <Inventor/fields/SoFieldData.h>
#include <Inventor/threads/SbThreadLocalStorage.h>
#include <Inventor/threads/SbThreadMutex.h>
#include <Inventor/SbRenderEngineMode.h>
#include <Inventor/SoDB.h>

Go to the source code of this file.

Defines

#define SO__NODE_CHECK_INIT(className)
#define SO__NODE_CHECK_CONSTRUCT(where)
#define SO_NODE_ABSTRACT_HEADER(className)
#define SO_NODE_HEADER(className)
#define SO__NODE_ABSTRACT_VARS(className)
#define SO__NODE_VARS(className)   SO__NODE_ABSTRACT_VARS(className)
#define SO__NODE_ABSTRACT_METHODS(className)
#define SO__NODE_METHODS(className)
#define SO_NODE_SOURCE(className)
#define SO_NODE_ABSTRACT_SOURCE(className)
#define SO_NODE_INIT_CLASS_CHECK_PARENT(className, parentClass)
#define SO_NODE_INIT_RENDERING_MODE(className, parentClass)
#define SO__NODE_INIT_CLASS_INTERNAL(className, classPrintName, parentClass)
#define SO__NODE_INIT_CLASS(className, classPrintName, parentClass)   SO__NODE_INIT_CLASS_INTERNAL(className,classPrintName,parentClass)
#define SO__NODE_INIT_ABSTRACT_CLASS_INTERNAL(className, classPrintName, parentClass)
#define SO__NODE_INIT_ABSTRACT_CLASS(className, classPrintName, parentClass)   SO__NODE_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parentClass)
#define SO__NODE_EXIT_CLASS(className)
#define SO_THREAD_NODE_INIT_CLASS(className, structName)
#define SO_THREAD_NODE_EXIT_CLASS(className)
#define LOCAL_THREAD_VAR(_className_, _structName_, _varName_)
#define LOCAL_THREAD_STORAGE(_className_)
#define SO_NODE_INIT_CLASS_INTERNAL(className, parentClass, parentPrintClass)
#define SO_NODE_INIT_CLASS(className, parentClass, parentPrintClass)
#define SO_NODE_INIT_ABSTRACT_CLASS_INTERNAL(className, parentClass, parentPrintClass)
#define SO_NODE_INIT_ABSTRACT_CLASS(className, parentClass, parentPrintClass)
#define SO_NODE_CONSTRUCTOR(className)
#define SO_NODE_IS_FIRST_INSTANCE()
#define CHECK_FIELD_INIT(fieldName)
#define CHECK_MFIELD_INIT(fieldName)
#define SO_NODE_ADD_FIELD(fieldName, defValue)
#define SO_NODE_ADD_NAMED_FIELD(fieldName, memberName, defValue)
#define SO_NODE_ADD_MFIELD(fieldName)
#define SO_NODE_ADD_PRIVATEFIELD(fieldName, defValue)
#define SO_NODE_ADD_PRIVATEMFIELD(fieldName)
#define SO_NODE_ADD_EXPOSEDFIELD(fieldName, defValue)
#define SO_NODE_ADD_EVENTIN(fieldName)
#define SO_NODE_ADD_EVENTOUT(fieldName, defValue)
#define SO_NODE_ADD_HIDDEN_FIELD(fieldName, defValue)
#define SO_NODE_ADD_FIELD_EVENTIN(fieldName, defValue)
#define SO_NODE_DEFINE_ENUM_VALUE(enumType, enumValue)
#define SO__NODE_DEFINE_ENUM_VALUE(enumType, enumValueName, enumValue)

Functions

virtual const SbRenderEngineModegetRenderEngineMode () const
static SbRenderEngineModegetClassRenderEngineMode ()

Variables

static SbThreadMutex classMutex
static SoType classTypeId
static SbBool isBuiltIn
static SbBool firstInstance
static SoFieldData * fieldData
static const SoFieldData ** parentFieldData

Define Documentation

#define CHECK_FIELD_INIT ( fieldName   ) 

This adds the info for a field to the SoFieldData and sets the default value for it.

The parameters are as follows: fieldName: the name of the field (as a member) defValue: the default value enclosed in parentheses

For example,

SO_NODE_ADD_FIELD(ambientColor, (0.2, 0.2, 0.2)); SO_NODE_ADD_FIELD(shininess, (0.0));

adds info about fields named ambientColor and shininess with the given default values.

#define CHECK_MFIELD_INIT ( fieldName   ) 
#define LOCAL_THREAD_STORAGE ( _className_   ) 
Value:
\
  GET_THREAD_LOCAL_STORAGE(_className_)
#define LOCAL_THREAD_VAR ( _className_,
_structName_,
_varName_   ) 
Value:
\
  GET_THREAD_LOCAL_VAR(_className_, _structName_, _varName_)
#define SO__NODE_ABSTRACT_METHODS ( className   ) 
Value:
\
    SoType       \
    className::getTypeId() const         \
    { \
        return classTypeId; \
    } \
 \
    const SoFieldData * \
    className::getFieldData() const      \
    { \
    classMutex.lock(); \
        SO__NODE_CHECK_CONSTRUCT(SO__QUOTE(className)); \
        SoFieldData * result = fieldData; \
        classMutex.unlock(); \
        return result; \
    } \
 \
    SbBool className::getIsBuiltIn() const \
    { \
      return isBuiltIn; \
    } \
 \
    const SoFieldData **className::getFieldDataPtr() \
    { \
      classMutex.lock(); \
      const SoFieldData **result = (const SoFieldData **)&fieldData; \
      classMutex.unlock(); \
      return result; \
    }
#define SO__NODE_ABSTRACT_VARS ( className   ) 
#define SO__NODE_CHECK_CONSTRUCT ( where   ) 
Value:
{ \
  if (fieldData == NULL) { \
    fieldData = new SoFieldData(parentFieldData ? *parentFieldData : NULL); \
  } \
}
#define SO__NODE_CHECK_INIT ( className   ) 
Value:
{ \
  if (classTypeId.isBad()) { \
    className::initClass(); \
  } \
}
#define SO__NODE_DEFINE_ENUM_VALUE ( enumType,
enumValueName,
enumValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
  fieldData->addEnumValue(SO__QUOTE(enumType), \
                          enumValueName, \
                          enumValue); \
  classMutex.unlock(); \
}
#define SO__NODE_EXIT_CLASS ( className   ) 
Value:
SoType::removeType(classTypeId.getName()); \
  classTypeId = SoType::badType(); \
  if (fieldData != NULL) \
  { \
    delete fieldData; \
    fieldData = NULL; \
  } \
  parentFieldData = NULL; \
  firstInstance = TRUE
#define SO__NODE_INIT_ABSTRACT_CLASS ( className,
classPrintName,
parentClass   )     SO__NODE_INIT_ABSTRACT_CLASS_INTERNAL(className,classPrintName,parentClass)
#define SO__NODE_INIT_ABSTRACT_CLASS_INTERNAL ( className,
classPrintName,
parentClass   ) 
Value:
classMutex.lock(); \
  SO_NODE_INIT_CLASS_CHECK_PARENT(className, parentClass); \
  classTypeId = SoType::createType( parentClass::getClassTypeId(), \
                                    classPrintName, \
                                    NULL, \
                                    (short)SoNode::getNextActionMethodIndex()); \
  if (parentFieldData == NULL) \
    SoNode::incNextActionMethodIndex(); \
  parentFieldData = parentClass::getFieldDataPtr(); \
  classMutex.unlock();
#define SO__NODE_INIT_CLASS ( className,
classPrintName,
parentClass   )     SO__NODE_INIT_CLASS_INTERNAL(className,classPrintName,parentClass)
#define SO__NODE_INIT_CLASS_INTERNAL ( className,
classPrintName,
parentClass   ) 
Value:
classMutex.lock(); \
  SO_NODE_INIT_RENDERING_MODE(className, parentClass); \
  SO_NODE_INIT_CLASS_CHECK_PARENT(className, parentClass); \
  classTypeId = SoType::createType( parentClass::getClassTypeId(), \
                                    classPrintName, \
                                    &className::createInstance, \
                                    (short)SoNode::getNextActionMethodIndex()); \
  if (parentFieldData == NULL) \
    SoNode::incNextActionMethodIndex(); \
  parentFieldData = parentClass::getFieldDataPtr(); \
  classMutex.unlock();
#define SO__NODE_METHODS ( className   ) 
Value:
\
    SO__NODE_ABSTRACT_METHODS(className) \
 \
    void * \
    className::createInstance(SoType *) \
    { \
        return (void *)(new className); \
    }
#define SO__NODE_VARS ( className   )     SO__NODE_ABSTRACT_VARS(className)
#define SO_NODE_ABSTRACT_HEADER ( className   ) 
Value:
public: \
     \
    static  SoType getClassTypeId()        \
    { return classTypeId; } \
     \
    virtual SoType getTypeId() const;     \
     \
#define SO_NODE_ABSTRACT_SOURCE ( className   ) 
#define SO_NODE_ADD_EVENTIN ( fieldName   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::EVENTIN_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_EVENTOUT ( fieldName,
defValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setValue defValue; \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::EVENTOUT_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_EXPOSEDFIELD ( fieldName,
defValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setValue defValue; \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::EXPOSED_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_FIELD ( fieldName,
defValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setValue defValue; \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::EXPOSED_FIELD); \
  CHECK_FIELD_INIT(fieldName); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_FIELD_EVENTIN ( fieldName,
defValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setValue defValue; \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::FIELD_EVENTIN_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_HIDDEN_FIELD ( fieldName,
defValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setValue defValue; \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::INTERNAL_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_MFIELD ( fieldName   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::EXPOSED_FIELD); \
  CHECK_MFIELD_INIT(fieldName); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_NAMED_FIELD ( fieldName,
memberName,
defValue   ) 
Value:
{        \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->memberName); \
  this->memberName.setValue defValue; \
  this->memberName.setContainer(this); \
  this->memberName.setFieldType(SoField::EXPOSED_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_PRIVATEFIELD ( fieldName,
defValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), &this->fieldName); \
  this->fieldName.setValue defValue; \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::HIDDEN_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_ADD_PRIVATEMFIELD ( fieldName   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addField(this, SO__QUOTE(fieldName), \
                        &this->fieldName); \
  this->fieldName.setContainer(this); \
  this->fieldName.setFieldType(SoField::HIDDEN_FIELD); \
  classMutex.unlock(); \
}
#define SO_NODE_CONSTRUCTOR ( className   ) 
Value:
SoBaseInitializer sbi(this); \
  classMutex.lock(); \
  SO__NODE_CHECK_INIT(className); \
  if (fieldData == NULL) \
    fieldData = new SoFieldData(parentFieldData ? \
                      (SoFieldData *)*parentFieldData : \
                      (SoFieldData *)NULL); \
  else \
    firstInstance = FALSE; \
  classMutex.unlock();

This is included at the beginning of a constructor, to do required initializations.

#define SO_NODE_DEFINE_ENUM_VALUE ( enumType,
enumValue   ) 
Value:
{ \
  classMutex.lock(); \
  SO__NODE_CHECK_CONSTRUCT(__FILE__); \
  if (firstInstance) \
    fieldData->addEnumValue(SO__QUOTE(enumType), \
                            SO__QUOTE(enumValue), \
                            enumValue); \
  classMutex.unlock(); \
}
#define SO_NODE_HEADER ( className   ) 
Value:
SO_NODE_ABSTRACT_HEADER(className); \
    static void *createInstance(SoType* dynamicType = NULL)
#define SO_NODE_INIT_ABSTRACT_CLASS ( className,
parentClass,
parentPrintClass   ) 
Value:
\
  SO_NODE_INIT_ABSTRACT_CLASS_INTERNAL(className,parentClass,parentPrintClass)
#define SO_NODE_INIT_ABSTRACT_CLASS_INTERNAL ( className,
parentClass,
parentPrintClass   ) 
Value:
classMutex.lock(); \
  SO_NODE_INIT_RENDERING_MODE(className,parentClass); \
  SO_NODE_INIT_CLASS_CHECK_PARENT(className, parentClass); \
  classTypeId = SoType::createType( SoType::fromName(parentPrintClass), \
                                    SO__QUOTE(className), \
                                    NULL, \
                                    (short)SoNode::getNextActionMethodIndex()); \
  if (parentFieldData == NULL) \
    SoNode::incNextActionMethodIndex(); \
  parentFieldData = parentClass::getFieldDataPtr(); \
  classMutex.unlock();
#define SO_NODE_INIT_CLASS ( className,
parentClass,
parentPrintClass   ) 
Value:
\
  SO_NODE_INIT_CLASS_INTERNAL(className,parentClass,parentPrintClass)
#define SO_NODE_INIT_CLASS_CHECK_PARENT ( className,
parentClass   ) 
Value:
if (parentClass::getClassTypeId().isBad())                    \
    parentClass::initClass()
#define SO_NODE_INIT_CLASS_INTERNAL ( className,
parentClass,
parentPrintClass   ) 
Value:
classMutex.lock(); \
  SO_NODE_INIT_RENDERING_MODE(className, parentClass); \
  SO_NODE_INIT_CLASS_CHECK_PARENT(className, parentClass); \
  classTypeId = SoType::createType( SoType::fromName(parentPrintClass), \
                                    SO__QUOTE(className), \
                                    &className::createInstance, \
                                    (short)SoNode::getNextActionMethodIndex()); \
  if (parentFieldData == NULL) \
    SoNode::incNextActionMethodIndex(); \
  parentFieldData = parentClass::getFieldDataPtr(); \
  classMutex.unlock();
#define SO_NODE_INIT_RENDERING_MODE ( className,
parentClass   ) 
Value:
if ( className::getClassRenderEngineMode().isNotDefined() ) \
  { \
    if (parentClass::getClassRenderEngineMode().isChildrenInherit()) \
      s_renderEngineMode = parentClass::getClassRenderEngineMode(); \
    else \
      SbRenderEngineMode::postInitWarning( OIV_FUNCTION); \
  }
 
#define SO_NODE_IS_FIRST_INSTANCE (  ) 
Value:

Boolean check that can be used in constructors.

#define SO_NODE_SOURCE ( className   ) 
#define SO_THREAD_NODE_EXIT_CLASS ( className   ) 
#define SO_THREAD_NODE_INIT_CLASS ( className,
structName   ) 
Value:

Function Documentation

static SbRenderEngineMode& getClassRenderEngineMode (  )  [static]

Returns the Render engine mode supported for this class.

virtual const SbRenderEngineMode& getRenderEngineMode (  )  const [virtual]

Returns the type identifier for this class.

Returns the type identifier for this specific instance. Returns the Render engine mode supported by this specific instance.


Variable Documentation

SoType classTypeId [static]
SoFieldData* fieldData [static]
SbBool isBuiltIn [static]
const SoFieldData** parentFieldData [static]

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/