JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqtpcontour.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger & Sebastian Isbaner (contour plot)
3
4
5
6 This software is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License (LGPL) as published by
8 the Free Software Foundation, either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License (LGPL) for more details.
15
16 You should have received a copy of the GNU Lesser General Public License (LGPL)
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef JKQTPGRAPHSCONTOUR_H
22#define JKQTPGRAPHSCONTOUR_H
23
24
25#include <QString>
26#include <QPainter>
27#include <QImage>
28#include <QVector3D>
29#include <QIcon>
30#include "jkqtplotter/graphs/jkqtpscatter.h"
31#include "jkqtplotter/jkqtptools.h"
32#include "jkqtplotter/jkqtpbaseelements.h"
33#include "jkqtplotter/graphs/jkqtpimage.h"
34#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
35#include "jkqtplotter/jkqtplotter_imexport.h"
36#include "jkqtplotter/jkqtpimagetools.h"
37
38
39
40/*! \brief class for a contour plot
41 * \ingroup jkqtplotter_imagelots_contour
42 *
43 * This class calculates the contour plot for a given image \f$ f(x,y) \f$ , i.e. it
44 * finds the iso lines/polygons, connecting all neighboring points \f$ \{(x,y)|f(x,y)\equiv L_i\} \f$
45 * that equal a given set of contour levels \f$ \{L_i\} \f$ .
46 *
47 * For its calculations, this class implements the CONREC algorithm
48 * (see <a href="http://paulbourke.net/papers/conrec/">http://paulbourke.net/papers/conrec/</a>).
49 *
50 * In order to use this class, you first have to set an image column with the data for this plot and then
51 * define several contour levels for which to plot the contour lines. See \ref JKQTPlotterContourPlot for a
52 * detailed example!
53 *
54 * \note Although this class is derived from JKQTPColumnMathImage, which supports a modifier to the data,
55 * (see JKQTPColumnMathImage::modifierColumn), these features do not make sense for a contour plot
56 * and are not used here. The access functions are hidden in this class, but may be accessible
57 * via a down-cast! Still they do not have any effect on the plotted graph!
58 *
59 * \see See \ref JKQTPlotterContourPlot for a detailed example.
60 * See https://en.wikipedia.org/wiki/Contour_line for details on Contour Lines and Plots.
61 * The implementation for Qt is adapted from Qwt: <a href="http://qwt.sourceforge.net/">http://qwt.sourceforge.net/</a>
62 *
63 * \author Sebastian Isbaner (2013-2014) & Jan Krieger (2019)
64 *
65 * \image html JKQTPColumnContourPlot.png
66 *
67 * \image html contourplot.png
68 *
69 * \note This class uses a caching strategy to determine whether contour lines need to be recalculated (which is time-consuming):
70 * Whenever contours have been calculated, these contours are stored in the member contourLinesCache and can then be used for
71 * redrawing. In addition the checksum of the data column is stored in contourLinesCachedForChecksum. On every redraw,
72 * the checksum is recalculated and compared to the value in contourLinesCachedForChecksum. If it matches, no recalculation
73 * is necessary. If it doesn't match, the contours are recalculated. In addition several methods that change certain
74 * properties of the plot will force a recalculation. Finally you can call clearCachedContours() to force a recalculation!
75 */
77 Q_OBJECT
78 public:
79 /** \brief options of how the colors for the contours are chosen (note that all images in the documentation show the same graph, just with different coloring modes!)*/
81 SingleColorContours, /*!< \brief each contour line has the same color \image html contourplot_SingleColorContours.png */
82 ColorContoursFromPaletteByValue, /*!< \brief the color for each contour line is determined by the current color palette, image range and the value associated with each contour line \image html contourplot_ColorContoursFromPaletteByValue.png */
83 ColorContoursFromPalette, /*!< \brief the color for each contour line is chosen from the current color palette, distributing the contour lines evenly over the palette, wirhout any connection to the value associated with each contour line \image html contourplot_ColorContoursFromPalette.png */
84 };
85
86 /** \brief class constructor */
88 /** \brief class constructor */
90 /** \brief plots the graph to the plotter object specified as parent */
91 virtual void draw(JKQTPEnhancedPainter& painter) override;
92
93 /** \brief creates at nLevels contour levels linearly spaced between the data's minimum and maximum values */
94 void createContourLevels(int nLevels=3);
95 /** \brief creates at least nLevels contour levels with logarithmic spacing. FIXME: Has not been tested yet */
96 void createContourLevelsLog(int nLevels=3,int m=2);
97
98 /** \copydoc ignoreOnPlane */
99 void setIgnoreOnPlane(bool __value);
100 /** \copydoc ignoreOnPlane */
101 bool getIgnoreOnPlane() const;
102 /** \copydoc contourLevels */
103 int getNumberOfLevels() const;
104 /** \copydoc contourColoringMode */
106 /** \copydoc contourColoringMode */
108 /** \brief sets new contour levels from a container \a levels
109 *
110 * \tparam TConatiner any standard container with c++ standard iterators. The contents needs to be convertible to double via jkqtp_todouble()
111 * \param levels the container to copy from
112 */
113 template <class TContainer>
114 void setContourLevels(const TContainer &levels);
115 /** \brief sets new contour levels from a container \a levels
116 *
117 * \tparam TConatiner any standard container with c++ standard iterators. The contents needs to be convertible to double via jkqtp_todouble()
118 * \tparam TColorContainer any standard container with c++ standard iterators. The contents needs to be convertible to QColor
119 * \param levels the container to copy from
120 * \param colors a container with QColors inside, which define the line colors
121 */
122 template <class TContainer, class TColorContainer>
123 void setContourLevels(const TContainer &levels, const TColorContainer& colors);
124 /** \copydoc contourLevels */
125 QVector<double> getContourLevels() const;
126 /** \copydoc relativeLevels */
127 void setRelativeLevels(bool __value);
128 /** \copydoc relativeLevels */
129 bool getRelativeLevels() const;
130 /** \brief add another level for which to draw a contour
131 * \see setOverrideColor(), addContourLevel(), hasOverrideColor(), removeOverrideColor(), getOverrideColor()
132 */
133 void addContourLevel(double level);
134 /** \brief add another level for which to draw a contour and define an override color for this line
135 *
136 * \image html contourplot_overridecolors.png
137 *
138 * \see setOverrideColor(), addContourLevel(), hasOverrideColor(), removeOverrideColor(), getOverrideColor()
139 */
140 void addContourLevel(double level, QColor overrideColor);
141 /** \brief define an override color for the contour line at the given level
142 *
143 * \image html contourplot_overridecolors.png
144 *
145 * \see setOverrideColor(), addContourLevel(), hasOverrideColor(), removeOverrideColor(), getOverrideColor()
146 */
147 void setOverrideColor(double level, QColor overrideColor);
148 /** \brief returns the override color for contour level \a level
149 * \see setOverrideColor(), addContourLevel(), hasOverrideColor(), removeOverrideColor(), getOverrideColor()
150 */
151 QColor getOverrideColor(int level) const;
152 /** \brief returns the override color for contour level \a level
153 * \see setOverrideColor(), addContourLevel(), hasOverrideColor(), removeOverrideColor(), getOverrideColor()
154 */
155 bool hasOverrideColor(int level) const;
156 /** \brief removes the override color for contour level \a level
157 * \see setOverrideColor(), addContourLevel(), hasOverrideColor(), removeOverrideColor(), getOverrideColor()
158 */
159 void removeOverrideColor(int level) ;
160 /** \brief clear all currently defined contour levels */
162
163 /** \brief overrides the caching strategy and forces a recalculation of the contours */
165
166 protected:
167 /** \brief if true, vertices that all lie on the contour plane will be ignored*/
169 /** \brief defines how the colors for the contours are chosen */
171
172 /** \brief the list of contour levels */
173 QVector<double> contourLevels;
174 /** \brief override contour level colors for specific levels, when \c contourColoringMode==SingleColorContours */
175 QMap<double,QColor> contourOverrideColor;
176 /** \brief indicates wether the contour levels are absolute values or relative to the maximum (max-min) */
178
179
180
181 // hide unusable members (this class does not provide data modifier functionality
203 private:
204 /** \brief gives the intersection line of a plane defined by three vertices with a contour level in the x-y plane of heigth level */
205 inline bool intersect(QLineF &line, const QVector3D &vertex1,const QVector3D &vertex2,const QVector3D &vertex3,double level) const;
206 /**
207 * @brief interpolatePoint linear interpolation of a line to the x-y plane using the z-value relative to level
208 * @param point1 start point of the line
209 * @param point2 end point of the line
210 * @param level the heigth for the interpolation (this z-value is projected onto the xy-plane)
211 * @return the interpolated point in the x-y plane
212 */
213 inline QPointF interpolatePoint(const QVector3D &point1, const QVector3D &point2,double level) const ;
214 /**
215 * @brief compare2level checks if the vertex lies above, under or on the contour plane level
216 * @param vertex
217 * @param level contour plane
218 * @return above (1), on the plane (0), below (-1);
219 */
220 inline int compare2level(const QVector3D &vertex, float level) const ;
221 /** \brief calcContourLines calculates the contour lines using the CONREC algorithm */
222 void calcContourLines(QList<QVector<QLineF > > &ContourLines);
223 /** \brief For Caching: the contour lines as vector of single lines (one for each triangle). the list index refers to the contour level.
224 * \internal
225 *
226 * This property is used to store the last result of the contour line calculation. This is done, because
227 * calculating contour lines is rather expensive. In order to determine the need for a recalculation,
228 * the data in the column is converted to a checksum, which can be compared to the sum value stored in
229 * contourLinesCachedForChecksum.
230 *
231 * \see contourLinesCachedForChecksum
232 */
233 QList<QVector<QPolygonF > > contourLinesCache; // contour levels, squares on grid, line
234 /** \brief if (>=0) checksum of the column for which contours were cached in contourLinesCache
235 * \internal
236 * \see contourLinesCache
237 */
239
240};
241
242
243
244
245
246/** \brief class for a contour plots (same as JKQTPContourPlot) of images stored in a JKQTPDatastore column
247 * \ingroup jkqtplotter_imagelots_contour
248 *
249 * \copydetails JKQTPContourPlot
250 *
251 * \see jkqtpstatAddKDE2DContour(), jkqtpstatAddHistogram2DContour(), \ref JKQTPlotterContourPlot, \ref JKQTPlotterBasicJKQTPDatastoreStatistics2D
252 */
254 Q_OBJECT
255 public:
256
257
258 /** \brief class constructor */
260 /** \brief class constructor */
262
263 /** \copydoc imageColumn */
264 void setImageColumn(int __value);
265
266 /** \copydoc imageColumn */
267 void setImageColumn(size_t __value);
268 /** \copydoc imageColumn */
269 int getImageColumn() const;
270
271 /** \copydoc JKQTPGraph::usesColumn() */
272 virtual bool usesColumn(int c) const override;
273
274
275
276 protected:
277 /** \brief column containing the displayed image */
279
280 virtual void ensureImageData() override;
281
282};
283
284
285
286
287
288
289
290
291
292
293
294////////////////////////////////////////////////////////////////////////////////////////////////
295template<class TContainer, class TColorContainer>
296void JKQTPContourPlot::setContourLevels(const TContainer &levels, const TColorContainer &colors)
297{
298 contourLevels.clear();
299 contourOverrideColor.clear();
300 auto itc=colors.begin();
301 for (auto it=levels.begin(); it!=levels.end(); ++it) {
302 const double v=jkqtp_todouble(*it);
303 contourLevels<<v;
304 contourOverrideColor[v]=*itc;
305 ++itc;
306 }
307 std::sort(contourLevels.begin(), contourLevels.end());
309
310}
311
312////////////////////////////////////////////////////////////////////////////////////////////////
313template<class TContainer>
314void JKQTPContourPlot::setContourLevels(const TContainer &levels)
315{
316 contourLevels.clear();
317 contourOverrideColor.clear();
318 for (auto it=levels.begin(); it!=levels.end(); ++it) {
320 }
321 std::sort(contourLevels.begin(), contourLevels.end());
323
324}
325
326
327////////////////////////////////////////////////////////////////////////////////////////////////
328bool JKQTPContourPlot::intersect(QLineF &line, const QVector3D &vertex1, const QVector3D &vertex2, const QVector3D &vertex3, double level) const
329{
330 bool found = true;
331
332 // Are the vertices below (-1), on (0) or above (1) the plane ?
333 const int eq1 = compare2level(vertex1,level);
334 const int eq2 = compare2level(vertex2,level);
335 const int eq3 = compare2level(vertex3,level);
336
337 /*
338 (a) All the vertices lie below the contour level.
339 (b) Two vertices lie below and one on the contour level.
340 (c) Two vertices lie below and one above the contour level.
341 (d) One vertex lies below and two on the contour level.
342 (e) One vertex lies below, one on and one above the contour level.
343 (f) One vertex lies below and two above the contour level.
344 (g) Three vertices lie on the contour level.
345 (h) Two vertices lie on and one above the contour level.
346 (i) One vertex lies on and two above the contour level.
347 (j) All the vertices lie above the contour level.
348 */
349
350 static const int caseLUT[3][3][3] =
351 {
352 // jump table to avoid nested case statements
353 { { 0, 0, 8 }, { 0, 2, 5 }, { 7, 6, 9 } },
354 { { 0, 3, 4 }, { 1, 10, 1 }, { 4, 3, 0 } },
355 { { 9, 6, 7 }, { 5, 2, 0 }, { 8, 0, 0 } }
356 };
357
358 const int caseType = caseLUT[eq1+1][eq2+1][eq3+1];
359 switch (caseType)
360 {
361 case 1:
362 // d(0,0,-1), h(0,0,1)
363 line.setP1(vertex1.toPointF());
364 line.setP2(vertex2.toPointF());
365 break;
366 case 2:
367 // d(-1,0,0), h(1,0,0)
368 line.setP1(vertex2.toPointF());
369 line.setP2(vertex3.toPointF());
370 break;
371 case 3:
372 // d(0,-1,0), h(0,1,0)
373 line.setP1(vertex3.toPointF());
374 line.setP2(vertex1.toPointF());
375 break;
376 case 4:
377 // e(0,-1,1), e(0,1,-1)
378 line.setP1(vertex1.toPointF());
379 line.setP2(interpolatePoint(vertex2, vertex3, level));
380 break;
381 case 5:
382 // e(-1,0,1), e(1,0,-1)
383 line.setP1(vertex2.toPointF());
384 line.setP2(interpolatePoint(vertex3, vertex1, level));
385 break;
386 case 6:
387 // e(-1,1,0), e(1,0,-1)
388 line.setP1(vertex3.toPointF());
389 line.setP2(interpolatePoint(vertex1, vertex2, level));
390 break;
391 case 7:
392 // c(-1,1,-1), f(1,1,-1)
393 line.setP1(interpolatePoint(vertex1, vertex2, level));
394 line.setP2(interpolatePoint(vertex2, vertex3, level));
395 break;
396 case 8:
397 // c(-1,-1,1), f(1,1,-1)
398 line.setP1(interpolatePoint(vertex2, vertex3, level));
399 line.setP2(interpolatePoint(vertex3, vertex1, level));
400 break;
401 case 9:
402 // f(-1,1,1), c(1,-1,-1)
403 line.setP1(interpolatePoint(vertex3, vertex1, level));
404 line.setP2(interpolatePoint(vertex1, vertex2, level));
405 break;
406 case 10:
407 // g(0,0,0)
408 // The CONREC algorithm has no satisfying solution for
409 // what to do, when all vertices are on the plane.
410
411 if ( ignoreOnPlane )
412 found = false;
413 else
414 {
415 line.setP1(vertex3.toPointF());
416 line.setP2(vertex1.toPointF());
417 }
418 break;
419 default:
420 found = false;
421 }
422 // qDebug()<<caseType;
423 // qDebug()<<line;
424 return found;
425}
426
427////////////////////////////////////////////////////////////////////////////////////////////////
428QPointF JKQTPContourPlot::interpolatePoint(const QVector3D &point1, const QVector3D &point2, double level) const
429{
430 const double h1 = point1.z() - level; // height above contour level
431 const double h2 = point2.z() - level;
432
433 // // check if h1 or h2 is zero
434 // Division by zero is not possible (the intersect function is not called if h2-h1 is zero, !)
435 // if(h2-h1==0||h1==0||h2==0) {
436 // qDebug()<<h1<<h2;
437 // qDebug()<<"interpolate p1="<<point1<<", p2="<<point2<<" level="<<level;
438 // }
439
440 const double x = (h2 * point1.x() - h1 * point2.x()) / (h2 - h1); // linear interpolation in x.direction (independent of y)
441 const double y = (h2 * point1.y() - h1 * point2.y()) / (h2 - h1);
442
443 // const double alpha=(level-point1.z())/(point2.z()-point1.z());
444 // const double x=point1.x()+alpha*(point2.x()-point1.x());
445 // const double y=point1.y()+alpha*(point2.y()-point1.y());
446
447 return QPointF(x, y);
448}
449
450////////////////////////////////////////////////////////////////////////////////////////////////
451int JKQTPContourPlot::compare2level(const QVector3D &vertex, float level) const {
452 if (vertex.z() > level) {
453 return 1;
454 }
455
456 if (vertex.z() < level) {
457 return -1;
458 }
459
460 return 0;
461}
462
463
464
465
466
467#endif // JKQTPGRAPHSCONTOUR_H
468
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
void setModifierMode(const JKQTPMathImageModifierMode &__value)
how to apply the modifier column dataModifier
double getColorBarModifiedWidth() const
width of the color bar when modifier is on
void setModifierMin(double __value)
modifier value range minimum
void setColorBarModifiedWidth(double __value)
width of the color bar when modifier is on
JKQTPVerticalIndependentAxis * getModifierColorBarTopAxis()
object used for color bar axes (right border, modifier image data)
JKQTPHorizontalIndependentAxis * getModifierColorBarRightAxis()
object used for color bar axes (top border, modifier image data)
double getModifierMin() const
modifier value range minimum
JKQTPMathImageModifierMode getModifierMode() const
how to apply the modifier column dataModifier
bool getAutoModifierRange() const
indicates whether to estimate min/max of the modifier automatically
void setAutoModifierRange(bool __value)
indicates whether to estimate min/max of the modifier automatically
void setModifierMax(double __value)
modifier value range maximum
double getModifierMax() const
modifier value range maximum
class for a contour plots (same as JKQTPContourPlot) of images stored in a JKQTPDatastore column
Definition jkqtpcontour.h:253
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
virtual void ensureImageData() override
overwrite this to fill the data poiters before they are accessed (e.g. to load data from a column in ...
JKQTPColumnContourPlot(JKQTPlotter *parent)
class constructor
void setImageColumn(int __value)
column containing the displayed image
JKQTPColumnContourPlot(JKQTBasePlotter *parent=nullptr)
class constructor
int getImageColumn() const
column containing the displayed image
void setImageColumn(size_t __value)
column containing the displayed image
int imageColumn
column containing the displayed image
Definition jkqtpcontour.h:278
class for a contour plot
Definition jkqtpcontour.h:76
ContourColoringMode
options of how the colors for the contours are chosen (note that all images in the documentation show...
Definition jkqtpcontour.h:80
@ SingleColorContours
each contour line has the same color
Definition jkqtpcontour.h:81
@ ColorContoursFromPalette
the color for each contour line is chosen from the current color palette, distributing the contour li...
Definition jkqtpcontour.h:83
@ ColorContoursFromPaletteByValue
the color for each contour line is determined by the current color palette, image range and the value...
Definition jkqtpcontour.h:82
QVector< double > contourLevels
the list of contour levels
Definition jkqtpcontour.h:173
QList< QVector< QPolygonF > > contourLinesCache
For Caching: the contour lines as vector of single lines (one for each triangle). the list index refe...
Definition jkqtpcontour.h:233
ContourColoringMode contourColoringMode
defines how the colors for the contours are chosen
Definition jkqtpcontour.h:170
void clearContourLevel()
clear all currently defined contour levels
void setIgnoreOnPlane(bool __value)
if true, vertices that all lie on the contour plane will be ignored
void addContourLevel(double level, QColor overrideColor)
add another level for which to draw a contour and define an override color for this line
JKQTPContourPlot(JKQTPlotter *parent)
class constructor
QPointF interpolatePoint(const QVector3D &point1, const QVector3D &point2, double level) const
interpolatePoint linear interpolation of a line to the x-y plane using the z-value relative to level
Definition jkqtpcontour.h:428
ContourColoringMode getContourColoringMode() const
defines how the colors for the contours are chosen
void setContourColoringMode(ContourColoringMode __value)
defines how the colors for the contours are chosen
void clearCachedContours()
overrides the caching strategy and forces a recalculation of the contours
QColor getOverrideColor(int level) const
returns the override color for contour level level
JKQTPContourPlot(JKQTBasePlotter *parent=nullptr)
class constructor
void addContourLevel(double level)
add another level for which to draw a contour
void setRelativeLevels(bool __value)
indicates wether the contour levels are absolute values or relative to the maximum (max-min)
bool getIgnoreOnPlane() const
if true, vertices that all lie on the contour plane will be ignored
QMap< double, QColor > contourOverrideColor
override contour level colors for specific levels, when contourColoringMode==SingleColorContours
Definition jkqtpcontour.h:175
void createContourLevelsLog(int nLevels=3, int m=2)
creates at least nLevels contour levels with logarithmic spacing. FIXME: Has not been tested yet
int getNumberOfLevels() const
the list of contour levels
bool intersect(QLineF &line, const QVector3D &vertex1, const QVector3D &vertex2, const QVector3D &vertex3, double level) const
gives the intersection line of a plane defined by three vertices with a contour level in the x-y plan...
Definition jkqtpcontour.h:328
QVector< double > getContourLevels() const
the list of contour levels
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
void setContourLevels(const TContainer &levels)
sets new contour levels from a container levels
Definition jkqtpcontour.h:314
bool hasOverrideColor(int level) const
returns the override color for contour level level
int compare2level(const QVector3D &vertex, float level) const
compare2level checks if the vertex lies above, under or on the contour plane level
Definition jkqtpcontour.h:451
int64_t contourLinesCachedForChecksum
if (>=0) checksum of the column for which contours were cached in contourLinesCache
Definition jkqtpcontour.h:238
void removeOverrideColor(int level)
removes the override color for contour level level
void setOverrideColor(double level, QColor overrideColor)
define an override color for the contour line at the given level
void calcContourLines(QList< QVector< QLineF > > &ContourLines)
calcContourLines calculates the contour lines using the CONREC algorithm
void createContourLevels(int nLevels=3)
creates at nLevels contour levels linearly spaced between the data's minimum and maximum values
bool getRelativeLevels() const
indicates wether the contour levels are absolute values or relative to the maximum (max-min)
bool relativeLevels
indicates wether the contour levels are absolute values or relative to the maximum (max-min)
Definition jkqtpcontour.h:177
bool ignoreOnPlane
if true, vertices that all lie on the contour plane will be ignored
Definition jkqtpcontour.h:168
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:49
double x
x coordinate of lower left corner
Definition jkqtpimage.h:104
double y
y coordinate of lower left corner
Definition jkqtpimage.h:106
virtual void setDatatypeModifier(JKQTPMathImageDataType __value)
datatype of the data array data
virtual const void * getDataModifier() const
points to the data array, holding the modifier image
virtual JKQTPMathImageDataType getDatatypeModifier() const
datatype of the data array data
virtual void setDataModifier(const void *__value)
points to the data array, holding the modifier image
QVector< double > getDataModifierAsDoubleVector() const
returns the contents of the internal modifier image as a QVector<double>
class to plot an image from an 2-dimensional array of values
Definition jkqtpimage.h:433
double getModifierValueAt(double x, double y)
return the value (raw data!) of the contained modifier image at the given coordinate
Definition jkqtpimage.h:677
double getModifierPixelValue(int xIdx, int yIdx) const
retrieve modifier image data at a given position as double
Definition jkqtpimage.h:700
int getModifierSampleSize() const
retrieve size of a single sample in the modifier image data (i.e. size of the datatype)
Definition jkqtpimage.h:732
virtual void getModifierMinMax(double &imin, double &imax) override
determine min/max data value of the image
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:364
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
constexpr double jkqtp_todouble(const T &d)
converts a boolean to a double, is used to convert boolean to double by JKQTPDatastore
Definition jkqtpmathtools.h:113