Click or drag to resize
SoShapeHints Class

Node that provides hints about shapes.

Inheritance Hierarchy

Namespace: OIV.Inventor.Nodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 2024.2.2.0 (10.16.2.0)
Syntax
public class SoShapeHints : SoNode

The SoShapeHints type exposes the following members.

Constructors
  NameDescription
Public methodSoShapeHints

Creates a shape hints node with default settings.

Top
Methods
  NameDescription
Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoNode.)
Public methodCallback
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetPrimitiveCount
(Inherited from SoNode.)
Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoNode.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsBoundingBoxIgnoring

This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored.

(Inherited from SoNode.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override field.

(Overrides SoNodeIsOverride.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodStatic memberIsVBOSupported

Indicates if Vertex Buffer Object (VBO) is supported by your graphics board.

Public methodPick
Public methodRayPick
(Inherited from SoNode.)
Public methodSearch
(Inherited from SoNode.)
Public methodSet

Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Set the state of the override field.

(Overrides SoNodeSetOverride(Boolean).)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoNode.)
Top
Properties
  NameDescription
Public propertycreaseAngle

Indicates the minimum angle (in radians) between two adjacent face normals required to form a sharp crease at the edge when normal vectors are computed automatically by Open Inventor.

Public propertyfaceType

Indicates whether each face is convex.

Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertyneighborTolerance

Specifies the tolerance value to use when default normals are computed.

Public propertyshapeType

Indicates whether the shape is known to enclose a volume (SOLID) or not.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Public propertyuseVBO

This field controls whether subsequent shapes in the scene graph can use OpenGL Vertex Buffer Objects (VBO) to speed up rendering.

Public propertyvertexOrdering

Indicates how the vertices of faces are ordered.

Public propertywindingType

Indicates the winding rule used to define holes in a polygon.

Top
Remarks

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

These hints allow Open 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, Open 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. Summary:

Note: Two-sided lighting is automatically enabled for VolumeViz "slice" primitives, such as OIV.VolumeViz.Nodes.SoOrthoSlice and OIV.VolumeViz.Nodes.SoVolumeSkin.

This node allows the creation of polygons with holes. See the OIV.Inventor.Nodes.SoShapeHints.windingType field description, OIV.Inventor.Nodes.SoIndexedFaceSet, and OIV.Inventor.Nodes.SoFaceSet for details.

The OIV.Inventor.Nodes.SoShapeHints node also affects how default normals are generated. When a node derived from OIV.Inventor.Nodes.SoVertexShape has to generate default normals, it uses the OIV.Inventor.Nodes.SoShapeHints.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.

creaseAngle = 0 creaseAngle = 0.5 creaseAngle = PI

Smooth shaded means that the normal vectors of all the faces that share a vertex are averaged together to compute the normal vector for that vertex.

Normal averaging

Normal generation is fastest when the OIV.Inventor.Nodes.SoShapeHints.creaseAngle is 0 (the default), producing one normal per facet. However, if a vertex is shared by two (or more) faces that should be faceted, the result of normal generation will be multiple normal vectors (one for each face) associated with that vertex. This is in conflict with using OpenGL Vertex Buffer Objects (VBO), which usually provide the best performance. VBO rendering only allows per-vertex (not per-face) normal vectors and only one normal vector per vertex. Some high-level shapes, like OIV.Inventor.Nodes.SoIndexedFaceSet, will automatically reorganize the geometry data to produce the requested appearance and still use VBOs for rendering. Lower level shapes like OIV.Inventor.Nodes.SoBufferedShape will ignore the creaseAngle field and compute normals using a crease angle of Pi in order to use VBOs for rendering. A OIV.Inventor.Nodes.SoShapeHints.creaseAngle of Pi produces one averaged normal per vertex.

See OIV.Inventor.Nodes.SoVertexShape for more information about Vertex Buffer Objects and shape rendering.

FILE FORMAT/DEFAULT

ShapeHints {
vertexOrdering UNKNOWN_ORDERING
shapeType UNKNOWN_SHAPE_TYPE
faceType CONVEX
windingType NO_WINDING_TYPE
creaseAngle 0
neighborTolerance 1e-6
useVBO true
}

ACTION BEHAVIOR

OIV.Inventor.Actions.SoGLRenderAction, OIV.Inventor.Actions.SoCallbackAction, OIV.Inventor.Actions.SoRayPickAction, OIV.Inventor.Actions.SoGetBoundingBoxAction Sets the state to contain the hints; sets up optimizations based on the hints. Sets: OIV.Inventor.Elements.SoShapeHintsElement, OIV.Inventor.Elements.SoCreaseAngleElement, OIV.Inventor.Elements.SoNeighborToleranceElement

See Also