Class MoDrawStyle

  • All Implemented Interfaces:

    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 and displayEdges 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
    • Field Detail

      • displayFaces

        public SoSFBool displayFaces
        The display mode for mesh faces.
        When set to true (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 to true 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 to true, 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).

    • Constructor Detail

      • MoDrawStyle

        public MoDrawStyle()
        Constructs a property node with draw style set to default values.
        • displayFaces = true
        • displayEdges = false
        • displayPoints = false
        • fadingThreshold = 0