SoCallbackAction.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoCallbackAction.h
1 #ifndef COIN_SOCALLBACKACTION_H
2 #define COIN_SOCALLBACKACTION_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 // FIXME: Support getTextureFilename[s]() ? (kintel 20011205)
28
29 #include <Inventor/actions/SoAction.h>
30 #include <Inventor/actions/SoSubAction.h>
31 #include <Inventor/elements/SoDecimationTypeElement.h>
32 #include <Inventor/lists/SbList.h>
33 #include <Inventor/nodes/SoComplexity.h>
34 #include <Inventor/nodes/SoDrawStyle.h>
35 #include <Inventor/nodes/SoLightModel.h>
36 #include <Inventor/nodes/SoMaterialBinding.h>
37 #include <Inventor/nodes/SoNormalBinding.h>
38 #include <Inventor/nodes/SoPickStyle.h>
39 #include <Inventor/nodes/SoShapeHints.h>
40 #include <Inventor/nodes/SoTexture2.h>
41 #include <Inventor/nodes/SoTextureCoordinateBinding.h>
42 #include <Inventor/nodes/SoUnits.h>
43
44 class SbColor;
45 class SbMatrix;
46 class SbVec2f;
47 class SbVec2s;
48 class SbVec3f;
49 class SbVec4f;
50 class SbViewVolume;
51 class SoCallbackAction;
52 class SoCallbackActionP;
53 class SoCallbackData;
54 class SoPrimitiveVertex;
55 class SoShape;
56 class SbViewportRegion;
57
58 typedef void SoTriangleCB(void * userdata, SoCallbackAction * action,
59 const SoPrimitiveVertex * v1,
60 const SoPrimitiveVertex * v2,
61 const SoPrimitiveVertex * v3);
62
63 typedef void SoLineSegmentCB(void * userdata, SoCallbackAction * action,
64 const SoPrimitiveVertex * v1,
65 const SoPrimitiveVertex * v2);
66
67 typedef void SoPointCB(void * userdata, SoCallbackAction * action,
68 const SoPrimitiveVertex * v);
69
70
71 class COIN_DLL_API SoCallbackAction : public SoAction {
72 typedef SoAction inherited;
73
74 SO_ACTION_HEADER(SoCallbackAction);
75
76 public:
77 static void initClass(void);
78
79 SoCallbackAction(void);
80 SoCallbackAction(const SbViewportRegion & vp);
81 virtual ~SoCallbackAction(void);
82
83 void setViewportRegion(const SbViewportRegion & vp);
84
85 enum Response { CONTINUE, ABORT, PRUNE };
86
87 typedef Response SoCallbackActionCB(void * userdata,
88 SoCallbackAction * action,
89 const SoNode * node);
90
91 void addPreCallback(const SoType type, SoCallbackActionCB * cb, void * userdata);
92 void addPostCallback(const SoType type, SoCallbackActionCB * cb, void * userdata);
93
94 void addPreTailCallback(SoCallbackActionCB * cb, void * userdata);
95 void addPostTailCallback(SoCallbackActionCB * cb, void * userdata);
96
97 void addTriangleCallback(const SoType type, SoTriangleCB * cb, void * userdata);
98 void addLineSegmentCallback(const SoType type, SoLineSegmentCB * cb, void * userdata);
99 void addPointCallback(const SoType type, SoPointCB * cb, void * userdata);
100
101 SoDecimationTypeElement::Type getDecimationType(void) const;
102 float getDecimationPercentage(void) const;
103 float getComplexity(void) const;
104 SoComplexity::Type getComplexityType(void) const;
105 int32_t getNumCoordinates(void) const;
106 const SbVec3f & getCoordinate3(const int index) const;
107 const SbVec4f & getCoordinate4(const int index) const;
108 SoDrawStyle::Style getDrawStyle(void) const;
109 unsigned short getLinePattern(void) const;
110 float getLineWidth(void) const;
111 float getPointSize(void) const;
112 const SbName & getFontName(void) const;
113 float getFontSize(void) const;
114 SoLightModel::Model getLightModel(void) const;
115 const SbVec3f & getLightAttenuation(void) const;
116 void getMaterial(SbColor & ambient, SbColor & diffuse,
117 SbColor & specular, SbColor & emission,
118 float & shininess, float & transparency,
119 const int index = 0) const;
120 SoMaterialBinding::Binding getMaterialBinding(void) const;
121 uint32_t getNumNormals(void) const;
122 const SbVec3f & getNormal(const int index) const;
123 SoNormalBinding::Binding getNormalBinding(void) const;
124 int32_t getNumProfileCoordinates(void) const;
125 const SbVec2f & getProfileCoordinate2(const int index) const;
126 const SbVec3f & getProfileCoordinate3(const int index) const;
127 const SoNodeList & getProfile(void) const;
128 SoShapeHints::VertexOrdering getVertexOrdering(void) const;
129 SoShapeHints::ShapeType getShapeType(void) const;
130 SoShapeHints::FaceType getFaceType(void) const;
131 float getCreaseAngle(void) const;
132 int32_t getNumTextureCoordinates(void) const;
133 const SbVec2f & getTextureCoordinate2(const int index) const;
134 const SbVec3f & getTextureCoordinate3(const int index) const;
135 const SbVec4f & getTextureCoordinate4(const int index) const;
136 SoTextureCoordinateBinding::Binding getTextureCoordinateBinding(void) const;
137 const SbColor & getTextureBlendColor(void) const;
138 const unsigned char * getTextureImage(SbVec2s & size, int & numcomps) const;
139 const unsigned char * getTextureImage(SbVec3s & size, int & numcomps) const;
140 const SbMatrix & getTextureMatrix(void) const;
141 SoTexture2::Model getTextureModel(void) const;
142 SoTexture2::Wrap getTextureWrapS(void) const;
143 SoTexture2::Wrap getTextureWrapT(void) const;
144 SoTexture2::Wrap getTextureWrapR(void) const;
145 const SbMatrix & getModelMatrix(void) const;
146 SoUnits::Units getUnits(void) const;
147 float getFocalDistance(void) const;
148 const SbMatrix & getProjectionMatrix(void) const;
149 const SbMatrix & getViewingMatrix(void) const;
150 const SbViewVolume & getViewVolume(void) const;
151 const SbViewportRegion & getViewportRegion(void) const;
152 SoPickStyle::Style getPickStyle(void) const;
153 int32_t getSwitch(void) const;
154
155 Response getCurrentResponse(void) const;
156 void invokePreCallbacks(const SoNode * const node);
157 void invokePostCallbacks(const SoNode * const node);
158 void invokeTriangleCallbacks(const SoShape * const shape,
159 const SoPrimitiveVertex * const v1,
160 const SoPrimitiveVertex * const v2,
161 const SoPrimitiveVertex * const v3);
162 void invokeLineSegmentCallbacks(const SoShape * const shape,
163 const SoPrimitiveVertex * const v1,
164 const SoPrimitiveVertex * const v2);
165 void invokePointCallbacks(const SoShape * const shape,
166 const SoPrimitiveVertex * const v);
167
168 SbBool shouldGeneratePrimitives(const SoShape * shape) const;
169
170 virtual SoNode * getCurPathTail(void);
171 void setCurrentNode(SoNode * const node);
172
173 void setCallbackAll(SbBool callbackall);
174 SbBool isCallbackAll(void) const;
175
176 protected:
177 virtual void beginTraversal(SoNode * node);
178
179 private:
180 void commonConstructor(void);
181
182 private:
183 SbPimplPtr<SoCallbackActionP> pimpl;
184 friend class SoCallbackActionP;
185
186 SoCallbackAction(const SoCallbackAction & rhs);
187 SoCallbackAction & operator = (const SoCallbackAction & rhs);
188 }; // SoCallbackAction
189
190 #endif // !COIN_SOCALLBACKACTION_H
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec2f.h:39
SbColor
The SbColor class contains the red, green and blue components which make up a color value...
Definition: SbColor.h:30
SoAction::initClass
static void initClass(void)
Definition: SoAction.cpp:366
SoShapeHints::FaceType
FaceType
Definition: SoShapeHints.h:53
SoPrimitiveVertex
The SoPrimitiveVertex class represents a single vertex of a generated primitive.Instances of SoPrimit...
Definition: SoPrimitiveVertex.h:34
SbVec4f
The SbVec4f class is a 4 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec4f.h:40
SoShapeHints::ShapeType
ShapeType
Definition: SoShapeHints.h:48
SoUnits::Units
Units
Definition: SoUnits.h:42
SoShapeHints::VertexOrdering
VertexOrdering
Definition: SoShapeHints.h:42
SoDrawStyle::Style
Style
Definition: SoDrawStyle.h:43
SoComplexity::Type
Type
Definition: SoComplexity.h:41
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SoAction::getCurPathTail
virtual SoNode * getCurPathTail(void)
Definition: SoAction.cpp:1111
SbVec3s
The SbVec3s class is a 3 dimensional vector with short integer coordinates.This vector class provides...
Definition: SbVec3s.h:39
SoAction
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
SoTextureCoordinateBinding::Binding
Binding
Definition: SoTextureCoordinateBinding.h:40
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
SoTexture2::Wrap
Wrap
Definition: SoTexture2.h:56
SoCallbackAction::Response
Response
Definition: SoCallbackAction.h:85
SoLightModel::Model
Model
Definition: SoLightModel.h:40
SoTexture2::Model
Model
Definition: SoTexture2.h:49
SoDecimationTypeElement::Type
Type
Definition: SoDecimationTypeElement.h:39
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.SbMatrix is used by many other cla...
Definition: SbMatrix.h:37
SoCallbackAction::SoCallbackActionCB
Response SoCallbackActionCB(void *userdata, SoCallbackAction *action, const SoNode *node)
Definition: SoCallbackAction.h:87
SbViewVolume
The SbViewVolume class is a viewing volume in 3D space.This class contains the necessary information ...
Definition: SbViewVolume.h:41
SoCallbackAction
The SoCallbackAction class invokes callbacks at specific nodes.This action has mechanisms for trackin...
Definition: SoCallbackAction.h:71
SoNodeList
The SoNodeList class is a container for pointers to SoNode objects.
Definition: SoNodeList.h:31
SoAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1263
SoPickStyle::Style
Style
Definition: SoPickStyle.h:40
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31
SoShape
The SoShape class is the superclass for geometry shapes.The node types which have actual geometry to ...
Definition: SoShape.h:43
SoNormalBinding::Binding
Binding
Definition: SoNormalBinding.h:40
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41
SoType
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50
SbName
The SbName class stores strings by reference.The class is used by Coin for storing keywords...
Definition: SbName.h:31
SoMaterialBinding::Binding
Binding
Definition: SoMaterialBinding.h:40

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.