ddt  1.0.0
ddtGraphicalElementRectangle.hpp
Go to the documentation of this file.
1 
19 #ifndef DDT_DATAVISUALISATION_DDTGRAPHCIS_GE_RECTANGLE_HPP
20 #define DDT_DATAVISUALISATION_DDTGRAPHCIS_GE_RECTANGLE_HPP
21 
23 
28  public:
41  const double y, const double w, const double h,
42  const QString obj_name = "", const QString elem_name = "");
43 
48 
52  virtual void DrawElement(QPainter* painter) override;
53 
58  QRectF boundingRect() const override;
59 
64  int type() const override;
65 
66  private:
67  void hoverEnterEvent(QGraphicsSceneHoverEvent* const event) override;
68  void hoverLeaveEvent(QGraphicsSceneHoverEvent* const event) override;
69 
70  bool sceneEventFilter(QGraphicsItem* const watched,
71  QEvent* const event) override;
72 
73  void Initialize();
74  void SetCornerPositions() const;
75 
76  // Rectangle is made up of x/y coordinates for upper-left and lower-right
77  // corner
78  double x1;
79  double y1;
80  double x2;
81  double y2;
82 
83  CornerGrabber* corners[4];
84 };
85 
86 #endif // DDT_DATAVISUALISATION_DDTGRAPHCIS_GE_RECTANGLE_HPP
87 
Definition: ddtCornergrabber.hpp:42
Definition: ddtGraphicalElementProperties.hpp:29
Definition: ddtGraphicalElementRectangle.hpp:27
int type() const override
Definition: ddtGraphicalElementRectangle.cpp:60
QRectF boundingRect() const override
Definition: ddtGraphicalElementRectangle.cpp:48
DdtGraphicalElementRectangle(DdtGraphicalElementProperties const &element_properties, const double x, const double y, const double w, const double h, const QString obj_name="", const QString elem_name="")
Definition: ddtGraphicalElementRectangle.cpp:23
virtual void DrawElement(QPainter *painter) override
Definition: ddtGraphicalElementRectangle.cpp:68
Definition: ddtGraphicalElement.hpp:89
DdtGraphicalElementProperties element_properties
Definition: ddtGraphicalElement.hpp:257
DDT Graphics. Base Class for the DDT Graphical Elements. Elements can be lines, ovals,...