RobWorkProject
23.9.11-
|
Abstract base class for all drawable classes. More...
#include <DrawableGeometry.hpp>
Inherits DrawableGeometryNode.
Public Types | |
typedef rw::core::Ptr< DrawableGeometry > | Ptr |
smart pointer type to this class | |
Public Types inherited from DrawableGeometryNode | |
typedef rw::core::Ptr< DrawableGeometryNode > | Ptr |
Smart pointer type for DrawableGeometryNode. | |
Public Types inherited from DrawableNode | |
enum | DrawableTypeMask { Physical = 1 , Virtual = 2 , DrawableObject = 4 , CollisionObject = 8 , User1 = 1024 , User2 = 2048 , User3 = 4096 , User4 = 8096 , ALL = 0x7FFFFFFF } |
draw mask is used to filter which drawables to exclude from rendering. More... | |
enum | DrawType { SOLID , WIRE , OUTLINE } |
when calling render on the draw mode or type can be specified. More... | |
typedef rw::core::Ptr< DrawableNode > | Ptr |
smart pointer type to this class | |
Public Types inherited from SceneNode | |
enum | AddPolicy { Front , Back } |
Policy for adding parent nodes. More... | |
enum | NodeType { GroupType = 0 , CameraType , DrawableType , UserBeginType = 1024 } |
Node types. More... | |
typedef rw::core::Ptr< SceneNode > | Ptr |
Smart pointer type for SceneNode. | |
typedef std::list< SceneNode::Ptr > | NodeList |
Type for the list of nodes. | |
typedef const std::list< SceneNode::Ptr > | NodeListConst |
Type for a const list of nodes. | |
Public Member Functions | |
DrawableGeometry (const std::string &name, unsigned int dmask=Physical) | |
Constructer for Drawable. More... | |
virtual | ~DrawableGeometry () |
Virtual destructor. | |
std::vector< rw::core::Ptr< rw::graphics::Render > > | getRenders () const |
Get this drawables Render object. | |
void | setColor (double r, double g, double b, double alpha) |
void | setColor (const rw::math::Vector3D<> &rgb) |
sets the RGB color of the geometry More... | |
void | setAlpha (double alpha) |
sets the alpha value More... | |
rw::math::Vector3D | getColor () |
get the RGB color More... | |
double | getAlpha () |
get alpha value More... | |
void | addLines (const std::vector< rw::geometry::Line > &lines) |
add lines to this geometry More... | |
void | addLine (const rw::math::Vector3D<> &v1, const rw::math::Vector3D<> &v2) |
add a single line segment to this geometry render More... | |
void | addGeometry (rw::core::Ptr< rw::geometry::Geometry > geom) |
add a geometry to this render More... | |
void | addFrameAxis (double size) |
add a frame axis to this geometry More... | |
virtual void | draw (const rw::graphics::DrawableNode::RenderInfo &info) const |
draws the object. More... | |
void | setHighlighted (bool b) |
enables or disables highlighting of the drawable class More... | |
bool | isHighlighted () const |
Returns whether the DrawableNode is highlighted. More... | |
void | setDrawType (rw::graphics::DrawableNode::DrawType drawType) |
Sets the DrawType. More... | |
void | setTransparency (float alpha) |
Sets up the color alpha value. More... | |
float | getTransparency () |
Gets the color alpha value. More... | |
void | setScale (float scale) |
Specifies the scale of the object. More... | |
float | getScale () const |
gets the scale of the object More... | |
void | setVisible (bool enable) |
enable or disable this drawable. When disabled the drawable will not render anything. More... | |
bool | isVisible () |
checks if this drawable is enabled More... | |
const rw::math::Transform3D & | getTransform () const |
gets the transformation of the drawable object More... | |
void | setTransform (const rw::math::Transform3D<> &t3d) |
Sets the transformation of the drawable object. More... | |
void | setMask (unsigned int mask) |
the group(s) that this drawable belong to More... | |
unsigned int | getMask () const |
Get the DrawableTypeMask for the node. More... | |
Public Member Functions inherited from DrawableNode | |
virtual | ~DrawableNode () |
Destructor. | |
bool | isTransparent () |
Check if node is transparent. More... | |
DrawableNode * | asDrawableNode () |
Get a pointer to a DrawableNode, if this is a DrawableNode. More... | |
Public Member Functions inherited from SceneNode | |
virtual | ~SceneNode () |
Destructor. | |
void | addParent (SceneNode::Ptr node, AddPolicy policy=Back) |
Add a parent node. More... | |
bool | hasParent (SceneNode::Ptr parent) |
Check if the given node is a parent node. More... | |
void | removeParent (SceneNode::Ptr node) |
erases the parent from the parent list. More... | |
virtual GroupNode * | asGroupNode () |
Get a pointer to a GroupNode, if this is a GroupNode. More... | |
virtual SceneCamera * | asCameraNode () |
Get a pointer to a CameraNode, if this is a CameraNode. More... | |
int | getType () |
Get the NodeType. More... | |
const std::string & | getName () |
Get the name of the node. More... | |
void | setName (const std::string &name) |
Set the name of this node. More... | |
Protected Attributes | |
rw::core::Ptr< Drawable > | _drawable |
The drawable that controls the rendering of the geometry, frame axes and more. | |
rw::core::Ptr< RenderLines > | _rlines |
Linear to render. | |
std::vector< rw::core::Ptr< RenderFrame > > | _rframes |
Renders for frames. | |
std::vector< rw::core::Ptr< RenderGeometry > > | _rgeoms |
Renders for geometries. | |
Additional Inherited Members | |
Static Public Member Functions inherited from SceneNode | |
static void | removeParent (SceneNode::Ptr node, SceneNode::Ptr parent) |
Remove a parent node. More... | |
Public Attributes inherited from SceneNode | |
std::string | _name |
The name of the node. | |
std::list< SceneNode::Ptr > | _parentNodes |
The list of parent nodes. | |
int | _type |
The NodeType. | |
Protected Member Functions inherited from DrawableGeometryNode | |
DrawableGeometryNode (const std::string &name) | |
Construct new drawable geometry node. More... | |
Protected Member Functions inherited from DrawableNode | |
DrawableNode (const std::string &name) | |
constructor | |
Protected Member Functions inherited from SceneNode | |
SceneNode (const std::string &name, int type) | |
Construct new scene node. More... | |
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:
DrawableGeometry | ( | const std::string & | name, |
unsigned int | dmask = Physical |
||
) |
Constructer for Drawable.
name | [in] name/id of this drawable |
dmask | [in] the drawmask of this drawable |
|
virtual |
add a frame axis to this geometry
size | [in] length of the frame axis's |
Implements DrawableGeometryNode.
|
virtual |
add a geometry to this render
geom | [in] a geometry that should be rendered |
Implements DrawableGeometryNode.
|
virtual |
add a single line segment to this geometry render
v1 | [in] line segment vertice 1 |
v2 | [in] line segment vertice 2 |
Implements DrawableGeometryNode.
|
virtual |
add lines to this geometry
lines | [in] list of line segments that should be added |
Implements DrawableGeometryNode.
|
virtual |
draws the object.
Implements DrawableNode.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
gets the transformation of the drawable object
Implements DrawableNode.
|
virtual |
Gets the color alpha value.
Implements DrawableNode.
|
virtual |
|
virtual |
checks if this drawable is enabled
Implements DrawableNode.
|
virtual |
sets the alpha value
alpha | [in] between [0;1], 0 is completely transparent |
Implements DrawableGeometryNode.
|
virtual |
sets the RGB color of the geometry
rgb | [in] red, green and blue must be between [0;1] |
Implements DrawableGeometryNode.
|
virtual |
r | [in] red [0;1] |
g | [in] green [0;1] |
b | [in] blue [0;1] |
alpha | [in] opasity value [0;1], 0 is completely transparent |
Implements DrawableGeometryNode.
|
virtual |
|
virtual |
enables or disables highlighting of the drawable class
b | [in] a if true highlight is enabled if false disabled |
Implements DrawableNode.
|
virtual |
the group(s) that this drawable belong to
mask | [in] drawable mask |
Implements DrawableNode.
|
virtual |
|
virtual |
Sets the transformation of the drawable object.
t3d | [in] transform of drawable object |
Implements DrawableNode.
|
virtual |
Sets up the color alpha value.
alpha | [in] \( 0.0 \) corresponds to fully transparent and \( 1.0\) to completely solid. |
Implements DrawableNode.
|
virtual |
enable or disable this drawable. When disabled the drawable will not render anything.
Implements DrawableNode.