Open Inventor Reference
SoSubAction.h File Reference

Go to the source code of this file.

Macros

#define SO_ACTION_HEADER(className)
 Macros to be called within the class definition header for an action subclass:
 
#define SO__ACTION_VARS(className)
 Macros to be called within the source file for a action subclass:
 
#define SO__ACTION_METHODS(className)
 This implements the methods defined in SO_ACTION_HEADER.
 
#define SO_ACTION_SOURCE(className)
 This contains the definitions necessary at file scope.
 
#define SO_ACTION_INIT_CLASS(className, parentClass)
 This initializes the type identifer variables defined in SO_ACTION_HEADER.
 
#define SO_ACTION_CONSTRUCTOR(className)    traversalMethods = methods
 This is included at the beginning of a constructor, to do required initializations.
 
#define SO_ACTION_ADD_METHOD(nodeClass, method)    addMethod(nodeClass::getClassTypeId(), method)
 This macro can be used by action subclasses within initClass() to register a method to call for a specific node class.
 

Macro Definition Documentation

◆ SO__ACTION_METHODS

#define SO__ACTION_METHODS (   className)
Value:
\
SoType \
className::getTypeId() const \
{ \
return classTypeId; \
} \
\
className::getEnabledElements() const \
{ \
return *enabledElements; \
}
Internal class.
Definition SoAction.h:121

Definition at line 124 of file SoSubAction.h.

◆ SO__ACTION_VARS

#define SO__ACTION_VARS (   className)
Value:
SoEnabledElementsList *className::enabledElements; \
SoActionMethodList *className::methods; \
SoType className::classTypeId
Internal class.
Definition SoAction.h:81
SoType has no virtual functions to keep it small...
Definition SoType.h:103

This declares the static variables defined in SO_ACTION_HEADER.

Definition at line 114 of file SoSubAction.h.

◆ SO_ACTION_ADD_METHOD

#define SO_ACTION_ADD_METHOD (   nodeClass,
  method 
)     addMethod(nodeClass::getClassTypeId(), method)

It is passed the name of the node class and the method to call.

Definition at line 175 of file SoSubAction.h.

◆ SO_ACTION_CONSTRUCTOR

#define SO_ACTION_CONSTRUCTOR (   className)     traversalMethods = methods

Definition at line 165 of file SoSubAction.h.

◆ SO_ACTION_HEADER

#define SO_ACTION_HEADER (   className)
Value:
public: \
virtual SoType getTypeId() const; \
static SoType getClassTypeId() \
{ return classTypeId; } \
SoEXTENDER public: \
static void addMethod(SoType t, SoActionMethod method) \
{ methods->addMethod(t, method); } \
static void enableElement(SoType t, int stkIndex) \
{ enabledElements->enable(t, stkIndex);} \
protected: \
virtual const SoEnabledElementsList & getEnabledElements() const; \
static SoEnabledElementsList *enabledElements; \
static SoActionMethodList *methods; \
private: \
static SoType classTypeId
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
Definition SbBasic.h:154
void(* SoActionMethod)(SoAction *, SoNode *)
Definition SoAction.h:70

This defines type-identifier variables and methods that all subclasses must support.

Definition at line 87 of file SoSubAction.h.

◆ SO_ACTION_INIT_CLASS

#define SO_ACTION_INIT_CLASS (   className,
  parentClass 
)
Value:
enabledElements = new SoEnabledElementsList(parentClass::enabledElements);\
methods = new SoActionMethodList(parentClass::methods); \
classTypeId = SoType::createType(parentClass::getClassTypeId(), \
SO__QUOTE(className), NULL)
#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().

Definition at line 153 of file SoSubAction.h.

◆ SO_ACTION_SOURCE

#define SO_ACTION_SOURCE (   className)
Value:
SO__ACTION_VARS(className); \
SO__ACTION_METHODS(className)
#define SO__ACTION_VARS(className)
Macros to be called within the source file for a action subclass:

Definition at line 142 of file SoSubAction.h.