18 #ifndef _RECT_ITEM_HH_
19 #define _RECT_ITEM_HH_
45 ITEM_WIDTH = 0x01, ITEM_HEIGHT = 0x02};
55 public:
void SetWidth(
int _width);
59 public:
void SetHeight(
int _height);
63 public:
void SetSize(QSize _size);
67 public:
double GetWidth()
const;
71 public:
double GetHeight()
const;
75 public:
void ShowHandles(
bool _show);
79 protected:
void UpdateCornerPositions();
83 protected:
void DrawBoundingBox(QPainter *_painter);
87 public:
virtual void SetPosition(
const QPointF &_pos);
92 public:
virtual void SetPosition(
double _x,
double _y);
96 public:
virtual void SetRotation(
double _angle);
101 public:
virtual void SetResizeFlag(
unsigned int _flag);
105 public:
virtual double GetRotation()
const;
108 public:
virtual QVector3D GetSize()
const;
111 public:
virtual QVector3D GetScenePosition()
const;
114 public:
virtual double GetSceneRotation()
const;
118 protected:
virtual QRectF boundingRect()
const;
123 private:
virtual bool RotateEventFilter(
RotateHandle *_rotateHandle,
129 private:
virtual bool GrabberEventFilter(
GrabberHandle *_grabber,
136 private:
virtual void paint(QPainter *_painter,
137 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
141 private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
145 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
149 private:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
153 private:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
157 private:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
161 private:
virtual void mouseReleaseEvent(
162 QGraphicsSceneMouseEvent *_event);
166 private:
virtual void mousePressEvent(
167 QGraphicsSceneDragDropEvent *_event);
171 private:
virtual void mouseMoveEvent(
172 QGraphicsSceneDragDropEvent *_event);
176 private:
virtual void mouseDoubleClickEvent(
177 QGraphicsSceneMouseEvent *_event);
182 private:
virtual bool sceneEventFilter(QGraphicsItem *_watched,
189 private: QVariant itemChange(GraphicsItemChange _change,
190 const QVariant &_value);
194 private:
virtual void contextMenuEvent(
195 QGraphicsSceneContextMenuEvent *_event);
198 private:
virtual void SizeChanged();
203 private:
void AdjustSize(
double _x,
double _y);
206 private slots:
virtual void OnOpenInspector();
209 private slots:
virtual void OnDeleteItem();
245 private: QPointF mousePressPos;
248 private:
int gridSpace;
252 private: std::vector<GrabberHandle *> grabbers;
259 private: std::vector<Qt::CursorShape> cursors;
262 private:
int zValueSelected;
265 private:
unsigned int resizeFlag;
QAction * deleteItemAct
Qt action for deleting the item.
Definition: RectItem.hh:242
double drawingHeight
Actual height of rect item drawn in pixels.
Definition: RectItem.hh:221
QColor borderColor
Border color of the rect item.
Definition: RectItem.hh:230
double rotationAngle
Rotation angle of the rect item in degrees.
Definition: RectItem.hh:233
Base class of an item in the editor.
Definition: EditorItem.hh:34
ResizeFlags
Resize flags used to indicate which dimension can be resized.
Definition: RectItem.hh:44
2D rectangle.
Definition: RectItem.hh:39
double drawingOriginX
X origin of the rect item in pixels.
Definition: RectItem.hh:224
double drawingWidth
Actual width of rect item drawn in pixels.
Definition: RectItem.hh:218
Handle for rotating an editor item.
Definition: RotateHandle.hh:33
int zValueIdle
Z ordering of the rect item when idle (unselected.)
Definition: RectItem.hh:236
Definition: GrabberHandle.hh:28
double drawingOriginY
Y origin of the rect item in pixels.
Definition: RectItem.hh:227
double width
Width of rect item in pixels.
Definition: RectItem.hh:212
double height
Height of rect item in pixels.
Definition: RectItem.hh:215
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
QAction * openInspectorAct
Qt action for opening the inspector.
Definition: RectItem.hh:239