ddt  0.1
ddtGraphicalElementRefLine.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 ddtGraphicalElementRefLine.hpp
8 // @brief DDT Graphics. Class for reference line elements
9 //
10 // Class for the Graphical Elements - Reference Line
11 //
12 // @author Carsten Mannel, CGI
13 // @since 2021/03/10
14 //
15 
16 #ifndef DDT_DATAVISUALISATION_DDTGRAPHCIS_GE_REF_LINE_HPP
17 #define DDT_DATAVISUALISATION_DDTGRAPHCIS_GE_REF_LINE_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 ReDrawLine(const QPointF start, const QPointF end);
62 
67  QPointF Start() const;
68 
73  QPointF End() const;
74 
79  void ResetEventFilter();
80 
81  protected:
85  double x1;
86 
90  double y1;
91 
95  double x2;
96 
100  double y2;
101 
106 
111 
112  private:
113  virtual bool sceneEventFilter(QGraphicsItem* watched, QEvent* event);
114  bool HandleEvent(CornerGrabber* corner, QEvent* event) const;
115 
116  void SetCornerPositions() const;
117 
118  QPointF location;
119  QPointF drag_start;
120  QPointF drag_end;
121 };
122 
123 #endif // DDT_DATAVISUALISATION_DDTGRAPHCIS_GE_REF_LINE_HPP
DdtGraphicalElementRefLine::installed_event_filters
bool installed_event_filters
Definition: ddtGraphicalElementRefLine.hpp:110
DdtGraphicalElementRefLine
Definition: ddtGraphicalElementRefLine.hpp:25
DdtGraphicalElementRefLine::~DdtGraphicalElementRefLine
virtual ~DdtGraphicalElementRefLine()
Definition: ddtGraphicalElementRefLine.cpp:34
DdtGraphicalElement::element_properties
DdtGraphicalElementProperties element_properties
Definition: ddtGraphicalElement.hpp:132
DdtGraphicalElement
Definition: ddtGraphicalElement.hpp:70
DdtGraphicalElementRefLine::ReDrawLine
void ReDrawLine(const QPointF start, const QPointF end)
Definition: ddtGraphicalElementRefLine.cpp:81
DdtGraphicalElementRefLine::y2
double y2
Definition: ddtGraphicalElementRefLine.hpp:100
DdtGraphicalElementRefLine::End
QPointF End() const
Definition: ddtGraphicalElementRefLine.cpp:53
DdtGraphicalElementRefLine::Start
QPointF Start() const
Definition: ddtGraphicalElementRefLine.cpp:51
ddtGraphicalElement.hpp
ddtCornergrabber.hpp
DdtGraphicalElementRefLine::y1
double y1
Definition: ddtGraphicalElementRefLine.hpp:90
DdtGraphicalElementRefLine::type
int type() const
Definition: ddtGraphicalElementRefLine.cpp:55
DdtGraphicalElementRefLine::x1
double x1
Definition: ddtGraphicalElementRefLine.hpp:85
CornerGrabber
Definition: ddtCornergrabber.hpp:22
DdtGraphicalElementRefLine::DrawElement
virtual void DrawElement(QPainter *painter)
Definition: ddtGraphicalElementRefLine.cpp:60
DdtGraphicalElementRefLine::DdtGraphicalElementRefLine
DdtGraphicalElementRefLine(const DdtGraphicalElementProperties element_properties, const double x1, const double y1, const double x2, const double y2)
Definition: ddtGraphicalElementRefLine.cpp:22
DdtGraphicalElementRefLine::x2
double x2
Definition: ddtGraphicalElementRefLine.hpp:95
DdtGraphicalElementRefLine::corners
CornerGrabber * corners[2]
Definition: ddtGraphicalElementRefLine.hpp:105
DdtGraphicalElementProperties
Definition: ddtGraphicalElementProperties.hpp:27
DdtGraphicalElementRefLine::ResetEventFilter
void ResetEventFilter()
Definition: ddtGraphicalElementRefLine.cpp:89
DdtGraphicalElementRefLine::boundingRect
QRectF boundingRect() const
Definition: ddtGraphicalElementRefLine.cpp:47