A renderable object. More...
#include <rendering/rendering.hh>
Public Member Functions | |
Visual (const std::string &_name, VisualPtr _parent, bool _useRTShader=true) | |
Constructor. More... | |
Visual (const std::string &_name, ScenePtr _scene, bool _useRTShader=true) | |
Constructor. More... | |
virtual | ~Visual () |
Destructor. More... | |
void | AttachAxes () |
Attach visualization axes. More... | |
void | AttachLineVertex (DynamicLines *_line, unsigned int _index) |
Attach a vertex of a line to the position of the visual. More... | |
Ogre::MovableObject * | AttachMesh (const std::string &_meshName, const std::string &_subMesh="", bool _centerSubmesh=false, const std::string &_objName="") |
Attach a mesh to this visual by name. More... | |
void | AttachObject (Ogre::MovableObject *_obj) |
Attach a renerable object to the visual. More... | |
void | AttachVisual (VisualPtr _vis) |
Attach a visual to this visual. More... | |
void | ClearParent () |
Clear parents. More... | |
VisualPtr | Clone (const std::string &_name, VisualPtr _newParent) |
Clone the visual with a new name. More... | |
DynamicLines * | CreateDynamicLine (RenderOpType _type=RENDERING_LINE_STRIP) |
Add a line to the visual. More... | |
void | DeleteDynamicLine (DynamicLines *_line) |
Delete a dynamic line. More... | |
void | DetachObjects () |
Detach all objects. More... | |
void | DetachVisual (VisualPtr _vis) |
Detach a visual. More... | |
void | DetachVisual (const std::string &_name) |
Detach a visual. More... | |
void | DisableTrackVisual () |
Disable tracking of a visual. More... | |
void | EnableTrackVisual (VisualPtr _vis) |
Set one visual to track/follow another. More... | |
void | Fini () |
Helper for the destructor. More... | |
unsigned int | GetAttachedObjectCount () const |
Return the number of attached movable objects. More... | |
math::Box | GetBoundingBox () const |
Get the bounding box for the visual. More... | |
VisualPtr | GetChild (unsigned int _index) |
Get an attached visual based on an index. More... | |
unsigned int | GetChildCount () |
Get the number of attached visuals. More... | |
bool | GetHighlighted () const |
Get whether or not the visual is visually highlighted. More... | |
uint32_t | GetId () const |
Get the id associated with this visual. More... | |
std::string | GetMaterialName () const |
Get the name of the material. More... | |
std::string | GetMeshName () const |
The name of the mesh set in the visual's SDF. More... | |
std::string | GetName () const |
Get the name of the visual. More... | |
std::string | GetNormalMap () const |
Get the normal map. More... | |
VisualPtr | GetParent () const |
Get the parent visual, if one exists. More... | |
math::Pose | GetPose () const |
Get the pose of the visual. More... | |
math::Vector3 | GetPosition () const |
Get the position of the visual. More... | |
VisualPtr | GetRootVisual () |
Get the root visual. More... | |
math::Quaternion | GetRotation () const |
Get the rotation of the visual. More... | |
math::Vector3 | GetScale () |
Get the scale. More... | |
ScenePtr | GetScene () const |
Get current. More... | |
Ogre::SceneNode * | GetSceneNode () const |
Return the scene Node of this visual entity. More... | |
std::string | GetShaderType () const |
Get the shader type. More... | |
std::string | GetSubMeshName () const |
Get the name of the sub mesh set in the visual's SDF. More... | |
float | GetTransparency () |
Get the transparency. More... | |
uint32_t | GetVisibilityFlags () |
Get visibility flags for this visual and all children. More... | |
bool | GetVisible () const |
Get whether the visual is visible. More... | |
math::Pose | GetWorldPose () const |
Get the global pose of the node. More... | |
bool | HasAttachedObject (const std::string &_name) |
Returns true if an object with _name is attached. More... | |
void | Init () |
Helper for the contructor. More... | |
void | InsertMesh (const std::string &_meshName, const std::string &_subMesh="", bool _centerSubmesh=false) |
Insert a mesh into Ogre. More... | |
bool | IsPlane () const |
Return true if the visual is a plane. More... | |
bool | IsStatic () const |
Return true if the visual is a static geometry. More... | |
void | Load (sdf::ElementPtr _sdf) |
Load the visual with a set of parameters. More... | |
virtual void | Load () |
Load the visual with default parameters. More... | |
void | LoadFromMsg (ConstVisualPtr &_msg) |
Load from a message. More... | |
void | LoadPlugin (const std::string &_filename, const std::string &_name, sdf::ElementPtr _sdf) |
Load a plugin. More... | |
void | MakeStatic () |
Make the visual objects static renderables. More... | |
void | MoveToPosition (const math::Pose &_pose, double _time) |
Move to a pose and over a given time. More... | |
void | MoveToPositions (const std::vector< math::Pose > &_pts, double _time, boost::function< void()> _onComplete=NULL) |
Move to a series of pose and over a given time. More... | |
void | RemovePlugin (const std::string &_name) |
Remove a running plugin. More... | |
void | SetAmbient (const common::Color &_color) |
Set the ambient color of the visual. More... | |
void | SetCastShadows (bool _shadows) |
Set whether the visual should cast shadows. More... | |
void | SetDiffuse (const common::Color &_color) |
Set the diffuse color of the visual. More... | |
virtual void | SetEmissive (const common::Color &_color) |
Set the emissive value. More... | |
void | SetHighlighted (bool _highlighted) |
Set the visual to be visually highlighted. More... | |
void | SetId (uint32_t _id) |
Set the id associated with this visual. More... | |
void | SetLighting (bool _lighting) |
Set whether or not to enable or disable lighting. More... | |
void | SetMaterial (const std::string &_materialName, bool _unique=true) |
Set the material. More... | |
void | SetName (const std::string &_name) |
Set the name of the visual. More... | |
void | SetNormalMap (const std::string &_nmap) |
Set the normal map. More... | |
void | SetPose (const math::Pose &_pose) |
Set the pose of the visual. More... | |
void | SetPosition (const math::Vector3 &_pos) |
Set the position of the visual. More... | |
void | SetRibbonTrail (bool _value, const common::Color &_initialColor, const common::Color &_changeColor) |
True on or off a ribbon trail. More... | |
void | SetRotation (const math::Quaternion &_rot) |
Set the rotation of the visual. More... | |
void | SetScale (const math::Vector3 &_scale) |
Set the scale. More... | |
void | SetScene (ScenePtr _scene) |
Set current scene. More... | |
void | SetShaderType (const std::string &_type) |
Set the shader type for the visual's material. More... | |
void | SetSkeletonPose (const msgs::PoseAnimation &_pose) |
Set animation skeleton pose. More... | |
void | SetSpecular (const common::Color &_color) |
Set the specular color of the visual. More... | |
void | SetTransparency (float _trans) |
Set the transparency. More... | |
void | SetVisibilityFlags (uint32_t _flags) |
Set visibility flags for this visual and all children. More... | |
void | SetVisible (bool _visible, bool _cascade=true) |
Set whether the visual is visible. More... | |
void | SetWireframe (bool _show) |
Enable or disable wireframe for this visual. More... | |
void | SetWorldPose (const math::Pose &_pose) |
Set the world pose of the visual. More... | |
void | SetWorldPosition (const math::Vector3 &_pos) |
Set the world linear position of the visual. More... | |
void | SetWorldRotation (const math::Quaternion &_rot) |
Set the world orientation of the visual. More... | |
void | ShowBoundingBox () |
Display the bounding box visual. More... | |
void | ShowCollision (bool _show) |
Display the collision visuals. More... | |
void | ShowCOM (bool _show) |
Display Center of Mass visuals. More... | |
void | ShowJoints (bool _show) |
Display joint visuals. More... | |
void | ShowSkeleton (bool _show) |
Display the skeleton visuals. More... | |
void | ToggleVisible () |
Toggle whether this visual is visible. More... | |
void | Update () |
Update the visual. More... | |
void | UpdateFromMsg (ConstVisualPtr &_msg) |
Update a visual based on a message. More... | |
Static Public Member Functions | |
static void | InsertMesh (const common::Mesh *_mesh, const std::string &_subMesh="", bool _centerSubmesh=false) |
Insert a mesh into Ogre. More... | |
Protected Member Functions | |
Visual (VisualPrivate &_dataPtr, const std::string &_name, VisualPtr _parent, bool _useRTShader=true) | |
Visual (VisualPrivate &_dataPtr, const std::string &_name, ScenePtr _scene, bool _useRTShader=true) | |
Protected Attributes | |
VisualPrivate * | dataPtr |
A renderable object.
gazebo::rendering::Visual::Visual | ( | const std::string & | _name, |
VisualPtr | _parent, | ||
bool | _useRTShader = true |
||
) |
Constructor.
[in] | _name | Name of the visual. |
[in] | _parent | Parent of the visual. |
[in] | _useRTShader | True if the visual should use the real-time shader system (RTShader). |
gazebo::rendering::Visual::Visual | ( | const std::string & | _name, |
ScenePtr | _scene, | ||
bool | _useRTShader = true |
||
) |
Constructor.
[in] | _name | Name of the visual. |
[in] | _scene | Scene containing the visual. |
[in] | _useRTShader | True if the visual should use the real-time shader system (RTShader). |
|
virtual |
Destructor.
|
protected |
|
protected |
void gazebo::rendering::Visual::AttachAxes | ( | ) |
Attach visualization axes.
void gazebo::rendering::Visual::AttachLineVertex | ( | DynamicLines * | _line, |
unsigned int | _index | ||
) |
Attach a vertex of a line to the position of the visual.
[in] | _line | Line to attach to this visual. |
[in] | _index | Index of the line vertex to attach. |
Ogre::MovableObject* gazebo::rendering::Visual::AttachMesh | ( | const std::string & | _meshName, |
const std::string & | _subMesh = "" , |
||
bool | _centerSubmesh = false , |
||
const std::string & | _objName = "" |
||
) |
Attach a mesh to this visual by name.
[in] | _meshName | Name of the mesh. |
[in] | _subMesh | Name of the submesh. Empty string to use all submeshes. |
[in] | _centerSubmesh | True to center a submesh. |
[in] | _objName | Name of the attached Object to put the mesh onto. |
void gazebo::rendering::Visual::AttachObject | ( | Ogre::MovableObject * | _obj | ) |
Attach a renerable object to the visual.
[in] | _obj | A movable object to attach to the visual. |
void gazebo::rendering::Visual::AttachVisual | ( | VisualPtr | _vis | ) |
Attach a visual to this visual.
[in] | _vis | Visual to attach. |
void gazebo::rendering::Visual::ClearParent | ( | ) |
Clear parents.
DynamicLines* gazebo::rendering::Visual::CreateDynamicLine | ( | RenderOpType | _type = RENDERING_LINE_STRIP | ) |
Add a line to the visual.
[in] | _type | The type of line to make. |
void gazebo::rendering::Visual::DeleteDynamicLine | ( | DynamicLines * | _line | ) |
Delete a dynamic line.
[in] | _line | Pointer to the line to delete. |
void gazebo::rendering::Visual::DetachObjects | ( | ) |
Detach all objects.
void gazebo::rendering::Visual::DetachVisual | ( | VisualPtr | _vis | ) |
Detach a visual.
[in] | _vis | Visual to detach. |
void gazebo::rendering::Visual::DetachVisual | ( | const std::string & | _name | ) |
Detach a visual.
[in] | _name | Name of the visual to detach. |
void gazebo::rendering::Visual::DisableTrackVisual | ( | ) |
Disable tracking of a visual.
void gazebo::rendering::Visual::EnableTrackVisual | ( | VisualPtr | _vis | ) |
Set one visual to track/follow another.
[in] | _vis | Visual to track. |
void gazebo::rendering::Visual::Fini | ( | ) |
Helper for the destructor.
unsigned int gazebo::rendering::Visual::GetAttachedObjectCount | ( | ) | const |
Return the number of attached movable objects.
math::Box gazebo::rendering::Visual::GetBoundingBox | ( | ) | const |
Get the bounding box for the visual.
VisualPtr gazebo::rendering::Visual::GetChild | ( | unsigned int | _index | ) |
Get an attached visual based on an index.
Index should be between 0 and Visual::GetChildCount.
[in] | _index | Index of the child to retreive. |
unsigned int gazebo::rendering::Visual::GetChildCount | ( | ) |
Get the number of attached visuals.
bool gazebo::rendering::Visual::GetHighlighted | ( | ) | const |
Get whether or not the visual is visually highlighted.
This is most often means that an object is selected by a user via the GUI.
uint32_t gazebo::rendering::Visual::GetId | ( | ) | const |
Get the id associated with this visual.
std::string gazebo::rendering::Visual::GetMaterialName | ( | ) | const |
Get the name of the material.
std::string gazebo::rendering::Visual::GetMeshName | ( | ) | const |
The name of the mesh set in the visual's SDF.
std::string gazebo::rendering::Visual::GetName | ( | ) | const |
Get the name of the visual.
std::string gazebo::rendering::Visual::GetNormalMap | ( | ) | const |
Get the normal map.
VisualPtr gazebo::rendering::Visual::GetParent | ( | ) | const |
Get the parent visual, if one exists.
math::Pose gazebo::rendering::Visual::GetPose | ( | ) | const |
Get the pose of the visual.
math::Vector3 gazebo::rendering::Visual::GetPosition | ( | ) | const |
Get the position of the visual.
VisualPtr gazebo::rendering::Visual::GetRootVisual | ( | ) |
Get the root visual.
math::Quaternion gazebo::rendering::Visual::GetRotation | ( | ) | const |
Get the rotation of the visual.
math::Vector3 gazebo::rendering::Visual::GetScale | ( | ) |
Get the scale.
ScenePtr gazebo::rendering::Visual::GetScene | ( | ) | const |
Get current.
Ogre::SceneNode* gazebo::rendering::Visual::GetSceneNode | ( | ) | const |
Return the scene Node of this visual entity.
std::string gazebo::rendering::Visual::GetShaderType | ( | ) | const |
Get the shader type.
std::string gazebo::rendering::Visual::GetSubMeshName | ( | ) | const |
Get the name of the sub mesh set in the visual's SDF.
float gazebo::rendering::Visual::GetTransparency | ( | ) |
Get the transparency.
uint32_t gazebo::rendering::Visual::GetVisibilityFlags | ( | ) |
Get visibility flags for this visual and all children.
bool gazebo::rendering::Visual::GetVisible | ( | ) | const |
Get whether the visual is visible.
math::Pose gazebo::rendering::Visual::GetWorldPose | ( | ) | const |
Get the global pose of the node.
bool gazebo::rendering::Visual::HasAttachedObject | ( | const std::string & | _name | ) |
Returns true if an object with _name is attached.
[in] | _name | Name of an object to find. |
void gazebo::rendering::Visual::Init | ( | ) |
Helper for the contructor.
void gazebo::rendering::Visual::InsertMesh | ( | const std::string & | _meshName, |
const std::string & | _subMesh = "" , |
||
bool | _centerSubmesh = false |
||
) |
Insert a mesh into Ogre.
[in] | _meshName | Name of the mesh to insert. |
[in] | _subMesh | Name of the mesh within _meshName to insert. |
[in] | _centerSubmesh | True to center the submesh. |
|
static |
Insert a mesh into Ogre.
[in] | _mesh | Pointer to the mesh to insert. |
[in] | _subMesh | Name of the mesh within _meshName to insert. |
[in] | _centerSubmesh | True to center the submesh. |
bool gazebo::rendering::Visual::IsPlane | ( | ) | const |
Return true if the visual is a plane.
bool gazebo::rendering::Visual::IsStatic | ( | ) | const |
Return true if the visual is a static geometry.
void gazebo::rendering::Visual::Load | ( | sdf::ElementPtr | _sdf | ) |
Load the visual with a set of parameters.
[in] | _sdf | Load from an SDF element. |
|
virtual |
Load the visual with default parameters.
Reimplemented in gazebo::rendering::SelectionObj, gazebo::rendering::SonarVisual, gazebo::rendering::TransmitterVisual, gazebo::rendering::AxisVisual, and gazebo::rendering::ArrowVisual.
void gazebo::rendering::Visual::LoadFromMsg | ( | ConstVisualPtr & | _msg | ) |
Load from a message.
[in] | _msg | A visual message. |
void gazebo::rendering::Visual::LoadPlugin | ( | const std::string & | _filename, |
const std::string & | _name, | ||
sdf::ElementPtr | _sdf | ||
) |
Load a plugin.
_filename | The filename of the plugin |
_name | A unique name for the plugin |
_sdf | The SDF to pass into the plugin. |
void gazebo::rendering::Visual::MakeStatic | ( | ) |
Make the visual objects static renderables.
void gazebo::rendering::Visual::MoveToPosition | ( | const math::Pose & | _pose, |
double | _time | ||
) |
Move to a pose and over a given time.
[in] | _pose | Pose the visual will end at. |
[in] | _time | Time it takes the visual to move to the pose. |
void gazebo::rendering::Visual::MoveToPositions | ( | const std::vector< math::Pose > & | _pts, |
double | _time, | ||
boost::function< void()> | _onComplete = NULL |
||
) |
Move to a series of pose and over a given time.
[in] | _poses | Series of poses the visual will move to. |
[in] | _time | Time it takes the visual to move to the pose. |
[in] | _onComplete | Callback used when the move is complete. |
void gazebo::rendering::Visual::RemovePlugin | ( | const std::string & | _name | ) |
Remove a running plugin.
_name | The unique name of the plugin to remove |
void gazebo::rendering::Visual::SetAmbient | ( | const common::Color & | _color | ) |
Set the ambient color of the visual.
[in] | _color | The ambient color. |
void gazebo::rendering::Visual::SetCastShadows | ( | bool | _shadows | ) |
Set whether the visual should cast shadows.
[in] | _shadows | True to enable shadows. |
void gazebo::rendering::Visual::SetDiffuse | ( | const common::Color & | _color | ) |
Set the diffuse color of the visual.
[in] | _color | Set the diffuse color. |
|
virtual |
Set the emissive value.
[in] | _color | The emissive color. |
Reimplemented in gazebo::rendering::LaserVisual.
void gazebo::rendering::Visual::SetHighlighted | ( | bool | _highlighted | ) |
Set the visual to be visually highlighted.
This is most often used when an object is selected by a user via the GUI.
[in] | _highlighted | True to enable the highlighting. |
void gazebo::rendering::Visual::SetId | ( | uint32_t | _id | ) |
Set the id associated with this visual.
void gazebo::rendering::Visual::SetLighting | ( | bool | _lighting | ) |
Set whether or not to enable or disable lighting.
[in] | _lighting | True to enable lighting. |
void gazebo::rendering::Visual::SetMaterial | ( | const std::string & | _materialName, |
bool | _unique = true |
||
) |
Set the material.
[in] | _materialName | The name of the material. |
[in] | _unique | True to make the material unique, which allows the material to change without changing materials that originally had the same name. |
void gazebo::rendering::Visual::SetName | ( | const std::string & | _name | ) |
Set the name of the visual.
[in] | _name | Name of the visual |
void gazebo::rendering::Visual::SetNormalMap | ( | const std::string & | _nmap | ) |
Set the normal map.
[in] | _nmap | Name of the normal map material. |
void gazebo::rendering::Visual::SetPose | ( | const math::Pose & | _pose | ) |
Set the pose of the visual.
[in] | _pose | The new pose of the visual. |
void gazebo::rendering::Visual::SetPosition | ( | const math::Vector3 & | _pos | ) |
Set the position of the visual.
[in] | _pos | The position to set the visual to. |
void gazebo::rendering::Visual::SetRibbonTrail | ( | bool | _value, |
const common::Color & | _initialColor, | ||
const common::Color & | _changeColor | ||
) |
True on or off a ribbon trail.
[in] | _value | True to enable ribbon trail. |
[in] | _initialColor | The initial color of the ribbon trail. |
[in] | _changeColor | Color to change too as the trail grows. |
void gazebo::rendering::Visual::SetRotation | ( | const math::Quaternion & | _rot | ) |
Set the rotation of the visual.
[in] | _rot | The rotation of the visual. |
void gazebo::rendering::Visual::SetScale | ( | const math::Vector3 & | _scale | ) |
Set the scale.
[in] | _scale | The scaling factor for the visual. |
void gazebo::rendering::Visual::SetScene | ( | ScenePtr | _scene | ) |
Set current scene.
[in] | _scene | Pointer to the scene. |
void gazebo::rendering::Visual::SetShaderType | ( | const std::string & | _type | ) |
Set the shader type for the visual's material.
[in] | _type | Shader type string: "vertex", "pixel", "normal_map_object_space", "normal_map_tangent_space". |
void gazebo::rendering::Visual::SetSkeletonPose | ( | const msgs::PoseAnimation & | _pose | ) |
Set animation skeleton pose.
[in] | _pose | Skelton message |
void gazebo::rendering::Visual::SetSpecular | ( | const common::Color & | _color | ) |
Set the specular color of the visual.
[in] | _color | Specular color. |
void gazebo::rendering::Visual::SetTransparency | ( | float | _trans | ) |
Set the transparency.
[in] | _trans | The transparency, between 0 and 1 where 0 is no transparency. |
void gazebo::rendering::Visual::SetVisibilityFlags | ( | uint32_t | _flags | ) |
Set visibility flags for this visual and all children.
[in] | _flags | The visiblity flags. |
void gazebo::rendering::Visual::SetVisible | ( | bool | _visible, |
bool | _cascade = true |
||
) |
Set whether the visual is visible.
[in] | _visible | set this node visible. |
[in] | _cascade | setting this parameter in children too. |
void gazebo::rendering::Visual::SetWireframe | ( | bool | _show | ) |
Enable or disable wireframe for this visual.
[in] | _show | True to enable wireframe for this visual. |
void gazebo::rendering::Visual::SetWorldPose | ( | const math::Pose & | _pose | ) |
Set the world pose of the visual.
[in] | _pose | Pose of the visual in the world coordinate frame. |
void gazebo::rendering::Visual::SetWorldPosition | ( | const math::Vector3 & | _pos | ) |
Set the world linear position of the visual.
[in] | _pose | Position in the world coordinate frame. |
void gazebo::rendering::Visual::SetWorldRotation | ( | const math::Quaternion & | _rot | ) |
Set the world orientation of the visual.
[in] | _rot | Rotation in the world coordinate frame. |
void gazebo::rendering::Visual::ShowBoundingBox | ( | ) |
Display the bounding box visual.
void gazebo::rendering::Visual::ShowCollision | ( | bool | _show | ) |
Display the collision visuals.
[in] | _show | True to show visuals labeled as collision objects. |
void gazebo::rendering::Visual::ShowCOM | ( | bool | _show | ) |
Display Center of Mass visuals.
[in] | _show | True to show center of mass visualizations. |
void gazebo::rendering::Visual::ShowJoints | ( | bool | _show | ) |
Display joint visuals.
[in] | _show | True to show joint visualizations. |
void gazebo::rendering::Visual::ShowSkeleton | ( | bool | _show | ) |
Display the skeleton visuals.
[in] | _show | True to show skeleton visuals. |
void gazebo::rendering::Visual::ToggleVisible | ( | ) |
Toggle whether this visual is visible.
void gazebo::rendering::Visual::Update | ( | ) |
Update the visual.
void gazebo::rendering::Visual::UpdateFromMsg | ( | ConstVisualPtr & | _msg | ) |
Update a visual based on a message.
[in] | _msg | The visual message. |
|
protected |