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
MoStringSetnode is inherited in the scene graph with the suitable type andDataBinding.PER_CELLbinding, 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 theMoMeshhandles an unstructured mesh (seeMiVolumeMeshUnstructuredandMiSurfaceMeshUnstructured) a suitable string set as cell name is of typeMiStringSetI. If theMoMeshhandles 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
MoStringSetis 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.RenderModesNested 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 ofcellIndicesrepresents 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 totruethecellIndicesfield will represent the list of cells to display and the list of cells to exclude otherwise.
The default value istrueField 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 therelativeOffsetfield is set totrue.When set totruethe 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 totruethe cell's name is displayed near the cell.When set totruethe node's names are displayed near the cell.Fields inherited from class com.openinventor.meshvizxlm.mapping.nodes.MoMeshRepresentation
colorScalarSetIdFields 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 benullif 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 benullif 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 benullif 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, setExtractorCallbackMethods inherited from class com.openinventor.meshvizxlm.mapping.nodes.MoMeshBaseRepresentation
affectsState, writeMethods inherited from class com.openinventor.meshvizxlm.mapping.nodes.MoActionNode
callback, distribute, getBoundingBox, getMatrix, getPrimitiveCount, getRenderEngineMode, GLRender, handleEvent, pick, rayPickMethods inherited from class com.openinventor.inventor.nodes.SoNode
copy, copy, getAlternateRep, getByName, getRenderUnitID, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, isBoundingBoxIgnoring, isOverride, search, setOverride, touchMethods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaultsMethods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizableMethods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Field Details
-
inclusiveList
When set totruethecellIndicesfield 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 ofcellIndicesrepresents 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
inclusiveListis set totrueand 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 totruethe 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 totruethe 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 therelativeOffsetfield 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 totruethe 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.cellIndicesis emptyinclusiveList = truefactor = 1showCellName = falseshowNodeName = falseoffset = 0.1relativeOffset = false
-
-
Method Details
-
getUnstructuredExtractor
Gets the cell extractor for unstructured meshes to reuse outside this node.
Note: The returned object may benullif 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 benullif 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 benullif 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 benullif 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
-