All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
gazebo::gui::ModelManipulator Class Reference

Manipulator tool for translating/rotating/scaling models and links. More...

#include <gui/Gui.hh>

Inheritance diagram for gazebo::gui::ModelManipulator:
Inheritance graph
[legend]
Collaboration diagram for gazebo::gui::ModelManipulator:
Collaboration graph
[legend]

Public Member Functions

void Init ()
 Initialize the model manipulator. More...
 
void OnKeyPressEvent (const common::KeyEvent &_event)
 Process a key press event. More...
 
void OnKeyReleaseEvent (const common::KeyEvent &_event)
 Process a key release event. More...
 
void OnMouseMoveEvent (const common::MouseEvent &_event)
 Process an object translate mouse move event. More...
 
void OnMousePressEvent (const common::MouseEvent &_event)
 Process an object translate mouse press event. More...
 
void OnMouseReleaseEvent (const common::MouseEvent &_event)
 Process an object translate mouse release event. More...
 
void RotateEntity (rendering::VisualPtr &_vis, const math::Vector3 &_axis, bool _local=false)
 Rotate entity. More...
 
void ScaleEntity (rendering::VisualPtr &_vis, const math::Vector3 &_axis, bool _local=false)
 Scale entity. More...
 
void SetAttachedVisual (rendering::VisualPtr _vis)
 Set the visual to be manipulated by the model manipulator. More...
 
void SetManipulationMode (const std::string &_mode)
 Set the manipulation mode. More...
 
void TranslateEntity (rendering::VisualPtr &_vis, const math::Vector3 &_axis, bool _local=false)
 Translate entity. More...
 

Static Public Member Functions

static math::Vector3 GetMouseMoveDistance (rendering::CameraPtr _camera, const math::Vector2i &_start, const math::Vector2i &_end, const math::Pose &_pose, const math::Vector3 &_axis, bool _local)
 Helper function to get the distance moved by the mouse. More...
 
static math::Vector3 GetMousePositionOnPlane (rendering::CameraPtr _camera, const common::MouseEvent &_event)
 Helper function to get the 3D position of mouse on ground plane. More...
 
static math::Vector3 SnapPoint (const math::Vector3 &_point, double _interval=1.0, double _sensitivity=0.4)
 Snap a point at intervals of a fixed distance. More...
 
- Static Public Member Functions inherited from SingletonT< ModelManipulator >
static ModelManipulator * Instance ()
 Get an instance of the singleton. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SingletonT< ModelManipulator >
 SingletonT ()
 Constructor. More...
 
virtual ~SingletonT ()
 Destructor. More...
 

Detailed Description

Manipulator tool for translating/rotating/scaling models and links.

Member Function Documentation

static math::Vector3 gazebo::gui::ModelManipulator::GetMouseMoveDistance ( rendering::CameraPtr  _camera,
const math::Vector2i _start,
const math::Vector2i _end,
const math::Pose _pose,
const math::Vector3 _axis,
bool  _local 
)
static

Helper function to get the distance moved by the mouse.

Parameters
[in]_cameraPointer to user camera.
[in]_posePose of origin.
[in]_axisMovement axis.
[in]_localTrue to get distance in local frame.
Returns
Mouse distance moved.
static math::Vector3 gazebo::gui::ModelManipulator::GetMousePositionOnPlane ( rendering::CameraPtr  _camera,
const common::MouseEvent _event 
)
static

Helper function to get the 3D position of mouse on ground plane.

param[in] _camera Pointer to user camera. param[in] _event Mouse event. return Point of mouse-plane intersection in world coordinates.

void gazebo::gui::ModelManipulator::Init ( )

Initialize the model manipulator.

void gazebo::gui::ModelManipulator::OnKeyPressEvent ( const common::KeyEvent _event)

Process a key press event.

Parameters
[in]_eventKey event.
void gazebo::gui::ModelManipulator::OnKeyReleaseEvent ( const common::KeyEvent _event)

Process a key release event.

Parameters
[in]_eventKey event.
void gazebo::gui::ModelManipulator::OnMouseMoveEvent ( const common::MouseEvent _event)

Process an object translate mouse move event.

Parameters
[in]_eventMouse event.
void gazebo::gui::ModelManipulator::OnMousePressEvent ( const common::MouseEvent _event)

Process an object translate mouse press event.

Parameters
[in]_eventMouse event.
void gazebo::gui::ModelManipulator::OnMouseReleaseEvent ( const common::MouseEvent _event)

Process an object translate mouse release event.

Parameters
[in]_eventMouse event.
void gazebo::gui::ModelManipulator::RotateEntity ( rendering::VisualPtr _vis,
const math::Vector3 _axis,
bool  _local = false 
)

Rotate entity.

Parameters
[in]_visVisual representing the entity.
[in]_axisAxis of rotation.
[in]_localTrue to apply rotation in local frame.
void gazebo::gui::ModelManipulator::ScaleEntity ( rendering::VisualPtr _vis,
const math::Vector3 _axis,
bool  _local = false 
)

Scale entity.

Parameters
[in]_visVisual representing the entity.
[in]_axisScaling axis.
[in]_localTrue to apply scaling in local frame.
void gazebo::gui::ModelManipulator::SetAttachedVisual ( rendering::VisualPtr  _vis)

Set the visual to be manipulated by the model manipulator.

void gazebo::gui::ModelManipulator::SetManipulationMode ( const std::string &  _mode)

Set the manipulation mode.

Parameters
[in]_modeManipulation mode: translate, rotate, or scale.
static math::Vector3 gazebo::gui::ModelManipulator::SnapPoint ( const math::Vector3 _point,
double  _interval = 1.0,
double  _sensitivity = 0.4 
)
static

Snap a point at intervals of a fixed distance.

Currently used to give a snapping behavior when moving models with a mouse.

Parameters
[in]_pointInput point.
[in]_intervalFixed distance interval at which the point is snapped.
[in]_sensitivitySensitivity of point snapping, in terms of a percentage of the interval.
Returns
Snapped 3D point.
void gazebo::gui::ModelManipulator::TranslateEntity ( rendering::VisualPtr _vis,
const math::Vector3 _axis,
bool  _local = false 
)

Translate entity.

Parameters
[in]_visVisual representing the entity.
[in]_axisAxis of translation.
[in]_localTrue to apply translation in local frame.

The documentation for this class was generated from the following file: