18 #ifndef _GAZEBO_VISUAL_HH_
19 #define _GAZEBO_VISUAL_HH_
21 #include <boost/enable_shared_from_this.hpp>
32 #include "gazebo/msgs/MessageTypes.hh"
59 public boost::enable_shared_from_this<Visual>
88 bool _useRTShader =
true);
96 bool _useRTShader =
true);
105 public:
virtual void Fini();
115 public:
void LoadFromMsg(ConstVisualPtr &_msg);
119 public:
void Load(sdf::ElementPtr _sdf);
122 public:
virtual void Load();
125 public:
void Update();
133 public: sdf::ElementPtr GetSDF()
const;
137 public:
void SetName(
const std::string &_name);
141 public: std::string GetName()
const;
145 public:
void AttachVisual(
VisualPtr _vis);
149 public:
void DetachVisual(
VisualPtr _vis);
153 public:
void DetachVisual(
const std::string &_name);
157 public:
void AttachObject(Ogre::MovableObject *_obj);
161 public:
bool HasAttachedObject(
const std::string &_name);
165 public:
unsigned int GetAttachedObjectCount()
const;
168 public:
void DetachObjects();
172 public:
unsigned int GetChildCount();
178 public:
VisualPtr GetChild(
unsigned int _index);
187 public: Ogre::MovableObject *AttachMesh(
const std::string &_meshName,
188 const std::string &_subMesh=
"",
189 bool _centerSubmesh =
false,
190 const std::string &_objName=
"");
202 public:
bool GetLighting()
const;
206 public:
void SetLighting(
bool _lighting);
213 public:
void SetMaterial(
const std::string &_materialName,
214 bool _unique =
true);
246 public:
void SetWireframe(
bool _show);
251 private:
void SetTransparencyInnerLoop(Ogre::SceneNode *_sceneNode);
256 public:
void SetTransparency(
float _trans);
260 public:
float GetTransparency();
265 public:
virtual void SetHighlighted(
bool _highlighted);
270 public:
bool GetHighlighted()
const;
274 public:
virtual void SetEmissive(
const common::Color &_color);
278 public:
bool GetCastShadows()
const;
282 public:
void SetCastShadows(
bool _shadows);
287 public:
void SetVisible(
bool _visible,
bool _cascade =
true);
290 public:
void ToggleVisible();
294 public:
bool GetVisible()
const;
306 public:
void SetPose(
const math::Pose &_pose);
326 public:
void SetWorldPose(
const math::Pose &_pose);
338 public: Ogre::SceneNode *GetSceneNode()
const;
341 public:
void MakeStatic();
345 public:
bool IsStatic()
const;
349 public:
void EnableTrackVisual(
VisualPtr _vis);
352 public:
void DisableTrackVisual();
356 public: std::string GetNormalMap()
const;
360 public:
void SetNormalMap(
const std::string &_nmap);
366 public:
void SetRibbonTrail(
bool _value,
372 public:
math::Box GetBoundingBox()
const;
388 unsigned int _index);
392 public: std::string GetMaterialName()
const;
398 public:
void InsertMesh(
const std::string &_meshName,
399 const std::string &_subMesh =
"",
400 bool _centerSubmesh =
false);
406 public:
static void InsertMesh(
const common::Mesh *_mesh,
407 const std::string &_subMesh =
"",
408 bool _centerSubmesh =
false);
412 public:
void UpdateFromMsg(ConstVisualPtr &_msg);
416 public:
bool IsPlane()
const;
433 public:
VisualPtr GetNthAncestor(
unsigned int _n);
438 public:
unsigned int GetDepth()
const;
443 public: std::string GetShaderType()
const;
448 public:
void SetShaderType(
const std::string &_type);
453 public:
void MoveToPosition(
const math::Pose &_pose,
double _time);
459 public:
void MoveToPositions(
const std::vector<math::Pose> &_pts,
461 boost::function<
void()> _onComplete =
NULL);
468 public:
void SetVisibilityFlags(uint32_t _flags);
475 public: uint32_t GetVisibilityFlags();
478 public:
void ShowBoundingBox();
483 public:
void ShowCollision(
bool _show);
487 public:
void ShowSkeleton(
bool _show);
491 public:
void SetScene(
ScenePtr _scene);
499 public:
void ShowJoints(
bool _show);
503 public:
void ShowCOM(
bool _show);
507 public:
void ShowInertia(
bool _show);
511 public:
void ShowLinkFrame(
bool _show);
515 public:
void SetSkeletonPose(
const msgs::PoseAnimation &_pose);
521 public:
void LoadPlugin(
const std::string &_filename,
522 const std::string &_name,
523 sdf::ElementPtr _sdf);
527 public:
void RemovePlugin(
const std::string &_name);
530 public: uint32_t GetId()
const;
533 public:
void SetId(uint32_t _id);
537 public: std::string GetGeometryType()
const;
541 public: std::string GetMeshName()
const;
546 public: std::string GetSubMeshName()
const;
549 public:
void ClearParent();
554 public:
void ToggleLayer(
const int32_t _layer);
568 const msgs::Visual::Type &_type);
573 public:
static msgs::Visual::Type ConvertVisualType(
584 const std::string &_name,
VisualPtr _parent,
585 bool _useRTShader =
true);
595 const std::string &_name,
ScenePtr _scene,
596 bool _useRTShader =
true);
604 private:
void Init(
const std::string &_name,
ScenePtr _scene,
613 private:
void Init(
const std::string &_name,
VisualPtr _parent,
618 private:
void LoadPlugins();
620 private:
void LoadPlugin(sdf::ElementPtr _sdf);
625 private:
void GetBoundsHelper(Ogre::SceneNode *_node,
631 private:
bool GetCenterSubMesh()
const;
635 private:
void DestroyAllAttachedMovableObjects(
636 Ogre::SceneNode *_sceneNode);
A 3D mesh.
Definition: Mesh.hh:44
VisualPrivate * dataPtr
Definition: Visual.hh:645
Class for drawing lines that can change.
Definition: DynamicLines.hh:43
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
Private data for the Visual class.
Definition: VisualPrivate.hh:57
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Mathematical representation of a box and related functions.
Definition: Box.hh:35
Visual visual.
Definition: Visual.hh:71
Sensor visual.
Definition: Visual.hh:75
VisualType
Type of visual.
Definition: Visual.hh:62
Model visual.
Definition: Visual.hh:67
A renderable object.
Definition: Visual.hh:58
RenderOpType
Type of render operation for a drawable.
Definition: RenderTypes.hh:197
#define GZ_RENDERING_VISIBLE
Definition: system.hh:241
Link visual.
Definition: Visual.hh:69
Collision visual.
Definition: Visual.hh:73
Entity visual.
Definition: Visual.hh:65
A quaternion class.
Definition: Quaternion.hh:42
A strip of connected lines, 1 vertex per line plus 1 start vertex.
Definition: RenderTypes.hh:207
#define NULL
Definition: CommonTypes.hh:30
Defines a color.
Definition: Color.hh:36
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:79
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:107
GUI visual.
Definition: Visual.hh:77