30 #ifndef INTERACTIVE_MARKER_CONTROL_H_ 31 #define INTERACTIVE_MARKER_CONTROL_H_ 35 #include <boost/shared_ptr.hpp> 36 #include <boost/enable_shared_from_this.hpp> 39 #include <OgreVector3.h> 40 #include <OgreQuaternion.h> 41 #include <OgreSceneManager.h> 46 #include <visualization_msgs/InteractiveMarkerControl.h> 61 class InteractiveMarker;
70 public boost::enable_shared_from_this<InteractiveMarkerControl>
81 Ogre::SceneNode* reference_node,
88 void processMessage(
const visualization_msgs::InteractiveMarkerControl& message);
91 void enableInteraction(
bool enable)
override;
122 const Ogre::Vector3& cursor_3D_pos,
123 const Ogre::Quaternion& cursor_3D_orientation);
130 void interactiveMarkerPoseChanged(Ogre::Vector3 int_marker_position,
131 Ogre::Quaternion int_marker_orientation);
135 return interaction_mode_ != visualization_msgs::InteractiveMarkerControl::NONE;
185 return interaction_mode_;
193 return orientation_mode_;
201 show_visual_aids_ = show;
206 void preFindVisibleObjects(Ogre::SceneManager* source,
207 Ogre::SceneManager::IlluminationRenderStage irs,
208 Ogre::Viewport* v)
override;
210 void updateControlOrientationForViewFacing(Ogre::Viewport* v);
240 void rotate(Ogre::Ray& mouse_ray);
243 void rotate(
const Ogre::Vector3& cursor_position_in_reference_frame);
247 void moveRotate(Ogre::Ray& mouse_ray);
251 void moveRotate(
const Ogre::Vector3& cursor_position_in_reference_frame,
bool lock_axis =
true);
255 void movePlane(Ogre::Ray& mouse_ray);
258 void movePlane(
const Ogre::Vector3& cursor_position_in_reference_frame);
265 void moveAxis(
const Ogre::Vector3& cursor_position_in_reference_frame);
268 void move3D(
const Ogre::Vector3& cursor_position_in_reference_frame,
269 const Ogre::Quaternion& cursor_orientation_in_reference_frame);
272 void rotate3D(
const Ogre::Vector3& cursor_position_in_reference_frame,
273 const Ogre::Quaternion& cursor_orientation_in_reference_frame);
276 void moveRotate3D(
const Ogre::Vector3& cursor_position_in_reference_frame,
277 const Ogre::Quaternion& cursor_orientation_in_reference_frame);
280 bool intersectYzPlane(
const Ogre::Ray& mouse_ray,
281 Ogre::Vector3& intersection_3d,
282 Ogre::Vector2& intersection_2d,
286 bool intersectSomeYzPlane(
const Ogre::Ray& mouse_ray,
287 const Ogre::Vector3& point_in_plane,
288 const Ogre::Quaternion& plane_orientation,
289 Ogre::Vector3& intersection_3d,
290 Ogre::Vector2& intersection_2d,
296 bool findClosestPoint(
const Ogre::Ray& target_ray,
297 const Ogre::Ray& mouse_ray,
298 Ogre::Vector3& closest_point);
302 void worldToScreen(
const Ogre::Vector3& pos_rel_reference,
303 const Ogre::Viewport* viewport,
304 Ogre::Vector2& screen_pos);
310 void setHighlight(
float a);
327 Ogre::Vector3 closestPointOnLineToPoint(
const Ogre::Vector3& line_start,
328 const Ogre::Vector3& line_dir,
329 const Ogre::Vector3& test_point);
332 void makeMarkers(
const visualization_msgs::InteractiveMarkerControl& message);
334 void stopDragging(
bool force =
false);
Ogre::Vector3 parent_to_cursor_in_cursor_frame_at_grab_
Ogre::SceneNode * markers_node_
ViewportMouseEvent dragging_in_place_event_
Ogre::Viewport * drag_viewport_
Ogre::Vector3 parent_to_grab_position_
DisplayContext * context_
std::set< Ogre::Pass * > highlight_passes_
InteractiveMarker * parent_
void setShowVisualAids(bool show)
If true, will show some geometric helpers while dragging.
int mouse_relative_to_absolute_x_
std::vector< PointsMarkerPtr > points_markers_
Ogre::Quaternion rotation_cursor_to_parent_at_grab_
Ogre::Quaternion control_frame_orientation_at_mouse_down_
void setVisible(PanelDockWidget *widget, bool visible)
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Abstract base class of things in the scene which handle mouse events.
Pure-virtual base class for objects which give Display subclasses context in which to work...
Ogre::Ray mouse_ray_at_drag_begin_
Ogre::Vector3 grab_point_in_reference_frame_
Qt::KeyboardModifiers modifiers_at_drag_begin_
Ogre::SceneNode * reference_node_
int mouse_y_at_drag_begin_
Ogre::Quaternion control_orientation_
Ogre::Vector3 parent_position_at_mouse_down_
boost::shared_ptr< MarkerBase > MarkerBasePtr
const QString & getDescription()
Ogre::Vector3 rotation_center_rel_control_
std::vector< MarkerBasePtr > markers_
const std::string & getName()
bool isInteractive() override
InteractiveMarker * getParent()
Ogre::SceneNode * control_frame_node_
int mouse_x_at_drag_begin_
bool interaction_enabled_
int mouse_relative_to_absolute_y_
Ogre::Quaternion grab_orientation_in_reference_frame_
CollObjectHandle coll_object_handle_
Ogre::Radian rotation_at_mouse_down_
std::set< Ogre::MaterialPtr > S_MaterialPtr
bool independent_marker_orientation_
Ogre::Vector3 grab_point_rel_control_
boost::shared_ptr< Line > line_
const QCursor & getCursor() const override
Ogre::Quaternion parent_orientation_at_mouse_down_
Ogre::Vector3 rotation_axis_
uint32_t CollObjectHandle
boost::shared_ptr< PointsMarker > PointsMarkerPtr