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>
41 class ModelManipulatorPrivate;
96 const ignition::math::Vector3d &_axis,
97 const bool _local =
false);
104 const ignition::math::Vector3d &_axis,
105 const bool _local =
false);
112 const ignition::math::Vector3d &_axis,
113 const bool _local =
false);
124 const ignition::math::Vector3d &_point,
125 const double _interval = 1.0,
const double _sensitivity = 0.4);
146 const ignition::math::Vector2i &_start,
147 const ignition::math::Vector2i &_end,
148 const ignition::math::Pose3d &_pose,
149 const ignition::math::Vector3d &_axis,
const bool _local);
156 private: ignition::math::Vector3d MouseMoveDistance(
157 const ignition::math::Pose3d &_pose,
158 const ignition::math::Vector3d &_axis,
const bool _local)
const;
178 private: ignition::math::Vector3d UpdateScale(
179 const ignition::math::Vector3d &_axis,
180 const ignition::math::Vector3d &_scale,
const std::string &_geom);
187 private: std::unique_ptr<ModelManipulatorPrivate> dataPtr;
gui
Definition KeyEventHandler.hh:29
gazebo
Definition ModelManipulator.hh:35
gui
Definition ModelManipulator.hh:35
Singleton template class.
Definition SingletonT.hh:34
Generic description of a keyboard event.
Definition KeyEvent.hh:33
Generic description of a mouse event.
Definition MouseEvent.hh:36
Manipulator tool for translating/rotating/scaling models and links.
Definition ModelManipulator.hh:47
void OnMousePressEvent(const common::MouseEvent &_event)
Process an object translate mouse press event.
void Init()
Initialize the model manipulator.
void SetManipulationMode(const std::string &_mode)
Set the manipulation mode.
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 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.
void RotateEntity(rendering::VisualPtr &_vis, const ignition::math::Vector3d &_axis, const bool _local=false)
Rotate entity.
void SetAttachedVisual(rendering::VisualPtr _vis)
Set the visual to be manipulated by the model manipulator.
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.
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 Clear()
Clear the model manipulator.
void Detach()
Detach the manipulator from an entity.
void ScaleEntity(rendering::VisualPtr &_vis, const ignition::math::Vector3d &_axis, const bool _local=false)
Scale entity.
void OnKeyPressEvent(const common::KeyEvent &_event)
Process a key press event.
void OnMouseMoveEvent(const common::MouseEvent &_event)
Process an object translate mouse move event.
void OnMouseReleaseEvent(const common::MouseEvent &_event)
Process an object translate mouse release event.
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition SingletonT.hh:58
std::shared_ptr< Visual > VisualPtr
Definition RenderTypes.hh:114
boost::shared_ptr< Camera > CameraPtr
Definition RenderTypes.hh:90
Forward declarations for the common classes.
Definition Animation.hh:27