18 #ifndef _RECT_ITEM_HH_
19 #define _RECT_ITEM_HH_
46 ITEM_WIDTH = 0x01, ITEM_HEIGHT = 0x02};
56 public:
void SetWidth(
int _width);
60 public:
void SetHeight(
int _height);
64 public:
void SetSize(QSize _size);
68 public:
double GetWidth()
const;
72 public:
double GetHeight()
const;
76 public:
void SetPositionOnWall(
double _positionOnWall);
80 public:
double GetPositionOnWall()
const;
84 public:
void SetAngleOnWall(
double _angleOnWall);
88 public:
double GetAngleOnWall()
const;
92 public:
void ShowHandles(
bool _show);
95 public:
void SetHighlighted(
bool _highlighted);
99 protected:
void UpdateCornerPositions();
103 protected:
void DrawBoundingBox(QPainter *_painter);
107 public:
virtual void SetPosition(
const QPointF &_pos);
112 public:
virtual void SetPosition(
double _x,
double _y);
116 public:
virtual void SetRotation(
double _angle);
121 public:
virtual void SetResizeFlag(
unsigned int _flag);
125 public:
virtual double GetRotation()
const;
128 public:
virtual QVector3D GetSize()
const;
131 public:
virtual QVector3D GetScenePosition()
const;
134 public:
virtual double GetSceneRotation()
const;
138 protected:
virtual QRectF boundingRect()
const;
141 protected:
void UpdateMeasures();
146 private:
virtual bool RotateEventFilter(
RotateHandle *_rotateHandle,
152 private:
virtual bool GrabberEventFilter(
GrabberHandle *_grabber,
159 private:
virtual void paint(QPainter *_painter,
160 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
164 private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
168 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
172 private:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
176 private:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
180 private:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
184 private:
virtual void mouseReleaseEvent(
185 QGraphicsSceneMouseEvent *_event);
189 private:
virtual void mousePressEvent(
190 QGraphicsSceneDragDropEvent *_event);
194 private:
virtual void mouseMoveEvent(
195 QGraphicsSceneDragDropEvent *_event);
199 private:
virtual void mouseDoubleClickEvent(
200 QGraphicsSceneMouseEvent *_event);
205 private:
virtual bool sceneEventFilter(QGraphicsItem *_watched,
212 private: QVariant itemChange(GraphicsItemChange _change,
213 const QVariant &_value);
217 private:
virtual void contextMenuEvent(
218 QGraphicsSceneContextMenuEvent *_event);
221 private:
virtual void SizeChanged();
226 private:
void AdjustSize(
double _x,
double _y);
229 private slots:
virtual void OnOpenInspector();
232 private slots:
virtual void OnDeleteItem();
270 private: QPointF mousePressPos;
273 private:
int gridSpace;
277 private: std::vector<GrabberHandle *> grabbers;
284 private: std::vector<Qt::CursorShape> cursors;
287 private:
unsigned int resizeFlag;
291 private:
double positionOnWall;
294 private:
double angleOnWall;
QAction * deleteItemAct
Qt action for deleting the item.
Definition: RectItem.hh:262
double drawingHeight
Actual height of rect item drawn in pixels.
Definition: RectItem.hh:244
QColor borderColor
Border color of the rect item.
Definition: RectItem.hh:253
double rotationAngle
Rotation angle of the rect item in degrees.
Definition: RectItem.hh:256
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:45
2D rectangle.
Definition: RectItem.hh:40
double drawingOriginX
X origin of the rect item in pixels.
Definition: RectItem.hh:247
double drawingWidth
Actual width of rect item drawn in pixels.
Definition: RectItem.hh:241
std::vector< MeasureItem * > measures
A vector containing this item's measure items.
Definition: RectItem.hh:267
Handle for rotating an editor item.
Definition: RotateHandle.hh:33
Definition: GrabberHandle.hh:29
double drawingOriginY
Y origin of the rect item in pixels.
Definition: RectItem.hh:250
double width
Width of rect item in pixels.
Definition: RectItem.hh:235
double height
Height of rect item in pixels.
Definition: RectItem.hh:238
#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:259