17#ifndef GAZEBO_GUI_BUILDING_SEGMENTITEM_HH_
18#define GAZEBO_GUI_BUILDING_SEGMENTITEM_HH_
22#include <ignition/math/Vector2.hh>
23#include <ignition/math/Vector3.hh>
37 class SegmentItemPrivate;
57 public:
void SetLine(
const ignition::math::Vector2d &_start,
58 const ignition::math::Vector2d &_end);
70 public:
void SetEndPoint(
const ignition::math::Vector2d &_end);
74 public: ignition::math::Vector2d
EndPoint()
const;
94 public:
void SetColor(
const ignition::math::Color &_color);
104 public: ignition::math::Vector3d
Size()
const;
114 public: std::vector<GrabberHandle *>
Grabbers()
const;
123 const ignition::math::Vector2d &_pos);
129 private:
bool sceneEventFilter(QGraphicsItem *watched,
141 private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
145 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
149 private:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
153 private:
void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
157 private:
void mousePressEvent(QGraphicsSceneMouseEvent *_event);
161 private:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event);
167 private:
void paint(QPainter *_painter,
168 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
182 private: std::unique_ptr<SegmentItemPrivate> dataPtr;
gui
Definition KeyEventHandler.hh:29
Base class of an item in the editor.
Definition EditorItem.hh:43
Definition GrabberHandle.hh:39
2D line segment.
Definition SegmentItem.hh:46
double Thickness() const
Get the thickness of the segment item.
void SegmentChanged()
Emit segment changed Qt signals.
void SetThickness(const double _thickness)
Set the thickness of the segment item on the 2d view.
double SceneRotation() const
Get the scene rotation of the editor item.
std::vector< GrabberHandle * > Grabbers() const
Get the grabber handles.
ignition::math::Vector3d ScenePosition() const
Get the scene position of editor item.
void SetScale(const double _scale)
Set the scale of the segment item.
void SetLine(const ignition::math::Vector2d &_start, const ignition::math::Vector2d &_end)
Set the segment's line.
static const double SnapLength
Length to snap in meters.
Definition SegmentItem.hh:174
ignition::math::Vector3d Size() const
Get the size of the item in pixels.
void SetEndPoint(const ignition::math::Vector2d &_end)
Set the end point of the segment.
std::vector< GrabberHandle * > grabbers
A list of grabber handles for this item.
Definition SegmentItem.hh:178
ignition::math::Vector2d EndPoint() const
Get the end point of the segment.
void ShowHandles(const bool _show)
Show the grabber handles of the segment item.
void SetStartPoint(const ignition::math::Vector2d &_start)
Set the start point of the segment.
void SetColor(const ignition::math::Color &_color)
Set the color of the segment item.
ignition::math::Vector2d StartPoint() const
Get the start point of the segment.
double Scale() const
Get the scale of the segment item.
~SegmentItem()
Destructor.
void UpdateLinkedGrabbers(GrabberHandle *_grabber, const ignition::math::Vector2d &_pos)
Update the position of all grabbers linked to the given one.
virtual void SegmentUpdated()
Update item.
SegmentItem(QGraphicsItem *_parent=0)
Constructor.
static const double SnapAngle
Angle to snap in degrees.
Definition SegmentItem.hh:171
Forward declarations for the common classes.
Definition Animation.hh:27