18 #ifndef _SEGMENT_ITEM_HH_
19 #define _SEGMENT_ITEM_HH_
51 public:
void SetLine(
const QPointF &_start,
const QPointF &_end);
55 public:
void SetStartPoint(
const QPointF &_start);
59 public: QPointF GetStartPoint()
const;
63 public:
void SetEndPoint(
const QPointF &_end);
67 public: QPointF GetEndPoint()
const;
71 public:
void SetThickness(
double _thickness);
75 public:
double GetThickness()
const;
79 public:
double GetScale()
const;
83 public:
void SetScale(
double _scale);
87 public:
void SetColor(QColor _color);
91 public:
void ShowHandles(
bool _show);
94 public:
void SegmentChanged();
97 public: QVector3D GetSize()
const;
100 public: QVector3D GetScenePosition()
const;
103 public:
double GetSceneRotation()
const;
106 protected:
virtual void SegmentUpdated();
111 protected:
void UpdateLinkedGrabbers(
GrabberHandle *_grabber,
112 const QPointF &_pos);
118 private:
bool sceneEventFilter(QGraphicsItem *watched,
130 private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
134 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
138 private:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
142 private:
void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
146 private:
void mousePressEvent(QGraphicsSceneMouseEvent *_event);
150 private:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event);
156 private:
void paint(QPainter *_painter,
157 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
170 private: QPointF start;
173 private: QPointF end;
176 private: QPointF segmentMouseMove;
179 private:
double thickness;
182 private:
double grabberWidth;
185 private:
double grabberHeight;
Base class of an item in the editor.
Definition: EditorItem.hh:34
static const double SnapLength
Length to snap in meters.
Definition: SegmentItem.hh:167
2D line segment.
Definition: SegmentItem.hh:38
std::vector< GrabberHandle * > grabbers
A list of grabber handles for this item.
Definition: SegmentItem.hh:161
static const double SnapAngle
Angle to snap in degrees.
Definition: SegmentItem.hh:164
Definition: GrabberHandle.hh:29
#define GZ_GUI_BUILDING_VISIBLE
Definition: system.hh:393