Class DrawableNode

  • Direct Known Subclasses:
    DrawableGeometryNode, DrawableNodeClone

    public class DrawableNode
    extends SceneNode
    Abstract base class for all drawable classes

    Classes that are able to draw them self, may inherit from this class.

    The drawable class use a draw mask to distinguish between different
    groups to draw. E.g. when taking snapshots with a simulated camera
    virtual objects such as the red laser vector or the lines showing
    the camera view angle is should not be rendered. Hence objects that
    are virtual should be set to virtual.

    A call to draw enabling Physical and User1 defined objects look like:
    drawable->draw(DrawableNode::Physical | DrawableNode::User1);
    • Constructor Detail

      • DrawableNode

        public DrawableNode​(long cPtr,
                            boolean cMemoryOwn)
    • Method Detail

      • getCPtr

        public static long getCPtr​(DrawableNode obj)
      • draw

        public void draw()
        draws the object.
      • setHighlighted

        public void setHighlighted​(boolean b)
        enables or disables highlighting of the drawable class

        b - [in] a if true highlight is enabled if false disabled
      • isHighlighted

        public boolean isHighlighted()
        Returns whether the DrawableNode is highlighted

      • setDrawType

        public void setDrawType​(DrawableNode.DrawType drawType)
        Sets the DrawType

        drawType - [in] the DrawType to be used
      • setTransparency

        public void setTransparency​(float alpha)
        Sets up the color alpha value.

        alpha - [in] 0.0 corresponds to fully transparent and
        1.0 to completely solid.
      • getTransparency

        public float getTransparency()
        Gets the color alpha value.
        alpha value in the interval [0.0;1.0]
      • isTransparent

        public boolean isTransparent()
        Check if node is transparent.
        true if transparent, false otherwise.
      • setScale

        public void setScale​(float scale)
        Specifies the scale of the object
        scale - [in] the scale
      • getScale

        public float getScale()
        gets the scale of the object
        scale [in] the scale
      • setVisible

        public void setVisible​(boolean enable)
        enable or disable this drawable. When disabled the drawable
        will not render anything.
      • isVisible

        public boolean isVisible()
        checks if this drawable is enabled
      • getTransform

        public Transform3D getTransform()
        gets the transformation of the drawable object
        transform of the drawable object
      • setTransform

        public void setTransform​(Transform3D t3d)
        Sets the transformation of the drawable object
        t3d - [in] transform of drawable object
      • setMask

        public void setMask​(long mask)
        the group(s) that this drawable belong to
        mask - [in] drawable mask
      • getMask

        public long getMask()
        Get the DrawableTypeMask for the node.
        the type mask.
      • asDrawableNode

        public DrawableNode asDrawableNode()
        Description copied from class: SceneNode
        Get a pointer to a DrawableNode, if this is a DrawableNode.
        asDrawableNode in class SceneNode
        a pointer, or NULL if the SceneNode is not of correct type.