Class MoMeshCellShape
- All Implemented Interfaces:
SafeDisposable
This node renders an unstructured surface mesh defined by a set of cells in
the original mesh. The set of cells to be rendered is specified by a list of
cell indices. The size of the rendered cells can be scaled up or down using
the scaleFactor
field and annotation of the cell and node names can
optionally be displayed.
The cell name annotated is defined in the following way:
- if a
MoStringSet
node is inherited in the scene graph with the suitable type andDataBinding.PER_CELL
binding, the cell name is defined by the string returned byMiStringSetI.get(long)
orMiStringSetIj.get(long, long)
orMiStringSetIjk.get(int, int, int)
.
The suitable type depends on the mesh type handled by the inherited MoMesh instance. For instance if theMoMesh
handles an unstructured mesh (seeMiVolumeMeshUnstructured
andMiSurfaceMeshUnstructured
) a suitable string set as cell name is of typeMiStringSetI
. If theMoMesh
handles anMiVolumeMeshHexahedronIjk
, a suitable string set as cell name is of typeMiStringSetIjk
. If several MoStringSet are inherited with the suitable string set type and PER_CELL binding, the last one on the state list is used. - if no suitable
MoStringSet
is inherited in the scene graph, the cell name is defined by the string corresponding to the serialization of its cell ids. For Ij or Ijk mesh type the ij or ijk ids are separated by commas.
DataBinding.PER_NODE
.
The cells can be colored using a scalar set defined in the
colorScalarSetId
inherited field. This is an index into the list of
scalar sets existing in the traversal state (see the MoScalarSetxxx
nodes). To disable coloring set this field to -1.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionField representing the list of cells given by their index in the mesh.
If the mesh is unstructured, each value ofcellIndices
represents one cell.
If the mesh is a structured surface mesh, each cell is defined by a pair of indices (cellIndices(i)
,cellIndices(i+1)
).
If the mesh is a structured volume mesh, each cell is defined by three indices (cellIndices(i)
,cellIndices(i+1)
,cellIndices(i+2)
).
So, depending on the type of mesh, one, two or three indices are necessary to define each cell.Field representing the factor to resize extracted cells.
A factor lower than one will shrink cells, whereas a factor greater than one will expand cells.
The default value is 1.0, which will not resize cells.When set totrue
thecellIndices
field will represent the list of cells to display and the list of cells to exclude otherwise.
The default value istrue
Field representing the distance to shift the display of node names away from the node coordinates.
A negative offset will display node names inside the cell, whereas a positive offset will display them outside the cell.
Note: The offset is relative to the cell's size if therelativeOffset
field is set totrue
.When set totrue
the distance between the node and the name to display is relative to the size of the cell.
Note: For unstructured meshes, the offset field is then multiplied by thegetRelativeSize()
method from the cell interface.When set totrue
the cell's name is displayed near the cell.When set totrue
the node's names are displayed near the cell.Fields inherited from class com.openinventor.meshvizxlm.mapping.nodes.MoMeshRepresentation
colorScalarSetId
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a rendering node with default options and cell indices list. -
Method Summary
Modifier and TypeMethodDescriptionGets the cell extractor for hexahedron IJK meshes to reuse outside this node.
Note: The returned object may benull
if no hexahedron IJK mesh has been set in the scene graph or if no render action has traversed the scene graph.Gets the cell extractor for structured surface meshes to reuse outside this node.
Note: The returned object may benull
if no structured surface mesh has been set in the scene graph or if no render action has traversed the scene graph.Gets the cell extractor for IJK meshes to reuse outside this node.
Note: The returned object may benull
if no IJK mesh has been set in the scene graph or if no render action has traversed the scene graph.Gets the cell extractor for unstructured meshes to reuse outside this node.Methods inherited from class com.openinventor.meshvizxlm.mapping.nodes.MoMeshRepresentation
doAction, setExtractorCallback
Methods inherited from class com.openinventor.meshvizxlm.mapping.nodes.MoMeshBaseRepresentation
affectsState, write
Methods inherited from class com.openinventor.meshvizxlm.mapping.nodes.MoActionNode
callback, distribute, getBoundingBox, getMatrix, getPrimitiveCount, getRenderEngineMode, GLRender, handleEvent, pick, rayPick
Methods inherited from class com.openinventor.inventor.nodes.SoNode
copy, copy, getAlternateRep, getByName, getRenderUnitID, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, isBoundingBoxIgnoring, isOverride, search, setOverride, touch
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
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Field Details
-
inclusiveList
When set totrue
thecellIndices
field will represent the list of cells to display and the list of cells to exclude otherwise.
The default value istrue
-
cellIndices
Field representing the list of cells given by their index in the mesh.
If the mesh is unstructured, each value ofcellIndices
represents one cell.
If the mesh is a structured surface mesh, each cell is defined by a pair of indices (cellIndices(i)
,cellIndices(i+1)
).
If the mesh is a structured volume mesh, each cell is defined by three indices (cellIndices(i)
,cellIndices(i+1)
,cellIndices(i+2)
).
So, depending on the type of mesh, one, two or three indices are necessary to define each cell.Note: If the index list is empty, no cells are displayed when
inclusiveList
is set totrue
and all cells otherwise. By default, the list is empty. -
factor
Field representing the factor to resize extracted cells.
A factor lower than one will shrink cells, whereas a factor greater than one will expand cells.
The default value is 1.0, which will not resize cells. -
showCellName
When set totrue
the cell's name is displayed near the cell. The default value isfalse
.
The documentation of this class describes how the cell's name is defined. -
showNodeName
When set totrue
the node's names are displayed near the cell. The default value isfalse
.
The documentation of this class describes how the node's name is defined.
Note: For structured meshes, this field is not used since nodes are computed implicitly. -
offset
Field representing the distance to shift the display of node names away from the node coordinates.
A negative offset will display node names inside the cell, whereas a positive offset will display them outside the cell.
Note: The offset is relative to the cell's size if therelativeOffset
field is set totrue
. Otherwise it represents an absolute distance.
The default value is 0.1, which will slightly shift node names outside the cell. -
relativeOffset
When set totrue
the distance between the node and the name to display is relative to the size of the cell.
Note: For unstructured meshes, the offset field is then multiplied by thegetRelativeSize()
method from the cell interface. A default implementation ofgetRelativeSize()
returns 1 which will leave the offset as an absolute distance.getRelativeSize()
needs to be overloaded to activate this feature for unstructured mesh (see classMiCell
).
The default value isfalse
.
-
-
Constructor Details
-
MoMeshCellShape
public MoMeshCellShape()Constructs a rendering node with default options and cell indices list.cellIndices
is emptyinclusiveList = true
factor = 1
showCellName = false
showNodeName = false
offset = 0.1
relativeOffset = false
-
-
Method Details
-
getUnstructuredExtractor
Gets the cell extractor for unstructured meshes to reuse outside this node.
Note: The returned object may benull
if no unstructured mesh has been set in the scene graph or if no render action has traversed the scene graph.- Returns:
- the cell extractor for unstructured meshes
-
getIjkExtractor
Gets the cell extractor for IJK meshes to reuse outside this node.
Note: The returned object may benull
if no IJK mesh has been set in the scene graph or if no render action has traversed the scene graph.- Returns:
- the cell extractor for IJK meshes
-
getHexahedronIjkExtractor
Gets the cell extractor for hexahedron IJK meshes to reuse outside this node.
Note: The returned object may benull
if no hexahedron IJK mesh has been set in the scene graph or if no render action has traversed the scene graph.- Returns:
- the cell extractor for hexahedron IJK meshes
-
getIjExtractor
Gets the cell extractor for structured surface meshes to reuse outside this node.
Note: The returned object may benull
if no structured surface mesh has been set in the scene graph or if no render action has traversed the scene graph.- Returns:
- the cell extractor for structured surface meshes
-