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
jkqtpgeoshapes.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
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#ifndef jkqtpgeoshapes_H_INCLUDED
21#define jkqtpgeoshapes_H_INCLUDED
22
23
24#include <QString>
25#include <QPainter>
26#include <QPair>
27#include "jkqtplotter/graphs/jkqtpgeobase.h"
28#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
29#include "jkqtplotter/jkqtptools.h"
30#include "jkqtplotter/jkqtplotter_imexport.h"
31#include "jkqtmathtext/jkqtmathtext.h"
32
33
34
35
36/** \brief This JKQTPGeometricPlotElement is used to draw a rectangle
37 * \ingroup jkqtplotter_geoplots
38 *
39 * \image html plot_georectangle.png
40 *
41 * \note This class support JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve. If set,
42 * and non-linear axes are chosen, the corner points of the rectangle will be possibly
43 * connected by curves, instead of straight lines. In the mode
44 * JKQTPGeometricPlotElement::DrawMode::DrawAsGraphicElement the corners are connected by straight
45 * lines, independent of the linearity or non-linearity of the coordinate axes.
46 *
47 * \see \ref JKQTPlotterGeometricGraphs
48 */
50 Q_OBJECT
51 public:
52
53
54
55 /** \brief class constructor
56 *
57 * \param parent the parent plotter object
58 * \param x x-coordinate of center of rectangle
59 * \param y y-coordinate of center of rectangle
60 * \param width width of rectangle
61 * \param height of rectangle
62 *
63 * \param drawMode draw the rectangle as a graphic or geometric element
64 */
65 JKQTPGeoRectangle(JKQTBasePlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
66 /** \brief class constructor
67 *
68 * \param parent the parent plotter object
69 * \param x x-coordinate of center of rectangle
70 * \param y y-coordinate of center of rectangle
71 * \param width width of rectangle
72 * \param height of rectangle
73 *
74 * \param drawMode draw the rectangle as a graphic or geometric element
75 */
76 JKQTPGeoRectangle(JKQTPlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
77 /** \brief class constructor
78 *
79 * \param parent the parent plotter object
80 * \param bottomleft bottom left corner of rectangle
81 * \param topright top right corner of rectangle
82 *
83 * \param drawMode draw the rectangle as a graphic or geometric element
84 */
85 JKQTPGeoRectangle(JKQTBasePlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
86 /** \brief class constructor
87 *
88 * \param parent the parent plotter object
89 * \param bottomleft bottom left corner of rectangle
90 * \param topright top right corner of rectangle
91 *
92 * \param drawMode draw the rectangle as a graphic or geometric element
93 */
94 JKQTPGeoRectangle(JKQTPlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
95 /** \brief class constructor
96 *
97 * \param parent the parent plotter object
98 * \param center center of rectangle
99 * \param size width and heigt of rectangle
100 *
101 * \param drawMode draw the rectangle as a graphic or geometric element
102 */
103 JKQTPGeoRectangle(JKQTBasePlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
104 /** \brief class constructor
105 *
106 * \param parent the parent plotter object
107 * \param center center of rectangle
108 * \param size width and heigt of rectangle
109 *
110 * \param drawMode draw the rectangle as a graphic or geometric element
111 */
112 JKQTPGeoRectangle(JKQTPlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
113
114
115
116
117
118 /** \copydoc JKQTPPlotElement::getXMinMax() */
119 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
120 /** \copydoc JKQTPPlotElement::getYMinMax() */
121 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
122
123 /** \brief plots the graph to the plotter object specified as parent
124 *
125 * \note This function support JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve. If set,
126 * and non-linear axes are chosen, the corner points of the rectangle will be possibly
127 * connected by curves, instead of straight lines.
128 */
129 virtual void draw(JKQTPEnhancedPainter& painter) override;
130
131 /** \copydoc x */
132 void setX(double __value);
133 /** \copydoc x */
134 double getX() const;
135 /** \copydoc y */
136 void setY(double __value);
137 /** \copydoc y */
138 double getY() const;
139 /** \brief returns the center point of the rectangle */
140 QPointF getCenter() const;
141 /** \brief sets the center point of the rectangle */
142 void setCenter(const QPointF& center);
143 /** \copydoc width */
144 void setWidth(double __value);
145 /** \copydoc width */
146 double getWidth() const;
147 /** \copydoc height */
148 void setHeight(double __value);
149 /** \copydoc height */
150 double getHeight() const;
151 /** \brief returns the size (width and height) of the rectangle */
152 QSizeF getSize() const;
153 /** \brief sets the size (width and height) of the rectangle */
154 void setSize(const QSizeF& size);
155 /** \copydoc angle */
156 void setAngle(double __value);
157 /** \copydoc angle */
158 double getAngle() const;
159 /** \brief set the rectangle using the bottom-left corner, as well as its width and height */
160 void setBottomLeftRectangle(double x, double y, double width, double height);
161 /** \brief set the rectangle using the bottom-left corner, as well as its width and height */
162 void setBottomLeftRectangle(const QRectF& rect);
163 /** \brief returns the rectangle using the bottom-left corner, as well as its width and height, ignoring the rotation angle!!!
164 *
165 * This is equivalent to
166 * \code
167 * QRectF result(x-width/2.0, y-height/2.0, width, height);
168 * \endcode
169 */
171
172 protected:
173 /** \brief x-coordinate of a center of the rectangle */
174 double x;
175 /** \brief y-coordinate of a center of the rectangle */
176 double y;
177 /** \brief width of a center of the rectangle */
178 double width;
179 /** \brief height of a center of the rectangle */
180 double height;
181 /** \brief rotation angle of rectangle [degrees] around (x,y) */
182 double angle;
183 /** \brief returns the transformation matrix used for this rectangle */
184 QTransform getTransform();
185 /** \brief returns a QPolygonF which represents the rectangle after rotation, but still in the world coordinate system, not in the screen/widget system */
186 QPolygonF getPolygon();
187};
188
189
190/** \brief This JKQTPGeometricPlotElement is used to draw a polygon
191 * \ingroup jkqtplotter_geoplots
192 *
193 * \image html plot_geopolygon.png
194 *
195 * \note This function support JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve. If set,
196 * and non-linear axes are chosen, the points of the polygon will be possibly
197 * connected by curves, instead of straight lines.
198 *
199 * \see \ref JKQTPlotterGeometricGraphs
200 *
201 */
203 Q_OBJECT
204 public:
205 /** \brief class constructor
206 *
207 * \param parent the parent plotter object
208 * \param points points on the polygon
209 * \param drawMode draw the rectangle as a graphic or geometric element
210 */
211 JKQTPGeoPolygon(JKQTBasePlotter* parent, const QPolygonF& points, DrawMode drawMode=DrawAsGraphicElement);
212 /** \brief class constructor
213 *
214 * \param parent the parent plotter object
215 * \param points points on the polygon
216 * \param drawMode draw the rectangle as a graphic or geometric element
217 */
218 JKQTPGeoPolygon(JKQTPlotter* parent, const QPolygonF& points, DrawMode drawMode=DrawAsGraphicElement);
219
220 /** \brief class constructor
221 *
222 * \param parent the parent plotter object
223 * \param drawMode draw the rectangle as a graphic or geometric element
224 */
225 JKQTPGeoPolygon(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
226 /** \brief class constructor
227 *
228 * \param parent the parent plotter object
229 * \param drawMode draw the rectangle as a graphic or geometric element
230 */
231 JKQTPGeoPolygon(JKQTPlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
232
233
234 /** \copydoc JKQTPPlotElement::getXMinMax() */
235 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
236 /** \copydoc JKQTPPlotElement::getYMinMax() */
237 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
238
239 /** \brief plots the graph to the plotter object specified as parent
240 *
241 * \note This function support JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve. If set,
242 * and non-linear axes are chosen, the points of the polygon will be possibly
243 * connected by curves, instead of straight lines.
244 */
245 virtual void draw(JKQTPEnhancedPainter& painter) override;
246
247 /** \copydoc points */
248 void setPoints(const QPolygonF & __value);
249 /** \copydoc points */
250 QPolygonF getPoints() const;
251
252 /** \brief append a point to the polygon \see points */
253 void appendPoint(const QPointF& p);
254
255 /** \brief append a point to the polygon \see points */
256 void appendPoint(const double x, const double y);
257
258 /** \brief returns the number of points \see points */
259 int getPointCount() const;
260 /** \brief returns the i-th of point \see points */
261 const QPointF& getPoint(int i) const;
262 /** \brief returns the i-th of point \see points */
263 QPointF& getPoint(int i);
264 /** \brief overwrites the i-th point \see points */
265 void setPoint(int i, const QPointF& point);
266 /** \brief deletes the i-the point \see points */
267 void removePoint(int i);
268 /** \brief returns an iterator to the first point \see points */
269 QPolygonF::iterator pointsBegin();
270 /** \brief returns an iterator after the last point \see points */
271 QPolygonF::iterator pointsEnd();
272 /** \brief returns a constant iterator to the first point \see points */
273 QPolygonF::const_iterator pointsCBegin() const;
274 /** \brief returns a constant iterator after the last point \see points*/
275 QPolygonF::const_iterator pointsCEnd() const;
276
277 protected:
278 /** \brief list with all points on the polygon */
279 QPolygonF points;
280};
281
282/** \brief This JKQTPGeometricPlotElement is used to draw an ellipse
283 * \ingroup jkqtplotter_geoplots
284 *
285 * \image html plot_geoellipse.png
286 *
287 * \image html plot_geoellipse_rotated.png
288 *
289 * \note This function support the JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve only.
290 * This means that ellipses are always treated as mathematical curves, as no meaningful
291 * parametrization for ellipses on non-linear axes could be found! In the mode
292 * JKQTPGeometricPlotElement::DrawMode::DrawAsGraphicElement the points are connected by straight
293 * lines, independent of the linearity or non-linearity of the coordinate axes.
294 *
295 * \see <a href="http://www.codeguru.com/cpp/g-m/gdi/article.php/c131">http://www.codeguru.com/cpp/g-m/gdi/article.php/c131</a> and
296 * <a href="http://en.wikipedia.org/wiki/Ellipse#General_parametric_form">http://en.wikipedia.org/wiki/Ellipse#General_parametric_form</a>
297 *
298 * \see \ref JKQTPlotterGeometricGraphs, JKQTPGeoPie, JKQTPGeoChord, JKQTPGeoArc
299 */
301 Q_OBJECT
302 public:
303
304
305
306 /** \brief class constructor
307 *
308 * \param parent the parent plotter object
309 * \param x x-coordinate of center of rectangle
310 * \param y y-coordinate of center of rectangle
311 * \param width width of rectangle
312 * \param height of rectangle
313 *
314 * \param drawMode draw the rectangle as a graphic or geometric element
315 */
316 JKQTPGeoEllipse(JKQTBasePlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
317 /** \brief class constructor
318 *
319 * \param parent the parent plotter object
320 * \param x x-coordinate of center of rectangle
321 * \param y y-coordinate of center of rectangle
322 * \param width width of rectangle
323 * \param height of rectangle
324 *
325 * \param drawMode draw the rectangle as a graphic or geometric element
326 */
327 JKQTPGeoEllipse(JKQTPlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
328 /** \brief class constructor
329 *
330 * \param parent the parent plotter object
331 * \param bottomleft bottom left corner of rectangle
332 * \param topright top right corner of rectangle
333 *
334 * \param drawMode draw the rectangle as a graphic or geometric element
335 */
336 JKQTPGeoEllipse(JKQTBasePlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
337 /** \brief class constructor
338 *
339 * \param parent the parent plotter object
340 * \param bottomleft bottom left corner of rectangle
341 * \param topright top right corner of rectangle
342 *
343 * \param drawMode draw the rectangle as a graphic or geometric element
344 */
345 JKQTPGeoEllipse(JKQTPlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
346 /** \brief class constructor
347 *
348 * \param parent the parent plotter object
349 * \param center center of rectangle
350 * \param size width and heigt of rectangle
351 *
352 * \param drawMode draw the rectangle as a graphic or geometric element
353 */
354 JKQTPGeoEllipse(JKQTBasePlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
355 /** \brief class constructor
356 *
357 * \param parent the parent plotter object
358 * \param center center of rectangle
359 * \param size width and heigt of rectangle
360 *
361 * \param drawMode draw the rectangle as a graphic or geometric element
362 */
363 JKQTPGeoEllipse(JKQTPlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
364
365
366
367
368 /** \brief plots the graph to the plotter object specified as parent
369 *
370 * \note This function support the JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve only.
371 * This means that ellipses are always treated as mathematical curves, as no meaningful
372 * parametrization for ellipses on non-linear axes could be found!*/
373 virtual void draw(JKQTPEnhancedPainter& painter) override;
374
375 protected:
376
377 /** \brief drawing modes for drawInternal() */
378 enum class InternalDrawMode {
379 Ellipse,
380 Pie,
381 Chord
382 };
383
384 /** \brief inertnal draw function, can draw an ellipse, a pie or a chord! */
385 void drawInternal(JKQTPEnhancedPainter& painter, double angleStart=0, double angleStop=0, InternalDrawMode mode=InternalDrawMode::Ellipse);
386};
387
388
389
390
391/** \brief This JKQTPGeometricPlotElement is used to draw a pie
392 * \ingroup jkqtplotter_geoplots
393 *
394 *
395 * A pie on linear and log-log axes (start angle: 10deg and end-angle 110deg):
396 * \image html plot_geopie.png
397 *
398 * \note This function support the JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve only.
399 * This means that pies are always treated as mathematical curves, as no meaningful
400 * parametrization for pies on non-linear axes could be found!
401 *
402 * \see \ref JKQTPlotterGeometricGraphs, JKQTPGeoEllipse, JKQTPGeoChord, JKQTPGeoArc
403 */
405 Q_OBJECT
406 public:
407 /** \brief class constructor
408 *
409 * \param parent the parent plotter object
410 * \param x x-coordinate of center of ellipse
411 * \param y y-coordinate of center of ellipse
412 * \param width width of ellipse (2 * half axis)
413 * \param height of ellipse (2 * half axis)
414 * \param angleStart if we only draw an arc, this is the starting angle in degrees
415 * \param angleStop if we only draw an arc, this is the ending angle in degrees
416 * \param drawMode draw the rectangle as a graphic or geometric element
417 */
418 JKQTPGeoPie(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
419 /** \brief class constructor
420 *
421 * \param parent the parent plotter object
422 * \param x x-coordinate of center of ellipse
423 * \param y y-coordinate of center of ellipse
424 * \param width width of ellipse (2 * half axis)
425 * \param height of ellipse (2 * half axis)
426 * \param angleStart if we only draw an arc, this is the starting angle in degrees
427 * \param angleStop if we only draw an arc, this is the ending angle in degrees
428 * \param drawMode draw the rectangle as a graphic or geometric element
429 */
430 JKQTPGeoPie(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
431
432
433 /** \copydoc JKQTPPlotElement::getXMinMax() */
434 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
435 /** \copydoc JKQTPPlotElement::getYMinMax() */
436 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
437
438
439 /** \brief plots the graph to the plotter object specified as parent
440 *
441 * \note This function support the JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve only.
442 * This means that pies are always treated as mathematical curves, as no meaningful
443 * parametrization for pies on non-linear axes could be found!*/
444 virtual void draw(JKQTPEnhancedPainter& painter) override;
445
446 /** \copydoc angleStart */
447 void setAngleStart(double __value);
448 /** \copydoc angleStart */
449 double getAngleStart() const;
450 /** \copydoc angleStop */
451 void setAngleStop(double __value);
452 /** \copydoc angleStop */
453 double getAngleStop() const;
454 protected:
455 /** \brief if we only draw an arc, this is the starting angle */
457 /** \brief if we only draw an arc, this is the ending angle */
458 double angleStop;
459};
460
461
462
463
464/** \brief This JKQTPGeometricPlotElement is used to draw a chord
465 * \ingroup jkqtplotter_geoplots
466 *
467 * A chord on linear and log-log axes (start angle: 10deg and end-angle 110deg):
468 *
469 * \image html plot_geochord.png
470 *
471 * \note This function support the JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve only.
472 * This means that chords are always treated as mathematical curves, as no meaningful
473 * parametrization for chords on non-linear axes could be found!
474 *
475 * \see \ref JKQTPlotterGeometricGraphs, JKQTPGeoPie, JKQTPGeoEllipse, JKQTPGeoArc
476 */
478 Q_OBJECT
479 public:
480 /** \brief class constructor
481 *
482 * \param parent the parent plotter object
483 * \param x x-coordinate of center of ellipse
484 * \param y y-coordinate of center of ellipse
485 * \param width width of ellipse (2 * half axis)
486 * \param height of ellipse (2 * half axis)
487 * \param angleStart if we only draw an arc, this is the starting angle in degrees
488 * \param angleStop if we only draw an arc, this is the ending angle in degrees
489 * \param drawMode draw the rectangle as a graphic or geometric element
490 */
491 JKQTPGeoChord(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
492 /** \brief class constructor
493 *
494 * \param parent the parent plotter object
495 * \param x x-coordinate of center of ellipse
496 * \param y y-coordinate of center of ellipse
497 * \param width width of ellipse (2 * half axis)
498 * \param height of ellipse (2 * half axis)
499 * \param angleStart if we only draw an arc, this is the starting angle in degrees
500 * \param angleStop if we only draw an arc, this is the ending angle in degrees
501 * \param drawMode draw the rectangle as a graphic or geometric element
502 */
503 JKQTPGeoChord(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
504
505 /** \copydoc JKQTPPlotElement::getXMinMax() */
506 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
507 /** \copydoc JKQTPPlotElement::getYMinMax() */
508 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
509
510 /** \brief plots the graph to the plotter object specified as parent
511 *
512 * \note This function support the JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve only.
513 * This means that chords are always treated as mathematical curves, as no meaningful
514 * parametrization for chords on non-linear axes could be found!
515 */
516 virtual void draw(JKQTPEnhancedPainter& painter) override;
517};
518
519
520#endif // jkqtpgeoshapes_H_INCLUDED
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
This JKQTPGeometricPlotElement is used as base class for geometric drawing elements that only consist...
Definition jkqtpgeobase.h:177
This JKQTPGeometricPlotElement is used to draw a chord.
Definition jkqtpgeoshapes.h:477
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
JKQTPGeoChord(JKQTBasePlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement)
class constructor
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
JKQTPGeoChord(JKQTPlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement)
class constructor
This JKQTPGeometricPlotElement is used to draw an ellipse.
Definition jkqtpgeoshapes.h:300
JKQTPGeoEllipse(JKQTBasePlotter *parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement)
class constructor
void drawInternal(JKQTPEnhancedPainter &painter, double angleStart=0, double angleStop=0, InternalDrawMode mode=InternalDrawMode::Ellipse)
inertnal draw function, can draw an ellipse, a pie or a chord!
JKQTPGeoEllipse(JKQTPlotter *parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement)
class constructor
InternalDrawMode
drawing modes for drawInternal()
Definition jkqtpgeoshapes.h:378
JKQTPGeoEllipse(JKQTBasePlotter *parent, const QPointF &center, const QSizeF &size, DrawMode drawMode=DrawAsGraphicElement)
class constructor
JKQTPGeoEllipse(JKQTPlotter *parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement)
class constructor
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
JKQTPGeoEllipse(JKQTPlotter *parent, const QPointF &center, const QSizeF &size, DrawMode drawMode=DrawAsGraphicElement)
class constructor
JKQTPGeoEllipse(JKQTBasePlotter *parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement)
class constructor
This JKQTPGeometricPlotElement is used to draw a pie.
Definition jkqtpgeoshapes.h:404
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
double angleStop
if we only draw an arc, this is the ending angle
Definition jkqtpgeoshapes.h:458
JKQTPGeoPie(JKQTPlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement)
class constructor
JKQTPGeoPie(JKQTBasePlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement)
class constructor
void setAngleStop(double __value)
if we only draw an arc, this is the ending angle
double angleStart
if we only draw an arc, this is the starting angle
Definition jkqtpgeoshapes.h:456
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
double getAngleStop() const
if we only draw an arc, this is the ending angle
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
void setAngleStart(double __value)
if we only draw an arc, this is the starting angle
double getAngleStart() const
if we only draw an arc, this is the starting angle
This JKQTPGeometricPlotElement is used to draw a polygon.
Definition jkqtpgeoshapes.h:202
void removePoint(int i)
deletes the i-the point
QPolygonF points
list with all points on the polygon
Definition jkqtpgeoshapes.h:279
QPolygonF::iterator pointsBegin()
returns an iterator to the first point
const QPointF & getPoint(int i) const
returns the i-th of point
int getPointCount() const
returns the number of points
void appendPoint(const double x, const double y)
append a point to the polygon
JKQTPGeoPolygon(JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class constructor
QPolygonF::const_iterator pointsCBegin() const
returns a constant iterator to the first point
void setPoints(const QPolygonF &__value)
list with all points on the polygon
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
QPolygonF::iterator pointsEnd()
returns an iterator after the last point
QPolygonF getPoints() const
list with all points on the polygon
JKQTPGeoPolygon(JKQTPlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class constructor
QPolygonF::const_iterator pointsCEnd() const
returns a constant iterator after the last point
JKQTPGeoPolygon(JKQTBasePlotter *parent, const QPolygonF &points, DrawMode drawMode=DrawAsGraphicElement)
class constructor
void appendPoint(const QPointF &p)
append a point to the polygon
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
void setPoint(int i, const QPointF &point)
overwrites the i-th point
JKQTPGeoPolygon(JKQTPlotter *parent, const QPolygonF &points, DrawMode drawMode=DrawAsGraphicElement)
class constructor
QPointF & getPoint(int i)
returns the i-th of point
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
This JKQTPGeometricPlotElement is used to draw a rectangle.
Definition jkqtpgeoshapes.h:49
QRectF getBottomLeftRectangle() const
returns the rectangle using the bottom-left corner, as well as its width and height,...
double getHeight() const
height of a center of the rectangle
QSizeF getSize() const
returns the size (width and height) of the rectangle
double getX() const
x-coordinate of a center of the rectangle
JKQTPGeoRectangle(JKQTPlotter *parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement)
class constructor
JKQTPGeoRectangle(JKQTBasePlotter *parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement)
class constructor
double width
width of a center of the rectangle
Definition jkqtpgeoshapes.h:178
JKQTPGeoRectangle(JKQTBasePlotter *parent, const QPointF &center, const QSizeF &size, DrawMode drawMode=DrawAsGraphicElement)
class constructor
JKQTPGeoRectangle(JKQTBasePlotter *parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement)
class constructor
void setBottomLeftRectangle(const QRectF &rect)
set the rectangle using the bottom-left corner, as well as its width and height
void setAngle(double __value)
rotation angle of rectangle [degrees] around (x,y)
double height
height of a center of the rectangle
Definition jkqtpgeoshapes.h:180
JKQTPGeoRectangle(JKQTPlotter *parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement)
class constructor
void setSize(const QSizeF &size)
sets the size (width and height) of the rectangle
double angle
rotation angle of rectangle [degrees] around (x,y)
Definition jkqtpgeoshapes.h:182
void setX(double __value)
x-coordinate of a center of the rectangle
void setCenter(const QPointF &center)
sets the center point of the rectangle
void setBottomLeftRectangle(double x, double y, double width, double height)
set the rectangle using the bottom-left corner, as well as its width and height
QTransform getTransform()
returns the transformation matrix used for this rectangle
double getY() const
y-coordinate of a center of the rectangle
double x
x-coordinate of a center of the rectangle
Definition jkqtpgeoshapes.h:174
void setY(double __value)
y-coordinate of a center of the rectangle
double getAngle() const
rotation angle of rectangle [degrees] around (x,y)
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
void setHeight(double __value)
height of a center of the rectangle
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
QPolygonF getPolygon()
returns a QPolygonF which represents the rectangle after rotation, but still in the world coordinate ...
QPointF getCenter() const
returns the center point of the rectangle
double getWidth() const
width of a center of the rectangle
JKQTPGeoRectangle(JKQTPlotter *parent, const QPointF &center, const QSizeF &size, DrawMode drawMode=DrawAsGraphicElement)
class constructor
double y
y-coordinate of a center of the rectangle
Definition jkqtpgeoshapes.h:176
void setWidth(double __value)
width of a center of the rectangle
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
DrawMode
indicates how to draw the geometric object
Definition jkqtpgraphsbase.h:496
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