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
jkqtpgeobase.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 jkqtpgeobase_H_INCLUDED
21#define jkqtpgeobase_H_INCLUDED
22
23
24#include <QString>
25#include <QPainter>
26#include <QPair>
27#include "jkqtplotter/graphs/jkqtpscatter.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/*! \brief This JKQTPGeometricPlotElement is used as base class for geometric drawing
35 elements that only consist of lines (i.e. no filling of any kind is done)
36 \ingroup jkqtplotter_geoplots
37
38*/
40 Q_OBJECT
41public:
42 /*! \brief class contructor
43
44 \param parent the parent plotter object
45 \param drawMode how to draw te element (as geometric or graphic element)
46 */
47 explicit JKQTPGeoBaseLine(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
48
49 /** \brief set several of the style properties with one call */
50 virtual void setStyle(QColor color, double lineWidth);
51 /** \brief set several of the style properties with one call */
52 virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style);
53 /** \brief set several of the style properties with one call */
54 virtual void setStyle(QColor color, Qt::PenStyle style);
55
56
57
58
59 /** \brief sets the alpha-channel of the \a color (i.e. its transparency) */
60 virtual void setAlpha(float alpha);
61 /** \brief set line color */
62 virtual void setColor(QColor c);
63
64 /** \brief plots a key marker inside the specified rectangle \a rect */
65 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
66 /** \brief returns the color to be used for the key label */
67 virtual QColor getKeyLabelColor() const override;
68
69protected:
70
71};
72
73
74
75
76/*! \brief This JKQTPGeometricPlotElement is used as base class for geometric drawing
77 elements that consist of lines with one decorated end (i.e. no filling of any kind is done)
78 \ingroup jkqtplotter_geoplots
79
80*/
82 Q_OBJECT
83public:
84 /*! \brief class contructor
85
86 \param headStyle style of the head decoration
87 \param parent the parent plotter object
88 \param drawMode how to draw te element (as geometric or graphic element)
89 */
90 explicit JKQTPGeoBaseDecoratedHeadLine(JKQTPLineDecoratorStyle headStyle, JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
91
92 /*! \brief class contructor
93
94 \param parent the parent plotter object
95 \param drawMode how to draw te element (as geometric or graphic element)
96 */
97 explicit JKQTPGeoBaseDecoratedHeadLine(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
98
99
100 /** \brief set several of the style properties with one call */
101 virtual void setStyle(QColor color, double lineWidth);
102 /** \brief set several of the style properties with one call */
103 virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style);
104 /** \brief set several of the style properties with one call */
105 virtual void setStyle(QColor color, Qt::PenStyle style);
106
107
108 /** \brief sets the alpha-channel of the \a color (i.e. its transparency) */
109 virtual void setAlpha(float alpha);
110 /** \brief set line color */
111 virtual void setColor(QColor c);
112
113 /** \brief plots a key marker inside the specified rectangle \a rect */
114 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
115 /** \brief returns the color to be used for the key label */
116 virtual QColor getKeyLabelColor() const override;
117
118protected:
119
120};
121
122
123
124
125/*! \brief This JKQTPGeometricPlotElement is used as base class for geometric drawing
126 elements that consist of lines with decorated ends (i.e. no filling of any kind is done)
127 \ingroup jkqtplotter_geoplots
128
129*/
131 Q_OBJECT
132public:
133 /*! \brief class contructor
134
135 \param headStyle style of the head decoration
136 \param tailStyle style of the tail decoration
137 \param parent the parent plotter object
138 \param drawMode how to draw te element (as geometric or graphic element)
139 */
140 explicit JKQTPGeoBaseDecoratedLine(JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
141 /** \brief class contructor
142 *
143 * \param parent the parent plotter object
144 * \param drawMode how to draw te element (as geometric or graphic element)
145 */
146 explicit JKQTPGeoBaseDecoratedLine(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
147
148 /** \brief set several of the style properties with one call */
149 virtual void setStyle(QColor color, double lineWidth);
150 /** \brief set several of the style properties with one call */
151 virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style);
152 /** \brief set several of the style properties with one call */
153 virtual void setStyle(QColor color, Qt::PenStyle style);
154
155
156
157 /** \brief sets the alpha-channel of the \a color (i.e. its transparency) */
158 virtual void setAlpha(float alpha);
159 /** \brief set line color */
160 virtual void setColor(QColor c);
161
162 /** \brief plots a key marker inside the specified rectangle \a rect */
163 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
164 /** \brief returns the color to be used for the key label */
165 virtual QColor getKeyLabelColor() const override;
166
167protected:
168
169};
170
171
172/*! \brief This JKQTPGeometricPlotElement is used as base class for geometric drawing
173 elements that only consist of lines (i.e. no filling of any kind is done)
174 \ingroup jkqtplotter_geoplots
175
176 */
178 Q_OBJECT
179 public:
180 /*! \brief class contructor
181
182 \param parent the parent plotter object
183 \param drawMode how to draw te element (as geometric or graphic element)
184 */
185 JKQTPGeoBaseFilled(JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement);
186
187 /** \brief sets the alpha-channel of the \a color and \a fillColor (i.e. its transparency) to the same value */
188 virtual void setAlpha(float alpha) override;
189 /** \brief sets the alpha-channel of the \a color and \a fillColor (i.e. its transparency) */
190 virtual void setAlpha(float alphaLine, float alphaFill);
191 /** \brief set line and fill color */
192 virtual void setColor(QColor c) override;
193 /** \brief set several of the style properties with one call */
194 virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle) ;
195 /** \brief set several of the style properties with one call */
196 virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, const JKQTFillStyleSummmary& fillStyle) ;
197 /** \brief set several of the style properties with one call */
198 virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style) override;
199 /** \brief set several of the style properties with one call */
200 virtual void setStyle(QColor color, Qt::PenStyle style) override;
201 /** \brief set several of the style properties with one call */
202 virtual void setStyle(QColor color, double lineWidth) override;
203 /** \brief set several of the style properties with one call */
204 void setStyle(QColor color, QColor fillColor);
205 /** \brief set several of the style properties with one call, sets fill to transparent */
206 void setStyleTransparentFill(QColor color, double lineWidth, Qt::PenStyle style);
207 /** \brief set several of the style properties with one call, sets fill to transparent */
208 void setStyleTransparentFill(QColor color, Qt::PenStyle style);
209 /** \brief set several of the style properties with one call, sets fill to transparent */
210 void setStyleTransparentFill(QColor color, double lineWidth);
211 /** \brief set several of the style properties with one call, sets fill to transparent */
212 void setStyleTransparentFill(QColor color);
213
214 /** \brief plots a key marker inside the specified rectangle \a rect */
215 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
216 protected:
217
218
219};
220
221#endif // jkqtpgeobase_H_INCLUDED
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
Support Class for JKQTBasePlotter, which summarizes a fill style.
Definition jkqtpgraphsbasestyle.h:47
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
This JKQTPGeometricPlotElement is used as base class for geometric drawing elements that consist of l...
Definition jkqtpgeobase.h:81
JKQTPGeoBaseDecoratedHeadLine(JKQTPLineDecoratorStyle headStyle, JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class contructor
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style)
set several of the style properties with one call
virtual void setColor(QColor c)
set line color
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
virtual void setStyle(QColor color, Qt::PenStyle style)
set several of the style properties with one call
virtual void setStyle(QColor color, double lineWidth)
set several of the style properties with one call
virtual void setAlpha(float alpha)
sets the alpha-channel of the color (i.e. its transparency)
JKQTPGeoBaseDecoratedHeadLine(JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class contructor
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
This JKQTPGeometricPlotElement is used as base class for geometric drawing elements that consist of l...
Definition jkqtpgeobase.h:130
virtual void setStyle(QColor color, Qt::PenStyle style)
set several of the style properties with one call
JKQTPGeoBaseDecoratedLine(JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class contructor
virtual void setColor(QColor c)
set line color
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style)
set several of the style properties with one call
virtual void setStyle(QColor color, double lineWidth)
set several of the style properties with one call
JKQTPGeoBaseDecoratedLine(JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class contructor
virtual void setAlpha(float alpha)
sets the alpha-channel of the color (i.e. its transparency)
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
This JKQTPGeometricPlotElement is used as base class for geometric drawing elements that only consist...
Definition jkqtpgeobase.h:177
JKQTPGeoBaseFilled(JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class contructor
void setStyleTransparentFill(QColor color, double lineWidth, Qt::PenStyle style)
set several of the style properties with one call, sets fill to transparent
virtual void setStyle(QColor color, Qt::PenStyle style) override
set several of the style properties with one call
void setStyle(QColor color, QColor fillColor)
set several of the style properties with one call
virtual void setStyle(QColor color, double lineWidth) override
set several of the style properties with one call
virtual void setAlpha(float alpha) override
sets the alpha-channel of the color and fillColor (i.e. its transparency) to the same value
void setStyleTransparentFill(QColor color, double lineWidth)
set several of the style properties with one call, sets fill to transparent
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, const JKQTFillStyleSummmary &fillStyle)
set several of the style properties with one call
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle)
set several of the style properties with one call
void setStyleTransparentFill(QColor color, Qt::PenStyle style)
set several of the style properties with one call, sets fill to transparent
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style) override
set several of the style properties with one call
void setStyleTransparentFill(QColor color)
set several of the style properties with one call, sets fill to transparent
virtual void setAlpha(float alphaLine, float alphaFill)
sets the alpha-channel of the color and fillColor (i.e. its transparency)
virtual void setColor(QColor c) override
set line and fill color
This JKQTPGeometricPlotElement is used as base class for geometric drawing elements that only consist...
Definition jkqtpgeobase.h:39
virtual void setStyle(QColor color, Qt::PenStyle style)
set several of the style properties with one call
JKQTPGeoBaseLine(JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement)
class contructor
virtual void setStyle(QColor color, double lineWidth)
set several of the style properties with one call
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style)
set several of the style properties with one call
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
virtual void setColor(QColor c)
set line color
virtual void setAlpha(float alpha)
sets the alpha-channel of the color (i.e. its transparency)
this is the virtual base class of all JKQTPPlotElement's in a JKQTPlotter plot that represent geometr...
Definition jkqtpgraphsbase.h:491
DrawMode
indicates how to draw the geometric object
Definition jkqtpgraphsbase.h:496
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:248
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:303
This Mix-In class provides setter/getter methods, storage and other facilities for the graph filling ...
Definition jkqtpgraphsbasestylingmixins.h:529
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:49
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
JKQTPLineDecoratorStyle
symbols that can be used to plot a datapoint for a graph
Definition jkqtpdrawingtools.h:365