Go to the documentation of this file.
18 #ifndef GAZEBO_GUI_BUILDING_GRABBERHANDLE_HH_
19 #define GAZEBO_GUI_BUILDING_GRABBERHANDLE_HH_
24 #include <ignition/math/Color.hh>
25 #include <ignition/math/Vector2.hh>
36 class GrabberHandlePrivate;
43 public:
GrabberHandle(QGraphicsItem *_parent = 0,
int index = 0);
50 public:
int Index()
const;
54 public:
int MouseState()
const;
58 public: ignition::math::Vector2d CenterPoint()
const;
62 public:
double MouseDownX()
const;
66 public:
double MouseDownY()
const;
69 public:
double Width()
const;
73 public:
double Height()
const;
77 public: ignition::math::Color Color()
const;
81 public:
void SetMouseState(
int _state);
85 public:
void SetMouseDownX(
double _x);
89 public:
void SetMouseDownY(
double _y);
93 public:
void SetWidth(
double _width);
97 public:
void SetHeight(
double _height);
101 public:
void SetColor(
const ignition::math::Color &_color);
105 public:
void SetBorderColor(
const ignition::math::Color &_borderColor);
109 public:
virtual QRectF boundingRect()
const;
113 public: std::vector<GrabberHandle *> LinkedGrabbers()
const;
127 private:
virtual void paint(QPainter *_painter,
128 const QStyleOptionGraphicsItem *_option, QWidget *_widget);
132 protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event);
136 protected:
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event);
140 protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *_event);
144 protected:
void mousePressEvent(QGraphicsSceneMouseEvent *_event);
148 protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event);
152 protected:
void mousePressEvent(QGraphicsSceneDragDropEvent *_event);
156 protected:
void mouseMoveEvent(QGraphicsSceneDragDropEvent *_event);
160 private: std::unique_ptr<GrabberHandlePrivate> dataPtr;
void SetHeight(double _height)
Set the height of the grabber handle.
ignition::math::Color Color() const
Get the fill color of the grabber handle.
void hoverEnterEvent(QGraphicsSceneHoverEvent *_event)
Qt mouse hover enter event.
void EraseLinkedGrabber(GrabberHandle *_grabber)
Erase a grabber from the list of grabbers linked to this.
void mousePressEvent(QGraphicsSceneMouseEvent *_event)
Qt mouse press event.
Forward declarations for the common classes.
Definition: Animation.hh:26
int MouseState() const
Get the current mouse state.
ignition::math::Vector2d CenterPoint() const
Get the center point of the grabber handle.
double MouseDownY() const
Get the Y position of the mouse press.
std::vector< GrabberHandle * > LinkedGrabbers() const
Get the vector of grabbers linked to this.
void hoverLeaveEvent(QGraphicsSceneHoverEvent *_event)
Qt mouse hover leave event.
Definition: GrabberHandle.hh:38
void SetBorderColor(const ignition::math::Color &_borderColor)
Set the border color of the grabber handle.
virtual ~GrabberHandle()
Destructor.
void SetColor(const ignition::math::Color &_color)
Set the fill color of the grabber handle.
int Index() const
Get the index of the grabber handle.
void PushLinkedGrabber(GrabberHandle *_grabber)
Push a grabber to the list of grabbers linked to this.
double MouseDownX() const
Get the X position of the mouse press.
void SetMouseState(int _state)
Set the current mouse state.
double Width() const
Get the width of the grabber handle.
void SetMouseDownX(double _x)
Set the X position of the mouse press.
virtual QRectF boundingRect() const
Get the bounding box of the grabber handle.
void mouseMoveEvent(QGraphicsSceneMouseEvent *_event)
Qt mouse move event.
double Height() const
Get the height of the grabber handle.
void SetWidth(double _width)
Set the width of the grabber handle.
void SetMouseDownY(double _y)
Set the Y position of the mouse press.
GrabberHandle(QGraphicsItem *_parent=0, int index=0)
Constructor.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *_event)
Qt mouse release event.