Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoFaceSet.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 : Paul S. Strauss (MMM yyyy)
25** Modified by : Gavin Bell (MMM yyyy)
26**=======================================================================*/
27/*=======================================================================
28 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
29 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
30 *** ***
31 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
32 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
33 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
34 *** ***
35 *** RESTRICTED RIGHTS LEGEND ***
36 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
37 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
38 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
39 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
40 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
41 *** ***
42 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, ***
43 *** BORDEAUX, FRANCE ***
44 *** ALL RIGHTS RESERVED ***
45**=======================================================================*/
46/*=======================================================================
47** Modified by : VSG (MMM YYYY)
48**=======================================================================*/
49
50
51#ifndef _SO_FACE_SET_
52#define _SO_FACE_SET_
53
54#include <Inventor/SbLinear.h>
55#include <Inventor/fields/SoMFInt32.h>
56#include <Inventor/nodes/SoNonIndexedShape.h>
57#include <Inventor/SbPImpl.h>
58
59
61//
62// Class: SoFaceSet
63//
64// Set of faces. Each face consists of 3 or more vertices, taken in
65// order from the current coordinates. The startIndex field gives the
66// starting coordinate index for the first face. The number of
67// vertices in each face is determined by successive entries in the
68// numVertices field.
69//
71
72// This value, when used in the numVertices field, means that the
73// corresponding face should use the rest of the vertices
74#define SO_FACE_SET_USE_REST_OF_VERTICES (-1)
75
76class SoNormalBundle;
77class SoState;
78class SoVolumeFaceSet;
79class IShapeVrtxImpl2ShapeVrtxAPI;
80
81SO_PIMPL_PUBLIC_DECLARATION(SoFaceSet)
82
83
229{
230 SO_NODE_HEADER(SoFaceSet);
231 SO_PIMPL_PUBLIC_HEADER(SoFaceSet)
232
233public:
234
239
244
245private:
246 // Implement actions
247 virtual void GLRender( SoGLRenderAction* action );
248
249 virtual void getPrimitiveCount( SoGetPrimitiveCountAction* action );
250
251 // Generates default normals using the given normal bundle.
252 // Returns TRUE.
253 virtual void generateDefaultNormals( SoState* state,
254 const SbVec3f* coords,
255 int numCoords,
256 SoNormalBundle* nb,
257 SbBool storeRef = FALSE );
258
260 virtual void shouldGenerateTangents( SoGLRenderAction* /*action*/, const SoShapeStyleElement* /*shapeStyle*/ ) {}
261
262private:
263
264 static void initClass();
265 static void exitClass();
266
267 virtual int getNumVert( SoState* state = NULL );
268
269 virtual int getNumPrim( SoState* state = NULL );
270
271private:
272
273 //shape must check shape hints in GlRender
274 virtual SbBool shouldCheckShapeHints(){ return TRUE; }
275
276 //Test function
277 virtual SbBool shapeHintsTest( SoState* state = NULL );
278
279 //Free memory
280 virtual void exitRender( SoState* state,
281 int stateFlag,
282 SoTextureCoordinateBundle* tcb,
283 SoTextureCoordinate3Bundle* tc3b);
284
285 virtual void countPrim( SoState* state = NULL );
286
287 // Generates triangles representing faces
288 virtual void generatePrimitives( SoAction* action );
289
290 // render function
291 void doRendering( SoGLRenderAction* action, const SoShapeStyleElement* shapeStyle );
292
293 // Overrides standard method to create an SoFaceDetail instance
294 virtual SoDetail* createTriangleDetail( SoRayPickAction* action,
295 const SoPrimitiveVertex* v1,
296 const SoPrimitiveVertex* v2,
297 const SoPrimitiveVertex* v3,
298 SoPickedPoint* pp );
299
300 ~SoFaceSet();
301
302 //When tesselating complex polygons, keep the result cached
303 virtual bool hasGeneratePrimitiveCache()
304 {
305 return true;
306 }
307
308private:
309
310 // set numTris/Quads/Faces to -1, checks SO_USE_REST_OF_VERTICES
311 // when notified
312 virtual void notify( SoNotList* list );
313
314private:
315
316 // This enum is used to indicate the current material or normal binding
317 enum Binding {
318 OVERALL, PER_FACE, PER_VERTEX
319 };
320
321 void commonConstructor();
322
323};
324
325#endif /* _SO_FACE_SET_ */
326
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
Polygonal face shape node.
Definition SoFaceSet.h:229
SoMFInt32 numVertices
Number of vertices per face or per contour.
Definition SoFaceSet.h:238
SoFaceSet()
Creates a face set node with default settings.
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...
Multiple-value field containing any number of int32_t integers.
Definition SoMFInt32.h:88
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.
Stores some information used by shapes.
Traversal state.
Definition SoState.h:74
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Polygonal face shape ...
int SbBool
Boolean type.
Definition SbBase.h:87