#include <interactive_marker_control.h>
Public Types | |
enum | ControlHighlight { NO_HIGHLIGHT = 0, HOVER_HIGHLIGHT = 3, ACTIVE_HIGHLIGHT = 5 } |
Public Member Functions | |
void | enableInteraction (bool enable) override |
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) |
void | handleMouseEvent (ViewportMouseEvent &event) override |
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 () override |
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 () |
~InteractiveMarkerControl () override | |
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) |
const QCursor & | getCursor () const override |
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) |
void | preFindVisibleObjects (Ogre::SceneManager *source, Ogre::SceneManager::IlluminationRenderStage irs, Ogre::Viewport *v) override |
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 386 of file interactive_marker_control.h.
|
protected |
Definition at line 396 of file interactive_marker_control.h.
Enumerator | |
---|---|
NO_HIGHLIGHT | |
HOVER_HIGHLIGHT | |
ACTIVE_HIGHLIGHT |
Definition at line 146 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 63 of file interactive_marker_control.cpp.
|
override |
Definition at line 127 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 1457 of file interactive_marker_control.cpp.
|
protected |
Definition at line 1270 of file interactive_marker_control.cpp.
|
protected |
begin a relative-motion drag.
Definition at line 465 of file interactive_marker_control.cpp.
|
protected |
Definition at line 375 of file interactive_marker_control.cpp.
|
overridevirtual |
Implements rviz::InteractiveObject.
Definition at line 324 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 634 of file interactive_marker_control.cpp.
|
inlineoverrideprotectedvirtual |
Implements rviz::InteractiveObject.
Definition at line 336 of file interactive_marker_control.h.
|
inline |
Definition at line 175 of file interactive_marker_control.h.
|
inline |
Definition at line 183 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 449 of file interactive_marker_control.cpp.
|
inline |
Definition at line 167 of file interactive_marker_control.h.
|
inline |
Definition at line 191 of file interactive_marker_control.h.
|
inline |
Definition at line 159 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 477 of file interactive_marker_control.cpp.
bool rviz::InteractiveMarkerControl::getVisible | ( | ) |
Definition at line 297 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 1011 of file interactive_marker_control.cpp.
|
overridevirtual |
Implements rviz::InteractiveObject.
Definition at line 1158 of file interactive_marker_control.cpp.
|
protected |
Definition at line 1350 of file interactive_marker_control.cpp.
|
protected |
Definition at line 1402 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 339 of file interactive_marker_control.cpp.
|
protected |
compute intersection between mouse ray and a y-z plane.
Definition at line 1426 of file interactive_marker_control.cpp.
|
protected |
compute intersection between mouse ray and y-z plane given in local coordinates
Definition at line 1416 of file interactive_marker_control.cpp.
|
inlineoverridevirtual |
Implements rviz::InteractiveObject.
Definition at line 133 of file interactive_marker_control.h.
|
protected |
Create marker objects from the message and add them to the internal marker arrays.
Definition at line 85 of file interactive_marker_control.cpp.
|
protected |
Translate in 3-degrees-of-freedom, following the 3D cursor translation.
Definition at line 859 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 665 of file interactive_marker_control.cpp.
|
protected |
Translate along the local X-axis, following the 3D cursor movement.
Definition at line 713 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 575 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 595 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 727 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 792 of file interactive_marker_control.cpp.
|
protected |
Rotate and translate in full 6-DOF, following the 3D cursor movement.
Definition at line 929 of file interactive_marker_control.cpp.
|
protected |
Move the pose around the XY view plane (perpendicular to the camera direction).
Definition at line 558 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 545 of file interactive_marker_control.cpp.
|
overrideprotected |
Definition at line 264 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 138 of file interactive_marker_control.cpp.
|
protected |
Definition at line 989 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 393 of file interactive_marker_control.cpp.
|
protected |
Rotate the pose around the local X axis, following the 3D cursor movement.
Definition at line 415 of file interactive_marker_control.cpp.
|
protected |
Rotate in 3-degrees-of-freedom, following the 3D cursor rotation.
Definition at line 893 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 489 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 507 of file interactive_marker_control.cpp.
void rviz::InteractiveMarkerControl::setHighlight | ( | const ControlHighlight & | hl | ) |
Definition at line 964 of file interactive_marker_control.cpp.
|
protected |
Definition at line 974 of file interactive_marker_control.cpp.
|
inline |
If true, will show some geometric helpers while dragging.
Definition at line 199 of file interactive_marker_control.h.
void rviz::InteractiveMarkerControl::setVisible | ( | bool | visible | ) |
Definition at line 302 of file interactive_marker_control.cpp.
|
protected |
Definition at line 995 of file interactive_marker_control.cpp.
void rviz::InteractiveMarkerControl::update | ( | ) |
Definition at line 316 of file interactive_marker_control.cpp.
|
protected |
Definition at line 271 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 614 of file interactive_marker_control.cpp.
|
protected |
Definition at line 380 of file interactive_marker_control.h.
|
protected |
Definition at line 348 of file interactive_marker_control.h.
|
protected |
Definition at line 346 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 360 of file interactive_marker_control.h.
|
protected |
The orientation of the control_frame_node_ when the mouse button is pressed.
Definition at line 449 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 378 of file interactive_marker_control.h.
|
protected |
Definition at line 474 of file interactive_marker_control.h.
|
protected |
Definition at line 382 of file interactive_marker_control.h.
|
protected |
Definition at line 342 of file interactive_marker_control.h.
|
protected |
Definition at line 344 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 414 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 410 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 466 of file interactive_marker_control.h.
|
protected |
Definition at line 468 of file interactive_marker_control.h.
|
protected |
Definition at line 391 of file interactive_marker_control.h.
|
protected |
Definition at line 372 of file interactive_marker_control.h.
|
protected |
Definition at line 469 of file interactive_marker_control.h.
|
protected |
Definition at line 366 of file interactive_marker_control.h.
|
protected |
Definition at line 479 of file interactive_marker_control.h.
|
protected |
Definition at line 387 of file interactive_marker_control.h.
|
protected |
Definition at line 363 of file interactive_marker_control.h.
|
protected |
The modifier state when drag begins.
Definition at line 425 of file interactive_marker_control.h.
|
protected |
Definition at line 477 of file interactive_marker_control.h.
|
protected |
Definition at line 341 of file interactive_marker_control.h.
|
protected |
Definition at line 432 of file interactive_marker_control.h.
|
protected |
offset of the absolute mouse position from the relative mouse position
Definition at line 438 of file interactive_marker_control.h.
|
protected |
Definition at line 439 of file interactive_marker_control.h.
|
protected |
position of mouse when drag begins.
Definition at line 428 of file interactive_marker_control.h.
|
protected |
Definition at line 429 of file interactive_marker_control.h.
|
protected |
Definition at line 435 of file interactive_marker_control.h.
|
protected |
Definition at line 384 of file interactive_marker_control.h.
|
protected |
Definition at line 367 of file interactive_marker_control.h.
|
protected |
Definition at line 389 of file interactive_marker_control.h.
|
protected |
The orientation of the parent when the mouse button is pressed.
Definition at line 453 of file interactive_marker_control.h.
|
protected |
The position of the parent when the mouse button is pressed.
Definition at line 445 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 418 of file interactive_marker_control.h.
|
protected |
position of grab relative to parent in world coordinates.
Definition at line 442 of file interactive_marker_control.h.
|
protected |
Definition at line 397 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 352 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 401 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 406 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 458 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 462 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 422 of file interactive_marker_control.h.
|
protected |
Definition at line 481 of file interactive_marker_control.h.
|
protected |
Definition at line 475 of file interactive_marker_control.h.
|
protected |
Definition at line 472 of file interactive_marker_control.h.
|
protected |
Definition at line 471 of file interactive_marker_control.h.