#include <interactive_marker_control.h>
Public Types | |
enum | ControlHighlight { NO_HIGHLIGHT = 0, HOVER_HIGHLIGHT = 3, ACTIVE_HIGHLIGHT = 5 } |
Public Member Functions | |
virtual void | enableInteraction (bool enable) |
const QString & | getDescription () |
int | getInteractionMode () |
const std::string & | getName () |
int | getOrientationMode () |
InteractiveMarker * | getParent () |
bool | getVisible () |
virtual void | handle3DCursorEvent (ViewportMouseEvent event, const Ogre::Vector3 &cursor_3D_pos, const Ogre::Quaternion &cursor_3D_orientation) |
virtual void | handleMouseEvent (ViewportMouseEvent &event) |
InteractiveMarkerControl (DisplayContext *context, Ogre::SceneNode *reference_node, InteractiveMarker *parent) | |
Constructor. More... | |
void | interactiveMarkerPoseChanged (Ogre::Vector3 int_marker_position, Ogre::Quaternion int_marker_orientation) |
bool | isInteractive () |
void | processMessage (const visualization_msgs::InteractiveMarkerControl &message) |
Set up or update the contents of this control to match the specification in the message. More... | |
void | setHighlight (const ControlHighlight &hl) |
void | setShowVisualAids (bool show) |
If true, will show some geometric helpers while dragging. More... | |
void | setVisible (bool visible) |
void | update () |
virtual | ~InteractiveMarkerControl () |
Public Member Functions inherited from rviz::InteractiveObject | |
virtual | ~InteractiveObject () |
Protected Types | |
typedef boost::shared_ptr< MarkerBase > | MarkerBasePtr |
typedef boost::shared_ptr< PointsMarker > | PointsMarkerPtr |
Protected Member Functions | |
void | addHighlightPass (S_MaterialPtr materials) |
take all the materials, add a highlight pass and store a pointer to the pass for later use More... | |
void | beginMouseMovement (ViewportMouseEvent &event, bool line_visible) |
void | beginRelativeMouseMotion (const ViewportMouseEvent &event) |
Ogre::Vector3 | closestPointOnLineToPoint (const Ogre::Vector3 &line_start, const Ogre::Vector3 &line_dir, const Ogre::Vector3 &test_point) |
bool | findClosestPoint (const Ogre::Ray &target_ray, const Ogre::Ray &mouse_ray, Ogre::Vector3 &closest_point) |
virtual const QCursor & | getCursor () const |
Ogre::Ray | getMouseRayInReferenceFrame (const ViewportMouseEvent &event, int x, int y) |
bool | getRelativeMouseMotion (const ViewportMouseEvent &event, int &dx, int &dy) |
void | handleMouseMovement (ViewportMouseEvent &event) |
void | handleMouseWheelMovement (ViewportMouseEvent &event) |
bool | intersectSomeYzPlane (const Ogre::Ray &mouse_ray, const Ogre::Vector3 &point_in_plane, const Ogre::Quaternion &plane_orientation, Ogre::Vector3 &intersection_3d, Ogre::Vector2 &intersection_2d, float &ray_t) |
compute intersection between mouse ray and a y-z plane. More... | |
bool | intersectYzPlane (const Ogre::Ray &mouse_ray, Ogre::Vector3 &intersection_3d, Ogre::Vector2 &intersection_2d, float &ray_t) |
compute intersection between mouse ray and y-z plane given in local coordinates More... | |
void | makeMarkers (const visualization_msgs::InteractiveMarkerControl &message) |
Create marker objects from the message and add them to the internal marker arrays. More... | |
void | move3D (const Ogre::Vector3 &cursor_position_in_reference_frame, const Ogre::Quaternion &cursor_orientation_in_reference_frame) |
void | moveAxis (const Ogre::Ray &mouse_ray, const ViewportMouseEvent &event) |
void | moveAxis (const Ogre::Vector3 &cursor_position_in_reference_frame) |
void | movePlane (Ogre::Ray &mouse_ray) |
void | movePlane (const Ogre::Vector3 &cursor_position_in_reference_frame) |
void | moveRotate (Ogre::Ray &mouse_ray) |
void | moveRotate (const Ogre::Vector3 &cursor_position_in_reference_frame, bool lock_axis=true) |
void | moveRotate3D (const Ogre::Vector3 &cursor_position_in_reference_frame, const Ogre::Quaternion &cursor_orientation_in_reference_frame) |
void | moveViewPlane (Ogre::Ray &mouse_ray, const ViewportMouseEvent &event) |
void | moveZAxisRelative (const ViewportMouseEvent &event) |
void | moveZAxisWheel (const ViewportMouseEvent &event) |
virtual void | preFindVisibleObjects (Ogre::SceneManager *source, Ogre::SceneManager::IlluminationRenderStage irs, Ogre::Viewport *v) |
void | recordDraggingInPlaceEvent (ViewportMouseEvent &event) |
void | rotate (Ogre::Ray &mouse_ray) |
void | rotate (const Ogre::Vector3 &cursor_position_in_reference_frame) |
void | rotate3D (const Ogre::Vector3 &cursor_position_in_reference_frame, const Ogre::Quaternion &cursor_orientation_in_reference_frame) |
void | rotateXYRelative (const ViewportMouseEvent &event) |
void | rotateZRelative (const ViewportMouseEvent &event) |
void | setHighlight (float a) |
void | stopDragging (bool force=false) |
void | updateControlOrientationForViewFacing (Ogre::Viewport *v) |
void | worldToScreen (const Ogre::Vector3 &pos_rel_reference, const Ogre::Viewport *viewport, Ogre::Vector2 &screen_pos) |
A single control element of an InteractiveMarker.
Definition at line 68 of file interactive_marker_control.h.
|
protected |
Definition at line 354 of file interactive_marker_control.h.
|
protected |
Definition at line 364 of file interactive_marker_control.h.
Enumerator | |
---|---|
NO_HIGHLIGHT | |
HOVER_HIGHLIGHT | |
ACTIVE_HIGHLIGHT |
Definition at line 140 of file interactive_marker_control.h.
rviz::InteractiveMarkerControl::InteractiveMarkerControl | ( | DisplayContext * | context, |
Ogre::SceneNode * | reference_node, | ||
InteractiveMarker * | parent | ||
) |
Constructor.
Just creates Ogre::SceneNodes and sets some defaults. To actually make it look like a visualization_msgs::InteractiveMarkerControl message specifies, call processMessage().
Definition at line 64 of file interactive_marker_control.cpp.
|
virtual |
Definition at line 128 of file interactive_marker_control.cpp.
|
protected |
take all the materials, add a highlight pass and store a pointer to the pass for later use
Definition at line 1428 of file interactive_marker_control.cpp.
|
protected |
Definition at line 1234 of file interactive_marker_control.cpp.
|
protected |
begin a relative-motion drag.
Definition at line 461 of file interactive_marker_control.cpp.
|
protected |
Definition at line 371 of file interactive_marker_control.cpp.
|
virtual |
Implements rviz::InteractiveObject.
Definition at line 320 of file interactive_marker_control.cpp.
|
protected |
Find the closest point on target_ray to mouse_ray.
closest_point | contains result point on target_ray if rays are not effectively parallel. |
Find the closest point on target_ray to mouse_ray.
Definition at line 637 of file interactive_marker_control.cpp.
|
inlineprotectedvirtual |
Implements rviz::InteractiveObject.
Definition at line 307 of file interactive_marker_control.h.
|
inline |
Definition at line 160 of file interactive_marker_control.h.
|
inline |
Definition at line 165 of file interactive_marker_control.h.
|
protected |
calculate a mouse ray in the reference frame. A mouse ray is a ray starting at the camera and pointing towards the mouse position.
Definition at line 446 of file interactive_marker_control.cpp.
|
inline |
Definition at line 155 of file interactive_marker_control.h.
|
inline |
Definition at line 170 of file interactive_marker_control.h.
|
inline |
Definition at line 150 of file interactive_marker_control.h.
|
protected |
get the relative motion of the mouse, and put the mouse back where it was when beginRelativeMouseMotion() was called.
Definition at line 473 of file interactive_marker_control.cpp.
bool rviz::InteractiveMarkerControl::getVisible | ( | ) |
Definition at line 294 of file interactive_marker_control.cpp.
|
virtual |
This is the main entry-point for interaction using a 3D cursor.
The ViewportMouseEvent struct is used to "fake" a mouse event. An event must have the panel, viewport, and type members filled in. The acting_button and buttons_down members can be specified as well, if appropriate. All other fields are currently ignored.
A sample construction of a "right-button mouse-up" event:
For more examples, see the implementation in the interaction_cursor_rviz package.
event | A struct holding certain event data (see description above). |
cursor_pos | The world-relative position of the 3D cursor. |
cursor_rot | The world-relative orientation of the 3D cursor. |
control_name | The name of the child InteractiveMarkerControl calling this function. |
Definition at line 983 of file interactive_marker_control.cpp.
|
virtual |
Implements rviz::InteractiveObject.
Definition at line 1124 of file interactive_marker_control.cpp.
|
protected |
Definition at line 1320 of file interactive_marker_control.cpp.
|
protected |
Definition at line 1373 of file interactive_marker_control.cpp.
void rviz::InteractiveMarkerControl::interactiveMarkerPoseChanged | ( | Ogre::Vector3 | int_marker_position, |
Ogre::Quaternion | int_marker_orientation | ||
) |
Update the pose of the interactive marker being controlled, relative to the reference frame. Each InteractiveMarkerControl maintains its pose relative to the reference frame independently, so when the parent InteractiveMarker mvoes, it calls this function on all its child controls.
Definition at line 335 of file interactive_marker_control.cpp.
|
protected |
compute intersection between mouse ray and a y-z plane.
Definition at line 1398 of file interactive_marker_control.cpp.
|
protected |
compute intersection between mouse ray and y-z plane given in local coordinates
Definition at line 1387 of file interactive_marker_control.cpp.
|
inlinevirtual |
Implements rviz::InteractiveObject.
Definition at line 130 of file interactive_marker_control.h.
|
protected |
Create marker objects from the message and add them to the internal marker arrays.
Definition at line 86 of file interactive_marker_control.cpp.
|
protected |
Translate in 3-degrees-of-freedom, following the 3D cursor translation.
Definition at line 858 of file interactive_marker_control.cpp.
|
protected |
Translate along the local X-axis, following the mouse movement. mouse_ray is relative to the reference frame.
Definition at line 668 of file interactive_marker_control.cpp.
|
protected |
Translate along the local X-axis, following the 3D cursor movement.
Definition at line 714 of file interactive_marker_control.cpp.
|
protected |
Translate in the plane perpendicular to the local X-axis, following the mouse movement. mouse_ray is relative to the reference frame.
Definition at line 580 of file interactive_marker_control.cpp.
|
protected |
Translate in the plane perpendicular to the local X-axis, following the 3D cursor movement.
Definition at line 599 of file interactive_marker_control.cpp.
|
protected |
Rotate about, and translate perpendicular to, the local X-axis, following the mouse movement. mouse_ray is relative to the reference frame.
Definition at line 725 of file interactive_marker_control.cpp.
|
protected |
Rotate about, and translate perpendicular to, the local X-axis, following the 3D cursor movement.
Definition at line 791 of file interactive_marker_control.cpp.
|
protected |
Rotate and translate in full 6-DOF, following the 3D cursor movement.
Definition at line 913 of file interactive_marker_control.cpp.
|
protected |
Move the pose around the XY view plane (perpendicular to the camera direction).
Definition at line 562 of file interactive_marker_control.cpp.
|
protected |
Move the pose along the mouse ray, based on relative mouse movement.
Definition at line 526 of file interactive_marker_control.cpp.
|
protected |
Move the pose along the mouse ray, based on mouse wheel movement.
Definition at line 547 of file interactive_marker_control.cpp.
|
protectedvirtual |
Definition at line 261 of file interactive_marker_control.cpp.
void rviz::InteractiveMarkerControl::processMessage | ( | const visualization_msgs::InteractiveMarkerControl & | message | ) |
Set up or update the contents of this control to match the specification in the message.
Definition at line 139 of file interactive_marker_control.cpp.
|
protected |
Definition at line 961 of file interactive_marker_control.cpp.
|
protected |
Rotate the pose around the local X-axis, following the mouse movement. mouse_ray is relative to the reference frame.
Definition at line 389 of file interactive_marker_control.cpp.
|
protected |
Rotate the pose around the local X axis, following the 3D cursor movement.
Definition at line 412 of file interactive_marker_control.cpp.
|
protected |
Rotate in 3-degrees-of-freedom, following the 3D cursor rotation.
Definition at line 885 of file interactive_marker_control.cpp.
|
protected |
Rotate the pose around the camera-frame XY (right/up) axes, based on relative mouse movement.
Definition at line 485 of file interactive_marker_control.cpp.
|
protected |
Rotate the pose around the camera-frame Z (look) axis, based on relative mouse movement.
Definition at line 505 of file interactive_marker_control.cpp.
void rviz::InteractiveMarkerControl::setHighlight | ( | const ControlHighlight & | hl | ) |
Definition at line 940 of file interactive_marker_control.cpp.
|
protected |
Definition at line 946 of file interactive_marker_control.cpp.
|
inline |
If true, will show some geometric helpers while dragging.
Definition at line 175 of file interactive_marker_control.h.
void rviz::InteractiveMarkerControl::setVisible | ( | bool | visible | ) |
Definition at line 299 of file interactive_marker_control.cpp.
|
protected |
Definition at line 967 of file interactive_marker_control.cpp.
void rviz::InteractiveMarkerControl::update | ( | ) |
Definition at line 312 of file interactive_marker_control.cpp.
|
protected |
Definition at line 268 of file interactive_marker_control.cpp.
|
protected |
Project a reference position onto the viewport to find screen coordinates in pixels.
screen_pos | the resultant screen position, in pixels. |
Project a world position onto the viewport to find screen coordinates in pixels.
screen_pos | the resultant screen position, in pixels. |
Definition at line 618 of file interactive_marker_control.cpp.
|
protected |
Definition at line 348 of file interactive_marker_control.h.
|
protected |
Definition at line 316 of file interactive_marker_control.h.
|
protected |
Definition at line 314 of file interactive_marker_control.h.
|
protected |
Represents the local frame of this control relative to reference node/frame. There is no intermediate InteractiveMarker node or frame, each control keeps track of its pose relative to the reference frame independently. In INHERIT mode, this will have an identical pose as the rest of the interactive marker, otherwise its orientation might be different.
Definition at line 328 of file interactive_marker_control.h.
|
protected |
The orientation of the control_frame_node_ when the mouse button is pressed.
Definition at line 417 of file interactive_marker_control.h.
|
protected |
Defines the axis / plane along which to transform. This is not keeping track of rotations applied to the control by the user, this is just a copy of the "orientation" parameter from the InteractiveMarkerControl message.
Definition at line 346 of file interactive_marker_control.h.
|
protected |
Definition at line 442 of file interactive_marker_control.h.
|
protected |
Definition at line 350 of file interactive_marker_control.h.
|
protected |
Definition at line 310 of file interactive_marker_control.h.
|
protected |
Definition at line 312 of file interactive_marker_control.h.
|
protected |
The orientation of the cursor when the 'grab' button is pressed, relative to the reference frame.
Definition at line 382 of file interactive_marker_control.h.
|
protected |
The 3D position of the mouse click/cursor when the 'grab' button is pressed, relative to the reference frame.
Definition at line 378 of file interactive_marker_control.h.
|
protected |
The grab point during a mouse drag, relative to the control frame. Computed on mouse down event.
Definition at line 434 of file interactive_marker_control.h.
|
protected |
Definition at line 436 of file interactive_marker_control.h.
|
protected |
Definition at line 359 of file interactive_marker_control.h.
|
protected |
Definition at line 340 of file interactive_marker_control.h.
|
protected |
Definition at line 437 of file interactive_marker_control.h.
|
protected |
Definition at line 334 of file interactive_marker_control.h.
|
protected |
Definition at line 447 of file interactive_marker_control.h.
|
protected |
Definition at line 355 of file interactive_marker_control.h.
|
protected |
Definition at line 331 of file interactive_marker_control.h.
|
protected |
The modifier state when drag begins.
Definition at line 393 of file interactive_marker_control.h.
|
protected |
Definition at line 445 of file interactive_marker_control.h.
|
protected |
Definition at line 309 of file interactive_marker_control.h.
|
protected |
Definition at line 400 of file interactive_marker_control.h.
|
protected |
offset of the absolute mouse position from the relative mouse position
Definition at line 406 of file interactive_marker_control.h.
|
protected |
Definition at line 407 of file interactive_marker_control.h.
|
protected |
position of mouse when drag begins.
Definition at line 396 of file interactive_marker_control.h.
|
protected |
Definition at line 397 of file interactive_marker_control.h.
|
protected |
Definition at line 403 of file interactive_marker_control.h.
|
protected |
Definition at line 352 of file interactive_marker_control.h.
|
protected |
Definition at line 335 of file interactive_marker_control.h.
|
protected |
Definition at line 357 of file interactive_marker_control.h.
|
protected |
The orientation of the parent when the mouse button is pressed.
Definition at line 421 of file interactive_marker_control.h.
|
protected |
The position of the parent when the mouse button is pressed.
Definition at line 413 of file interactive_marker_control.h.
|
protected |
Records the 3D position of the cursor relative to the parent marker, expressed in the cursor frame, when the 'grab' button is pressed.
Definition at line 386 of file interactive_marker_control.h.
|
protected |
position of grab relative to parent in world coordinates.
Definition at line 410 of file interactive_marker_control.h.
|
protected |
Definition at line 365 of file interactive_marker_control.h.
|
protected |
Node representing reference frame in tf, like /map, /base_link, /head, etc. Same as the field in InteractiveMarker.
Definition at line 320 of file interactive_marker_control.h.
|
protected |
Stores the rotation around the x axis of the control. Only relevant for fixed-orientation rotation controls.
Definition at line 369 of file interactive_marker_control.h.
|
protected |
Stores the rotation around the x axis of the control as it was when the mouse-down event happened. Only relevant for fixed-orientation rotation controls.
Definition at line 374 of file interactive_marker_control.h.
|
protected |
The direction vector of the axis of rotation during a mouse drag, relative to the reference frame. Computed on mouse down event.
Definition at line 426 of file interactive_marker_control.h.
|
protected |
The center of rotation during a mouse drag, relative to the control frame. Computed on mouse down event.
Definition at line 430 of file interactive_marker_control.h.
|
protected |
Records the rotation of the parent from the cursor frame, when the 'grab' button is pressed.
Definition at line 390 of file interactive_marker_control.h.
|
protected |
Definition at line 449 of file interactive_marker_control.h.
|
protected |
Definition at line 443 of file interactive_marker_control.h.
|
protected |
Definition at line 440 of file interactive_marker_control.h.
|
protected |
Definition at line 439 of file interactive_marker_control.h.