Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoIndexedTriangleStripSet.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Gavin Bell (MMM yyyy)
25**=======================================================================*/
26/*=======================================================================
27 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
28 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
29 *** ***
30 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
31 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
32 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
33 *** ***
34 *** RESTRICTED RIGHTS LEGEND ***
35 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
36 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
37 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
38 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
39 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
40 *** ***
41 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49
50#ifndef _SO_INDEXED_TRIANGLE_STRIP_SET_
51#define _SO_INDEXED_TRIANGLE_STRIP_SET_
52
53#include <Inventor/nodes/SoIndexedShape.h>
54#include <Inventor/SbPImpl.h>
55
57class SoNormalBundle;
58
59SO_PIMPL_PUBLIC_DECLARATION(SoIndexedTriangleStripSet)
60
61
62//
63// Class: SoIndexedTriangleStripSet
64//
65// Indexed set of triangles strips. Strips are separated by the
66// special index SO_END_STRIP_INDEX (-1). The N indices in the strip
67// define N-2 triangles, which are formed by indexing into the
68// current coordinates. Depending on the current material and normal
69// binding values, the materials and normals for the triangles or
70// vertices may be accessed in order or indexed. If they are indexed,
71// the materialIndex and normalIndex fields are used.
72//
74
75// This coordinate index indicates that the current triangle ends and the
76// next triangle begins
77#define SO_END_STRIP_INDEX (-1)
78
161{
163 SO_PIMPL_PUBLIC_HEADER(SoIndexedTriangleStripSet)
164
165public:
169 int getNumStrips( SoState* state = NULL );
170
174 int getNumTriangles( SoState* state = NULL );
175
176 // Constructor
181
182private:
183 // Implements actions
184 virtual void GLRender( SoGLRenderAction* action );
185
186 virtual void getPrimitiveCount( SoGetPrimitiveCountAction* action );
187
188 // Generates default normals using the given normal bundle.
189 virtual void generateDefaultNormals( SoState* state,
190 const SbVec3f* coords,
191 int numCoords,
192 SoNormalBundle* nb,
193 SbBool storeRef = FALSE );
194
196 virtual void shouldGenerateTangents( SoGLRenderAction* /*action*/, const SoShapeStyleElement* /*shapeStyle*/ ) {}
197
198private:
199 static void initClass();
200 static void exitClass();
201
202 // return num vertices for test
203 virtual int getNumVert( SoState* state = NULL );
204
205 // return num strips for test
206 virtual int getNumPrim( SoState* state = NULL );
207
208private:
209 // This enum is used to indicate the current material or normal binding
210 enum Binding {
211 OVERALL,
212 PER_STRIP,
213 PER_STRIP_INDEXED,
214 PER_TRIANGLE,
215 PER_TRIANGLE_INDEXED,
216 PER_VERTEX,
217 PER_VERTEX_INDEXED
218 };
219
220 // Generates triangles representing strips
221 virtual void generatePrimitives( SoAction* action );
222
223 // count primitives
224 virtual void countPrim( SoState* state = NULL );
225
226 virtual void callSetupIndices( SoState* state, const SoShapeStyleElement* shapeStyle, uint32_t useTexCoordsAnyway );
227
228 // render function
229 void doRendering( SoGLRenderAction* action, const SoShapeStyleElement* shapeStyle );
230
231 // Overrides standard method to create an SoFaceDetail instance
232 virtual SoDetail* createTriangleDetail( SoRayPickAction* action,
233 const SoPrimitiveVertex* v1,
234 const SoPrimitiveVertex* v2,
235 const SoPrimitiveVertex* v3,
236 SoPickedPoint* pp );
237
239
240private:
241
242 static const int AUTO_CACHE_ITSS_MIN_WITHOUT_VP;
243 static const int AUTO_CACHE_ITSS_MAX;
244};
245
246#endif /* _SO_INDEXED_TRIANGLE_STRIP_SET_ */
3D vector class.
Definition SbVec.h:932
Abstract base class for all actions.
Definition SoAction.h:132
Stores the current coordinates.
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 indexed vertex-based shapes.
Indexed triangle strip set shape node.
int getNumStrips(SoState *state=NULL)
Returns number of strips.
int getNumTriangles(SoState *state=NULL)
Returns number of triangles.
SoIndexedTriangleStripSet()
Creates an indexed triangle strip set node with default settings.
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