Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoTriangleSet.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : David Beilloin (Mar 2011)
22** Modified by : VSG (MMM YYYY)
23**=======================================================================*/
24
25#ifndef _SO_TRIANGLE_SET_
26#define _SO_TRIANGLE_SET_
27
28#include <Inventor/fields/SoSFInt32.h>
29#include <Inventor/nodes/SoNonIndexedShape.h>
30#include <Inventor/SbPImpl.h>
31
32// This value, when used in the numTriangles field, means that the
33// corresponding set should use the rest of the vertices
34#define SO_TRIANGLE_SET_USE_REST_OF_VERTICES (-1)
35
36class SoNormalBundle;
37class SoState;
38
39SO_PIMPL_PUBLIC_DECLARATION(SoTriangleSet)
40
41//@TOBEWRAPPED
123{
124 SO_NODE_HEADER(SoTriangleSet);
125 SO_PIMPL_PUBLIC_HEADER(SoTriangleSet)
126
127public:
128
135
140
141private:
142 // Implement actions
143
145 virtual void GLRender( SoGLRenderAction* action );
146
148 virtual void getPrimitiveCount( SoGetPrimitiveCountAction* action );
149
151 virtual void generateDefaultNormals( SoState* state,
152 const SbVec3f* coords,
153 int numCoords,
154 SoNormalBundle* nb,
155 SbBool storeRef = FALSE );
156
158 virtual void shouldGenerateTangents( SoGLRenderAction* /*action*/, const SoShapeStyleElement* /*shapeStyle*/ ) {}
159
160private:
161
163 static void initClass();
164
166 static void exitClass();
167
168 virtual int getNumVert( SoState* state = NULL );
169
170 virtual int getNumPrim( SoState* state = NULL );
171
172private:
173
174 // This enum is used to indicate the current material or normal binding
175 enum Binding {
176 OVERALL,
177 PER_FACE,
178 PER_VERTEX
179 };
180
181 //Free memory
182 virtual void exitRender( SoState* state,
183 int stateFlag,
184 SoTextureCoordinateBundle* tcb,
185 SoTextureCoordinate3Bundle* tc3b);
186
187 virtual void countPrim( SoState* state = NULL );
188
189 // Generates triangles representing faces
190 virtual void generatePrimitives( SoAction* action );
191
192 // render function
193 void doRendering( SoGLRenderAction* action, const SoShapeStyleElement* shapeStyle );
194
195 // Overrides standard method to create an SoFaceDetail instance
196 virtual SoDetail* createTriangleDetail( SoRayPickAction* action,
197 const SoPrimitiveVertex* v1,
198 const SoPrimitiveVertex* v2,
199 const SoPrimitiveVertex* v3,
200 SoPickedPoint* pp);
201
204
205private:
206
207 // reset numTris to -1, to rechecks SO_USE_REST_OF_VERTICES usage when notified
208 virtual void notify( SoNotList* list );
209
210private:
211
212 friend class SoVolumeTriangleSetDl;
213};
214
215#endif /* _SO_TRIANGLE_SET_ */
216
3D vector class.
Definition SbVec.h:932
Abstract base class for all actions.
Definition SoAction.h:132
Base class for describing detail information about a shape node.
Definition SoDetail.h:99
Renders a scene graph using Open Inventor's Render Engine.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Abstract base class for all non-indexed vertex-based shapes.
Represents point on surface of picked object.
Represents a vertex of a generated primitive.
Intersects objects with a ray cast into scene.
Field containing a int32_t integer.
Definition SoSFInt32.h:80
Stores some information used by shapes.
Traversal state.
Definition SoState.h:74
Set of triangles shape node.
SoTriangleSet()
Creates a triangle set node with default settings.
SoSFInt32 numTriangles
Number of triangles in the set.
int SbBool
Boolean type.
Definition SbBase.h:87