Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoShapeHints.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**=======================================================================*/
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-2017 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_SHAPE_HINTS_
51#define _SO_SHAPE_HINTS_
52
53#include <Inventor/elements/SoShapeHintsElement.h>
54#include <Inventor/fields/SoSFEnum.h>
55#include <Inventor/fields/SoSFFloat.h>
56#include <Inventor/fields/SoSFBool.h>
57#include <Inventor/nodes/SoNode.h>
58
60//
61// Class: SoShapeHints
62//
63// This node is used to give hints about subsequent shapes defined in
64// a scene graph. It allows Inventor to provide or optimize certain
65// features (such as back-face culling and two-sided lighting) based
66// on information about shapes. The vertexOrdering, faceType, and
67// shapeType fields hold this information. There is also a crease
68// angle field, which is used when default normals are generated for
69// a polyhedral shape. It defines the smallest edge angle that will
70// be shaded as a crease (faceted), rather than as smooth.
71//
73
171class SoShapeHints : public SoNode {
172
173 SO_NODE_HEADER(SoShapeHints);
174
175 public:
195
210
222
258
281
324
342
350
367
372
377
382 inline virtual void setOverride(const SbBool state)
383 { override.setValue(state); }
384
388 inline virtual SbBool isOverride() const
389 { return override.getValue(); }
390
391 private:
392 virtual void doAction(SoAction *action);
393 virtual void GLRender(SoGLRenderAction *action);
394 virtual void callback(SoCallbackAction *action);
395 virtual void pick(SoPickAction *action);
396 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
397
398 private:
399 static void initClass();
400 static void exitClass();
401
402 SoSFBool override;
403
404 private:
405 virtual ~SoShapeHints();
406
407 private:
408 // Does regular doAction stuff, also sets shapehints element
409 void doAction2(SoAction *action);
410};
411
412#endif /* _SO_SHAPE_HINTS_ */
413
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
Abstract base class for all database nodes.
Definition SoNode.h:145
Abstract base class for picking objects in a scene.
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
@ SOLID
Shape is known to be solid.
@ UNKNOWN_SHAPE_TYPE
Nothing is known about shape.
@ CONVEX
Faces are all convex.
@ UNKNOWN_FACE_TYPE
Nothing is known about faces.
@ UNKNOWN_ORDERING
No ordering info is known.
@ COUNTERCLOCKWISE
Vertices are ordered CCW around faces.
@ CLOCKWISE
Vertices are ordered CW around faces.
Node that provides hints about shapes.
virtual void setOverride(const SbBool state)
Set the state of the override field.
FaceType
Hints about faces of shape: if all faces are known to be convex or not.
@ CONVEX
All faces are convex.
@ UNKNOWN_FACE_TYPE
Nothing is known about faces.
SoSFEnum vertexOrdering
Indicates how the vertices of faces are ordered.
SoSFEnum shapeType
Indicates whether the shape is known to enclose a volume (SOLID) or not.
virtual SbBool isOverride() const
Returns the state of the override field.
SoShapeHints()
Creates a shape hints node with default settings.
SoSFEnum windingType
Indicates the winding rule used to define holes in a polygon.
SoSFFloat neighborTolerance
Specifies the tolerance value to use when default normals are computed.
SoSFBool useVBO
This field controls whether subsequent shapes in the scene graph can use OpenGL Vertex Buffer Objects...
SoSFEnum faceType
Indicates whether each face is convex.
VertexOrdering
Hints about ordering of face vertices: if ordering of all vertices of all faces is known to be consis...
@ COUNTERCLOCKWISE
Face vertices are ordered counterclockwise (from the outside)
@ UNKNOWN_ORDERING
Ordering of vertices is unknown.
@ CLOCKWISE
Face vertices are ordered clockwise (from the outside)
SoSFFloat creaseAngle
Indicates the minimum angle (in radians) between two adjacent face normals required to form a sharp c...
ShapeType
Hints about entire shape: if shape is known to be a solid object, as opposed to a surface.
@ UNKNOWN_SHAPE_TYPE
Nothing is known about the shape.
@ SOLID
The shape encloses a volume.
WindingType
Winding type possible values.
@ ABS_GEQ_TWO_TYPE
Regions with winding numbers whose absolute value is greater than or equal to two are filled.
@ NEGATIVE_TYPE
Regions with negative winding numbers are filled.
@ NON_ZERO_TYPE
Regions with non-zero winding numbers are filled.
@ POSITIVE_TYPE
Regions with positive winding numbers are filled.
@ ODD_TYPE
Regions with odd winding numbers are filled.
@ NO_WINDING_TYPE
Draw without holes (default).
static SbBool isVBOSupported()
Indicates if Vertex Buffer Object (VBO) is supported by your graphics board.
int SbBool
Boolean type.
Definition SbBase.h:87