public class SoEdgeFlag extends SoNode
The marking/unmarking of the edges is specified using an int_32t array. The meaning of this array and its elements depends on the shape it is applied to.
SoIndexedFaceSet
, each element of the array is an index in the SoIndexedShape.coordIndex
field. The vertex corresponding to this index is the first vertex of the edge. The other vertex of the edge is the next vertex in the face according to the order of the vertices in the SoIndexedFaceSet
array. If the next element in the array is -1 (end of face), the next vertex is the first vertex of the current face (as for edge (5,3) in the example below). Otherwise, the next vertex is the next element in the array (as for edge (1,2) in the example below). The same edge can appear in two different faces, but it is not necessary to mark it in both faces; only one mark per edge is needed.
Example:
<TABLE border=0 cellspacing=0 cellpadding=5> <TR><TD valign=_top> <TD valign=_top> 0 <B> 1 </B> 2 3 4 5 <B> 6 </B> 7 8 9 10 11 <TR><TD valign=_top> coordIndex = <TD valign=_top> [ 0, <B> 1 </B>, <B> 2 </B>, -1, <B> 3 </B>, 4, <B> 5 </B>, -1, 2, 1, 3, -1 ] <TR><TD valign=_top> edgeMarks = <TD valign=_top> [ 1 => edge (1, 2), <TR><TD valign=_top> <TD valign=_top> 6 => edge (5, 3) ] </TABLE>
SoFaceSet
For an SoFaceSet
, the marking is a little different from the SoIndexedFaceSet
. Each element is an index directly in the coordinate array. This corresponds to the first vertex of the edge; the other is the next vertex in the same face. As each face description in the coordinate array is cyclic, the other vertex is either the next vertex in the array, or the first vertex of the face if it is the end of the face.
Example:
<TABLE border=0 cellspacing=0 cellpadding=5> <TR><TD valign=_top> coordinates = <TD valign=_top> [{0.0, 1.0, 1.0}, <TD valign=_top> // 0 ... start face 1 <TR><TD valign=_top> <TD valign=_top> <B> {0.0, 0.0, 1.0} </B>, <TD valign=_top> // <B> 1 </B> <TR><TD valign=_top> <TD valign=_top> <B> {1.0, 0.0, 1.0} </B>, <TD valign=_top> // 2 <TR><TD valign=_top> <TD valign=_top> <TR><TD valign=_top> <TD valign=_top> <B> {0.0, 1.0, 1.0} </B>, <TD valign=_top> // 3 ... start face 2 <TR><TD valign=_top> <TD valign=_top> {0.0, 0.0, 1.0}, <TD valign=_top> // 4 <TR><TD valign=_top> <TD valign=_top> <B> {1.0, 0.0, 0.0} </B> ] <TD valign=_top> // <B> 5 </B> <TR><TD valign=_top> numVertices = <TD valign=_top> [ 3, 3 ] <TR><TD valign=_top> edgeMarks = <TD valign=_top> [ 1=> edge ({0.0, 0.0, 1.0}, {1.0, 0.0, 1.0}), <TR><TD valign=_top> <TD valign=_top> 5 => edge ({1.0, 0.0, 0.0}, {0.0, 1.0, 1.0}) ] </TABLE>
SoTriangleStripSet
For an SoTriangleStripSet
, marking an edge is very different from the previous two nodes. If
m is a mark, the edge corresponding is computed as follows:
. the first vertex is int(
m /2),
. the opposite vertex in the edge is int(
m /2) +
m %2 + 1; if (
m %2) = 0, this is the next vertex, otherwise this is the vertex just after, in the coordinate array.
Example:
(8%2)<TABLE border=0 cellspacing=0 cellpadding=5> <TR><TD valign=_top> coordinates = <TD valign=_top> [ <B> {0.0, 1.0, 1.0} </B>, <TD valign=_top> // <B> 0 </B>= int(1/2) <TR><TD valign=_top> <TD valign=_top> {0.0, 0.0, 1.0}, <TD valign=_top> // 1 <TR><TD valign=_top> <TD valign=_top> <B> {1.0, 0.0, 1.0} </B>, <TD valign=_top> // 2 = int(1/2) + 1 + (1\%2) <TR><TD valign=_top> <TD valign=_top> {1.0, 1.0, 1.0}, <TD valign=_top> // 3 <TR><TD valign=_top> <TD valign=_top> <B> {0.0, 1.0, 1.0} </B>, <TD valign=_top> // <B> 4 </B>= int(8/2) <TR><TD valign=_top> <TD valign=_top> <B> {1.0, 0.0, 0.0} </B> ] <TD valign=_top> // 5 = int(8/2) + 1 +
edgeMarks =
[ 1=>edge({0.0, 1.0, 1.0}, {1.0, 0.0, 1.0}),
An SoIndexedTriangleStripSet
works like an SoTriangleStripSet
, except that the SoIndexedShape.coordIndex
array is used instead of the coordinate array.
SoQuadMesh
For an SoQuadMesh
, the principle is the same as for SoTriangleStripSet
. If
m is the mark, then the corresponding edge is (
m /2,
n ) where
n is:
. the vertex just at the right of the vertex
m /2 if (
m %2) = 0,
. the vertex just below if (
m %2) = 1.
Example:
<TABLE border=0 cellspacing=0 cellpadding=5> <TR><TD valign=_top> coordinates = <TD valign=_top> [ <B> {0.0, 1.0, 1.0} </B>, {0.0, 2.0, 2.0}, {0.0, 3.0, 3.0}, <TR><TD valign=_top> <TD valign=_top> <B> {1.0, 0.0, 1.0} </B>, {2.0, 0.0, 2.0}, {3.0, 0.0, 3.0}, <TR><TD valign=_top> <TD valign=_top> {0.0, 1.0, 0.0}, <B> {0.0, 2.0, 0.0} </B>, <B> {0.0, 3.0, 0.0} </B> ] <TR><TD valign=_top> edgeMarks = <TD valign=_top> [ 1=> edge({0.0, 1.0, 1.0}, {1.0, 0.0, 1.0}), <TR><TD valign=_top> <TD valign=_top> 14 => edge({0.0, 2.0, 0.0}, {0.0, 3.0, 0.0}) ] </TABLE>
SoCube
For an SoCube
, edges are identified as shown below:
For each value between [0,11] in the flag array, the corresponding edge is marked/unmarked.
SoCone
For an SoCone
, only the edges of the base can be marked/unmarked. The flag array must contain at least one value greater than or equal to 0 to mark/unmark the edges of the base.
SoCylinder
For an SoCylinder
, only two values in the flag array are significant:
File format/default:
EdgeFlag {
edgeMarked | -1 |
edgeUnmarked | -1 |
Action behavior:
Sets: SoEdgeFlagElement
See also:
SoNode.RenderModes
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoMFInt32 |
edgeMarked |
SoMFInt32 |
edgeUnmarked
These are the fields for marked/unmarked edges.
|
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoEdgeFlag()
Constructor.
|
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
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
getNativeResourceHandle
Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com