man SoCallback () - provides custom behavior during actions

NAME

SoCallback - provides custom behavior during actions

INHERITS FROM

SoBase > SoFieldContainer > SoNode > SoCallback

SYNOPSIS

#include <Inventor/nodes/SoCallback.h> c } c } SoCallbackCB(void *userData, SoAction *action) Methods from class SoCallback: c } c } SoCallback()

c } c } setCallback(SoCallbackCB *func, void *userData = NULL)

c } c } getClassTypeId() Methods from class SoNode: c } c } setOverride(SbBool state)

c } c } isOverride() const

c } c } copy(SbBool copyConnections = FALSE) const

c } c } affectsState() const

c } c } getByName(const SbName &name)

c } c } getByName(const SbName &name, SoNodeList &list) Methods from class SoFieldContainer: c } c } setToDefaults()

c } c } hasDefaultValues() const

c } c } fieldsAreEqual(const SoFieldContainer *fc) const

c } c } copyFieldValues(const SoFieldContainer *fc, SbBool copyConnections = FALSE)

c } c } set(const char *fieldDataString)

c } c } get(SbString &fieldDataString)

c } c } getFields(SoFieldList &resultList) const

c } c } getField(const SbName &fieldName) const

c } c } getFieldName(const SoField *field, SbName &fieldName) const

c } c } isNotifyEnabled() const

c } c } enableNotify(SbBool flag) Methods from class SoBase: c } c } ref()

c } c } unref() const

c } c } unrefNoDelete() const

c } c } touch()

c } c } getTypeId() const

c } c } isOfType(SoType type) const

c } c } setName(const SbName &name)

c } c } getName() const

DESCRIPTION

This node provides a general mechanism for inserting callback functions into a scene graph. The callback function registered with the node is called each time the node is traversed while performing any scene graph action. The callback function is passed a pointer to the action being performed and a user data pointer registered with the callback function. You can use this node to make nonstandard OpenGL calls while rendering. If you do, be careful not to interfere with Inventor's use of OpenGL. If you use a callback node for GL rendering, you should be careful to follow render caching rules. If your callback node can make different rendering calls each time it is traversed, it cannot be cached. In such a case, the node should invalidate any open caches, as in the following example:

void myCallbackFunc(void *d, SoAction *action) { if (action->isOfType(SoGLRenderAction::getClassTypeId())) { // Make my custom GL calls ((MyClass *) d)->myRender(); // Invalidate the state so that a cache is not made SoCacheElement::invalidate(action->getState()); } }

METHODS

c } c } SoCallback()

Creates a callback node with default settings. c } c } setCallback(SoCallbackCB *func, void *userData = NULL)

Sets pointer to callback function and user data. By default, the function pointer in the node is NULL and does nothing. c } c } getClassTypeId()

Returns type identifier for this class.

ACTION BEHAVIOR

SoGLRenderAction, SoBoundingBoxAction, SoPickAction

Calls the specified callback function for all actions.

FILE FORMAT/DEFAULTS

Callback {
}

SEE ALSO

SoAction, SoCallbackAction, SoEventCallback