Class MoMeshCellShape
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.meshvizxlm.mapping.nodes.MoActionNode
-
- com.openinventor.meshvizxlm.mapping.nodes.MoMeshBaseRepresentation
-
- com.openinventor.meshvizxlm.mapping.nodes.MoMeshRepresentation
-
- com.openinventor.meshvizxlm.mapping.nodes.MoMeshCellShape
-
- All Implemented Interfaces:
SafeDisposable
public class MoMeshCellShape extends MoMeshRepresentation
Rendering node that displays a set of cells of a mesh.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 theMoScalarSetxxx
nodes). To disable coloring set this field to -1.
-
-
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
Fields Modifier and Type Field Description SoMFInt64
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.SoSFFloat
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.SoSFBool
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
SoSFFloat
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
.SoSFBool
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.SoSFBool
showCellName
When set totrue
the cell's name is displayed near the cell.SoSFBool
showNodeName
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
Constructors Constructor Description MoMeshCellShape()
Constructs a rendering node with default options and cell indices list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MiCellExtractHexahedronIjk
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.MiCellExtractIj
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.MiCellExtractIjk
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.MiCellExtractUnstructured
getUnstructuredExtractor()
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 Detail
-
inclusiveList
public SoSFBool 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
public SoMFInt64 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
public SoSFFloat 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
public SoSFBool 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
public SoSFBool 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
public SoSFFloat 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
public SoSFBool 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
.
-
-
Method Detail
-
getUnstructuredExtractor
public MiCellExtractUnstructured 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
public MiCellExtractIjk 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
public MiCellExtractHexahedronIjk 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
public MiCellExtractIj 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
-
-