Open Inventor Reference
SoVertexProperty Class Reference

Vertex property node. More...

#include <Inventor/nodes/SoVertexProperty.h>

Inheritance diagram for SoVertexProperty:
SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Binding {
  OVERALL = SoMaterialBindingElement::OVERALL, PER_PART = SoMaterialBindingElement::PER_PART, PER_PART_INDEXED = SoMaterialBindingElement::PER_PART_INDEXED, PER_FACE = SoMaterialBindingElement::PER_FACE,
  PER_FACE_INDEXED = SoMaterialBindingElement::PER_FACE_INDEXED, PER_VERTEX = SoMaterialBindingElement::PER_VERTEX, PER_VERTEX_INDEXED = SoMaterialBindingElement::PER_VERTEX_INDEXED
}

Public Member Functions

 SoVertexProperty ()
 When traversed in a scene graph, sets coordinates, normals, texture coordinates, diffuse colors, transparency, normal binding and material binding in current traversal state.
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 getBoundingBox (SoGetBoundingBoxAction *action)
virtual void callback (SoCallbackAction *action)
virtual void pick (SoPickAction *action)
void putVBOsIntoState (SoState *state)
 puts the VBOs into the SoGLVBOElement (MeVis ONLY)

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

SoMFVec3f vertex
 Fields:
SoMFVec2f texCoord
 Texture coordinate(s)
SoMFVec3f normal
 Normal vector(s)
SoSFEnum normalBinding
 Ignored unless normal field set.
SoMFUInt32 orderedRGBA
 Diffuse+transparency.
SoSFEnum materialBinding
 Ignored unless orderedRGBA field set.

Protected Member Functions

virtual ~SoVertexProperty ()

Protected Attributes

SoVBO_vertexVBO
SoVBO_colorVBO
SoVBO_normalVBO
SoVBO_texCoordVBO

Detailed Description

This property node may be used to efficiently specify coordinates, normals, texture coordinates, colors, transparency values, material binding and normal binding for vertex-based shapes, i.e., shapes of class SoVertexShape. An SoVertexProperty node can be used as a child of a group node in a scene graph, in which case the properties it specifies are inherited by subsequent shape nodes in the graph. It can also be directly referenced as the VertexProperty SoSFField of a vertex-based shape, bypassing scene graph inheritance.

When directly referenced by a VertexProperty SoSFField of a vertex-based shape, the SoVertexProperty node is the most efficient way of specifying vertex-based shapes. Use of the directly referenced SoVertexProperty node results in significantly faster scene rendering than scene graph inheritance of vertex properties, provided all required vertex properties are specified in the SoVertexProperty node.

Because the class SoVertexProperty is derived from SoNode, a vertex property node can be inserted as a child node in a scene graph. When inserted as a node in a scene graph, the SoVertexProperty node is traversed as any other property node and the properties it specifies are inherited by subsequent shape nodes in the scene graph. It specifies the current material and normal bindings, and can be used to specify the current 3D coordinates, the current normals, the current texture coordinates, the current diffuse colors, and the current transparencies.

All multiple-valued fields in the SoVertexProperty node are optional. If a field is not present (i.e. if it has 0 values), then shapes that require the missing information are required to obtain it from the current traversal state. However, users are cautioned that, for optimal performance, the vertex property node should be referenced as the VertexProperty field of an SoVertexShape, and should specify in its fields all values required to render that shape.

The various fields in a vertex property node can be used in place of corresponding fields in other property nodes, as follows: The vertex field contains 3D coordinates, as in the point field of an SoCoordinate3 node. The normal field contains normal vectors, as in the vector field of the SoNormal node. The orderedRGBA field contains packed colors in the hexadecimal format 0xrrggbbaa, where rr is the red value (between 00 and 0xFF hex) gg is the green value (between 00 and 0xFF hex) bb is the blue value (between 00 and 0xFF hex) aa is the alpha value (between 00 = transparent and 0xFF = opaque). The packed colors are equivalent to an SoPackedColor node, and provide values for both diffuse color and transparency. The texCoord field replaces the point field of the SoTextureCoordinate2 node.

If the transparency type is SoGLRenderAction::SCREEN_DOOR, only the first transparency value will be used. With other transparency types, multiple transparencies will be used.

The materialBinding field replaces the value field of the SoMaterialBinding node. The materialBinding field in a directly referenced SoVertexProperty node has no effect unless there is a nonempty orderedRGBA field, in which case the material binding specifies the assignment of diffuse colors and alpha values to the shape. The materialBinding field can take as value any of the material bindings supported by Inventor.

The normalBinding field replaces the value field of the SoNormalBinding node. The normalBinding field of a directly referenced SoVertexProperty node has no effect unless there is a nonempty normal field, in which case the normal binding specifies the assignment of normal vectors to the shape. The value of the normalBinding field can be any of the normal bindings supported by Inventor.

File Format/Default
Action Behavior
SoGetBoundingBoxAction
When traversed in a scene graph, sets coordinates in current traversal state. If not traversed, has no effect on current traversal state associated with action.
See Also
SoIndexedTriangleSet SoIndexedTriangleStripSet SoIndexedFaceSet SoIndexedLineSet SoTriangleStripSet SoLineSet SoFaceSet SoPointSet SoQuadMesh SoVertexShape SoIndexedShape SoNonindexedShape

Definition at line 194 of file SoVertexProperty.h.


Member Enumeration Documentation

Enumerator:
OVERALL 
PER_PART 
PER_PART_INDEXED 
PER_FACE 
PER_FACE_INDEXED 
PER_VERTEX 
PER_VERTEX_INDEXED 

Definition at line 208 of file SoVertexProperty.h.


Constructor & Destructor Documentation

SoVertexProperty::SoVertexProperty ( )

If not traversed, has no effect on current traversal state associated with action. The normalBinding field has no effect if there are no normals. The materialBinding has no effect if there are no packed colors.

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

Member Function Documentation

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

Reimplemented from SoNode.

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

The default implementation does nothing.

Reimplemented from SoNode.

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

Reimplemented from SoNode.

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

Reimplemented from SoNode.

static void SoVertexProperty::initClass ( ) [static]

Reimplemented from SoNode.

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

Reimplemented from SoNode.

void SoVertexProperty::putVBOsIntoState ( SoState state)

Member Data Documentation

Definition at line 243 of file SoVertexProperty.h.

Definition at line 244 of file SoVertexProperty.h.

Definition at line 245 of file SoVertexProperty.h.

Definition at line 242 of file SoVertexProperty.h.

Coordinate point(s)

Definition at line 201 of file SoVertexProperty.h.


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