18 #ifndef _GAZEBO_GUI_BUILDING_RECTITEM_HH_
19 #define _GAZEBO_GUI_BUILDING_RECTITEM_HH_
38 class RectItemPrivate;
71 public:
void SetWidth(
int _width);
75 public:
void SetHeight(
int _height);
79 public:
void SetSize(QSize _size);
83 public:
double GetWidth()
const;
87 public:
double GetHeight()
const;
91 public:
void SetPositionOnWall(
double _positionOnWall);
95 public:
double GetPositionOnWall()
const;
99 public:
void SetAngleOnWall(
double _angleOnWall);
103 public:
double GetAngleOnWall()
const;
107 public:
void ShowHandles(
bool _show);
110 public:
void SetHighlighted(
bool _highlighted);
113 public:
void DetachFromParent();
117 protected:
void UpdateCornerPositions();
121 protected:
void DrawBoundingBox(QPainter *_painter);
125 public:
virtual void SetPosition(
const QPointF &_pos);
130 public:
virtual void SetPosition(
double _x,
double _y);
134 public:
virtual void SetRotation(
double _angle);
139 public:
virtual void SetResizeFlag(
unsigned int _flag);
143 public:
virtual double GetRotation()
const;
146 public:
virtual QVector3D GetSize()
const;
149 public:
virtual QVector3D GetScenePosition()
const;
152 public:
virtual double GetSceneRotation()
const;
156 protected:
virtual QRectF boundingRect()
const;
159 protected:
void UpdateMeasures();
164 private:
virtual bool RotateEventFilter(
RotateHandle *_rotateHandle,
170 private:
virtual bool GrabberEventFilter(
GrabberHandle *_grabber,
177 private:
virtual void paint(QPainter *_painter,
178 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
182 private:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
186 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
190 private:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
194 private:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
198 private:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *_event);
202 private:
virtual void mouseReleaseEvent(
203 QGraphicsSceneMouseEvent *_event);
207 private:
virtual void mousePressEvent(
208 QGraphicsSceneDragDropEvent *_event);
212 private:
virtual void mouseMoveEvent(
213 QGraphicsSceneDragDropEvent *_event);
217 private:
virtual void mouseDoubleClickEvent(
218 QGraphicsSceneMouseEvent *_event);
223 private:
virtual bool sceneEventFilter(QGraphicsItem *_watched,
230 private: QVariant itemChange(GraphicsItemChange _change,
231 const QVariant &_value);
235 private:
virtual void contextMenuEvent(
236 QGraphicsSceneContextMenuEvent *_event);
239 private:
virtual void SizeChanged();
244 private:
void AdjustSize(
double _x,
double _y);
247 private slots:
virtual void OnOpenInspector();
250 private slots:
virtual void OnDeleteItem();
289 private: std::unique_ptr<RectItemPrivate> dataPtr;
QAction * deleteItemAct
Qt action for deleting the item.
Definition: RectItem.hh:280
double drawingHeight
Actual height of rect item drawn in pixels.
Definition: RectItem.hh:262
QColor borderColor
Border color of the rect item.
Definition: RectItem.hh:271
double rotationAngle
Rotation angle of the rect item in degrees.
Definition: RectItem.hh:274
Base class of an item in the editor.
Definition: EditorItem.hh:40
ResizeFlags
Resize flags used to indicate which dimension can be resized.
Definition: RectItem.hh:51
#define GZ_GUI_VISIBLE
Definition: system.hh:284
2D rectangle.
Definition: RectItem.hh:45
double drawingOriginX
X origin of the rect item in pixels.
Definition: RectItem.hh:265
double drawingWidth
Actual width of rect item drawn in pixels.
Definition: RectItem.hh:259
std::vector< MeasureItem * > measures
A vector containing this item's measure items.
Definition: RectItem.hh:285
Handle for rotating an editor item.
Definition: RotateHandle.hh:40
Definition: GrabberHandle.hh:42
double drawingOriginY
Y origin of the rect item in pixels.
Definition: RectItem.hh:268
double width
Width of rect item in pixels.
Definition: RectItem.hh:253
double height
Height of rect item in pixels.
Definition: RectItem.hh:256
QAction * openInspectorAct
Qt action for opening the inspector.
Definition: RectItem.hh:277