Open Inventor Reference
SoSubElement.h File Reference

Go to the source code of this file.

Macros

#define SO_ELEMENT_ABSTRACT_HEADER(className)
 Macros to be called within the class definition header for a element subclass:
 
#define SO_ELEMENT_HEADER(className)
 This one is for non-abstract element classes.
 
#define SO__ELEMENT_ABSTRACT_VARS(className)
 Macros to be called within the source file for a element subclass:
 
#define SO__ELEMENT_VARS(className)   SO__ELEMENT_ABSTRACT_VARS(className)
 
#define SO__ELEMENT_ABSTRACT_METHODS(className)
 Methods on an abstract type.
 
#define SO__ELEMENT_METHODS(className)
 Methods on a non-abstract type.
 
#define SO_ELEMENT_ABSTRACT_SOURCE(className)
 These include all the definitions required at file scope.
 
#define SO_ELEMENT_SOURCE(className)
 
#define SO_ELEMENT_INIT_ABSTRACT_CLASS(className, parentClass)
 This initializes the type identifer variables defined in SO_ELEMENT_HEADER or SO_ELEMENT_ABSTRACT_HEADER.
 
#define SO_ELEMENT_INIT_CLASS(className, parentClass)
 

Macro Definition Documentation

◆ SO__ELEMENT_ABSTRACT_METHODS

#define SO__ELEMENT_ABSTRACT_METHODS (   className)
Value:
\
className::className() \
{ \
}

Definition at line 138 of file SoSubElement.h.

◆ SO__ELEMENT_ABSTRACT_VARS

#define SO__ELEMENT_ABSTRACT_VARS (   className)
Value:
SoType className::classTypeId; \
int className::classStackIndex
SoType has no virtual functions to keep it small...
Definition SoType.h:103

This declares the static variables defined in SO_ELEMENT_HEADER or SO_ELEMENT_ABSTRACT_HEADER.

Definition at line 128 of file SoSubElement.h.

◆ SO__ELEMENT_METHODS

#define SO__ELEMENT_METHODS (   className)
Value:
\
className::className() \
{ \
setTypeId(classTypeId); \
setStackIndex(classStackIndex); \
} \
\
void * \
className::createInstance() \
{ \
return new className; \
}

Definition at line 147 of file SoSubElement.h.

◆ SO__ELEMENT_VARS

#define SO__ELEMENT_VARS (   className)    SO__ELEMENT_ABSTRACT_VARS(className)

Definition at line 132 of file SoSubElement.h.

◆ SO_ELEMENT_ABSTRACT_HEADER

#define SO_ELEMENT_ABSTRACT_HEADER (   className)
Value:
public: \
static SoType getClassTypeId() { return classTypeId; } \
static int getClassStackIndex() { return classStackIndex; } \
protected: \
static int classStackIndex; \
className(); \
private: \
static SoType classTypeId

These define type-identifier and stack index variables and methods that all subclasses must support. This one is for abstract element classes.

Definition at line 99 of file SoSubElement.h.

◆ SO_ELEMENT_ABSTRACT_SOURCE

#define SO_ELEMENT_ABSTRACT_SOURCE (   className)
Value:
SO__ELEMENT_ABSTRACT_METHODS(className)
#define SO__ELEMENT_ABSTRACT_VARS(className)
Macros to be called within the source file for a element subclass:

Definition at line 167 of file SoSubElement.h.

◆ SO_ELEMENT_HEADER

#define SO_ELEMENT_HEADER (   className)
Value:
private: \
static void *createInstance()
#define SO_ELEMENT_ABSTRACT_HEADER(className)
Macros to be called within the class definition header for a element subclass:

Definition at line 112 of file SoSubElement.h.

◆ SO_ELEMENT_INIT_ABSTRACT_CLASS

#define SO_ELEMENT_INIT_ABSTRACT_CLASS (   className,
  parentClass 
)
Value:
{ \
int _value_false= 0; \
do { \
classTypeId = SoType::createType(parentClass::getClassTypeId(), \
SO__QUOTE(className), \
NULL); \
if (parentClass::classStackIndex < 0) \
classStackIndex = createStackIndex(classTypeId); \
else \
classStackIndex = parentClass::classStackIndex; \
} while (_value_false); \
}
#define SO__QUOTE(str)
Handy macros.
Definition SoBasic.h:69
static SoType createType(SoType parent, SbName name, void *(*createMethod)()=NULL, short data=0)
Create a new type.

This macro should be called from within initClass(). The parentClass argument should be the class that this subclass is derived from.

Definition at line 183 of file SoSubElement.h.

◆ SO_ELEMENT_INIT_CLASS

#define SO_ELEMENT_INIT_CLASS (   className,
  parentClass 
)
Value:
{ \
int _value_false= 0; \
do { \
classTypeId = SoType::createType(parentClass::getClassTypeId(), \
SO__QUOTE(className), \
&className::createInstance); \
if (parentClass::classStackIndex < 0) \
classStackIndex = createStackIndex(classTypeId); \
else \
classStackIndex = parentClass::classStackIndex; \
} while (_value_false); \
}

Definition at line 196 of file SoSubElement.h.

◆ SO_ELEMENT_SOURCE

#define SO_ELEMENT_SOURCE (   className)
Value:
SO__ELEMENT_VARS(className); \
SO__ELEMENT_METHODS(className)
#define SO__ELEMENT_VARS(className)

Definition at line 171 of file SoSubElement.h.