18 #ifndef _POLYLINE_ITEM_HH_
19 #define _POLYLINE_ITEM_HH_
32 class LineSegmentItem;
47 public:
PolylineItem(
const QPointF &_start,
const QPointF &_end);
54 public:
void AddPoint(
const QPointF &_point);
57 public:
void PopEndPoint();
61 public:
unsigned int GetVertexCount()
const;
65 public:
unsigned int GetSegmentCount()
const;
70 public:
void SetVertexPosition(
unsigned int _index,
76 public:
void TranslateVertex(
unsigned int _index,
77 const QPointF &_trans);
85 public:
void ShowHandles(
bool _show);
89 public:
void SetThickness(
double _thickness);
93 public:
void SetPosition(
const QPointF &_pos);
97 public:
void ClosePath();
101 public:
bool IsClosed()
const;
105 public:
void Update();
108 private:
void UpdatePath();
114 private:
void UpdatePathAt(
unsigned int _index,
const QPointF &_pos);
119 private:
void AppendToPath(
const QPointF &_point);
124 private:
bool sceneEventFilter(QGraphicsItem * watched,
130 private:
virtual bool GrabberEventFilter(
GrabberHandle *_grabber,
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);
165 private:
void mousePressEvent(QGraphicsSceneDragDropEvent *_event);
169 private:
void mouseMoveEvent(QGraphicsSceneDragDropEvent *_event);
175 private: QVariant itemChange(GraphicsItemChange _change,
176 const QVariant &_value);
182 private:
void paint(QPainter *_painter,
183 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
187 protected:
void DrawBoundingBox(QPainter *_painter);
202 private: QPointF origin;
207 private:
double grabberWidth;
210 private:
double grabberHeight;
213 private:
double lineThickness;
Base class of an item in the editor.
Definition: EditorItem.hh:34
bool closed
True to indicate that the polyline is closed.
Definition: PolylineItem.hh:199
2D polyline.
Definition: PolylineItem.hh:39
QPointF segmentMouseMove
Keep track of mouse press position for translating segments.
Definition: PolylineItem.hh:196
std::vector< LineSegmentItem * > segments
A list of line segments of the polyline.
Definition: PolylineItem.hh:193
2D line segment.
Definition: LineSegmentItem.hh:35
std::vector< GrabberHandle * > grabbers
A list of grabber handles for this item, one on each vertex.
Definition: PolylineItem.hh:190
Definition: GrabberHandle.hh:28
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48