ModelSnap Class Reference

A gui tool for snapping one model to another. More...

#include <gui/Gui.hh>

Inherits SingletonT< ModelSnap >.

Public Member Functions

void Clear ()
 Clear the model snapping tool. More...
 
void Fini ()
 Clean up the model snap tool. More...
 
void GetSnapTransform (const std::vector< math::Vector3 > &_triangleSrc, const std::vector< math::Vector3 > &_triangleDest, const math::Pose &_poseSrc, math::Vector3 &_trans, math::Quaternion &_rot) GAZEBO_DEPRECATED(8.0)
 Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets. More...
 
void Init ()
 Initialize the model snapping tool. 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 Reset ()
 Reset the model snapping tool. More...
 
void Snap (const std::vector< math::Vector3 > &_triangleSrc, const std::vector< math::Vector3 > &_triangleDest, rendering::VisualPtr _visualSrc) GAZEBO_DEPRECATED(8.0)
 Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets. More...
 
void Snap (const ignition::math::Triangle3d &_triangleSrc, const ignition::math::Triangle3d &_triangleDest, rendering::VisualPtr _visualSrc)
 Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets. More...
 

Static Public Member Functions

static ModelSnapInstance ()
 Get an instance of the singleton. More...
 
static void SnapTransform (const ignition::math::Triangle3d &_triangleSrc, const ignition::math::Triangle3d &_triangleDest, const ignition::math::Pose3d &_poseSrc, ignition::math::Vector3d &_trans, ignition::math::Quaterniond &_rot)
 Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets. More...
 

Detailed Description

A gui tool for snapping one model to another.

Member Function Documentation

void Clear ( )

Clear the model snapping tool.

This explicity cleans up the internal state of the singleton and prepares it for exit.

void Fini ( )

Clean up the model snap tool.

void GetSnapTransform ( const std::vector< math::Vector3 > &  _triangleSrc,
const std::vector< math::Vector3 > &  _triangleDest,
const math::Pose _poseSrc,
math::Vector3 _trans,
math::Quaternion _rot 
)

Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets.

Parameters
[in]_triangleSrcvertices of target triangle being snapped to.
[in]_triangleDestvertices of the other triangle that will be moved.
[in]_poseSrcPose offset of triangleB relative to its model visual.
[out]_transTranslation output.
[out]_rotationRotation output.
Deprecated:
See function that accepts ignition::math parameters.
void Init ( )

Initialize the model snapping tool.

static ModelSnap * Instance ( )
inlinestaticinherited

Get an instance of the singleton.

void OnMouseMoveEvent ( const common::MouseEvent _event)

Process an object translate mouse move event.

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

Process an object translate mouse press event.

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

Process an object translate mouse release event.

Parameters
[in]_eventMouse event.
void Reset ( )

Reset the model snapping tool.

void Snap ( const std::vector< math::Vector3 > &  _triangleSrc,
const std::vector< math::Vector3 > &  _triangleDest,
rendering::VisualPtr  _visualSrc 
)

Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets.

Parameters
[in]_triangleSrcvertices of target triangle being snapped to.
[in]_triangleDestvertices of the other triangle that will be moved.
[in]_visualSrcVisual being moved by the snap action.
Deprecated:
See function that accepts ignition::math parameters.
void Snap ( const ignition::math::Triangle3d &  _triangleSrc,
const ignition::math::Triangle3d &  _triangleDest,
rendering::VisualPtr  _visualSrc 
)

Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets.

Parameters
[in]_triangleSrcvertices of target triangle being snapped to.
[in]_triangleDestvertices of the other triangle that will be moved.
[in]_visualSrcVisual being moved by the snap action.
static void SnapTransform ( const ignition::math::Triangle3d &  _triangleSrc,
const ignition::math::Triangle3d &  _triangleDest,
const ignition::math::Pose3d &  _poseSrc,
ignition::math::Vector3d &  _trans,
ignition::math::Quaterniond &  _rot 
)
static

Calculate the translation and rotation needed to snap the centroid of a mesh triangle of a visual to another, taking into account any pose offsets.

Parameters
[in]_triangleSrcvertices of target triangle being snapped to.
[in]_triangleDestvertices of the other triangle that will be moved.
[in]_poseSrcPose offset of triangleB relative to its model visual.
[out]_transTranslation output.
[out]_rotationRotation output.

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