1SoCallbackAction(3IV)()                                SoCallbackAction(3IV)()
2
3
4

NAME

6       SoCallbackAction — performs a generic traversal of the scene graph
7

INHERITS FROM

9       SoAction > SoCallbackAction
10

SYNOPSIS

12       #include <Inventor/actions/SoCallbackAction.h>
13
14     typedef void        SoTriangleCB(void *userData,
15                               SoCallbackAction *action,
16                               const SoPrimitiveVertex *v1,
17                               const SoPrimitiveVertex *v2,
18                               const SoPrimitiveVertex *v3)
19     typedef void        SoLineSegmentCB(void *userData,
20                               SoCallbackAction *action,
21                               const SoPrimitiveVertex *v1,
22                               const SoPrimitiveVertex *v2)
23     typedef void        SoPointCB(void *userData,
24                               SoCallbackAction *action,
25                               const SoPrimitiveVertex *v)
26     typedef SoCallbackAction::Response
27                         SoCallbackActionCB(void *userData,
28                               SoCallbackAction *action,
29                               const SoNode *node)
30
31     enum Response {
32          SoCallbackAction::CONTINUE  Continue  traversal  as  if nothing hap‐
33                                           pened
34          SoCallbackAction::ABORT     Abort traversal
35          SoCallbackAction::PRUNE     Do not  traverse  node's  children,  but
36                                           continue traversal
37     }
38
39          Methods from class SoCallbackAction:
40
41                                 SoCallbackAction()
42     void                        addPreCallback(SoType   type,   SoCallbackAc‐
43                                      tionCB *cb, void *data)
44     void                        addPostCallback(SoType  type,   SoCallbackAc‐
45                                      tionCB *cb, void *data)
46     void                        addPreTailCallback(SoCallbackActionCB    *cb,
47                                      void *data)
48     void                        addPostTailCallback(SoCallbackActionCB   *cb,
49                                      void *data)
50     void                        addTriangleCallback(SoType type, SoTriangleCB
51                                      *cb, void *data)
52     void                        addLineSegmentCallback(SoType  type,  SoLine‐
53                                      SegmentCB *cb, void *data)
54     void                        addPointCallback(SoType  type, SoPointCB *cb,
55                                      void *data)
56     float                       getComplexity() const
57     SoComplexity::Type          getComplexityType() const
58     int32_t                     getNumCoordinates() const
59     const SbVec3f &             getCoordinate3(int index) const
60     const SbVec4f &             getCoordinate4(int index) const
61     SoDrawStyle::Style          getDrawStyle() const
62     unsigned short              getLinePattern() const
63     float                       getLineWidth() const
64     float                       getPointSize() const
65     const SbName &              getFontName() const
66     float                       getFontSize() const
67     SoLightModel::Model         getLightModel() const
68     const SbVec3f &             getLightAttenuation() const
69     void                        getMaterial(SbColor &ambient,  SbColor  &dif‐
70                                      fuse,  SbColor &specular, SbColor &emis‐
71                                      sion, float  &shininess,  float  &trans‐
72                                      parency, int mtlIndex = 0) const
73     SoMaterialBinding::Binding  getMaterialBinding() const
74     long                        getNumNormals() const
75     const SbVec3f &             getNormal(int index) const
76     SoNormalBinding::Binding    getNormalBinding() const
77     int32_t                     getNumProfileCoordinates() const
78     const SbVec2f &             getProfileCoordinate2(int index) const
79     const SbVec3f &             getProfileCoordinate3(int index) const
80     const SoNodeList &          getProfile() const
81     SoShapeHints::VertexOrdering
82                                 getVertexOrdering() const
83     SoShapeHints::ShapeType     getShapeType() const
84     SoShapeHints::FaceType      getFaceType() const
85     float                       getCreaseAngle() const
86     int32_t                     getNumTextureCoordinates() const
87     const SbVec2f &             getTextureCoordinate2(int index) const
88     const SbVec4f &             getTextureCoordinate4(int index) const
89     SoTextureCoordinateBinding::Binding
90                                 getTextureCoordinateBinding() const
91     const SbColor &             getTextureBlendColor() const
92     const unsigned char *       getTextureImage(SbVec2s &size, int &numComps)
93                                      const
94     const SbMatrix &            getTextureMatrix() const
95     SoTexture2::Model           getTextureModel() const
96     SoTexture2::Wrap            getTextureWrapS() const
97     SoTexture2::Wrap            getTextureWrapT() const
98     const SbMatrix &            getModelMatrix() const
99     SoUnits::Units              getUnits() const
100     float                       getFocalDistance() const
101     const SbMatrix &            getProjectionMatrix() const
102     const SbMatrix &            getViewingMatrix() const
103     const SbViewVolume &        getViewVolume() const
104     SoPickStyle::Style          getPickStyle() const
105     int32_t                     getSwitch() const
106
107          Methods from class SoAction:
108
109     virtual void        apply(SoNode *node)
110     virtual void        apply(SoPath *path)
111     virtual void        apply(const SoPathList &pathList, SbBool obeysRules =
112                              FALSE)
113     static SoType       getClassTypeId()
114     virtual SoType      getTypeId()
115     virtual SbBool      isOfType(SoType type)
116     virtual void        invalidateState()
117
118

DESCRIPTION

120       This  action  defines  a generic traversal of the scene graph. The user
121       can specify callback functions for node types or paths; when those node
122       types  or  paths  are encountered during traversal, the user's callback
123       function is called.
124
125       In addition, callback functions can be registered for primitives gener‐
126       ated by shapes in the scene graph. Most shape types can generate primi‐
127       tives that represent or approximate their geometries.  Triangle  primi‐
128       tives are used for all surfaces (such as cubes, face sets, or 3D text),
129       line segment primitives are used for line shapes, and point  primitives
130       are  used  for point shapes. Note that the type of primitives generated
131       for a shape is the same, regardless of drawing style or  other  proper‐
132       ties.
133
134       Most of the methods on this class access information from the traversal
135       state. They should be  called  only  by  callback  functions  that  are
136       invoked during traversal, so there is a valid state to work with.
137

METHODS

139                                 SoCallbackAction()
140          The constructor.
141
142     void                        addPreCallback(SoType   type,   SoCallbackAc‐
143                                      tionCB *cb, void *data)
144     void                        addPostCallback(SoType  type,   SoCallbackAc‐
145                                      tionCB *cb, void *data)
146          These  add a callback function to call when a node of the given type
147          is encountered during traversal.  The  PreCallback  is  called  just
148          before  the  node  is traversed, and the PostCallback is called just
149          after.  The value returned by a callback function indicates  whether
150          the action should continue with the traversal.
151
152     void                        addPreTailCallback(SoCallbackActionCB    *cb,
153                                      void *data)
154     void                        addPostTailCallback(SoCallbackActionCB   *cb,
155                                      void *data)
156          These  can  be  used  to  set up callback functions to call when the
157          action is applied to a path. The functions are called just before or
158          after the node at the tail of the path is traversed.
159
160     void                        addTriangleCallback(SoType type, SoTriangleCB
161                                      *cb, void *data)
162     void                        addLineSegmentCallback(SoType  type,  SoLine‐
163                                      SegmentCB *cb, void *data)
164     void                        addPointCallback(SoType  type, SoPointCB *cb,
165                                      void *data)
166          Routines to add callbacks for generated primitives (triangles,  line
167          segments, and points) for all shapes of the given type. The callback
168          function will be called for each primitive generated for all  shapes
169          of or derived from that type.
170
171     float                       getComplexity() const
172     SoComplexity::Type          getComplexityType() const
173          Returns complexity information from the state.
174
175     int32_t                     getNumCoordinates() const
176     const SbVec3f &             getCoordinate3(int index) const
177     const SbVec4f &             getCoordinate4(int index) const
178          Returns the current coordinates from the state.
179
180     SoDrawStyle::Style          getDrawStyle() const
181     unsigned short              getLinePattern() const
182     float                       getLineWidth() const
183     float                       getPointSize() const
184          Returns the current drawing style information from the state.
185
186     const SbName &              getFontName() const
187     float                       getFontSize() const
188          Returns the current font information from the state.
189
190     SoLightModel::Model         getLightModel() const
191     const SbVec3f &             getLightAttenuation() const
192          Returns the current lighting model information from the state.
193
194     void                        getMaterial(SbColor  &ambient,  SbColor &dif‐
195                                      fuse, SbColor &specular, SbColor  &emis‐
196                                      sion,  float  &shininess,  float &trans‐
197                                      parency, int mtlIndex = 0) const
198     SoMaterialBinding::Binding  getMaterialBinding() const
199          Returns the current material information from the state. Providing a
200          mtlIndex will return the material defined for that index.
201
202     long                        getNumNormals() const
203     const SbVec3f &             getNormal(int index) const
204     SoNormalBinding::Binding    getNormalBinding() const
205          Returns the current normal information from the state.
206
207     int32_t                     getNumProfileCoordinates() const
208     const SbVec2f &             getProfileCoordinate2(int index) const
209     const SbVec3f &             getProfileCoordinate3(int index) const
210     const SoNodeList &          getProfile() const
211          Returns the current profiles and their coordinates from the state.
212
213     SoShapeHints::VertexOrdering
214                                 getVertexOrdering() const
215     SoShapeHints::ShapeType     getShapeType() const
216     SoShapeHints::FaceType      getFaceType() const
217     float                       getCreaseAngle() const
218          Returns the current shape hints from the state.
219
220     int32_t                     getNumTextureCoordinates() const
221     const SbVec2f &             getTextureCoordinate2(int index) const
222     const SbVec4f &             getTextureCoordinate4(int index) const
223     SoTextureCoordinateBinding::Binding
224                                 getTextureCoordinateBinding() const
225     const SbColor &             getTextureBlendColor() const
226     const unsigned char *       getTextureImage(SbVec2s &size, int &numComps)
227                                      const
228          Returns texture information  from  the  state.  getNumTextureCoordi‐
229          nates()   returns  0 if texture coordinates are generated by a func‐
230          tion. getTextureImage()  returns NULL if no texture is enabled.
231
232     const SbMatrix &            getTextureMatrix() const
233     SoTexture2::Model           getTextureModel() const
234     SoTexture2::Wrap            getTextureWrapS() const
235     SoTexture2::Wrap            getTextureWrapT() const
236          Returns the current texture mapping information from the state.
237
238     const SbMatrix &            getModelMatrix() const
239     SoUnits::Units              getUnits() const
240          Returns the current modeling transformation and  the  current  units
241          from the state.
242
243     float                       getFocalDistance() const
244     const SbMatrix &            getProjectionMatrix() const
245     const SbMatrix &            getViewingMatrix() const
246     const SbViewVolume &        getViewVolume() const
247          Returns the current camera and viewing information from the state.
248
249     SoPickStyle::Style          getPickStyle() const
250          Returns the current picking style.
251
252     int32_t                     getSwitch() const
253          Returns the current switch value.
254
255

SEE ALSO

257       SoCallback, SoEventCallback, SoShape
258
259
260
261
262                                                       SoCallbackAction(3IV)()
Impressum