![]() |
http://www.sim.no http://www.coin3d.org |
The SoCallbackAction class invokes callbacks at specific nodes. More...
#include <Inventor/actions/SoCallbackAction.h>
Public Types | |
enum | Response { CONTINUE , ABORT , PRUNE } |
typedef Response | SoCallbackActionCB(void *userdata, SoCallbackAction *action, const SoNode *node) |
![]() | |
enum | AppliedCode { NODE = 0 , PATH = 1 , PATH_LIST = 2 } |
enum | PathCode { NO_PATH = 0 , IN_PATH = 1 , BELOW_PATH = 2 , OFF_PATH = 3 } |
Static Public Member Functions | |
static SoType | getClassTypeId (void) |
static void | addMethod (const SoType type, SoActionMethod method) |
static void | enableElement (const SoType type, const int stackindex) |
static void | initClass (void) |
![]() | |
static void | initClass (void) |
static void | initClasses (void) |
static SoType | getClassTypeId (void) |
static void | nullAction (SoAction *action, SoNode *node) |
Protected Member Functions | |
virtual const SoEnabledElementsList & | getEnabledElements (void) const |
virtual void | beginTraversal (SoNode *node) |
![]() | |
SoAction (void) | |
virtual void | endTraversal (SoNode *node) |
void | setTerminated (const SbBool flag) |
virtual SbBool | shouldCompactPathList (void) const |
Static Protected Member Functions | |
static SoEnabledElementsList * | getClassEnabledElements (void) |
static SoActionMethodList * | getClassActionMethods (void) |
![]() | |
static SoEnabledElementsList * | getClassEnabledElements (void) |
static SoActionMethodList * | getClassActionMethods (void) |
Friends | |
class | SoCallbackActionP |
Additional Inherited Members | |
![]() | |
SoState * | state |
SoActionMethodList * | traversalMethods |
The SoCallbackAction class invokes callbacks at specific nodes.
This action has mechanisms for tracking traversal position and traversal state. In combination with the ability to pass geometry primitives to callback actions set by the user, this does for instance make it rather straightforward to extract the geometry of a scene graph.
You should be able to use this action for most of your "simple" traversal needs, instead of cooking up your own code, as the SoCallbackAction is rather flexible.
A common use of this action is to extract geometry of non-primitive shapes as triangles. A full-fledged example that demonstrates this on a scenegraph with two spheres follows:
Response SoCallbackAction::SoCallbackActionCB |
Callback functions need to be of this type. node is at the current traversal point in the scene graph.
Response values for callback function.
SoCallbackAction::SoCallbackAction | ( | void | ) |
Default constructor. Will set the viewport to a standard viewport with size 640x512.
SoCallbackAction::SoCallbackAction | ( | const SbViewportRegion & | vp | ) |
Constructor which lets you specify the viewport.
This constructor is an extension versus the Open Inventor API.
|
virtual |
Destructor.
Returns the type identification of an action derived from a class inheriting SoAction. This is used for run-time type checking and "downward" casting.
Usage example:
For application programmers wanting to extend the library with new actions: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR.
For more information on writing Coin extensions, see the SoAction class documentation.
Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses.
Implements SoAction.
Reimplemented in SoVectorizeAction, and SoVectorizePSAction.
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
|
protectedvirtual |
Returns a list of the elements used by action instances of this class upon traversal operations.
Reimplemented from SoAction.
Reimplemented in SoVectorizeAction, and SoVectorizePSAction.
void SoCallbackAction::setViewportRegion | ( | const SbViewportRegion & | vp | ) |
Sets the viewport region for this action. When set, the viewport element is initialized right before a traversal starts, making it the current viewport.
This method is an extension versus the Open Inventor API.
Referenced by SoVectorizeAction::beginPage(), and SoVectorizeAction::beginViewport().
void SoCallbackAction::addPreCallback | ( | const SoType | type, |
SoCallbackActionCB * | cb, | ||
void * | userdata ) |
Set a function cb to call before every node of type is traversed. cb will be called with userdata.
void SoCallbackAction::addPostCallback | ( | const SoType | type, |
SoCallbackActionCB * | cb, | ||
void * | userdata ) |
Set a function cb to call after every node of type has been traversed. cb will be called with userdata.
void SoCallbackAction::addPreTailCallback | ( | SoCallbackActionCB * | cb, |
void * | userdata ) |
Set a function cb to call before the tail of a path is traversed. cb will be called with userdata.
References SbList< Type >::append().
void SoCallbackAction::addPostTailCallback | ( | SoCallbackActionCB * | cb, |
void * | userdata ) |
Set a function cb to call after the tail of a path has been traversed. cb will be called with userdata.
References SbList< Type >::append().
void SoCallbackAction::addTriangleCallback | ( | const SoType | type, |
SoTriangleCB * | cb, | ||
void * | userdata ) |
Set a function cb to call when traversing a node of type which generates triangle primitives for rendering. cb will be called with userdata.
void SoCallbackAction::addLineSegmentCallback | ( | const SoType | type, |
SoLineSegmentCB * | cb, | ||
void * | userdata ) |
Set a function cb to call when traversing a node of type which generates line primitives for rendering. cb will be called with userdata.
Set a function cb to call when traversing a node of type which generates single point primitives for rendering. cb will be called with userdata.
SoDecimationTypeElement::Type SoCallbackAction::getDecimationType | ( | void | ) | const |
Returns current decimation type setting.
References SoAction::state.
float SoCallbackAction::getDecimationPercentage | ( | void | ) | const |
Returns current decimation percentage setting.
References SoAction::state.
float SoCallbackAction::getComplexity | ( | void | ) | const |
Returns current complexity setting.
References SoAction::state.
SoComplexity::Type SoCallbackAction::getComplexityType | ( | void | ) | const |
Returns current complexity type setting.
References SoAction::state.
int32_t SoCallbackAction::getNumCoordinates | ( | void | ) | const |
Returns current number of coordinates in the state.
References SoAction::state.
Returns a coordinate triplet from the current state pool of coordinates.
References SoAction::state.
Returns a coordinate quartuplet from the current state pool of coordinates.
References SoAction::state.
SoDrawStyle::Style SoCallbackAction::getDrawStyle | ( | void | ) | const |
Returns current draw style setting.
References SoAction::state.
Returns current line pattern setting.
References SoAction::state.
float SoCallbackAction::getLineWidth | ( | void | ) | const |
Returns current line width setting.
References SoLineWidthElement::get(), and SoAction::state.
float SoCallbackAction::getPointSize | ( | void | ) | const |
Returns current point size setting.
References SoPointSizeElement::get(), and SoAction::state.
Returns current fontname setting.
References SoAction::state.
float SoCallbackAction::getFontSize | ( | void | ) | const |
Returns current fontsize setting.
References SoAction::state.
SoLightModel::Model SoCallbackAction::getLightModel | ( | void | ) | const |
Returns current lightmodel setting.
References SoAction::state.
Returns current light attenuation setting.
References SoAction::state.
void SoCallbackAction::getMaterial | ( | SbColor & | ambient, |
SbColor & | diffuse, | ||
SbColor & | specular, | ||
SbColor & | emission, | ||
float & | shininess, | ||
float & | transparency, | ||
const int | index = 0 ) const |
Returns current material settings.
References SbList< Type >::SbList(), and SoAction::state.
SoMaterialBinding::Binding SoCallbackAction::getMaterialBinding | ( | void | ) | const |
Returns current materialbinding setting.
References SoAction::state.
uint32_t SoCallbackAction::getNumNormals | ( | void | ) | const |
Returns current number of normals in the state.
References SoAction::state.
Returns the normal vectors at index from the current state.
References SoAction::state.
SoNormalBinding::Binding SoCallbackAction::getNormalBinding | ( | void | ) | const |
Returns current normalbinding setting.
References SoAction::state.
int32_t SoCallbackAction::getNumProfileCoordinates | ( | void | ) | const |
Returns current number of profile coordinates in the state.
References SoAction::state.
Returns current number of SbVec2f profile coordinates in the state.
References SoAction::state.
Returns current number of SbVec3f profile coordinates in the state.
References SoAction::state.
const SoNodeList & SoCallbackAction::getProfile | ( | void | ) | const |
Returns current list of profile nodes.
References SoAction::state.
SoShapeHints::VertexOrdering SoCallbackAction::getVertexOrdering | ( | void | ) | const |
Returns current vertexordering shapehint setting.
References SoAction::state.
SoShapeHints::ShapeType SoCallbackAction::getShapeType | ( | void | ) | const |
Returns current shapetype hint setting.
References SoAction::state.
SoShapeHints::FaceType SoCallbackAction::getFaceType | ( | void | ) | const |
Returns current facetype hint setting.
References SoAction::state.
float SoCallbackAction::getCreaseAngle | ( | void | ) | const |
Returns current creaseangle setting.
References SoAction::state.
int32_t SoCallbackAction::getNumTextureCoordinates | ( | void | ) | const |
Returns current number of texture coordinates in the traversal state.
References SoAction::state.
Returns SbVec2f texture coordinate at index from the texture coordinate pool of the traversal state.
References SoAction::state.
Returns SbVec3f texture coordinate at index from the texture coordinate pool of the traversal state.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
References SoAction::state.
Returns SbVec4f texture coordinate at index from the texture coordinate pool of the traversal state.
References SoAction::state.
SoTextureCoordinateBinding::Binding SoCallbackAction::getTextureCoordinateBinding | ( | void | ) | const |
Returns current texturecoordinate binding setting.
References SoAction::state.
Returns current texture blend color setting.
References SbList< Type >::SbList(), and SoAction::state.
Returns current texture image settings.
References SoAction::state.
Returns current 3D texture image settings.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
References SoAction::state.
Returns current texture transformation matrix setting.
References SoAction::state.
SoTexture2::Model SoCallbackAction::getTextureModel | ( | void | ) | const |
Returns current texturemapping model setting.
References SbList< Type >::SbList(), and SoAction::state.
SoTexture2::Wrap SoCallbackAction::getTextureWrapS | ( | void | ) | const |
Returns current texture wrapping setting for the S
coordinate.
References SbList< Type >::SbList(), and SoAction::state.
SoTexture2::Wrap SoCallbackAction::getTextureWrapT | ( | void | ) | const |
Returns current texture wrapping setting for the T
coordinate.
References SbList< Type >::SbList(), and SoAction::state.
SoTexture2::Wrap SoCallbackAction::getTextureWrapR | ( | void | ) | const |
Returns current texture wrapping setting for the R
coordinate.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
References SbList< Type >::SbList(), and SoAction::state.
Returns current model matrix.
References SoAction::state.
SoUnits::Units SoCallbackAction::getUnits | ( | void | ) | const |
Returns current units setting.
References SoAction::state.
float SoCallbackAction::getFocalDistance | ( | void | ) | const |
Returns current camera focal distance setting.
References SoAction::state.
Returns current projection matrix.
References SoAction::state.
Returns current viewing matrix.
References SoAction::state.
const SbViewVolume & SoCallbackAction::getViewVolume | ( | void | ) | const |
Returns current view volume setting.
References SoAction::state.
const SbViewportRegion & SoCallbackAction::getViewportRegion | ( | void | ) | const |
Returns current viewport region setting.
This method is an extension versus the Open Inventor API.
References SoAction::getState().
SoPickStyle::Style SoCallbackAction::getPickStyle | ( | void | ) | const |
Returns current pickstyle setting.
References SoAction::state.
int32_t SoCallbackAction::getSwitch | ( | void | ) | const |
Returns last SoSwitch::whichChild setting during the traversal.
References SoAction::state.
SoCallbackAction::Response SoCallbackAction::getCurrentResponse | ( | void | ) | const |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Invoke all "pre traversal" callbacks.
References ABORT, CONTINUE, SbList< Type >::getLength(), SoAction::getPathAppliedTo(), SoBase::getTypeId(), SoAction::getWhatAppliedTo(), PRUNE, and SoAction::setTerminated().
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Invoke all "post traversal" callbacks.
References ABORT, CONTINUE, SbList< Type >::getLength(), SoAction::getPathAppliedTo(), SoBase::getTypeId(), SoAction::getWhatAppliedTo(), PRUNE, and SoAction::setTerminated().
void SoCallbackAction::invokeTriangleCallbacks | ( | const SoShape *const | shape, |
const SoPrimitiveVertex *const | v1, | ||
const SoPrimitiveVertex *const | v2, | ||
const SoPrimitiveVertex *const | v3 ) |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Invoke all "triangle generation" callbacks.
References SbList< Type >::getLength(), and SoShape::getTypeId().
void SoCallbackAction::invokeLineSegmentCallbacks | ( | const SoShape *const | shape, |
const SoPrimitiveVertex *const | v1, | ||
const SoPrimitiveVertex *const | v2 ) |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Invoke all "line segment generation" callbacks.
References SbList< Type >::getLength(), and SoShape::getTypeId().
void SoCallbackAction::invokePointCallbacks | ( | const SoShape *const | shape, |
const SoPrimitiveVertex *const | v ) |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Invoke all "point" callbacks.
References SbList< Type >::getLength(), and SoShape::getTypeId().
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Check from the shape nodes whether or not to generate primitives from the complex shapes. If there are no callbacks attached to the node types, making the primitives would only be a waste of CPU.
References SbList< Type >::getLength(), and SoShape::getTypeId().
Referenced by SoShape::callback().
Returns the current tail of the traversal path for the callback action.
Reimplemented from SoAction.
Used from nodes during traversal to keep a current node pointer in the action.
This virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal.
It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction.
Default method just calls traverse(), which any overridden implementation of the method must do too (or call SoAction::beginTraversal()) to trigger the scenegraph traversal.
Reimplemented from SoAction.
References CONTINUE, SoAction::getState(), and SoAction::traverse().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Jan 22 2024 for Coin by Doxygen. 1.10.0