- All Implemented Interfaces:
public class SoLineSet extends SoNonIndexedShapePolyline shape node. This node represents a 3D shape formed by constructing a set of polylines from vertices located at the coordinates specified in the
SoVertexShape), or the current inherited coordinates. For optimal performance, the
vertexPropertyfield is recommended.
Coordinates are used in order, starting with
startIndex(zero by default).
numVerticesfield contains -1 (the default), then all the coordinates (starting with startIndex) are rendered as a single polyline.
Otherwise each polyline uses the number of vertices specified by a value in the
numVerticesfield. For example, an
numVerticesof [3,4,2] would use the first three coordinates for the first polyline, the next four coordinates for the second polyline, and the next two coordinates for the third polyline. Thus the number of values in the
numVerticesfield indicates the number of polylines in the set.
The coordinates of the line set are transformed by the current cumulative transformation.
The line width and pattern are controlled by fields in
The lines are drawn with the current drawing style (see
SoDrawStyle), but drawing style FILLED is treated as LINES.
Treatment of the current material, normal and tangent binding is as follows:
- PER_PART binding specifies a material, normal or tangent for each segment of the line.
- PER_FACE binding specifies a material, normal or tangent for each polyline.
- PER_VERTEX specifies a material, normal or tangent for each vertex.
- The _INDEXED bindings mean exactly the same as their non-indexed counterparts.
- The default material binding is OVERALL.
- The default normal and tangent bindings are PER_VERTEX
The current complexity value has no effect on the rendering of line sets.
Shape Antialiasing type is
- By default, lighting is enabled (
SoLightModelmodel = PER_VERTEX_PHONG). But...
Unlike polygonal shapes, lighting will not be applied to line shapes unless the application explicitly sets normal vectors (using
SoNormal) or sets tangent vectors (using
SoVertexProperty). Normal vectors are not automatically computed for line shapes.
- If lighting is enabled and tangent vectors are specified:
then normal vectors are ignored and lines are lighted using the Illuminated Stream Lines algorithm (ZÃ¶ckler, Stalling & Hege, 1996) (
- If lighting is enabled and normal vectors are specified but
not tangent vectors:
then lines are lighted using the same algorithm as polygonal shapes.
- Note the above discussion is specific to rendering of
line shapes , e.g. this node.
If you render a polygonal shape, e.g.
SoFaceSet, using LINES mode (
SoDrawStyle), the rules for polygonal shapes apply (if lighting is enabled and no normal vectors were specified, then normal vectors are automatically computed by Open Inventor).
- NOTE: If you want to apply lighting in a shader, you must explicitly set normal or tangent vectors, otherwise lighting will be disabled for the line shape.
- Currently does not use VBOs (vertex buffer objects) for rendering. For very large line sets, performance may be better using
vertexProperty NULL startIndex 0 numVertices -1
Draws lines based on the current coordinates, normals, tangents, materials, drawing style, and so on.
Computes the bounding box that encloses all vertices of the line set with the current transformation applied to them. Sets the center to the average of the coordinates of all vertices.
If any line segment callbacks are registered with the action, they will be invoked for each successive segment in the line set.
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoShape
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
Fields Modifier and Type Field Description
numVerticesNumber of vertices per polyline.
Constructors Constructor Description
SoLineSet()Creates a line set node with default settings.
Methods inherited from class com.openinventor.inventor.nodes.SoVertexShape
Methods inherited from class com.openinventor.inventor.nodes.SoShape
getShapeType, isPrimitiveRestartAvailable, isPrimitiveRestartAvailable
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
public final SoMFInt32 numVerticesNumber of vertices per polyline.