| 1 |
NAME SoShapeHints SoShapeHints "" { node that provides hints about shapes } |
| 2 |
|
| 3 |
INCLUDE nodes/SoShapeHints.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
By default, Inventor assumes very little about the shapes it renders. |
| 7 |
You can use the \cSoShapeHints\. node to indicate that vertex-based |
| 8 |
shapes (those derived from \cSoVertexShape\.) are solid, contain |
| 9 |
ordered vertices, or contain convex faces. For fastest rendering, |
| 10 |
specify SOLID, COUNTERCLOCKWISE, CONVEX shapes. |
| 11 |
\p |
| 12 |
These hints allow Inventor to optimize certain rendering features. |
| 13 |
Optimizations that may be performed include enabling back-face culling |
| 14 |
and disabling two-sided lighting. For example, if an object is solid |
| 15 |
and has ordered vertices, Inventor turns on backface culling and turns |
| 16 |
off two-sided lighting. If the object is not solid but has ordered |
| 17 |
vertices, it turns off backface culling and turns on two-sided |
| 18 |
lighting. In all other cases, both backface culling and two-sided |
| 19 |
lighting are off. |
| 20 |
\p |
| 21 |
The \cSoShapeHints\. node also affects how default normals are |
| 22 |
generated. When a node derived from \cSoVertexShape\. has to generate |
| 23 |
default normals, it uses the \vcreaseAngle\. field to determine which |
| 24 |
edges should be smooth-shaded and which ones should have a sharp |
| 25 |
crease. The crease angle is the angle between surface normals on |
| 26 |
adjacent polygons. For example, a crease angle of .5 radians |
| 27 |
means that an edge between two adjacent polygonal faces |
| 28 |
will be smooth shaded if the normals to the two faces form an angle |
| 29 |
that is less than .5 radians (about 30 degrees). Otherwise, it will |
| 30 |
be faceted. Normal generation is fastest when the creaseAngle is 0 |
| 31 |
(the default), producing one normal per facet. A creaseAngle of pi |
| 32 |
produces one averaged normal per vertex. |
| 33 |
} |
| 34 |
|
| 35 |
ENUM VertexOrdering { |
| 36 |
UNKNOWN_ORDERING "Ordering of vertices is unknown", |
| 37 |
CLOCKWISE "Face vertices are ordered clockwise |
| 38 |
(from the outside)", |
| 39 |
COUNTERCLOCKWISE "Face vertices are ordered counterclockwise |
| 40 |
(from the outside)" |
| 41 |
} |
| 42 |
|
| 43 |
ENUM ShapeType { |
| 44 |
UNKNOWN_SHAPE_TYPE "Nothing is known about the shape", |
| 45 |
SOLID "The shape encloses a volume" |
| 46 |
} |
| 47 |
|
| 48 |
ENUM FaceType { |
| 49 |
UNKNOWN_FACE_TYPE "Nothing is known about faces", |
| 50 |
CONVEX "All faces are convex" |
| 51 |
} |
| 52 |
|
| 53 |
FIELD vertexOrdering { |
| 54 |
Indicates how the vertices of faces are ordered. \kCLOCKWISE\. |
| 55 |
ordering means that the vertices of each face form a clockwise loop |
| 56 |
around the face, when viewed from the outside (the side toward which |
| 57 |
the normal points). |
| 58 |
} |
| 59 |
|
| 60 |
FIELD shapeType { |
| 61 |
Indicates whether the shape is known to enclose a volume (\kSOLID\.) |
| 62 |
or not. If the inside (the side away from the surface normal) of any |
| 63 |
part of the shape is visible, the shape is not solid. |
| 64 |
} |
| 65 |
|
| 66 |
FIELD faceType { |
| 67 |
Indicates whether each face is convex. Because the penalty for |
| 68 |
non-convex faces is very steep (faces must be triangulated |
| 69 |
expensively), the default assumes all faces are convex. Therefore, |
| 70 |
shapes with concave faces may not be displayed correctly unless this |
| 71 |
hint is set to \kUNKNOWN_FACE_TYPE\.. |
| 72 |
} |
| 73 |
|
| 74 |
FIELD creaseAngle { |
| 75 |
Indicates the minimum angle (in radians) between two adjacent face |
| 76 |
normals required to form a sharp crease at the edge when default |
| 77 |
normals are computed and used. |
| 78 |
} |
| 79 |
|
| 80 |
METHOD "" SoShapeHints() { |
| 81 |
Creates a shape hints node with default settings. |
| 82 |
} |
| 83 |
|
| 84 |
METHOD "" static SoType getClassTypeId() { |
| 85 |
Returns type identifier for this class. |
| 86 |
} |
| 87 |
|
| 88 |
ACTION SoGLRenderAction, SoCallbackAction, SoRayPickAction, |
| 89 |
SoGetBoundingBoxAction { |
| 90 |
Sets the state to contain the hints; sets up optimizations based on |
| 91 |
the hints. |
| 92 |
} |
| 93 |
|
| 94 |
ALSO { SoVertexShape } |