SoVertexProperty Class Reference
[Properties]

Vertex property node. More...

#include <Inventor/nodes/SoVertexProperty.h>

Inheritance diagram for SoVertexProperty:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Classes

class  ValidityBits
 Helper structure used to return status of various vertex properties A bit set to true mean the attribute is valid.

Public Types

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

Public Member Functions

virtual SoType getTypeId () const
 SoVertexProperty ()
virtual void setOverride (const SbBool state)
virtual SbBool isOverride () const

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoMFVec3f vertex
SoMFVec2f texCoord
SoMFVec3f texCoord3
SoSFBool forceSending
SoMFVec3f normal
SoMFVec3f tangent
SoSFEnum normalBinding
SoSFEnum tangentBinding
SoMFUInt32 orderedRGBA
SoSFEnum materialBinding

Detailed Description

Vertex property node.

This property node is be used to efficiently specify coordinates, normals, tangents, texture coordinates, colors, transparency values, material binding, normal and tangent binding for vertex-based shapes, i.e., shapes derived from 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 using the vertexProperty field of a vertex-based shape, bypassing scene graph inheritance. Direct referencing is the recommended practice.

When directly referenced by a VertexProperty field 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, normal and tangent bindings, and can be used to specify the current 3D coordinates, the current normals, the current tangents, 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, developers 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.

Fields:

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.
    Normal vectors are used (for example) to compute the effect of lighting on the shape when lighting is enabled.

  • The tangent field contains tangent vectors.
    When not using any custom shader, tangents are used by line shapes to compute the effect of lighting on the shape when lighting is enabled. See SoLineSet and SoIndexedLineSet for more details.

  • The orderedRGBA field contains packed color+transparency values.
    Colors are specified 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). Packed colors use less memory than SoMaterial colors and can be sent directly to the GPU. A packed color value can be queried from an SbColor or SbColorRGBA object using the getPackedValue() method. The packed colors are equivalent to an SoPackedColor node, and provide values for both diffuse color and transparency.

  • The texCoord and texCoord3 fields contain texture coordinates, as in the point field of the SoTextureCoordinate2 and SoTextureCoordinate3 nodes.
If one of these nodes appears higher in the scene graph and setOverride(true) was called on that node, those values are used instead of the corresponding field of the vertex property node.
Note: Calling setIgnored(true) on the fields of this node has no effect on its behavior.

Color:

If setOverride() was called on an SoMaterial node higher in the scene graph and either the diffuseColor field or the transparency field is not ignored (setIgnored()), then the color and transparency values from the SoMaterial node are used instead of the values in the SoVertexProperty. It is not currently possible to override just the color or just the transparency.

Transparency:

The default transparency algorithm is NO_SORT. To get a nice appearance for transparent objects you must change this to another value, for example, OPAQUE_FIRST or SORTED_PIXEL, using the setTransparencyType method in the viewer or renderAction class. See SoGLRenderAction for a discussion of transparency algorithms and rendering order.

Material binding:

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.

Normal binding:

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.

Tangent binding:

The tangentBinding field of a directly referenced SoVertexProperty node has no effect unless there is a nonempty tangent field, in which case the tangent binding specifies the assignment of tangent vectors to the shape.

FILE FORMAT/DEFAULT

ACTION BEHAVIOR

SEE ALSO

SoIndexedTriangleStripSet, SoIndexedFaceSet, SoIndexedLineSet, SoTriangleStripSet, SoLineSet, SoFaceSet, SoPointSet, SoQuadMesh, SoVertexShape, SoIndexedShape, SoNonIndexedShape

See related examples:

PointCloud, MedicalGetDataPolyLine, MedicalDTI, GetDataPolyLine, SegY2D


Member Enumeration Documentation

Binding.

Note: The meaning of some binding values depends on the shape class. For example, PER_FACE and PER_PART are the same for some shapes.

Enumerator:
OVERALL 

Whole object has same material/normal/tangent.

PER_PART 

One material/normal/tangent for each part of object.

PER_PART_INDEXED 

One material/normal/tangent for each part, indexed.

PER_FACE 

One material/normal/tangent for each face of object.

PER_FACE_INDEXED 

One material/normal/tangent for each face, indexed.

PER_VERTEX 

One material/normal/tangent for each vertex of object.

PER_VERTEX_INDEXED 

One material/normal/tangent for each vertex, indexed.


Constructor & Destructor Documentation

SoVertexProperty::SoVertexProperty (  ) 

Creates an SoVertexProperty node with default settings.


Member Function Documentation

static SoType SoVertexProperty::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

virtual SoType SoVertexProperty::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

virtual SbBool SoVertexProperty::isOverride (  )  const [inline, virtual]

Returns the state of the override field.

Reimplemented from SoNode.

virtual void SoVertexProperty::setOverride ( const SbBool  state  )  [inline, virtual]

Set the state of the override field.

see SoNode::setOverride doc.

Reimplemented from SoNode.


Member Data Documentation

Forces the texture coordinates to be sent to the GPU even if no texture is bound.

Material binding.

Use enum Binding. Default is OVERALL.

Normal vector(s).

Default is empty.

Normal binding.

Use enum Binding. Default is PER_VERTEX_INDEXED.

Packed color(s), including transparencies.

Default is empty.

Tangent vector(s).

Default is empty. NOTE: field available since Open Inventor 10.2

Tangent binding.

Use enum Binding. Default is PER_VERTEX_INDEXED. NOTE: field available since Open Inventor 10.2

2D texture coordinate(s).

Default is empty.

3D texture coordinate(s).

Default is empty.

Vertex coordinate(s).

Default is empty.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/