Open Inventor Reference
|
#include <stdlib.h>
#include <Inventor/system/SbSystem.h>
#include <Inventor/errors/SoDebugError.h>
#include <Inventor/fields/SoFieldData.h>
#include <Inventor/nodes/SoNode.h>
Go to the source code of this file.
Macros | |
#define | SO__NODE_CHECK_INIT(className) { } |
*** note: many of the macros use the "do { ... } while(0)" *** hack to define multiline blocks as a single statement *** of code that can be used anywhere and ended with a semicolon | |
#define | SO__NODE_CHECK_CONSTRUCT(where) { } |
#define | SO_NODE_ABSTRACT_HEADER(className) |
Macros to be called within the class definition header for a node subclass: | |
#define | SO_NODE_HEADER(className) |
Non-abstract classes have everything abstract classes have, plus a way to create an instance. | |
#define | SO__NODE_ABSTRACT_VARS(className) |
Macros to be called within the source file for a node subclass: | |
#define | SO__NODE_VARS(className) SO__NODE_ABSTRACT_VARS(className) |
Non-abstract nodes have all the stuff abstract nodes do. | |
#define | SO__NODE_ABSTRACT_METHODS(className) |
Methods on the abstract type. | |
#define | SO__NODE_METHODS(className) |
These implement the methods defined in SO_NODE_HEADER or SO_NODE_ABSTRACT_HEADER. | |
#define | SO_NODE_SOURCE(className) |
These include all the definitions required at file scope. | |
#define | SO_NODE_ABSTRACT_SOURCE(className) |
#define | SO__NODE_INIT_CLASS(className, classPrintName, parentClass) |
Internal initialization macros. | |
#define | SO__NODE_INIT_ABSTRACT_CLASS(className, classPrintName, parentClass) |
#define | SO_NODE_INIT_CLASS(className, parentClass, parentPrintClass) |
This initializes the type identifer variables defined in SO_NODE_HEADER or SO_NODE_ABSTRACT_HEADER. | |
#define | SO_NODE_INIT_ABSTRACT_CLASS(className, parentClass, parentPrintClass) |
#define | SO_NODE_CONSTRUCTOR(className) |
This is included at the beginning of a constructor, to do required initializations. | |
#define | SO_NODE_IS_FIRST_INSTANCE() (firstInstance == TRUE) |
This is a boolean value that can be tested in constructors. | |
#define | SO_NODE_ADD_REMOVED_FIELD(fieldName) |
This adds the info for a removed field to the SoFieldData. | |
#define | SO_NODE_ADD_FIELD(fieldName, defValue) |
This adds the info for a field to the SoFieldData and sets the default value for it. | |
#define | SO_NODE_ADD_ENUM_FIELD(field, type, defaultValue) |
This adds an enum field of the given type to the SoFieldData and sets it's default value. | |
#define | SO_NODE_DEFINE_ENUM_VALUE(enumType, enumValue) |
This registers a value of an enum type. | |
#define | SO_NODE_DEFINE_ENUM_VALUE_NAMED(enumType, enumValue, enumValueName) |
This registers a named value of an enum type. | |
#define | SO_NODE_DEFINE_ENUM_VALUE_SCOPED(enumScope, enumType, enumValue) |
This registers a value of a scoped enum type. | |
#define SO__NODE_ABSTRACT_METHODS | ( | className | ) |
Definition at line 202 of file SoSubNode.h.
#define SO__NODE_ABSTRACT_VARS | ( | className | ) |
This declares the static variables defined in SO_NODE_HEADER or SO_NODE_ABSTRACT_HEADER.
Definition at line 185 of file SoSubNode.h.
#define SO__NODE_CHECK_CONSTRUCT | ( | where | ) | { } |
Definition at line 135 of file SoSubNode.h.
#define SO__NODE_CHECK_INIT | ( | className | ) | { } |
Debugging macros (used by other macros in this file)
Definition at line 134 of file SoSubNode.h.
#define SO__NODE_INIT_ABSTRACT_CLASS | ( | className, | |
classPrintName, | |||
parentClass | |||
) |
Definition at line 269 of file SoSubNode.h.
#define SO__NODE_INIT_CLASS | ( | className, | |
classPrintName, | |||
parentClass | |||
) |
Definition at line 254 of file SoSubNode.h.
#define SO__NODE_METHODS | ( | className | ) |
Definition at line 223 of file SoSubNode.h.
#define SO__NODE_VARS | ( | className | ) | SO__NODE_ABSTRACT_VARS(className) |
Definition at line 194 of file SoSubNode.h.
#define SO_NODE_ABSTRACT_HEADER | ( | className | ) |
These defines type-identifier and naming variables and methods that all subclasses and abstract subclasses must support.
Definition at line 150 of file SoSubNode.h.
#define SO_NODE_ABSTRACT_SOURCE | ( | className | ) |
Definition at line 244 of file SoSubNode.h.
#define SO_NODE_ADD_ENUM_FIELD | ( | field, | |
type, | |||
defaultValue | |||
) |
NOTE: The enum type's values need to be registered beforehand, using SO_NODE_DEFINE_ENUM_VALUE. This is a shortcut for using SO_NODE_ADD_FIELD and SO_NODE_SET_SF_ENUM_TYPE.
Definition at line 388 of file SoSubNode.h.
#define SO_NODE_ADD_FIELD | ( | fieldName, | |
defValue | |||
) |
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.
Definition at line 372 of file SoSubNode.h.
#define SO_NODE_ADD_REMOVED_FIELD | ( | fieldName | ) |
Definition at line 351 of file SoSubNode.h.
#define SO_NODE_CONSTRUCTOR | ( | className | ) |
Definition at line 328 of file SoSubNode.h.
#define SO_NODE_DEFINE_ENUM_VALUE | ( | enumType, | |
enumValue | |||
) |
enumType: the name of the enum type enumValue: the name of a value of that enum type
If a node defines an enum, each of the enum's values should be registered using this macro. For example:
[ in MyNode.h file: ] class MyNode { ... enum Chipmunk { ALVIN, SIMON, THEODORE }; ... } [ in constructor MyNode::MyNode(): ] SO_NODE_DEFINE_ENUM_VALUE(Chipmunk, ALVIN); SO_NODE_DEFINE_ENUM_VALUE(Chipmunk, SIMON); SO_NODE_DEFINE_ENUM_VALUE(Chipmunk, THEODORE);
Definition at line 414 of file SoSubNode.h.
#define SO_NODE_DEFINE_ENUM_VALUE_NAMED | ( | enumType, | |
enumValue, | |||
enumValueName | |||
) |
enumType: the name of the enum type enumValue: the value of that enum type enumValueName: the name of the enum value (as a string)
This macro is useful if you want to register enum values that are part of class scope and you want to register a shorter name for the enum value. Or you can use it to give the enum items names that are better readably for the user of the node.
[ in MyNode.h file: ] class SomeOtherClass { enum Chipmunk { ALVIN, SIMON, THEODORE }; }; class MyNode { } [ in constructor MyNode::MyNode(): ] SO_NODE_DEFINE_ENUM_VALUE_NAMED(SomeOtherClass::Chipmunk, SomeOtherClass::ALVIN, "Alvin"); SO_NODE_DEFINE_ENUM_VALUE_NAMED(SomeOtherClass::Chipmunk, SomeOtherClass::SIMON, "Simon"); SO_NODE_DEFINE_ENUM_VALUE_NAMED(SomeOtherClass::Chipmunk, SomeOtherClass::THEODORE, "Theodore");
Definition at line 447 of file SoSubNode.h.
#define SO_NODE_DEFINE_ENUM_VALUE_SCOPED | ( | enumScope, | |
enumType, | |||
enumValue | |||
) |
enumScope: the name of the enum scope (namespace/class) enumType: the type of the enum (without scope) enumValue: the value of that enum type
This macro is useful if you want to register enum values that are part of class scope and you want to register the names without the class/namespace scope.
[ in MyNode.h file: ] class SomeOtherClass { enum Chipmunk { ALVIN, SIMON, THEODORE }; }; class MyNode { } [ in constructor MyNode::MyNode(): ] SO_NODE_DEFINE_ENUM_ITEM_SCOPED(SomeOtherClass, Chipmunk, ALVIN); SO_NODE_DEFINE_ENUM_ITEM_SCOPED(SomeOtherClass, Chipmunk, SIMON); SO_NODE_DEFINE_ENUM_ITEM_SCOPED(SomeOtherClass, Chipmunk, THEODORE);
Definition at line 479 of file SoSubNode.h.
#define SO_NODE_HEADER | ( | className | ) |
Definition at line 170 of file SoSubNode.h.
#define SO_NODE_INIT_ABSTRACT_CLASS | ( | className, | |
parentClass, | |||
parentPrintClass | |||
) |
Definition at line 307 of file SoSubNode.h.
#define SO_NODE_INIT_CLASS | ( | className, | |
parentClass, | |||
parentPrintClass | |||
) |
This macro should be called from within initClass(). The parentClass argument should be the class that this subclass is derived from.
Definition at line 292 of file SoSubNode.h.
#define SO_NODE_IS_FIRST_INSTANCE | ( | ) | (firstInstance == TRUE) |
Definition at line 344 of file SoSubNode.h.
#define SO_NODE_SOURCE | ( | className | ) |
Definition at line 240 of file SoSubNode.h.