18 #ifndef _RECT_ITEM_HH_
19 #define _RECT_ITEM_HH_
47 ITEM_WIDTH = 0x01, ITEM_HEIGHT = 0x02};
57 public:
void SetWidth(
int _width);
61 public:
void SetHeight(
int _height);
65 public:
void SetSize(QSize _size);
69 public:
double GetWidth()
const;
73 public:
double GetHeight()
const;
77 public:
void SetPositionOnWall(
double _positionOnWall);
81 public:
double GetPositionOnWall()
const;
85 public:
void SetAngleOnWall(
double _angleOnWall);
89 public:
double GetAngleOnWall()
const;
93 public:
void ShowHandles(
bool _show);
96 public:
void SetHighlighted(
bool _highlighted);
100 protected:
void UpdateCornerPositions();
104 protected:
void DrawBoundingBox(QPainter *_painter);
108 public:
virtual void SetPosition(
const QPointF &_pos);
113 public:
virtual void SetPosition(
double _x,
double _y);
117 public:
virtual void SetRotation(
double _angle);
122 public:
virtual void SetResizeFlag(
unsigned int _flag);
126 public:
virtual double GetRotation()
const;
129 public:
virtual QVector3D GetSize()
const;
132 public:
virtual QVector3D GetScenePosition()
const;
135 public:
virtual double GetSceneRotation()
const;
139 protected:
virtual QRectF boundingRect()
const;
142 protected:
void UpdateMeasures();
147 private:
virtual bool RotateEventFilter(
RotateHandle *_rotateHandle,
153 private:
virtual bool GrabberEventFilter(
GrabberHandle *_grabber,
160 private:
virtual void paint(QPainter *_painter,
161 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
165 private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
169 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
173 private:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
177 private:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
181 private:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
185 private:
virtual void mouseReleaseEvent(
186 QGraphicsSceneMouseEvent *_event);
190 private:
virtual void mousePressEvent(
191 QGraphicsSceneDragDropEvent *_event);
195 private:
virtual void mouseMoveEvent(
196 QGraphicsSceneDragDropEvent *_event);
200 private:
virtual void mouseDoubleClickEvent(
201 QGraphicsSceneMouseEvent *_event);
206 private:
virtual bool sceneEventFilter(QGraphicsItem *_watched,
213 private: QVariant itemChange(GraphicsItemChange _change,
214 const QVariant &_value);
218 private:
virtual void contextMenuEvent(
219 QGraphicsSceneContextMenuEvent *_event);
222 private:
virtual void SizeChanged();
227 private:
void AdjustSize(
double _x,
double _y);
230 private slots:
virtual void OnOpenInspector();
233 private slots:
virtual void OnDeleteItem();
271 private: QPointF mousePressPos;
274 private:
int gridSpace;
278 private: std::vector<GrabberHandle *> grabbers;
285 private: std::vector<Qt::CursorShape> cursors;
288 private:
unsigned int resizeFlag;
292 private:
double positionOnWall;
295 private:
double angleOnWall;
QAction * deleteItemAct
Qt action for deleting the item.
Definition: RectItem.hh:263
double drawingHeight
Actual height of rect item drawn in pixels.
Definition: RectItem.hh:245
QColor borderColor
Border color of the rect item.
Definition: RectItem.hh:254
double rotationAngle
Rotation angle of the rect item in degrees.
Definition: RectItem.hh:257
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:46
2D rectangle.
Definition: RectItem.hh:40
double drawingOriginX
X origin of the rect item in pixels.
Definition: RectItem.hh:248
double drawingWidth
Actual width of rect item drawn in pixels.
Definition: RectItem.hh:242
std::vector< MeasureItem * > measures
A vector containing this item's measure items.
Definition: RectItem.hh:268
Handle for rotating an editor item.
Definition: RotateHandle.hh:33
Definition: GrabberHandle.hh:29
#define GZ_GUI_BUILDING_VISIBLE
Definition: system.hh:393
double drawingOriginY
Y origin of the rect item in pixels.
Definition: RectItem.hh:251
double width
Width of rect item in pixels.
Definition: RectItem.hh:236
double height
Height of rect item in pixels.
Definition: RectItem.hh:239
QAction * openInspectorAct
Qt action for opening the inspector.
Definition: RectItem.hh:260