Open Inventor Reference
MeVis/ThirdParty/Sources/Inventor/inventor/lib/database/include/Inventor/actions/SoSubAction.h File Reference

Go to the source code of this file.

Defines

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

Define Documentation

#define SO__ACTION_METHODS (   className)
Value:
\
SoType                                                                        \
className::getTypeId() const                                                  \
{                                                                             \
    return classTypeId;                                                       \
}                                                                             \
                                                                              \
const SoEnabledElementsList &                                                 \
className::getEnabledElements() const                                         \
{                                                                             \
    return *enabledElements;                                                  \
}

Definition at line 124 of file SoSubAction.h.

#define SO__ACTION_VARS (   className)
Value:
SoEnabledElementsList       *className::enabledElements;                  \
    SoActionMethodList          *className::methods;                          \
    SoType                      className::classTypeId

This declares the static variables defined in SO_ACTION_HEADER.

Definition at line 114 of file SoSubAction.h.

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

#define SO_ACTION_CONSTRUCTOR (   className)    traversalMethods = methods

Definition at line 165 of file SoSubAction.h.

#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

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

Definition at line 87 of file SoSubAction.h.

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

This macro should be called from within initClass().

Definition at line 153 of file SoSubAction.h.

#define SO_ACTION_SOURCE (   className)
Value:
SO__ACTION_VARS(className);                                               \
    SO__ACTION_METHODS(className)

Definition at line 142 of file SoSubAction.h.