ddt  1.0.0
ddtGraphicsViewDraw.hpp
Go to the documentation of this file.
1 
20 #ifndef DATAVISUALISATION_WIDGETSDIALOGS_SRC_INCLUDE_DDT_WIDGETS_DDTGRAPHICSVIEWDRAW_HPP_
21 #define DATAVISUALISATION_WIDGETSDIALOGS_SRC_INCLUDE_DDT_WIDGETS_DDTGRAPHICSVIEWDRAW_HPP_
22 
23 #include <QtWidgets>
24 
32 
37  public:
41  DdtGraphicsViewDraw() = default;
42 
49  void DrawMeasurements(QPainter& painter, const QPointF start,
50  const QPointF end) const;
51 
55  void CreateRefLine(DdtGraphicalElementRefLine*& ref_line_element,
56  QGraphicsScene* const scene, const QPointF start,
57  const QPointF end) const;
58 
68  void DrawRefLine(DdtGraphicalElementRefLine*& ref_line_element,
69  QGraphicsScene* const scene, QPainter& painter,
70  const QPointF start, const QPointF end) const;
71 
76  QGraphicsScene* const scene, const double x1,
77  const double y1, const double x2,
78  const double y2) const;
79 
90  QGraphicsScene* const scene, QPainter& painter,
91  const QPointF start, const QPointF end) const;
92 
105  QGraphicsScene* const scene, QPainter& painter, const QPointF start,
106  const QPointF end, const QString draw_mode,
107  const DdtGraphicalElementProperties& overlay_properties,
108  const QString overlay_image_file) const;
109 
115  void SetConvertPixelToDegrees(const double conv_pixel_degrees);
116 
117  private:
121  double convert_pixel_to_degrees = 0.0;
122 
123  void DrawMeasurementLines(QPainter& painter, const QLineF& line,
124  const QLineF& line2, const QLineF& linex,
125  const QLineF& liney) const;
126  void DrawMeasurementText(QPainter& painter, const QRectF& measurement_rect,
127  const QRectF& textx_rect, const QRectF& texty_rect,
128  const QString measurement_text,
129  const QString x_offset_text,
130  const QString y_offset_text) const;
131  QString GetTextForMeasurementLine(const qreal length,
132  const bool draw_distance_in_degrees) const;
133  double GetPixelDistance(const QPointF start, const QPointF end,
134  double* const xoffset, double* const yoffset) const;
135  void GetMovementCorrectionValues(const QPainter& painter,
136  const bool draw_distance_in_degrees,
137  qreal* const movehorizontal,
138  qreal* const movevertical,
139  qreal* const rect_width,
140  qreal* const rect_height) const;
141  QRectF GetMeasurementRectangle(const QPainter& painter, const QLineF& line,
142  const QLineF& linex, const QLineF& liney,
143  const qreal movehorizontal,
144  const qreal movevertical,
145  const qreal rect_width,
146  const qreal rect_height) const;
147  QRectF GetLineXRectangle(const QPainter& painter, const QLineF& linex,
148  const QLineF& liney, const qreal movehorizontal,
149  const qreal movevertical, const qreal rect_width,
150  const qreal rect_height) const;
151  QRectF GetLineYRectangle(const QPainter& painter, const QLineF& linex,
152  const QLineF& liney, const qreal movehorizontal,
153  const qreal movevertical, const qreal rect_width,
154  const qreal rect_height) const;
155 
163  QString DegreesToString(double deg) const;
164 
174  QString ConstructDegreesString(const qreal length) const;
175 };
176 
177 #endif /* DATAVISUALISATION_WIDGETSDIALOGS_SRC_INCLUDE_DDT_WIDGETS_DDTGRAPHICSVIEWDRAW_HPP_ \
178  */
179 
Definition: ddtGraphicalElementProperties.hpp:29
Definition: ddtGraphicalElementRefLine.hpp:29
Definition: ddtGraphicalElementStatRectangle.hpp:28
Definition: ddtGraphicsViewDraw.hpp:36
void DrawMeasurements(QPainter &painter, const QPointF start, const QPointF end) const
Definition: ddtGraphicsViewDraw.cpp:186
void DrawRefLine(DdtGraphicalElementRefLine *&ref_line_element, QGraphicsScene *const scene, QPainter &painter, const QPointF start, const QPointF end) const
Definition: ddtGraphicsViewDraw.cpp:172
void DrawStatisticRectangle(DdtGraphicalElementStatRectangle *&statistic_rect, QGraphicsScene *const scene, QPainter &painter, const QPointF start, const QPointF end) const
Definition: ddtGraphicsViewDraw.cpp:152
void DrawGraphicalElement(QGraphicsScene *const scene, QPainter &painter, const QPointF start, const QPointF end, const QString draw_mode, const DdtGraphicalElementProperties &overlay_properties, const QString overlay_image_file) const
Definition: ddtGraphicsViewDraw.cpp:37
void SetConvertPixelToDegrees(const double conv_pixel_degrees)
Definition: ddtGraphicsViewDraw.cpp:31
void CreateRefLine(DdtGraphicalElementRefLine *&ref_line_element, QGraphicsScene *const scene, const QPointF start, const QPointF end) const
Definition: ddtGraphicsViewDraw.cpp:131
void CreateStatisticRect(DdtGraphicalElementStatRectangle *&statistic_rect, QGraphicsScene *const scene, const double x1, const double y1, const double x2, const double y2) const
Definition: ddtGraphicsViewDraw.cpp:113
DdtGraphicsViewDraw()=default
DDT Graphics. Class for images. Class for the Graphical Elements - Image.
DDT Graphics. Class for common properties of graphical elements like line width, colour etc....
DDT Graphics. Class for reference line elements. Class for the Graphical Elements - Reference Line.
DDT Graphics. Class for slit elements. Class for the Graphical Elements - Slit.
DDT Graphics. Class for rectangles for statistics. Class for the Graphical Elements - Statistics Rect...
DDT Utils. Helper classes for DDT Datavisualisation. Utilities for the DDT Datavisualisation.
DDT Graphics. Class for the rendering of graphical elements into the view. Class for the Graphical Ov...