Class MoDrawStyle
- 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.MoDrawStyle
-
- All Implemented Interfaces:
SafeDisposable
public class MoDrawStyle extends MoActionNode
Property node that defines the draw style of representations.This node specifies the draw style to be used in subsequent nodes inheriting from
MoMeshRepresentation
and defining a surface or a line:- the
displayFaces
field controls drawing cell faces as solid - the
displayEdges
field controls drawing cell edges - the
displayPoints
field controls drawing node points - the
fadingThreshold
field controls fading out on node points and cell edges from surfaces
No Edge Fading Edge Fading See
MoMaterial
for setting the rendering attributes of facets, edges and points.Use this node, for example, to efficiently render a colored surface and the outlines of its cells using a single rendering node.
When the fields
displayFaces
anddisplayEdges
are true, it is possible that a surface (for instance extracted by a MoMeshSkin or a MoMeshSlab) is rendered in 2 passes. The first pass draws the cell faces of the surface, and the second pass draws the cell edges in addition to the faces. The rendering in 2 passes can occur only for very large surface (containing millions of triangles or quadrangles) where the first pass can be done quickly before starting additional computations to display the edges.
Note: The rendering of surfaces extracted from an unstructured grid is always done in one pass.- See Also:
MoMaterial
,MoMaterialElement
,MoDrawStyleElement
-
-
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 SoSFBool
displayEdges
The display mode for mesh edges.
When set totrue
the edges of cells are displayed.SoSFBool
displayFaces
The display mode for mesh faces.
When set totrue
(default), the surface of mesh representations are filled.SoSFBool
displayPoints
The display mode for mesh node points.
When set totrue
, the node points are displayed.SoSFFloat
fadingThreshold
Threshold allowing to fade out extra styles of a surface representation as it gets away from the view point.
If fadingThreshold is 0, no fading is done.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description MoDrawStyle()
Constructs a property node with draw style set to default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doAction(SoAction action)
-
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
affectsState, copy, copy, getAlternateRep, getByName, getRenderUnitID, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, isBoundingBoxIgnoring, isOverride, 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, 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
-
displayFaces
public SoSFBool displayFaces
The display mode for mesh faces.
When set totrue
(default), the surface of mesh representations are filled. Otherwise, they are not filled.
-
displayEdges
public SoSFBool displayEdges
The display mode for mesh edges.
When set totrue
the edges of cells are displayed. Otherwise, they are not displayed (default).
-
displayPoints
public SoSFBool displayPoints
The display mode for mesh node points.
When set totrue
, the node points are displayed. Otherwise, they are not displayed (default).
-
fadingThreshold
public SoSFFloat fadingThreshold
Threshold allowing to fade out extra styles of a surface representation as it gets away from the view point.
If fadingThreshold is 0, no fading is done. This is the default behavior. If fadingThreshold>
0, a fading effect may occur on the rendering.
In many cases, this field is just interpreted as a boolean value (fading/no fading) for edges rendering. That means that in many cases, the edge fading is done automatically without needing any threshold value, i.e. the floating value of the field is just ignored.
However in some cases, we have some limitation that needs to use a threshold value. For those cases, this threshold defines the pixel length limit on screen under which edges start fading out. Setting the threshold to 5 leads to fade out edges with less than 5 pixels on screen.
Rendering a surface containing some polygons with more than 8 edges is a typical example where the threshold value is needed.
In any case, the floating value of the threshold is used to fade out the points.Note: when the fading is activated, a transparency is required so be sure to check
SoGLRenderAction.TransparencyTypes
documentation in order to be aware of known transparency limitations (AA compatibility).
-
-