1SoShapeHints(3IV)() SoShapeHints(3IV)()
2
3
4
6 SoShapeHints — node that provides hints about shapes
7
9 SoBase > SoFieldContainer > SoNode > SoShapeHints
10
12 #include <Inventor/nodes/SoShapeHints.h>
13
14 enum VertexOrdering {
15 SoShapeHints::UNKNOWN_ORDERING
16 Ordering of vertices is unknown
17 SoShapeHints::CLOCKWISE Face vertices are ordered clockwise (from
18 the outside)
19 SoShapeHints::COUNTERCLOCKWISE
20 Face vertices are ordered counterclockwise
21 (from the outside)
22 }
23
24 enum ShapeType {
25 SoShapeHints::UNKNOWN_SHAPE_TYPE
26 Nothing is known about the shape
27 SoShapeHints::SOLID The shape encloses a volume
28 }
29
30 enum FaceType {
31 SoShapeHints::UNKNOWN_FACE_TYPE
32 Nothing is known about faces
33 SoShapeHints::CONVEX All faces are convex
34 }
35
36 Fields from class SoShapeHints:
37
38 SoSFEnum vertexOrdering
39 SoSFEnum shapeType
40 SoSFEnum faceType
41 SoSFFloat creaseAngle
42
43 Methods from class SoShapeHints:
44
45 SoShapeHints()
46 static SoType getClassTypeId()
47
48 Methods from class SoNode:
49
50 void setOverride(SbBool state)
51 SbBool isOverride() const
52 SoNode * copy(SbBool copyConnections = FALSE) const
53 virtual SbBool affectsState() const
54 static SoNode * getByName(const SbName &name)
55 static int getByName(const SbName &name, SoNodeList &list)
56
57 Methods from class SoFieldContainer:
58
59 void setToDefaults()
60 SbBool hasDefaultValues() const
61 SbBool fieldsAreEqual(const SoFieldContainer *fc) const
62 void copyFieldValues(const SoFieldContainer *fc, SbBool
63 copyConnections = FALSE)
64 SbBool set(const char *fieldDataString)
65 void get(SbString &fieldDataString)
66 virtual int getFields(SoFieldList &resultList) const
67 virtual SoField * getField(const SbName &fieldName) const
68 SbBool getFieldName(const SoField *field, SbName &fieldName)
69 const
70 SbBool isNotifyEnabled() const
71 SbBool enableNotify(SbBool flag)
72
73 Methods from class SoBase:
74
75 void ref()
76 void unref() const
77 void unrefNoDelete() const
78 void touch()
79 virtual SoType getTypeId() const
80 SbBool isOfType(SoType type) const
81 virtual void setName(const SbName &name)
82 virtual SbName getName() const
83
84
86 By default, Inventor assumes very little about the shapes it renders.
87 You can use the SoShapeHints node to indicate that vertex-based shapes
88 (those derived from SoVertexShape) are solid, contain ordered vertices,
89 or contain convex faces. For fastest rendering, specify SOLID, COUNTER‐
90 CLOCKWISE, CONVEX shapes.
91
92 These hints allow Inventor to optimize certain rendering features.
93 Optimizations that may be performed include enabling back-face culling
94 and disabling two-sided lighting. For example, if an object is solid
95 and has ordered vertices, Inventor turns on backface culling and turns
96 off two-sided lighting. If the object is not solid but has ordered ver‐
97 tices, it turns off backface culling and turns on two-sided lighting.
98 In all other cases, both backface culling and two-sided lighting are
99 off.
100
101 The SoShapeHints node also affects how default normals are generated.
102 When a node derived from SoVertexShape has to generate default normals,
103 it uses the creaseAngle field to determine which edges should be
104 smooth-shaded and which ones should have a sharp crease. The crease
105 angle is the angle between surface normals on adjacent polygons. For
106 example, a crease angle of .5 radians means that an edge between two
107 adjacent polygonal faces will be smooth shaded if the normals to the
108 two faces form an angle that is less than .5 radians (about 30
109 degrees). Otherwise, it will be faceted. Normal generation is fastest
110 when the creaseAngle is 0 (the default), producing one normal per
111 facet. A creaseAngle of pi produces one averaged normal per vertex.
112
114 SoSFEnum vertexOrdering
115 Indicates how the vertices of faces are ordered. CLOCKWISE ordering
116 means that the vertices of each face form a clockwise loop around
117 the face, when viewed from the outside (the side toward which the
118 normal points).
119
120 SoSFEnum shapeType
121 Indicates whether the shape is known to enclose a volume (SOLID) or
122 not. If the inside (the side away from the surface normal) of any
123 part of the shape is visible, the shape is not solid.
124
125 SoSFEnum faceType
126 Indicates whether each face is convex. Because the penalty for non-
127 convex faces is very steep (faces must be triangulated expensively),
128 the default assumes all faces are convex. Therefore, shapes with
129 concave faces may not be displayed correctly unless this hint is set
130 to UNKNOWN_FACE_TYPE.
131
132 SoSFFloat creaseAngle
133 Indicates the minimum angle (in radians) between two adjacent face
134 normals required to form a sharp crease at the edge when default
135 normals are computed and used.
136
137
139 SoShapeHints()
140 Creates a shape hints node with default settings.
141
142 static SoType getClassTypeId()
143 Returns type identifier for this class.
144
145
147 SoGLRenderAction, SoCallbackAction, SoRayPickAction, SoGetBoundingBox‐
148 Action
149 Sets the state to contain the hints; sets up optimizations based on
150 the hints.
151
152
154 ShapeHints {
155 vertexOrdering UNKNOWN_ORDERING
156 shapeType UNKNOWN_SHAPE_TYPE
157 faceType CONVEX
158 creaseAngle 0
159 }
160
162 SoVertexShape
163
164
165
166
167 SoShapeHints(3IV)()