man SoCallbackAction () - performs a generic traversal of the scene graph

NAME

SoCallbackAction - performs a generic traversal of the scene graph

INHERITS FROM

SoAction > SoCallbackAction

SYNOPSIS

#include <Inventor/actions/SoCallbackAction.h> c } c } SoTriangleCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3)

c } c } SoLineSegmentCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2)

c } c } SoPointCB(void *userData, SoCallbackAction *action, const SoPrimitiveVertex *v)

c } c } SoCallbackActionCB(void *userData, SoCallbackAction *action, const SoNode *node) enum Response { c } c } Continue traversal as if nothing happened

c } c } Abort traversal

c } c } Do not traverse node's children, but continue traversal

} Methods from class SoCallbackAction: c } c } SoCallbackAction()

c } c } addPreCallback(SoType type, SoCallbackActionCB *cb, void *data)

c } c } addPostCallback(SoType type, SoCallbackActionCB *cb, void *data)

c } c } addPreTailCallback(SoCallbackActionCB *cb, void *data)

c } c } addPostTailCallback(SoCallbackActionCB *cb, void *data)

c } c } addTriangleCallback(SoType type, SoTriangleCB *cb, void *data)

c } c } addLineSegmentCallback(SoType type, SoLineSegmentCB *cb, void *data)

c } c } addPointCallback(SoType type, SoPointCB *cb, void *data)

c } c } getComplexity() const

c } c } getComplexityType() const

c } c } getNumCoordinates() const

c } c } getCoordinate3(int index) const

c } c } getCoordinate4(int index) const

c } c } getDrawStyle() const

c } c } getLinePattern() const

c } c } getLineWidth() const

c } c } getPointSize() const

c } c } getFontName() const

c } c } getFontSize() const

c } c } getLightModel() const

c } c } getLightAttenuation() const

c } c } getMaterial(SbColor &ambient, SbColor &diffuse, SbColor &specular, SbColor &emission, float &shininess, float &transparency, int mtlIndex = 0) const

c } c } getMaterialBinding() const

c } c } getNumNormals() const

c } c } getNormal(int index) const

c } c } getNormalBinding() const

c } c } getNumProfileCoordinates() const

c } c } getProfileCoordinate2(int index) const

c } c } getProfileCoordinate3(int index) const

c } c } getProfile() const

c } c } getVertexOrdering() const

c } c } getShapeType() const

c } c } getFaceType() const

c } c } getCreaseAngle() const

c } c } getNumTextureCoordinates() const

c } c } getTextureCoordinate2(int index) const

c } c } getTextureCoordinate4(int index) const

c } c } getTextureCoordinateBinding() const

c } c } getTextureBlendColor() const

c } c } getTextureImage(SbVec2s &size, int &numComps) const

c } c } getTextureMatrix() const

c } c } getTextureModel() const

c } c } getTextureWrapS() const

c } c } getTextureWrapT() const

c } c } getModelMatrix() const

c } c } getUnits() const

c } c } getFocalDistance() const

c } c } getProjectionMatrix() const

c } c } getViewingMatrix() const

c } c } getViewVolume() const

c } c } getPickStyle() const

c } c } getSwitch() const Methods from class SoAction: c } c } apply(SoNode *node)

c } c } apply(SoPath *path)

c } c } apply(const SoPathList &pathList, SbBool obeysRules = FALSE)

c } c } getClassTypeId()

c } c } getTypeId()

c } c } isOfType(SoType type)

c } c } invalidateState()

DESCRIPTION

This action defines a generic traversal of the scene graph. The user can specify callback functions for node types or paths; when those node types or paths are encountered during traversal, the user's callback function is called. In addition, callback functions can be registered for primitives generated by shapes in the scene graph. Most shape types can generate primitives that represent or approximate their geometries. Triangle primitives are used for all surfaces (such as cubes, face sets, or 3D text), line segment primitives are used for line shapes, and point primitives are used for point shapes. Note that the type of primitives generated for a shape is the same, regardless of drawing style or other properties. Most of the methods on this class access information from the traversal state. They should be called only by callback functions that are invoked during traversal, so there is a valid state to work with.

METHODS

c } c } SoCallbackAction()

The constructor. c } c } addPreCallback(SoType type, SoCallbackActionCB *cb, void *data)

c } c } addPostCallback(SoType type, SoCallbackActionCB *cb, void *data)

These add a callback function to call when a node of the given type is encountered during traversal. The PreCallback is called just before the node is traversed, and the PostCallback is called just after. The value returned by a callback function indicates whether the action should continue with the traversal. c } c } addPreTailCallback(SoCallbackActionCB *cb, void *data)

c } c } addPostTailCallback(SoCallbackActionCB *cb, void *data)

These can be used to set up callback functions to call when the action is applied to a path. The functions are called just before or after the node at the tail of the path is traversed. c } c } addTriangleCallback(SoType type, SoTriangleCB *cb, void *data)

c } c } addLineSegmentCallback(SoType type, SoLineSegmentCB *cb, void *data)

c } c } addPointCallback(SoType type, SoPointCB *cb, void *data)

Routines to add callbacks for generated primitives (triangles, line segments, and points) for all shapes of the given type. The callback function will be called for each primitive generated for all shapes of or derived from that type. c } c } getComplexity() const

c } c } getComplexityType() const

Returns complexity information from the state. c } c } getNumCoordinates() const

c } c } getCoordinate3(int index) const

c } c } getCoordinate4(int index) const

Returns the current coordinates from the state. c } c } getDrawStyle() const

c } c } getLinePattern() const

c } c } getLineWidth() const

c } c } getPointSize() const

Returns the current drawing style information from the state. c } c } getFontName() const

c } c } getFontSize() const

Returns the current font information from the state. c } c } getLightModel() const

c } c } getLightAttenuation() const

Returns the current lighting model information from the state. c } c } getMaterial(SbColor &ambient, SbColor &diffuse, SbColor &specular, SbColor &emission, float &shininess, float &transparency, int mtlIndex = 0) const

c } c } getMaterialBinding() const

Returns the current material information from the state. Providing a mtlIndex will return the material defined for that index. c } c } getNumNormals() const

c } c } getNormal(int index) const

c } c } getNormalBinding() const

Returns the current normal information from the state. c } c } getNumProfileCoordinates() const

c } c } getProfileCoordinate2(int index) const

c } c } getProfileCoordinate3(int index) const

c } c } getProfile() const

Returns the current profiles and their coordinates from the state. c } c } getVertexOrdering() const

c } c } getShapeType() const

c } c } getFaceType() const

c } c } getCreaseAngle() const

Returns the current shape hints from the state. c } c } getNumTextureCoordinates() const

c } c } getTextureCoordinate2(int index) const

c } c } getTextureCoordinate4(int index) const

c } c } getTextureCoordinateBinding() const

c } c } getTextureBlendColor() const

c } c } getTextureImage(SbVec2s &size, int &numComps) const

Returns texture information from the state. getNumTextureCoordinates() returns 0 if texture coordinates are generated by a function. getTextureImage() returns NULL if no texture is enabled. c } c } getTextureMatrix() const

c } c } getTextureModel() const

c } c } getTextureWrapS() const

c } c } getTextureWrapT() const

Returns the current texture mapping information from the state. c } c } getModelMatrix() const

c } c } getUnits() const

Returns the current modeling transformation and the current units from the state. c } c } getFocalDistance() const

c } c } getProjectionMatrix() const

c } c } getViewingMatrix() const

c } c } getViewVolume() const

Returns the current camera and viewing information from the state. c } c } getPickStyle() const

Returns the current picking style. c } c } getSwitch() const

Returns the current switch value.

SEE ALSO

SoCallback, SoEventCallback, SoShape