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  int type() const;
55 
61  void ReDrawRectangle(const QPointF p1, const QPointF p2);
62 
67  QPointF Start() const;
68 
73  QPointF End() const;
74 
75  /*
76  * Returns the upper right coordinates of the rectangle
77  * @returns upper right point
78  */
79  QPointF UpperRight() const;
80 
85  QPointF LowerLeft() const;
86 
91  void ResetEventFilter();
92 
93  protected:
97  double x1;
98 
102  double y1;
103 
107  double x2;
108 
112  double y2;
113 
118 
123 
124  private:
125  virtual bool sceneEventFilter(QGraphicsItem* watched, QEvent* event);
126  bool HandleEvent(CornerGrabber* corner, QEvent* event) const;
127 
128  void SetCornerPositions() const;
129 
130  QPointF location;
131  QPointF drag_start;
132  QPointF drag_end;
133 };
134 
135 #endif /* DATAVISUALISATION_GRAPHICS_SRC_INCLUDE_DDT_DDTGRAPHICALELEMENTSTATRECTANGLE_HPP_ \
136  */
DdtGraphicalElementStatRectangle::corners
CornerGrabber * corners[4]
Definition: ddtGraphicalElementStatRectangle.hpp:117
DdtGraphicalElementStatRectangle
Definition: ddtGraphicalElementStatRectangle.hpp:25
DdtGraphicalElementStatRectangle::LowerLeft
QPointF LowerLeft() const
Definition: ddtGraphicalElementStatRectangle.cpp:75
DdtGraphicalElement::element_properties
DdtGraphicalElementProperties element_properties
Definition: ddtGraphicalElement.hpp:132
DdtGraphicalElementStatRectangle::y1
double y1
Definition: ddtGraphicalElementStatRectangle.hpp:102
DdtGraphicalElementStatRectangle::~DdtGraphicalElementStatRectangle
virtual ~DdtGraphicalElementStatRectangle()
Definition: ddtGraphicalElementStatRectangle.cpp:36
DdtGraphicalElement
Definition: ddtGraphicalElement.hpp:70
DdtGraphicalElementStatRectangle::DrawElement
virtual void DrawElement(QPainter *painter)
Definition: ddtGraphicalElementStatRectangle.cpp:84
DdtGraphicalElementStatRectangle::x1
double x1
Definition: ddtGraphicalElementStatRectangle.hpp:97
DdtGraphicalElementStatRectangle::ResetEventFilter
void ResetEventFilter()
Definition: ddtGraphicalElementStatRectangle.cpp:118
ddtGraphicalElement.hpp
ddtCornergrabber.hpp
DdtGraphicalElementStatRectangle::type
int type() const
Definition: ddtGraphicalElementStatRectangle.cpp:79
DdtGraphicalElementStatRectangle::End
QPointF End() const
Definition: ddtGraphicalElementStatRectangle.cpp:67
CornerGrabber
Definition: ddtCornergrabber.hpp:22
DdtGraphicalElementStatRectangle::y2
double y2
Definition: ddtGraphicalElementStatRectangle.hpp:112
DdtGraphicalElementStatRectangle::x2
double x2
Definition: ddtGraphicalElementStatRectangle.hpp:107
DdtGraphicalElementStatRectangle::Start
QPointF Start() const
Definition: ddtGraphicalElementStatRectangle.cpp:63
DdtGraphicalElementStatRectangle::ReDrawRectangle
void ReDrawRectangle(const QPointF p1, const QPointF p2)
Definition: ddtGraphicalElementStatRectangle.cpp:110
DdtGraphicalElementStatRectangle::installed_event_filters
bool installed_event_filters
Definition: ddtGraphicalElementStatRectangle.hpp:122
DdtGraphicalElementProperties
Definition: ddtGraphicalElementProperties.hpp:27
DdtGraphicalElementStatRectangle::boundingRect
QRectF boundingRect() const
Definition: ddtGraphicalElementStatRectangle.cpp:59
DdtGraphicalElementStatRectangle::UpperRight
QPointF UpperRight() const
Definition: ddtGraphicalElementStatRectangle.cpp:71
DdtGraphicalElementStatRectangle::DdtGraphicalElementStatRectangle
DdtGraphicalElementStatRectangle(const DdtGraphicalElementProperties element_properties, const double x1, const double y1, const double x2, const double y2)
Definition: ddtGraphicalElementStatRectangle.cpp:22