SoCallbackAction.h
#ifndef COIN_SOCALLBACKACTION_H
#define COIN_SOCALLBACKACTION_H
/**************************************************************************\
* Copyright (c) Kongsberg Oil & Gas Technologies AS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\**************************************************************************/
// FIXME: Support getTextureFilename[s]() ? (kintel 20011205)
#include <Inventor/actions/SoAction.h>
#include <Inventor/actions/SoSubAction.h>
#include <Inventor/elements/SoDecimationTypeElement.h>
#include <Inventor/lists/SbList.h>
#include <Inventor/nodes/SoComplexity.h>
#include <Inventor/nodes/SoDrawStyle.h>
#include <Inventor/nodes/SoLightModel.h>
#include <Inventor/nodes/SoMaterialBinding.h>
#include <Inventor/nodes/SoNormalBinding.h>
#include <Inventor/nodes/SoPickStyle.h>
#include <Inventor/nodes/SoShapeHints.h>
#include <Inventor/nodes/SoTexture2.h>
#include <Inventor/nodes/SoTextureCoordinateBinding.h>
#include <Inventor/nodes/SoUnits.h>
class SbColor;
class SbMatrix;
class SbVec2f;
class SbVec2s;
class SbVec3f;
class SbVec4f;
class SbViewVolume;
class SoCallbackAction;
class SoCallbackActionP;
class SoCallbackData;
class SoPrimitiveVertex;
class SoShape;
class SbViewportRegion;
typedef void SoTriangleCB(void * userdata, SoCallbackAction * action,
const SoPrimitiveVertex * v1,
const SoPrimitiveVertex * v2,
const SoPrimitiveVertex * v3);
typedef void SoLineSegmentCB(void * userdata, SoCallbackAction * action,
const SoPrimitiveVertex * v1,
const SoPrimitiveVertex * v2);
typedef void SoPointCB(void * userdata, SoCallbackAction * action,
const SoPrimitiveVertex * v);
class COIN_DLL_API SoCallbackAction : public SoAction {
typedef SoAction inherited;
SO_ACTION_HEADER(SoCallbackAction);
public:
static void initClass(void);
SoCallbackAction(void);
SoCallbackAction(const SbViewportRegion & vp);
virtual ~SoCallbackAction(void);
void setViewportRegion(const SbViewportRegion & vp);
enum Response { CONTINUE, ABORT, PRUNE };
typedef Response SoCallbackActionCB(void * userdata,
SoCallbackAction * action,
const SoNode * node);
void addPreCallback(const SoType type, SoCallbackActionCB * cb, void * userdata);
void addPostCallback(const SoType type, SoCallbackActionCB * cb, void * userdata);
void addPreTailCallback(SoCallbackActionCB * cb, void * userdata);
void addPostTailCallback(SoCallbackActionCB * cb, void * userdata);
void addTriangleCallback(const SoType type, SoTriangleCB * cb, void * userdata);
void addLineSegmentCallback(const SoType type, SoLineSegmentCB * cb, void * userdata);
void addPointCallback(const SoType type, SoPointCB * cb, void * userdata);
SoDecimationTypeElement::Type getDecimationType(void) const;
float getDecimationPercentage(void) const;
float getComplexity(void) const;
SoComplexity::Type getComplexityType(void) const;
int32_t getNumCoordinates(void) const;
const SbVec3f & getCoordinate3(const int index) const;
const SbVec4f & getCoordinate4(const int index) const;
SoDrawStyle::Style getDrawStyle(void) const;
unsigned short getLinePattern(void) const;
float getLineWidth(void) const;
float getPointSize(void) const;
const SbName & getFontName(void) const;
float getFontSize(void) const;
SoLightModel::Model getLightModel(void) const;
const SbVec3f & getLightAttenuation(void) const;
void getMaterial(SbColor & ambient, SbColor & diffuse,
SbColor & specular, SbColor & emission,
float & shininess, float & transparency,
const int index = 0) const;
SoMaterialBinding::Binding getMaterialBinding(void) const;
uint32_t getNumNormals(void) const;
const SbVec3f & getNormal(const int index) const;
SoNormalBinding::Binding getNormalBinding(void) const;
int32_t getNumProfileCoordinates(void) const;
const SbVec2f & getProfileCoordinate2(const int index) const;
const SbVec3f & getProfileCoordinate3(const int index) const;
const SoNodeList & getProfile(void) const;
SoShapeHints::VertexOrdering getVertexOrdering(void) const;
SoShapeHints::ShapeType getShapeType(void) const;
SoShapeHints::FaceType getFaceType(void) const;
float getCreaseAngle(void) const;
int32_t getNumTextureCoordinates(void) const;
const SbVec2f & getTextureCoordinate2(const int index) const;
const SbVec3f & getTextureCoordinate3(const int index) const;
const SbVec4f & getTextureCoordinate4(const int index) const;
SoTextureCoordinateBinding::Binding getTextureCoordinateBinding(void) const;
const SbColor & getTextureBlendColor(void) const;
const unsigned char * getTextureImage(SbVec2s & size, int & numcomps) const;
const unsigned char * getTextureImage(SbVec3s & size, int & numcomps) const;
const SbMatrix & getTextureMatrix(void) const;
SoTexture2::Model getTextureModel(void) const;
SoTexture2::Wrap getTextureWrapS(void) const;
SoTexture2::Wrap getTextureWrapT(void) const;
SoTexture2::Wrap getTextureWrapR(void) const;
const SbMatrix & getModelMatrix(void) const;
SoUnits::Units getUnits(void) const;
float getFocalDistance(void) const;
const SbMatrix & getProjectionMatrix(void) const;
const SbMatrix & getViewingMatrix(void) const;
const SbViewVolume & getViewVolume(void) const;
const SbViewportRegion & getViewportRegion(void) const;
SoPickStyle::Style getPickStyle(void) const;
int32_t getSwitch(void) const;
Response getCurrentResponse(void) const;
void invokePreCallbacks(const SoNode * const node);
void invokePostCallbacks(const SoNode * const node);
void invokeTriangleCallbacks(const SoShape * const shape,
const SoPrimitiveVertex * const v1,
const SoPrimitiveVertex * const v2,
const SoPrimitiveVertex * const v3);
void invokeLineSegmentCallbacks(const SoShape * const shape,
const SoPrimitiveVertex * const v1,
const SoPrimitiveVertex * const v2);
void invokePointCallbacks(const SoShape * const shape,
const SoPrimitiveVertex * const v);
SbBool shouldGeneratePrimitives(const SoShape * shape) const;
virtual SoNode * getCurPathTail(void);
void setCurrentNode(SoNode * const node);
void setCallbackAll(SbBool callbackall);
SbBool isCallbackAll(void) const;
protected:
virtual void beginTraversal(SoNode * node);
private:
void commonConstructor(void);
private:
SbPimplPtr<SoCallbackActionP> pimpl;
friend class SoCallbackActionP;
SoCallbackAction(const SoCallbackAction & rhs);
SoCallbackAction & operator = (const SoCallbackAction & rhs);
}; // SoCallbackAction
#endif // !COIN_SOCALLBACKACTION_H
SbColor
The SbColor class contains the red, green and blue components which make up a color value.
Definition SbColor.h:39
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition SbMatrix.h:47
SbName
The SbName class stores strings by reference.
Definition SbName.h:40
SbPimplPtr
Definition SbPimplPtr.h:55
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:49
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:51
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:51
SbVec3s
The SbVec3s class is a 3 dimensional vector with short integer coordinates.
Definition SbVec3s.h:51
SbVec4f
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition SbVec4f.h:49
SbViewVolume
The SbViewVolume class is a viewing volume in 3D space.
Definition SbViewVolume.h:50
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition SbViewportRegion.h:40
SoAction::getCurPathTail
virtual SoNode * getCurPathTail(void)
Definition SoAction.cpp:1117
SoAction::initClass
static void initClass(void)
Definition SoAction.cpp:370
SoAction::SoAction
SoAction(void)
Definition SoAction.cpp:337
SoAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition SoAction.cpp:1269
SoCallbackAction
The SoCallbackAction class invokes callbacks at specific nodes.
Definition SoCallbackAction.h:80
SoCallbackAction::getTextureCoordinate3
const SbVec3f & getTextureCoordinate3(const int index) const
Definition SoCallbackAction.cpp:926
SoCallbackAction::getTextureWrapT
SoTexture2::Wrap getTextureWrapT(void) const
Definition SoCallbackAction.cpp:1014
SoCallbackAction::Response
Response
Definition SoCallbackAction.h:94
SoCallbackAction::PRUNE
@ PRUNE
Definition SoCallbackAction.h:94
SoCallbackAction::CONTINUE
@ CONTINUE
Definition SoCallbackAction.h:94
SoCallbackAction::ABORT
@ ABORT
Definition SoCallbackAction.h:94
SoCallbackAction::getVertexOrdering
SoShapeHints::VertexOrdering getVertexOrdering(void) const
Definition SoCallbackAction.cpp:845
SoCallbackAction::setViewportRegion
void setViewportRegion(const SbViewportRegion &vp)
Definition SoCallbackAction.cpp:455
SoCallbackAction::getNumTextureCoordinates
int32_t getNumTextureCoordinates(void) const
Definition SoCallbackAction.cpp:902
SoCallbackAction::getViewingMatrix
const SbMatrix & getViewingMatrix(void) const
Definition SoCallbackAction.cpp:1072
SoCallbackAction::getProfileCoordinate3
const SbVec3f & getProfileCoordinate3(const int index) const
Definition SoCallbackAction.cpp:822
SoCallbackAction::getFontSize
float getFontSize(void) const
Definition SoCallbackAction.cpp:719
SoCallbackAction::getTextureMatrix
const SbMatrix & getTextureMatrix(void) const
Definition SoCallbackAction.cpp:987
SoCallbackAction::getNormalBinding
SoNormalBinding::Binding getNormalBinding(void) const
Definition SoCallbackAction.cpp:793
SoCallbackAction::getComplexityType
SoComplexity::Type getComplexityType(void) const
Definition SoCallbackAction.cpp:636
SoCallbackAction::getPointSize
float getPointSize(void) const
Definition SoCallbackAction.cpp:701
SoCallbackAction::SoCallbackActionCB
Response SoCallbackActionCB(void *userdata, SoCallbackAction *action, const SoNode *node)
Definition SoCallbackAction.h:96
SoCallbackAction::getTextureBlendColor
const SbColor & getTextureBlendColor(void) const
Definition SoCallbackAction.cpp:956
SoCallbackAction::getFocalDistance
float getFocalDistance(void) const
Definition SoCallbackAction.cpp:1054
SoCallbackAction::invokePostCallbacks
void invokePostCallbacks(const SoNode *const node)
Definition SoCallbackAction.cpp:1165
SoCallbackAction::getTextureCoordinate4
const SbVec4f & getTextureCoordinate4(const int index) const
Definition SoCallbackAction.cpp:936
SoCallbackAction::getCreaseAngle
float getCreaseAngle(void) const
Definition SoCallbackAction.cpp:892
SoCallbackAction::getProfileCoordinate2
const SbVec2f & getProfileCoordinate2(const int index) const
Definition SoCallbackAction.cpp:813
SoCallbackAction::getFaceType
SoShapeHints::FaceType getFaceType(void) const
Definition SoCallbackAction.cpp:878
SoCallbackAction::getNumProfileCoordinates
int32_t getNumProfileCoordinates(void) const
Definition SoCallbackAction.cpp:804
SoCallbackAction::addTriangleCallback
void addTriangleCallback(const SoType type, SoTriangleCB *cb, void *userdata)
Definition SoCallbackAction.cpp:573
SoCallbackAction::getNumCoordinates
int32_t getNumCoordinates(void) const
Definition SoCallbackAction.cpp:645
SoCallbackAction::getCoordinate4
const SbVec4f & getCoordinate4(const int index) const
Definition SoCallbackAction.cpp:665
SoCallbackAction::getPickStyle
SoPickStyle::Style getPickStyle(void) const
Definition SoCallbackAction.cpp:1101
SoCallbackAction::getUnits
SoUnits::Units getUnits(void) const
Definition SoCallbackAction.cpp:1045
SoCallbackAction::getNormal
const SbVec3f & getNormal(const int index) const
Definition SoCallbackAction.cpp:784
SoCallbackAction::getTextureCoordinateBinding
SoTextureCoordinateBinding::Binding getTextureCoordinateBinding(void) const
Definition SoCallbackAction.cpp:945
SoCallbackAction::getLinePattern
unsigned short getLinePattern(void) const
Definition SoCallbackAction.cpp:683
SoCallbackAction::getProjectionMatrix
const SbMatrix & getProjectionMatrix(void) const
Definition SoCallbackAction.cpp:1063
SoCallbackAction::getFontName
const SbName & getFontName(void) const
Definition SoCallbackAction.cpp:710
SoCallbackAction::getLineWidth
float getLineWidth(void) const
Definition SoCallbackAction.cpp:692
SoCallbackAction::getMaterialBinding
SoMaterialBinding::Binding getMaterialBinding(void) const
Definition SoCallbackAction.cpp:764
SoCallbackAction::getDrawStyle
SoDrawStyle::Style getDrawStyle(void) const
Definition SoCallbackAction.cpp:674
SoCallbackAction::getTextureWrapR
SoTexture2::Wrap getTextureWrapR(void) const
Definition SoCallbackAction.cpp:1027
SoCallbackAction::addPreTailCallback
void addPreTailCallback(SoCallbackActionCB *cb, void *userdata)
Definition SoCallbackAction.cpp:546
SoCallbackAction::getTextureWrapS
SoTexture2::Wrap getTextureWrapS(void) const
Definition SoCallbackAction.cpp:1005
SoCallbackAction::getTextureCoordinate2
const SbVec2f & getTextureCoordinate2(const int index) const
Definition SoCallbackAction.cpp:912
SoCallbackAction::setCurrentNode
void setCurrentNode(SoNode *const node)
Definition SoCallbackAction.cpp:1271
SoCallbackAction::getShapeType
SoShapeHints::ShapeType getShapeType(void) const
Definition SoCallbackAction.cpp:861
SoCallbackAction::getTextureModel
SoTexture2::Model getTextureModel(void) const
Definition SoCallbackAction.cpp:996
SoCallbackAction::getViewportRegion
const SbViewportRegion & getViewportRegion(void) const
Definition SoCallbackAction.cpp:1092
SoCallbackAction::addPointCallback
void addPointCallback(const SoType type, SoPointCB *cb, void *userdata)
Definition SoCallbackAction.cpp:597
SoCallbackAction::shouldGeneratePrimitives
SbBool shouldGeneratePrimitives(const SoShape *shape) const
Definition SoCallbackAction.cpp:1244
SoCallbackAction::getSwitch
int32_t getSwitch(void) const
Definition SoCallbackAction.cpp:1110
SoCallbackAction::addPreCallback
void addPreCallback(const SoType type, SoCallbackActionCB *cb, void *userdata)
Definition SoCallbackAction.cpp:524
SoCallbackAction::getDecimationPercentage
float getDecimationPercentage(void) const
Definition SoCallbackAction.cpp:618
SoCallbackAction::getCurrentResponse
Response getCurrentResponse(void) const
Definition SoCallbackAction.cpp:1121
SoCallbackAction::getLightModel
SoLightModel::Model getLightModel(void) const
Definition SoCallbackAction.cpp:728
SoCallbackAction::getProfile
const SoNodeList & getProfile(void) const
Definition SoCallbackAction.cpp:831
SoCallbackAction::invokeLineSegmentCallbacks
void invokeLineSegmentCallbacks(const SoShape *const shape, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2)
Definition SoCallbackAction.cpp:1213
SoCallbackAction::invokeTriangleCallbacks
void invokeTriangleCallbacks(const SoShape *const shape, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2, const SoPrimitiveVertex *const v3)
Definition SoCallbackAction.cpp:1197
SoCallbackAction::getModelMatrix
const SbMatrix & getModelMatrix(void) const
Definition SoCallbackAction.cpp:1036
SoCallbackAction::getViewVolume
const SbViewVolume & getViewVolume(void) const
Definition SoCallbackAction.cpp:1081
SoCallbackAction::SoCallbackAction
SoCallbackAction(void)
Definition SoCallbackAction.cpp:419
SoCallbackAction::getDecimationType
SoDecimationTypeElement::Type getDecimationType(void) const
Definition SoCallbackAction.cpp:609
SoCallbackAction::addPostCallback
void addPostCallback(const SoType type, SoCallbackActionCB *cb, void *userdata)
Definition SoCallbackAction.cpp:535
SoCallbackAction::invokePreCallbacks
void invokePreCallbacks(const SoNode *const node)
Definition SoCallbackAction.cpp:1132
SoCallbackAction::addLineSegmentCallback
void addLineSegmentCallback(const SoType type, SoLineSegmentCB *cb, void *userdata)
Definition SoCallbackAction.cpp:585
SoCallbackAction::addPostTailCallback
void addPostTailCallback(SoCallbackActionCB *cb, void *userdata)
Definition SoCallbackAction.cpp:559
SoCallbackAction::getMaterial
void getMaterial(SbColor &ambient, SbColor &diffuse, SbColor &specular, SbColor &emission, float &shininess, float &transparency, const int index=0) const
Definition SoCallbackAction.cpp:747
SoCallbackAction::getNumNormals
uint32_t getNumNormals(void) const
Definition SoCallbackAction.cpp:775
SoCallbackAction::getComplexity
float getComplexity(void) const
Definition SoCallbackAction.cpp:627
SoCallbackAction::getLightAttenuation
const SbVec3f & getLightAttenuation(void) const
Definition SoCallbackAction.cpp:737
SoCallbackAction::getTextureImage
const unsigned char * getTextureImage(SbVec2s &size, int &numcomps) const
Definition SoCallbackAction.cpp:965
SoCallbackAction::getCoordinate3
const SbVec3f & getCoordinate3(const int index) const
Definition SoCallbackAction.cpp:655
SoCallbackAction::invokePointCallbacks
void invokePointCallbacks(const SoShape *const shape, const SoPrimitiveVertex *const v)
Definition SoCallbackAction.cpp:1228
SoComplexity::Type
Type
Definition SoComplexity.h:50
SoDecimationTypeElement::Type
Type
Definition SoDecimationTypeElement.h:48
SoDrawStyle::Style
Style
Definition SoDrawStyle.h:52
SoLightModel::Model
Model
Definition SoLightModel.h:49
SoMaterialBinding::Binding
Binding
Definition SoMaterialBinding.h:49
SoNodeList
The SoNodeList class is a container for pointers to SoNode objects.
Definition SoNodeList.h:40
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
SoNormalBinding::Binding
Binding
Definition SoNormalBinding.h:49
SoPickStyle::Style
Style
Definition SoPickStyle.h:49
SoPrimitiveVertex
The SoPrimitiveVertex class represents a single vertex of a generated primitive.
Definition SoPrimitiveVertex.h:43
SoShapeHints::FaceType
FaceType
Definition SoShapeHints.h:62
SoShapeHints::VertexOrdering
VertexOrdering
Definition SoShapeHints.h:51
SoShapeHints::ShapeType
ShapeType
Definition SoShapeHints.h:57
SoShape
The SoShape class is the superclass for geometry shapes.
Definition SoShape.h:52
SoTexture2::Wrap
Wrap
Definition SoTexture2.h:65
SoTexture2::Model
Model
Definition SoTexture2.h:58
SoTextureCoordinateBinding::Binding
Binding
Definition SoTextureCoordinateBinding.h:49
SoType
The SoType class is the basis for the runtime type system in Coin.
Definition SoType.h:59
SoUnits::Units
Units
Definition SoUnits.h:51