Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoIndexedLineSet.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 : Nick Thompson (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 : David Beilloin (Mar 2010)
48**=======================================================================*/
49
50
51#ifndef _SO_INDEXED_LINE_SET_
52#define _SO_INDEXED_LINE_SET_
53
54#include <Inventor/nodes/SoIndexedShape.h>
55#include <Inventor/SbPImpl.h>
56
57class SoState;
58class SoTangentBundle;
59
60SO_PIMPL_PUBLIC_DECLARATION(SoIndexedLineSet)
61
62
63//
64// Class: SoIndexedLineSet
65//
66// Indexed set of (poly)lines. Each line consists of 2 or more
67// vertices, each of which is denoted by an integer index (from the
68// coordIndex field) into the current coordinates. Depending on the
69// current material, normal and tangent binding values, the materials,
70// normals and tangents for the lines or vertices may be accessed in order or
71// indexed. If they are indexed, the materialIndex, normalIndex and tangentIndex
72// fields are used. Texture coordinates may also be indexed, using
73// the textureCoordIndex field.
74//
76
77// This coordinate index indicates that the current line ends and the
78// next line begins
79#define SO_END_LINE_INDEX (-1)
80
187{
188 SO_NODE_HEADER(SoIndexedLineSet);
189 SO_PIMPL_PUBLIC_HEADER(SoIndexedLineSet)
190
191public:
192 // Inherits all fields
193
198
199private:
201 virtual void GLRender( SoGLRenderAction* action );
202
207 virtual void getBoundingBox( SoGetBoundingBoxAction* action );
208
210 virtual void getPrimitiveCount( SoGetPrimitiveCountAction* action );
211
218 virtual void generateDefaultTangents( SoState* state,
219 const SbVec3f* coords,
220 int numCoords,
221 SoTangentBundle* tb,
222 SbBool storeRef = FALSE );
223private:
224
226 static void initClass();
228 static void exitClass();
229
230 // return num lines for test
231 virtual int getNumPrim( SoState* state = NULL );
232
233private:
234
235 // Generates line segments representing line set
236 virtual void generatePrimitives( SoAction* action );
237
238 // count the number of primitives in the shape
239 virtual void countPrim( SoState* state = NULL );
240
241 // really do the rendering part
242 virtual void doRendering( SoGLRenderAction* action, const SoShapeStyleElement* shapeStyle );
243
244 virtual void callSetupIndices( SoState* state, const SoShapeStyleElement* shapeStyle, uint32_t useTexCoordsAnyway );
245
246 // says wether to generate normals
247 virtual void shouldGenerateNormals( SoGLRenderAction* action,const SoShapeStyleElement* shapeStyle );
248
249 // setup lazy element
250 virtual void setupLazyElement(SoGLRenderAction *action, const SoShapeStyleElement *shapeStyle);
251
252 // says that rendering is PointOrLine
253 virtual SbBool isRenderingPointsOrLines( SoGLRenderAction* action );
254
255 // Overrides standard method to create an SoLineDetail instance
256 virtual SoDetail* createLineSegmentDetail( SoRayPickAction* action,
257 const SoPrimitiveVertex* v1,
258 const SoPrimitiveVertex* v2,
259 SoPickedPoint* pp );
260
262 virtual ~SoIndexedLineSet();
263};
264
265inline SbBool
266SoIndexedLineSet::isRenderingPointsOrLines( SoGLRenderAction* )
267{
268 return TRUE;
269}
270
271#endif /* _SO_INDEXED_LINE_SET_ */
272
273
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.
Computes bounding box of a scene.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Indexed polyline shape node.
SoIndexedLineSet()
Creates an indexed line set node with default settings.
Abstract base class for all 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
int SbBool
Boolean type.
Definition SbBase.h:87