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
jkqtpbaseplotterstyle.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 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 for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef JKQTBASEPLOTTERSTYLE_H
21#define JKQTBASEPLOTTERSTYLE_H
22
23#include "jkqtplotter/jkqtptools.h"
24#include "jkqtplotter/jkqtpimagetools.h"
25#include "jkqtplotter/jkqtpcoordinateaxesstyle.h"
26#include "jkqtplotter/jkqtpkeystyle.h"
27#include "jkqtplotter/jkqtpimagetools.h"
28#include "jkqtplotter/jkqtpgraphsbasestyle.h"
29#include "jkqtplotter/jkqtplotter_imexport.h"
30#include "jkqtplotter/jkqtplotter_configmacros.h"
31#include "jkqtcommon/jkqtpdrawingtools.h"
32#include "jkqtcommon/jkqtpbasicimagetools.h"
33#include <QColor>
34#include <QPainter>
35#include <QString>
36#include <QHash>
37#include <QPair>
38#include <QVector>
39#include <QSettings>
40
41
42/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of a JKQTBasePlotter
43 * \ingroup jkqtpplotter_styling_classes
44 *
45 * \see JKQTBasePlotter, \ref jkqtpplotter_styling
46 */
48 Q_GADGET
49 public:
51
52
53
54 /** \brief loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object
55 *
56 * \param settings QSettings-object to read from
57 * \param group Group in the QSettings-object to read from
58 * \param defaultStyle If a setting cannot be found in \a settings, default values are taken from this object
59 * By default, this is a default-constructed object
60 */
61 void loadSettings(const QSettings &settings, const QString& group=QString("plots/"), const JKQTBasePlotterStyle &defaultStyle=JKQTBasePlotterStyle());
62
63 /** \brief saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object.
64 *
65 * \param settings QSettings-object to save to
66 * \param group Group in the QSettings-object to save to
67 */
68 void saveSettings(QSettings& settings, const QString& group=QString("plots/")) const;
69
70 /** \brief if set \c true (default: \c false ) the JKQTBasePlotter draws colored rectangles to indicate the different regions in the plot (border, axes, ...)
71 *
72 * \image html debugShowRegionBoxes.png
73 *
74 */
76 /** \brief width of the lines that are drawn, when debugShowRegionBoxes \c ==true [in pixels] */
78 /** \brief if set \c true (default: \c false ) the JKQTBasePlotter draws colored rectangles to indicate the outline etc. of text inside the plot
79 *
80 * \image html debugShowTextBoxes.png
81 *
82 */
84 /** \brief width of the lines that are drawn, when debugShowTextBoxes \c ==true [in pixels] */
86
87
88 /** \brief the decimal separator used when exporting data to text files */
90 /** \brief this string is used to introduce comments in text output when exporting data */
92 /** \brief free space between widget top border and plot top border, this property may be set by the user and is possibly altered
93 * by the key positioning algorithm. The altered value is written to internalPlotBorderTop
94 *
95 * \image html plot_widget_orientation.png
96 *
97 * \see JKQTBasePlotter::setBorder(), \ref jkqtplotter_base_plotsize
98 */
100 /** \brief free space between widget left border and plot left border, this property may be set by the user and is possibly altered
101 * by the key positioning algorithm. The altered value is written to internalPlotBorderLeft
102 *
103 * \image html plot_widget_orientation.png
104 *
105 * \see JKQTBasePlotter::setBorder(), \ref jkqtplotter_base_plotsize
106 */
108 /** \brief free space between widget bottom border and plot bottom border, this property may be set by the user and is possibly altered
109 * by the key positioning algorithm. The altered value is written to internalPlotBorderBottom
110 *
111 * \image html plot_widget_orientation.png
112 *
113 * \see JKQTBasePlotter::setBorder(), \ref jkqtplotter_base_plotsize
114 */
116 /** \brief free space between widget right border and plot right border, this property may be set by the user and is possibly altered
117 * by the key positioning algorithm. The altered value is written to internalPlotBorderRight
118 *
119 * \image html plot_widget_orientation.png
120 *
121 * \see JKQTBasePlotter::setBorder(), \ref jkqtplotter_base_plotsize
122 */
124 /** \brief color of the background of the plot (widget area) when drawing (to the screen) */
126 /** \brief color of the background of the plot (widget area) when exporting*/
128 /** \brief color of the plot's background (i.e. of the area within the coordinate axes rectangle) */
130 /** \brief if \c plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color */
132 /** \brief if \c plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width [pt] */
134 /** \brief if \c plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot, rounding the corners with this redius (<=0 -> no rounded rectangle) [pt] */
136 /** \brief if \c true, JKQTBasePlotter will draw a rectangle/frame around the plot */
138 /** \brief the plot label font name */
140 /** \brief the plot label font size [pt] */
142 /** \brief the plot label color */
144 /** \brief offset of the plot label from the next element of the graph, i.e. below the label [pt]. \see plotLabelTopBorder for spacing above */
146 /** \brief offset of the plot label from the top [pt]. \see plotLabelOffset for spacing between label and graph */
148 /** \brief specifies whether to use antialiasing for plotting the coordinate system */
150 /** \brief specifies whether to use antialiasing when drawing any text
151 * \note You can set this property \c false to increase plotting speed of complex plots (with many graphs inside). You can reach a
152 * roughly three-fold speed improvement!
153 */
155 /** \brief default text color in the plot */
157 /** \brief default font size in the plot [pt] */
159 /** \brief default font name in the plot */
161
162
163 /** \brief style of the plot key/legend */
165 /** \brief style of the x-axis of the main coordinate system */
167 /** \brief style of the y-axis of the main coordinate system */
169 /** \brief separation between two seondary axes in pt */
171 /** \brief style of the coordinate axes used to display colorbars in the right */
173 /** \brief style of the coordinate axes used to display colorbars at the top */
175 /** \brief style of the graphs */
177
178
179};
180
181/** \brief returns the system-wide default JKQTPlotterStyle
182 * \ingroup jkqtpplotter_styling_classes
183 *
184 * \see JKQTPGetSystemDefaultStyle(), JKQTPSetSystemDefaultStyle(), JKQTPSetSystemDefaultBaseStyle(), \ref jkqtpplotter_styling
185 */
187
188/** \brief replaces the system-wide default JKQTPlotterStyle with the given \a newStyle
189 * \ingroup jkqtpplotter_styling_classes
190 *
191 * \see JKQTPGetSystemDefaultStyle(), JKQTPSetSystemDefaultStyle(), JKQTPGetSystemDefaultBaseStyle(), \ref jkqtpplotter_styling
192 */
194
195#endif // JKQTBASEPLOTTERSTYLE_H
Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of ...
Definition jkqtpbaseplotterstyle.h:47
JKQTPKeyStyle keyStyle
style of the plot key/legend
Definition jkqtpbaseplotterstyle.h:164
QString CSVdecimalSeparator
the decimal separator used when exporting data to text files
Definition jkqtpbaseplotterstyle.h:89
bool plotFrameVisible
if true, JKQTBasePlotter will draw a rectangle/frame around the plot
Definition jkqtpbaseplotterstyle.h:137
int plotBorderBottom
free space between widget bottom border and plot bottom border, this property may be set by the user ...
Definition jkqtpbaseplotterstyle.h:115
double plotLabelOffset
offset of the plot label from the next element of the graph, i.e. below the label [pt].
Definition jkqtpbaseplotterstyle.h:145
double plotLabelTopBorder
offset of the plot label from the top [pt].
Definition jkqtpbaseplotterstyle.h:147
JKQTGraphsBaseStyle graphsStyle
style of the graphs
Definition jkqtpbaseplotterstyle.h:176
JKQTPColorbarCoordinateAxisStyle rightColorbarAxisStyle
style of the coordinate axes used to display colorbars in the right
Definition jkqtpbaseplotterstyle.h:172
bool debugShowTextBoxes
if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the outline et...
Definition jkqtpbaseplotterstyle.h:83
QString plotLabelFontName
the plot label font name
Definition jkqtpbaseplotterstyle.h:139
QColor plotLabelColor
the plot label color
Definition jkqtpbaseplotterstyle.h:143
double plotFrameWidth
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width ...
Definition jkqtpbaseplotterstyle.h:133
int plotBorderTop
free space between widget top border and plot top border, this property may be set by the user and is...
Definition jkqtpbaseplotterstyle.h:99
void saveSettings(QSettings &settings, const QString &group=QString("plots/")) const
saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object.
bool useAntiAliasingForSystem
specifies whether to use antialiasing for plotting the coordinate system
Definition jkqtpbaseplotterstyle.h:149
int plotBorderRight
free space between widget right border and plot right border, this property may be set by the user an...
Definition jkqtpbaseplotterstyle.h:123
double debugTextBoxLineWidth
width of the lines that are drawn, when debugShowTextBoxes ==true [in pixels]
Definition jkqtpbaseplotterstyle.h:85
void loadSettings(const QSettings &settings, const QString &group=QString("plots/"), const JKQTBasePlotterStyle &defaultStyle=JKQTBasePlotterStyle())
loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
bool useAntiAliasingForText
specifies whether to use antialiasing when drawing any text
Definition jkqtpbaseplotterstyle.h:154
QString defaultFontName
default font name in the plot
Definition jkqtpbaseplotterstyle.h:160
double plotLabelFontSize
the plot label font size [pt]
Definition jkqtpbaseplotterstyle.h:141
double defaultFontSize
default font size in the plot [pt]
Definition jkqtpbaseplotterstyle.h:158
QColor plotFrameColor
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color
Definition jkqtpbaseplotterstyle.h:131
QBrush widgetBackgroundBrush
color of the background of the plot (widget area) when drawing (to the screen)
Definition jkqtpbaseplotterstyle.h:125
QColor defaultTextColor
default text color in the plot
Definition jkqtpbaseplotterstyle.h:156
double plotFrameRounding
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot,...
Definition jkqtpbaseplotterstyle.h:135
int plotBorderLeft
free space between widget left border and plot left border, this property may be set by the user and ...
Definition jkqtpbaseplotterstyle.h:107
JKQTPCoordinateAxisStyle yAxisStyle
style of the y-axis of the main coordinate system
Definition jkqtpbaseplotterstyle.h:168
JKQTPCoordinateAxisStyle xAxisStyle
style of the x-axis of the main coordinate system
Definition jkqtpbaseplotterstyle.h:166
QBrush exportBackgroundBrush
color of the background of the plot (widget area) when exporting
Definition jkqtpbaseplotterstyle.h:127
QBrush plotBackgroundBrush
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
Definition jkqtpbaseplotterstyle.h:129
double secondaryAxisSeparation
separation between two seondary axes in pt
Definition jkqtpbaseplotterstyle.h:170
double debugRegionLineWidth
width of the lines that are drawn, when debugShowRegionBoxes ==true [in pixels]
Definition jkqtpbaseplotterstyle.h:77
bool debugShowRegionBoxes
if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the different ...
Definition jkqtpbaseplotterstyle.h:75
QString CSVcommentInitializer
this string is used to introduce comments in text output when exporting data
Definition jkqtpbaseplotterstyle.h:91
JKQTPColorbarCoordinateAxisStyle topColorbarAxisStyle
style of the coordinate axes used to display colorbars at the top
Definition jkqtpbaseplotterstyle.h:174
Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of ...
Definition jkqtpgraphsbasestyle.h:386
Support Class for JKQTPCoordinateAxis, which summarizes all properties that define the visual styling...
Definition jkqtpcoordinateaxesstyle.h:258
Support Class for JKQTPCoordinateAxis, which summarizes all properties that define the visual styling...
Definition jkqtpcoordinateaxesstyle.h:87
Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of ...
Definition jkqtpkeystyle.h:49
JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle & JKQTPGetSystemDefaultBaseStyle()
returns the system-wide default JKQTPlotterStyle
JKQTPLOTTER_LIB_EXPORT void JKQTPSetSystemDefaultBaseStyle(JKQTBasePlotterStyle &newStyle)
replaces the system-wide default JKQTPlotterStyle with the given newStyle
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89