Go to the documentation of this file.
17 #ifndef GAZEBO_GUI_MODELMANIPULATOR_HH_
18 #define GAZEBO_GUI_MODELMANIPULATOR_HH_
22 #include <ignition/math/Vector2.hh>
23 #include <ignition/math/Vector3.hh>
24 #include <ignition/math/Pose3.hh>
38 class ModelManipulatorPrivate;
59 public:
void Detach();
63 public:
void SetManipulationMode(
const std::string &_mode);
93 const ignition::math::Vector3d &_axis,
94 const bool _local =
false);
101 const ignition::math::Vector3d &_axis,
102 const bool _local =
false);
109 const ignition::math::Vector3d &_axis,
110 const bool _local =
false);
120 public:
static ignition::math::Vector3d SnapPoint(
121 const ignition::math::Vector3d &_point,
122 const double _interval = 1.0,
const double _sensitivity = 0.4);
129 public:
static ignition::math::Vector3d MousePositionOnPlane(
141 public:
static ignition::math::Vector3d MouseMoveDistance(
143 const ignition::math::Vector2i &_start,
144 const ignition::math::Vector2i &_end,
145 const ignition::math::Pose3d &_pose,
146 const ignition::math::Vector3d &_axis,
const bool _local);
153 private: ignition::math::Vector3d MouseMoveDistance(
154 const ignition::math::Pose3d &_pose,
155 const ignition::math::Vector3d &_axis,
const bool _local)
const;
175 private: ignition::math::Vector3d UpdateScale(
176 const ignition::math::Vector3d &_axis,
177 const ignition::math::Vector3d &_scale,
const std::string &_geom);
184 private: std::unique_ptr<ModelManipulatorPrivate> dataPtr;
static ignition::math::Vector3d MousePositionOnPlane(rendering::CameraPtr _camera, const common::MouseEvent &_event)
Helper function to get the 3D position of mouse on ground plane.
void RotateEntity(rendering::VisualPtr &_vis, const ignition::math::Vector3d &_axis, const bool _local=false)
Rotate entity.
void ScaleEntity(rendering::VisualPtr &_vis, const ignition::math::Vector3d &_axis, const bool _local=false)
Scale entity.
Forward declarations for the common classes.
Definition: Animation.hh:26
void OnMouseReleaseEvent(const common::MouseEvent &_event)
Process an object translate mouse release event.
Singleton template class.
Definition: SingletonT.hh:33
void OnMousePressEvent(const common::MouseEvent &_event)
Process an object translate mouse press event.
void TranslateEntity(rendering::VisualPtr &_vis, const ignition::math::Vector3d &_axis, const bool _local=false)
Translate entity.
void OnKeyReleaseEvent(const common::KeyEvent &_event)
Process a key release event.
static ignition::math::Vector3d SnapPoint(const ignition::math::Vector3d &_point, const double _interval=1.0, const double _sensitivity=0.4)
Snap a point at intervals of a fixed distance.
void OnMouseMoveEvent(const common::MouseEvent &_event)
Process an object translate mouse move event.
void OnKeyPressEvent(const common::KeyEvent &_event)
Process a key press event.
void SetManipulationMode(const std::string &_mode)
Set the manipulation mode.
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Manipulator tool for translating/rotating/scaling models and links.
Definition: ModelManipulator.hh:43
void SetAttachedVisual(rendering::VisualPtr _vis)
Set the visual to be manipulated by the model manipulator.
void Init()
Initialize the model manipulator.
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
void Detach()
Detach the manipulator from an entity.
void Clear()
Clear the model manipulator.
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90
static ignition::math::Vector3d MouseMoveDistance(rendering::CameraPtr _camera, const ignition::math::Vector2i &_start, const ignition::math::Vector2i &_end, const ignition::math::Pose3d &_pose, const ignition::math::Vector3d &_axis, const bool _local)
Helper function to get the distance moved by the mouse.
Generic description of a mouse event.
Definition: MouseEvent.hh:35