Open Inventor Reference
SoShapeHints Class Reference

Node that provides hints about shapes. More...

#include <Inventor/nodes/SoShapeHints.h>

Inheritance diagram for SoShapeHints:
SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  VertexOrdering { UNKNOWN_ORDERING = SoShapeHintsElement::UNKNOWN_ORDERING, CLOCKWISE = SoShapeHintsElement::CLOCKWISE, COUNTERCLOCKWISE = SoShapeHintsElement::COUNTERCLOCKWISE }
 Hints about ordering of face vertices: if ordering of all vertices of all faces is known to be consistent when viewed from "outside" shape or not. More...
enum  ShapeType { UNKNOWN_SHAPE_TYPE = SoShapeHintsElement::UNKNOWN_SHAPE_TYPE, SOLID = SoShapeHintsElement::SOLID }
 Hints about entire shape: if shape is known to be a solid object, as opposed to a surface. More...
enum  FaceType { UNKNOWN_FACE_TYPE = SoShapeHintsElement::UNKNOWN_FACE_TYPE, CONVEX = SoShapeHintsElement::CONVEX }
 Hints about faces of shape: if all faces are known to be convex or not. More...

Public Member Functions

 SoShapeHints ()
 Creates a shape hints node with default settings.
virtual void doAction (SoAction *action)
 This method performs the "typical" operation of a node for any action.
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void callback (SoCallbackAction *action)
virtual void pick (SoPickAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *action)

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

Fields
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.
SoSFEnum faceType
 Indicates whether each face is convex.
SoSFFloat creaseAngle
 Indicates the minimum angle (in radians) between two adjacent face normals required to form a sharp crease at the edge when default normals are computed and used.
SoSFBool useVBO
 Allows shapes to make use of vertex buffer objects if available.

Protected Member Functions

virtual ~SoShapeHints ()

Detailed Description

By default, Inventor assumes very little about the shapes it renders. You can use the SoShapeHints node to indicate that vertex-based shapes (those derived from SoVertexShape) are solid, contain ordered vertices, or contain convex faces. For fastest rendering, specify SOLID, COUNTERCLOCKWISE, CONVEX shapes.

These hints allow Inventor to optimize certain rendering features. Optimizations that may be performed include enabling back-face culling and disabling two-sided lighting. For example, if an object is solid and has ordered vertices, Inventor turns on backface culling and turns off two-sided lighting. If the object is not solid but has ordered vertices, it turns off backface culling and turns on two-sided lighting. In all other cases, both backface culling and two-sided lighting are off.

The SoShapeHints node also affects how default normals are generated. When a node derived from SoVertexShape has to generate default normals, it uses the creaseAngle field to determine which edges should be smooth-shaded and which ones should have a sharp crease. The crease angle is the angle between surface normals on adjacent polygons. For example, a crease angle of .5 radians means that an edge between two adjacent polygonal faces will be smooth shaded if the normals to the two faces form an angle that is less than .5 radians (about 30 degrees). Otherwise, it will be faceted. Normal generation is fastest when the creaseAngle is 0 (the default), producing one normal per facet. A creaseAngle of pi produces one averaged normal per vertex.

File Format/Default
Action Behavior
SoGLRenderAction, SoCallbackAction, SoRayPickAction, SoGetBoundingBoxAction
Sets the state to contain the hints; sets up optimizations based on the hints.
See Also
SoVertexShape

Definition at line 123 of file SoShapeHints.h.


Member Enumeration Documentation

Enumerator:
UNKNOWN_FACE_TYPE 
CONVEX 

Definition at line 146 of file SoShapeHints.h.

Enumerator:
UNKNOWN_SHAPE_TYPE 
SOLID 

Definition at line 139 of file SoShapeHints.h.

Enumerator:
UNKNOWN_ORDERING 
CLOCKWISE 
COUNTERCLOCKWISE 

Definition at line 131 of file SoShapeHints.h.


Constructor & Destructor Documentation

SoShapeHints::SoShapeHints ( )
virtual SoShapeHints::~SoShapeHints ( ) [protected, virtual]

Member Function Documentation

virtual void SoShapeHints::callback ( SoCallbackAction action) [virtual]

Reimplemented from SoNode.

virtual void SoShapeHints::doAction ( SoAction action) [virtual]

The default implementation does nothing.

Reimplemented from SoNode.

virtual void SoShapeHints::getBoundingBox ( SoGetBoundingBoxAction action) [virtual]

Reimplemented from SoNode.

virtual void SoShapeHints::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

static void SoShapeHints::initClass ( ) [static]

Reimplemented from SoNode.

virtual void SoShapeHints::pick ( SoPickAction action) [virtual]

Reimplemented from SoNode.


Member Data Documentation

Because the penalty for non-convex faces is very steep (faces must be triangulated expensively), the default assumes all faces are convex. Therefore, shapes with concave faces may not be displayed correctly unless this hint is set to UNKNOWN_FACE_TYPE.

Definition at line 170 of file SoShapeHints.h.

If the inside (the side away from the surface normal) of any part of the shape is visible, the shape is not solid.

Definition at line 163 of file SoShapeHints.h.

Definition at line 177 of file SoShapeHints.h.

CLOCKWISE ordering means that the vertices of each face form a clockwise loop around the face, when viewed from the outside (the side toward which the normal points).

Definition at line 158 of file SoShapeHints.h.


The documentation for this class was generated from the following file: