Open Inventor Reference
MeVis/ThirdParty/Sources/Inventor/inventor/lib/database/include/Inventor/elements/SoSubElement.h File Reference

Go to the source code of this file.

Defines

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

Define Documentation

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

Definition at line 138 of file SoSubElement.h.

#define SO__ELEMENT_ABSTRACT_VARS (   className)
Value:
SoType  className::classTypeId;                                               \
int             className::classStackIndex

This declares the static variables defined in SO_ELEMENT_HEADER or SO_ELEMENT_ABSTRACT_HEADER.

Definition at line 128 of file SoSubElement.h.

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

#define SO__ELEMENT_VARS (   className)    SO__ELEMENT_ABSTRACT_VARS(className)

Definition at line 132 of file SoSubElement.h.

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

#define SO_ELEMENT_ABSTRACT_SOURCE (   className)
Value:

Definition at line 167 of file SoSubElement.h.

#define SO_ELEMENT_HEADER (   className)
Value:
SO_ELEMENT_ABSTRACT_HEADER(className);                                    \
  private:                                                                    \
    static void *createInstance()

Definition at line 112 of file SoSubElement.h.

#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);                                                   \
    }

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.

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

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

Definition at line 171 of file SoSubElement.h.