Open Inventor Release 2025.1.0
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
SoIndexedTriangleSet.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_INDEXED_TRIANGLE_SET_
26#define _SO_INDEXED_TRIANGLE_SET_
27
28#include <Inventor/nodes/SoIndexedShape.h>
29#include <Inventor/SbPImpl.h>
30
31class SoNormalBundle;
33class SoVolumeIndexedTriangleSet;
34
35SO_PIMPL_PUBLIC_DECLARATION(SoIndexedTriangleSet)
36
37//@TOBEWRAPPED
118class SoIndexedTriangleSet : public SoIndexedShape
119{
120 SO_NODE_HEADER(SoIndexedTriangleSet);
121 SO_PIMPL_PUBLIC_HEADER(SoIndexedTriangleSet)
122
123public:
124 // Inherits fields
125
130
131private:
132 // Implements actions
133
135 virtual void GLRender( SoGLRenderAction* action );
136
138 virtual void generateDefaultNormals( SoState* state,
139 const SbVec3f* coords,
140 int numCoords,
141 SoNormalBundle* nb,
142 SbBool storeRef = FALSE );
143
145 virtual void shouldGenerateTangents( SoGLRenderAction* /*action*/, const SoShapeStyleElement* /*shapeStyle*/ ) {}
146
148 virtual void getPrimitiveCount( SoGetPrimitiveCountAction* action );
149
150private:
151
153 static void initClass();
154
156 static void exitClass();
157
158 // set numTris/Quads/Faces to -1 when notified
159 virtual void notify( SoNotList* list );
160
161 // Compute the number of vertices. This is just an approximation,
162 //so using 5 verts per unknown polygon is close enough.
163 virtual int getNumPrim( SoState* state = NULL );
164
165private:
166
167 // This enum is used to indicate the current material or normal binding
168 enum Binding {
169 OVERALL, PER_FACE, PER_FACE_INDEXED, PER_VERTEX,
170 PER_VERTEX_INDEXED
171 };
172
173 virtual SbBool shouldGenerateTexture3DCoordinates(){return TRUE;}
174
175 virtual void callSetupIndices( SoState* state, const SoShapeStyleElement* shapeStyle, uint32_t useTexCoordsAnyway );
176
177 //Wether to check or not 3d tex coords
178 virtual SbBool checkTex3Coords(){return TRUE;}
179
180 int getNumPrim( SoState* state, int& _numTris );
181
182 virtual void countPrim( SoState* state = NULL );
183
184 // Generates triangles representing faces
185 virtual void generatePrimitives( SoAction* action);
186
187 // render function
188 virtual void doRendering(SoGLRenderAction* action, const SoShapeStyleElement* shapeStyle);
189
190 // Overrides standard method to create an SoFaceDetail instance
191 virtual SoDetail *createTriangleDetail( SoRayPickAction* action,
192 const SoPrimitiveVertex* v1,
193 const SoPrimitiveVertex* v2,
194 const SoPrimitiveVertex* v3,
195 SoPickedPoint* pp);
196
197 // destructor
198 virtual ~SoIndexedTriangleSet();
199
200private:
201
204};
205
206#endif /* _SO_INDEXED_TRIANGLE_SET_ */
207
208
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...
Indexed triangle shape node.
friend class SoVolumeIndexedTriangleSet
SoIndexedTriangleSet()
Creates an indexed triangle set node with default settings.
friend class SoVolumeIndexedTriangleSetDl
Represents point on surface of picked object.
Represents a vertex of a generated primitive.
Intersects objects with a ray cast into scene.
Stores some information used by shapes.
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87