Package org.robwork.sdurw_graphics
Class DrawableNodeClone
- java.lang.Object
-
- org.robwork.sdurw_graphics.SceneNode
-
- org.robwork.sdurw_graphics.DrawableNode
-
- org.robwork.sdurw_graphics.DrawableNodeClone
-
public class DrawableNodeClone extends DrawableNode
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 renered. 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);
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.robwork.sdurw_graphics.DrawableNode
DrawableNode.DrawableTypeMask, DrawableNode.DrawType, DrawableNode.RenderInfo
-
Nested classes/interfaces inherited from class org.robwork.sdurw_graphics.SceneNode
SceneNode.AddPolicy, SceneNode.NodeType
-
-
Constructor Summary
Constructors Constructor Description DrawableNodeClone(long cPtr, boolean cMemoryOwn)
DrawableNodeClone(java.lang.String name, DrawableNodePtr drawable)
constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
void
draw()
draws the object.void
draw(DrawableNode.RenderInfo info)
draws the object.static long
getCPtr(DrawableNodeClone obj)
long
getMask()
Get the DrawableTypeMask for the node.float
getScale()
gets the scale of the objectTransform3D
getTransform()
gets the transformation of the drawable objectfloat
getTransparency()
Gets the color alpha value.boolean
isHighlighted()
Returns whether the DrawableNode is highlighted
boolean
isVisible()
checks if this drawable is enabledvoid
setDrawType(DrawableNode.DrawType drawType)
Sets the DrawType
void
setHighlighted(boolean b)
enables or disables highlighting of the drawable class
void
setMask(long mask)
the group(s) that this drawable belong tovoid
setScale(float scale)
Specifies the scale of the objectvoid
setTransform(Transform3D t3d)
Sets the transformation of the drawable objectvoid
setTransparency(float alpha)
Sets up the color alpha value.
void
setVisible(boolean enable)
enable or disable this drawable.-
Methods inherited from class org.robwork.sdurw_graphics.DrawableNode
asDrawableNode, getCPtr, isTransparent
-
Methods inherited from class org.robwork.sdurw_graphics.SceneNode
addParent, addParent, asCameraNode, asGroupNode, get_name, get_parentNodes, get_type, getCPtr, getName, getType, hasParent, removeParent, removeParent, set_name, set_parentNodes, set_type, setName
-
-
-
-
Constructor Detail
-
DrawableNodeClone
public DrawableNodeClone(long cPtr, boolean cMemoryOwn)
-
DrawableNodeClone
public DrawableNodeClone(java.lang.String name, DrawableNodePtr drawable)
constructor- Parameters:
name
- [in] the name of the node.drawable
- [in] the drawable to clone - it will not make an actual clone of data,
only of the visualization.
-
-
Method Detail
-
getCPtr
public static long getCPtr(DrawableNodeClone obj)
-
delete
public void delete()
- Overrides:
delete
in classDrawableNode
-
draw
public void draw(DrawableNode.RenderInfo info)
draws the object.- Overrides:
draw
in classDrawableNode
-
draw
public void draw()
draws the object.- Overrides:
draw
in classDrawableNode
-
setHighlighted
public void setHighlighted(boolean b)
enables or disables highlighting of the drawable class
- Overrides:
setHighlighted
in classDrawableNode
- Parameters:
b
- [in] a if true highlight is enabled if false disabled
-
isHighlighted
public boolean isHighlighted()
Returns whether the DrawableNode is highlighted
- Overrides:
isHighlighted
in classDrawableNode
- Returns:
- true/false
-
setDrawType
public void setDrawType(DrawableNode.DrawType drawType)
Sets the DrawType
- Overrides:
setDrawType
in classDrawableNode
- Parameters:
drawType
- [in] the DrawType to be used
-
setTransparency
public void setTransparency(float alpha)
Sets up the color alpha value.
- Overrides:
setTransparency
in classDrawableNode
- Parameters:
alpha
- [in] 0.0 corresponds to fully transparent and
.0 to completely solid.
-
getTransparency
public float getTransparency()
Gets the color alpha value.- Overrides:
getTransparency
in classDrawableNode
- Returns:
- alpha value in the interval [0.0;1.0]
-
setScale
public void setScale(float scale)
Specifies the scale of the object- Overrides:
setScale
in classDrawableNode
- Parameters:
scale
- [in] the scale
-
getScale
public float getScale()
gets the scale of the object- Overrides:
getScale
in classDrawableNode
- Returns:
- scale [in] the scale
-
setVisible
public void setVisible(boolean enable)
enable or disable this drawable. When disabled the drawable
will not render anything.- Overrides:
setVisible
in classDrawableNode
-
isVisible
public boolean isVisible()
checks if this drawable is enabled- Overrides:
isVisible
in classDrawableNode
-
getTransform
public Transform3D getTransform()
gets the transformation of the drawable object- Overrides:
getTransform
in classDrawableNode
- Returns:
- transform of the drawable object
-
setTransform
public void setTransform(Transform3D t3d)
Sets the transformation of the drawable object- Overrides:
setTransform
in classDrawableNode
- Parameters:
t3d
- [in] transform of drawable object
-
setMask
public void setMask(long mask)
the group(s) that this drawable belong to- Overrides:
setMask
in classDrawableNode
- Parameters:
mask
- [in] drawable mask
-
getMask
public long getMask()
Get the DrawableTypeMask for the node.- Overrides:
getMask
in classDrawableNode
- Returns:
- the type mask.
-
-