Class PoMesh
- java.lang.Object
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
PoBaseStreamLine
,PoCellShape
,PoMesh2D
,PoMesh3D
,PoMeshProbePoint
public class PoMesh extends Po3DdataMaster
Base class for all mesh representations. A representation of a mesh may depend on other MeshViz objects : The current mesh, the current data-mapping, the current module-data-mapping, the current isovalues list, the current domain, the current numeric display format and the current miscellaneous text attributes.If the method setMesh(mesh) is called with "mesh" derived from
PbMesh
, the current mesh is "mesh". Otherwise the current mesh has a type derived fromPoMeshProperty
and is inherited during the traversal. If the setMesh method is not called and if there is not any nodePoMeshProperty
before thePoMesh
node in the scene graph, the representation is empty.If the method setDataMapping(data_mapping) is called with "data_mapping" derived from
PbDataMapping
, the current data mapping is "data_mapping". Otherwise the current data-mapping has a type derived fromPoDataMapping
and is inherited during the traversal. The current data-mapping is not used if coloringType == COLOR_INHERITED, or if valuesIndex is not defined (i.e. < 0), or if the set of values refered by valuesIndex does not exist in the current mesh. If there is no current data-mapping (i.e setDataMapping not called and noPoDataMapping
node before in the scene graph), the inherited color is used for part of the representation.If the method setModuleDataMapping(mod_data_mapping) is called with "mod_data_mapping" derived from
PbDataMapping
, the current module data mapping is "mod_data_mapping". Otherwise if the field moduleDataMapping contains a node of a type derived fromPoDataMapping
, the current module data-mapping is defined by this nod. Otherwise the current module data-mapping has a type derived fromPoDataMapping
and is inherited during the traversal. The current module data mapping is used byPoMesh2DVec
andPoMesh3DVec
class.If the setIsovaluesList(isovalues_list) is called with "isovalues_list" derived from
PbIsovaluesList
, the current isovalues list is "isovalues_list".Otherwise the current isovalues list has a typePoIsovaluesList
and is inherited during the traversal. If the current isovalues list does not exist (i.e. setIsovaluesList not called and noPoIsovaluesList
before in the scene graph), thePoMeshContouring
make an empty representation, and the other representation classes work like if coloringType was equal COLOR_MAPPING.See
PoBase
for definition of the current domain.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PoMesh.ColoringTypes
Coloring type.-
Nested classes/interfaces inherited from class com.openinventor.meshviz.graph.PoBase
PoBase.NodeWriteFormats, PoBase.TextTypes, PoBase.UpdateMethodTypes
-
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 SoSFEnum<PoMesh.ColoringTypes>
coloringType
Defines the type of method used to color each mesh element, mesh edge or mesh contour line of a representation.SoSFFloat
creaseAngle
Indicates the minimum angle (in radians) between two adjacent face normals required to form a sharp crease at the edge when default normals are computed and used.SoSFNode
moduleDataMapping
Field used to do coloring according the module of the vectors.SoSFBool
smoothTextureContouring
If set to true and combined with COLOR_TEXTURE_CONTOURING coloring type, the texture used for coloring appears smoothed, since a linear interpolation is used instead of a nearest one.SoSFInt32
valuesIndex
Defines the index of the set of values for the coloring.SoSFInt32
valuesIndexForCellFilter
Specifies the index of the set of values used to filter cells for this mesh representation.SoSFInt32
vecsIndex
Defines the index of the set of vectors for all representations which need a vector at each mesh node (PoBaseStreamLine
,PoMesh2DVec
,PoMesh3DVec
,...)-
Fields inherited from class com.openinventor.inventor.nodekits.SoBaseKit
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SoNodekitCatalog
getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.PbDataMapping
getDataMapping()
Returns the currentPbDataMapping
object.PbIsovaluesList
getIsovaluesList()
Returns the currentPbIsovaluesList
object.PbMesh
getMesh()
Gets the currentPbMesh
object.PbDataMapping
getModuleDataMapping()
Returns the currentPbDataMapping
object for the association color-vectors module.void
setDataMapping(PbDataMapping data_mapping)
Sets a reference to aPbDataMapping
object for the association color-value.void
setIsovaluesList(PbIsovaluesList isovalues_list)
Sets a reference to aPbIsovaluesList
object to define a list of isovalues.void
setMesh(PbMesh mesh)
Sets a reference to aPbMesh
object.void
setModuleDataMapping(PbDataMapping mod_data_mapping)
Sets a reference to aPbDataMapping
object for the association color-vectors module.-
Methods inherited from class com.openinventor.meshviz.graph.PoBase
addPostRebuildCallback, addPreRebuildCallback, getDomain, getNodeWriteFormat, getTextType, getUpdateMethod, isBuilt, isModified, isVRML2Mode, rebuild, setDomain, setNodeWriteFormat, setTextType, setUpdateMethod, setVRML2Mode, touchKit
-
Methods inherited from class com.openinventor.inventor.nodekits.SoBaseKit
getNodekitCatalog, getPart, getPart, getPartString, getViewportIsEnabled, getViewportOrigin, getViewportSize, isSearchingChildren, set, set, setPart, setSearchingChildren
-
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, 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
-
valuesIndex
public final SoSFInt32 valuesIndex
Defines the index of the set of values for the coloring. If valuesIndex = -1, (the valuesIndex is called undefined) a mesh representation is colored with only one color which is inherited. If valuesIndex >= 0, the representation is colored relating to each node value, and relating to the coloring method defined by the field coloringType.
-
valuesIndexForCellFilter
public final SoSFInt32 valuesIndexForCellFilter
Specifies the index of the set of values used to filter cells for this mesh representation. The value of the cell is checked as follows:If
PoCellFilter.acceptCell
(id,(getMesh()
->getValuesSet(valuesIndexForCellFilter))[id]) returns false, the cell is not taken into account by this representation. (id is the index of the cell to be checked.)Warning: The values of the selected data set must be located at cells (see PoMeshProperty.addValuesSet(int,DataBinding,float *), use DataBinding.PER_CELL).
-
vecsIndex
public final SoSFInt32 vecsIndex
Defines the index of the set of vectors for all representations which need a vector at each mesh node (PoBaseStreamLine
,PoMesh2DVec
,PoMesh3DVec
,...)
-
coloringType
public final SoSFEnum<PoMesh.ColoringTypes> coloringType
Defines the type of method used to color each mesh element, mesh edge or mesh contour line of a representation.COLOR_INHERITED
: Each element of a mesh representation is colored with the same inherited color, even if valuesIndex field is defined (valuesIndex >= 0).COLOR_AVERAGE
: Each edge of a wireframe representation of the mesh (classesPoMeshLimit
,PoMeshLines
) is colored by a single color defined by the average value of its extremities mapped on aPbDataMapping
object. Each element of a solid surface representation of the mesh (classesPoMeshSides
,PoMeshFilled
) is colored by a single color defined by the average value of its nodes mapped on aPbDataMapping
object. However, an inherited coloring is done if the field valuesIndex is not defined or if there is no set of values of which the index is valuesIndex.COLOR_MAPPING
: Each mesh edge or mesh element of a representation is colored by using the "data mapping" method defined by aPbDataMapping
object. ThePbDataMapping
object defines how the mesh values (referenced by valuesIndex field) are transformed into colors. However, an inherited coloring is done if the valuesIndex field is not defined or if there is no set of values of which index is valuesIndex.COLOR_CONTOURING
: Each mesh edge of a wireframe representation is colored relating to both of its extremity values v1 and v2, to the isovalues between v1 and v2, and to thePbDataMapping
object which defines the color associated to these values. If some isovalues of thePbIsovaluesList
object exist between v1 and v2, the edge is cut into several segments. Each segment is colored with a single color. Each mesh element of a filled representation is colored relating to its node values, to the isovalues between these values, and to thePbDataMapping
object which defines the color associated to these values. If some isovalues of thePbIsovaluesList
object exist between these values, the element is cut up into several small surfaces. Each small surface is colored with a single color. The boundary between 2 small surfaces is part of a contour line. However, an inherited coloring is done if the valuesIndex field is not defined or if there is no set of values of which the index is valuesIndex.COLOR_TEXTURE_CONTOURING
: Same asCOLOR_CONTOURING
but a texture is used for creating contours. This method dramatically decreases the amount of generated geometry and speeds up the computation time of filled representations relative to theCOLOR_CONTOURING
method. This mode should be used for all animations.The catalog part appearance.texture2 contains the contour texture and the catalog part appearance.complexity.textureQuality is set to 0.1f to activate nearest (as opposed to linear) texture filtering.
This method should not be used for wireframe representations because texturing is not active in wireframe. Also, you may see some slight differences compared to
COLOR_CONTOURING
for meshes with few cells. Shapes or cells that contain an undefined value will not be discarded. For example, cells that are more transparent than the value specified byPoDataMapping.transparencyValueDeletedParts
will not be discarded when using this mode.
-
moduleDataMapping
public final SoSFNode moduleDataMapping
Field used to do coloring according the module of the vectors. It is used only if setModuleDataMapping is not called and if the field contains a node derived fromPoDataMapping
.
-
smoothTextureContouring
public final SoSFBool smoothTextureContouring
If set to true and combined with COLOR_TEXTURE_CONTOURING coloring type, the texture used for coloring appears smoothed, since a linear interpolation is used instead of a nearest one.- Since:
- Open Inventor 8.1
-
creaseAngle
public final SoSFFloat creaseAngle
Indicates the minimum angle (in radians) between two adjacent face normals required to form a sharp crease at the edge when default normals are computed and used. Default is 0. Default in Open Inventor 5.0 and earlier was 0.8.You can specify the default crease angle using the configuration parameter OIV_3DDATA_CREASE_ANGLE. See
SoPreferences
for details.- Since:
- Open Inventor 6.0
-
-
Method Detail
-
getClassNodekitCatalog
public static SoNodekitCatalog getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.
-
getDataMapping
public PbDataMapping getDataMapping()
Returns the currentPbDataMapping
object.
-
getModuleDataMapping
public PbDataMapping getModuleDataMapping()
Returns the currentPbDataMapping
object for the association color-vectors module.
-
getIsovaluesList
public PbIsovaluesList getIsovaluesList()
Returns the currentPbIsovaluesList
object.
-
setIsovaluesList
public void setIsovaluesList(PbIsovaluesList isovalues_list)
Sets a reference to aPbIsovaluesList
object to define a list of isovalues. The isovalues list is used by aPoMeshContouring
object, and by the others mesh representations objects when coloringType = COLOR_CONTOURING.
-
setDataMapping
public void setDataMapping(PbDataMapping data_mapping)
Sets a reference to aPbDataMapping
object for the association color-value. The data mapping is not used if the field coloringType = COLOR_INHERITED
-
setModuleDataMapping
public void setModuleDataMapping(PbDataMapping mod_data_mapping)
Sets a reference to aPbDataMapping
object for the association color-vectors module.
-
-