ddt  0.1
ddtGraphicalElementStatRectangle.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file ddtGraphicalElementStatRectangle.hpp
8 // @brief DDT Graphics. Class for rectangles for statistics
9 //
10 // Class for the Graphical Elements - Statistics Rectangle
11 //
12 // @author Carsten Mannel, CGI
13 // @since 2021/03/24
14 //
15 
16 #ifndef DATAVISUALISATION_GRAPHICS_SRC_INCLUDE_DDT_DDTGRAPHICALELEMENTSTATRECTANGLE_HPP_
17 #define DATAVISUALISATION_GRAPHICS_SRC_INCLUDE_DDT_DDTGRAPHICALELEMENTSTATRECTANGLE_HPP_
18 
19 #include "ddt/ddtCornergrabber.hpp"
21 
26  public:
32  const double y1, const double x2, const double y2);
33 
38 
42  virtual void DrawElement(QPainter* painter);
43 
48  QRectF boundingRect() const;
49 
54  void RedrawCorners(QGraphicsScene* scene);
55 
60  int type() const;
61 
67  void ReDrawRectangle(const QPointF p1, const QPointF p2);
68 
73  QPointF Start() const;
74 
79  QPointF End() const;
80 
81  /*
82  * Returns the upper right coordinates of the rectangle
83  * @returns upper right point
84  */
85  QPointF UpperRight() const;
86 
91  QPointF LowerLeft() const;
92 
97  void ResetEventFilter();
98 
99  protected:
103  double x1;
104 
108  double y1;
109 
113  double x2;
114 
118  double y2;
119 
124 
129 
130  private:
131  virtual bool sceneEventFilter(QGraphicsItem* watched, QEvent* event);
132  bool HandleEvent(CornerGrabber* corner, QEvent* event) const;
133 
134  void SetCornerPositions() const;
135 
136  QPointF location;
137  QPointF drag_start;
138  QPointF drag_end;
139 };
140 
141 #endif /* DATAVISUALISATION_GRAPHICS_SRC_INCLUDE_DDT_DDTGRAPHICALELEMENTSTATRECTANGLE_HPP_ \
142  */
DdtGraphicalElementStatRectangle::corners
CornerGrabber * corners[4]
Definition: ddtGraphicalElementStatRectangle.hpp:123
DdtGraphicalElementStatRectangle
Definition: ddtGraphicalElementStatRectangle.hpp:25
DdtGraphicalElementStatRectangle::LowerLeft
QPointF LowerLeft() const
Definition: ddtGraphicalElementStatRectangle.cpp:84
DdtGraphicalElement::element_properties
DdtGraphicalElementProperties element_properties
Definition: ddtGraphicalElement.hpp:145
DdtGraphicalElementStatRectangle::y1
double y1
Definition: ddtGraphicalElementStatRectangle.hpp:108
DdtGraphicalElementStatRectangle::~DdtGraphicalElementStatRectangle
virtual ~DdtGraphicalElementStatRectangle()
Definition: ddtGraphicalElementStatRectangle.cpp:44
DdtGraphicalElement
Definition: ddtGraphicalElement.hpp:78
DdtGraphicalElementStatRectangle::DrawElement
virtual void DrawElement(QPainter *painter)
Definition: ddtGraphicalElementStatRectangle.cpp:96
DdtGraphicalElementStatRectangle::x1
double x1
Definition: ddtGraphicalElementStatRectangle.hpp:103
DdtGraphicalElementStatRectangle::ResetEventFilter
void ResetEventFilter()
Definition: ddtGraphicalElementStatRectangle.cpp:140
ddtGraphicalElement.hpp
ddtCornergrabber.hpp
DdtGraphicalElementStatRectangle::type
int type() const
Definition: ddtGraphicalElementStatRectangle.cpp:88
DdtGraphicalElementStatRectangle::End
QPointF End() const
Definition: ddtGraphicalElementStatRectangle.cpp:76
CornerGrabber
Definition: ddtCornergrabber.hpp:24
DdtGraphicalElementStatRectangle::y2
double y2
Definition: ddtGraphicalElementStatRectangle.hpp:118
DdtGraphicalElementStatRectangle::x2
double x2
Definition: ddtGraphicalElementStatRectangle.hpp:113
DdtGraphicalElementStatRectangle::Start
QPointF Start() const
Definition: ddtGraphicalElementStatRectangle.cpp:72
DdtGraphicalElementStatRectangle::ReDrawRectangle
void ReDrawRectangle(const QPointF p1, const QPointF p2)
Definition: ddtGraphicalElementStatRectangle.cpp:131
DdtGraphicalElementStatRectangle::installed_event_filters
bool installed_event_filters
Definition: ddtGraphicalElementStatRectangle.hpp:128
DdtGraphicalElementProperties
Definition: ddtGraphicalElementProperties.hpp:27
DdtGraphicalElementStatRectangle::boundingRect
QRectF boundingRect() const
Definition: ddtGraphicalElementStatRectangle.cpp:68
DdtGraphicalElementStatRectangle::UpperRight
QPointF UpperRight() const
Definition: ddtGraphicalElementStatRectangle.cpp:80
DdtGraphicalElementStatRectangle::RedrawCorners
void RedrawCorners(QGraphicsScene *scene)
Definition: ddtGraphicalElementStatRectangle.cpp:144
DdtGraphicalElementStatRectangle::DdtGraphicalElementStatRectangle
DdtGraphicalElementStatRectangle(const DdtGraphicalElementProperties element_properties, const double x1, const double y1, const double x2, const double y2)
Definition: ddtGraphicalElementStatRectangle.cpp:27