18 #ifndef _GAZEBO_GUI_BUILDING_SEGMENTITEM_HH_ 19 #define _GAZEBO_GUI_BUILDING_SEGMENTITEM_HH_ 23 #include <ignition/math/Vector2.hh> 24 #include <ignition/math/Vector3.hh> 38 class SegmentItemPrivate;
58 public:
void SetLine(
const ignition::math::Vector2d &_start,
59 const ignition::math::Vector2d &_end);
63 public:
void SetStartPoint(
const ignition::math::Vector2d &_start);
67 public: ignition::math::Vector2d StartPoint()
const;
71 public:
void SetEndPoint(
const ignition::math::Vector2d &_end);
75 public: ignition::math::Vector2d EndPoint()
const;
79 public:
void SetThickness(
const double _thickness);
83 public:
double Thickness()
const;
87 public:
double Scale()
const;
91 public:
void SetScale(
const double _scale);
99 public:
void ShowHandles(
const bool _show);
102 public:
void SegmentChanged();
105 public: ignition::math::Vector3d Size()
const;
108 public: ignition::math::Vector3d ScenePosition()
const;
111 public:
double SceneRotation()
const;
115 public: std::vector<GrabberHandle *>Grabbers()
const;
118 protected:
virtual void SegmentUpdated();
123 protected:
void UpdateLinkedGrabbers(
GrabberHandle *_grabber,
124 const ignition::math::Vector2d &_pos);
130 private:
bool sceneEventFilter(QGraphicsItem *watched,
142 private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
146 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
150 private:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
154 private:
void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
158 private:
void mousePressEvent(QGraphicsSceneMouseEvent *_event);
162 private:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event);
168 private:
void paint(QPainter *_painter,
169 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
183 private: std::unique_ptr<SegmentItemPrivate> dataPtr;
Base class of an item in the editor.
Definition: EditorItem.hh:43
Forward declarations for the common classes.
Definition: Animation.hh:33
static const double SnapAngle
Angle to snap in degrees.
Definition: SegmentItem.hh:172
static const double SnapLength
Length to snap in meters.
Definition: SegmentItem.hh:175
2D line segment.
Definition: SegmentItem.hh:45
Defines a color.
Definition: Color.hh:36
Definition: GrabberHandle.hh:42
std::vector< GrabberHandle * > grabbers
A list of grabber handles for this item.
Definition: SegmentItem.hh:179