- fixed zoomin/synchronized graphs, which was broken by former update to user-interaction

- improved documentation & HTML-sytle
- removed datarange-facilities (not really useful!)
This commit is contained in:
jkriege2 2019-02-03 14:04:48 +01:00
parent 73bf9edd95
commit 4a63afc709
96 changed files with 1645 additions and 1152 deletions

View File

@ -695,7 +695,7 @@ SHOW_USED_FILES = YES
# (if specified). # (if specified).
# The default value is: YES. # The default value is: YES.
SHOW_FILES = YES SHOW_FILES = NO
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the # page. This will remove the Namespaces entry from the Quick Index and from the
@ -813,8 +813,9 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = ../lib/ \ INPUT = . \
./dox/ \ ./dox/ \
../lib \
../examples ../examples
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
@ -866,10 +867,6 @@ FILE_PATTERNS = *.d \
*.f \ *.f \
*.vhd \ *.vhd \
*.vhdl \ *.vhdl \
*.qrc \
*.pro \
*.ui \
*.pri \
*.md *.md
# The RECURSIVE tag can be used to specify whether or not subdirectories should # The RECURSIVE tag can be used to specify whether or not subdirectories should
@ -1028,7 +1025,7 @@ USE_MDFILE_AS_MAINPAGE =
# also VERBATIM_HEADERS is set to NO. # also VERBATIM_HEADERS is set to NO.
# The default value is: NO. # The default value is: NO.
SOURCE_BROWSER = YES SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body of functions, # Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation. # classes and enums directly into the documentation.
@ -1235,7 +1232,7 @@ HTML_STYLESHEET =
# list). For an example see the documentation. # list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = HTML_EXTRA_STYLESHEET = jkqtplotter_stylesheet.css
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note # other source files which should be copied to the HTML output directory. Note
@ -1245,7 +1242,9 @@ HTML_EXTRA_STYLESHEET =
# files will be copied as-is; there are no commands or markers available. # files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES = HTML_EXTRA_FILES = images/icon_code.png \
images/icon_note.png \
images/icon_see.png
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to # will adjust the colors in the style sheet and background images according to
@ -1295,7 +1294,7 @@ HTML_TIMESTAMP = YES
# The default value is: YES. # The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_MENUS = YES HTML_DYNAMIC_MENUS = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the # documentation will contain sections that can be hidden and shown after the
@ -1565,7 +1564,7 @@ EXT_LINKS_IN_WINDOW = NO
# Minimum value: 8, maximum value: 50, default value: 10. # Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 12 FORMULA_FONTSIZE = 13
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not # generated for formulas are transparent PNGs. Transparent PNGs are not

View File

@ -0,0 +1,64 @@
digraph
{
// LATEX_PDF_SIZE
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="12",labelfontname="FreeSans",labelfontsize="12"];
node [fontname="FreeSans",fontsize="12",shape=record];
rankdir="LR";
{
rank=same;
JKQTPPlotElement [URL="JKQTPPlotElement"];
noteJKQTPPlotElement [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nelements drawn\nonto a plot"];
JKQTPPlotElement -> noteJKQTPPlotElement [style=dashed,arrowhead=none];
}
{
rank=same;
JKQTPGraph [URL="JKQTPPlotElement"];
noteJKQTPGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nactual graphs"];
JKQTPGraph -> noteJKQTPGraph [style=dashed,arrowhead=none];
JKQTPPlotObject [URL="JKQTPPlotObject"];
noteJKQTPPlotObject [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\nnon-graph elements,\ne.g. geometric elements"];
JKQTPPlotObject -> noteJKQTPPlotObject [style=dashed,arrowhead=none];
}
{
rank=same;
JKQTPXYGraph [URL="JKQTPXYGraph"]
noteJKQTPXYGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on\n (x,y) data pairs"];
JKQTPXYGraph -> noteJKQTPXYGraph [style=dashed,arrowhead=none];
JKQTPSingleColumnGraph [URL="JKQTPSingleColumnGraph"]
noteJKQTPSingleColumnGraph [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphs based on only\n a single column of data"];
JKQTPSingleColumnGraph -> noteJKQTPSingleColumnGraph [style=dashed,arrowhead=none];
JKQTPImageBase [URL="JKQTPImageBase"]
noteJKQTPImageBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngraphsthat represent \n2D images/matrices"];
JKQTPImageBase -> noteJKQTPImageBase [style=dashed,arrowhead=none];
JKQTPGeoBaseLine [URL="JKQTPGeoBaseLine"];
noteJKQTPGeoBaseLine [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngeometric elements\nthat need line properties\n (color, width, ...)"];
JKQTPGeoBaseLine -> noteJKQTPGeoBaseLine [style=dashed,arrowhead=none];
}
{
rank=same;
JKQTPMathImageBase [URL="JKQTPMathImageBase"]
noteJKQTPMathImageBase [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngeometric elements\nthat need area fill properties\n (fillcolor, pattern, ...)"];
JKQTPMathImageBase -> noteJKQTPMathImageBase [style=dashed,arrowhead=none];
JKQTPGeoBaseFilled [URL="JKQTPGeoBaseFilled"];
noteJKQTPGeoBaseFilled [shape="note", color="lightyellow",style=filled,fontsize=8,label="base class for all\ngeometric elements\nthat need area fill properties\n (fillcolor, pattern, ...)"];
JKQTPGeoBaseFilled -> noteJKQTPGeoBaseFilled [style=dashed,arrowhead=none];
}
JKQTPGraph -> JKQTPXYGraph
JKQTPGraph -> JKQTPSingleColumnGraph
JKQTPGraph -> JKQTPImageBase -> JKQTPMathImageBase
JKQTPPlotElement -> JKQTPGraph
JKQTPPlotElement -> JKQTPPlotObject
JKQTPPlotObject -> JKQTPGeoBaseLine -> JKQTPGeoBaseFilled
}

View File

@ -77,12 +77,56 @@ There are these major subgroups:
\ingroup jkqtplotter_elements \ingroup jkqtplotter_elements
This group contains some tool classes that implement basic elements of the plot (coordinate axes, key, ...). This group contains some tool classes that implement basic elements of the plot (coordinate axes, key, ...).
These classes are used by JKQTPlotterBase to output the plot These classes are used by JKQTPlotterBase to output the plot.
\defgroup jkqtplotter_graphsgroup Graph Classes \defgroup jkqtplotter_graphsgroup Graph Classes
\ingroup jkqtplotter_elements \ingroup jkqtplotter_elements
This group contains all classes in the JKQTPlotter library that may be used to draw a graph (i.e. a curve) onto a plot.
\tableofcontents
\section jkqtplotter_graphsgroup_classstructure Graph Class Structure
\subsection jkqtplotter_graphsgroup_classstructure_basics Graph Classes
Each type of graph is represented by another class, which has to be derived from JKQTPPlotElement. This class provides a basic virtual interface
that allows JKQTPlotter to draw the graphs represented by them. This interface consists of these functions:
- JKQTPPlotElement::draw() draws the graph onto a given JKQTPEnhancedPainter (derived from <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a>)
- JKQTPPlotElement::drawKeyMarker() draws the small marker image in the plot legend
- JKQTPPlotElement::getKeyLabelColor() returns a color for the legend entry for the graph
- JKQTPPlotElement::getXMinMax() returns the extent of the graph in x-direction (e.g. for auto-zooming)
- JKQTPPlotElement::getYMinMax() returns the extent of the graph in Y-direction (e.g. for auto-zooming)
.
In addition to these basic functions, there are additional functions that can be used to draw something outside the actual plot rectangle.
These are used to e.g. add color-scales to the side of the graph:
- JKQTPPlotElement::getOutsideSize() returns the amount of space required outside the plot rectangle
- JKQTPPlotElement::drawOutside() draws the elements outside the plot rectangle
.
Usually if writing a new graph, one would not directly
derive from JKQTPPlotElement, but from a cass in it's hirarchy of children. These children already provide certain facilities for certain types of graphs.
\dotfile jkqtplotter_graphhirarchy.dot
\subsection jkqtplotter_graphsgroup_classstructure_mixins Mix-In Classes for Graphs
In addition there are mix-in classes that are used via multiple inheritance
that add additional features and properties to a graph. A prominent example are the classes for \ref jkqtplotter_basegraphserrors "error indicators".
With these there are usually two variants of one type of graph: One without error indicators and one with error indicators, e.g.:
- JKQTPXYLineGraph shows lines+symbols graphs made up from x/y-value pairs for each data point.
- JKQTPXYLineErrorGraph extends JKQTPXYLineGraph with error indicator drawing/properties provided by JKQTPXYGraphErrors
.
This approach allows to keep interfaces and appearance recognizeable over different graph classes and locates the source code
for a feature like error indicators in a single/in few class(es).
Another example of such a class is JKQTPColorPaletteTools, which provides functions that allow to use color palettes. It is
mainly used for the \ref jkqtplotter_imagelots "Image/Matrix graphs", but also by e.g. JKQTPXYParametrizedScatterGraph.
\defgroup jkqtplotter_basegraphs Baseclasses for Graphs \defgroup jkqtplotter_basegraphs Baseclasses for Graphs
\ingroup jkqtplotter_graphsgroup \ingroup jkqtplotter_graphsgroup
@ -93,6 +137,15 @@ These classes are used by JKQTPlotterBase to output the plot
\defgroup jkqtplotter_linesymbolgraphs Line/Symbol Graphs \defgroup jkqtplotter_linesymbolgraphs Line/Symbol Graphs
\ingroup jkqtplotter_graphsgroup \ingroup jkqtplotter_graphsgroup
\defgroup jkqtplotter_linesymbolgraphs_simple Basic Line/Scatter Graphs
\ingroup jkqtplotter_linesymbolgraphs
\defgroup jkqtplotter_linesymbolgraphs_param Parametrized Line/Scatter Graphs
\ingroup jkqtplotter_linesymbolgraphs
\defgroup jkqtplotter_filledgraphs Filled Polygon/Area Graphs
\ingroup jkqtplotter_graphsgroup
\defgroup jkqtplotter_functiongraphs Function Graphs \defgroup jkqtplotter_functiongraphs Function Graphs
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_linesymbolgraphs

View File

@ -9,46 +9,46 @@ This software is licensed under the term of the GNU Lesser General Public Licens
\image html examplesbanner.png \image html examplesbanner.png
\section jkqtp_main_features Main Features \section jkqtp_main_features Main Features
- Extensive Scientific 2D Plotting framework (JKQTPlotter/JKQTBasePlotter) - <b>Extensive Scientific 2D Plotting framework (JKQTPlotter / JKQTBasePlotter)</b>
- high-quality plotting - high-quality plotting
- no other dependencies than Qt >=4.7 (compatible with Qt 5.xx) - no other dependencies than Qt >=4.7 (compatible with Qt 5.xx)
- highly customizable axes/grids (linear/log, date/time, custom ticks ...) - highly customizable axes/grids (linear/log, date/time, custom ticks ...)
- integrated LaTeX parser/renderer JKQTMathText for axis labels, ticks, notes ... - integrated LaTeX parser/renderer JKQTMathText for axis labels, ticks, notes ...
- extensive user-interactions pre-programmed (several zooming modes, selecting regions, custom context menus, switch graph visibility, ...) - \ref JKQTPLOTTER_USERINTERACTION "extensive user-interactions pre-programmed (several zooming modes, selecting regions, custom context menus, switch graph visibility, ...)"
- full print and export (PDF,PNG,...) support with preview and parametrization out-the-box - \ref jkqtbaseplotter_dataexport_print "full print and export (PDF,PNG,...) support with preview and parametrization out-the-box "
- highly customizable look and feel - highly customizable look and feel
- supports the Qt layout system for graphs and allows to symchronize several graphs with each other - \ref JKQTBASEPLOTTER_SYNCMULTIPLOT "supports the Qt layout system for graphs and allows to symchronize several graphs with each other "
- centralized data management in an internal datastore: - <b>\ref jkqtpdatastorage "centralized data management in an internal datastore)":</b>
- data organized by columns, can also represent image data (ropw-major) - data organized by columns, can also represent image data (row-major)
- allows to reuse a column in several graphs - allows to reuse a column in several graphs
- access via Qt's model view framework - \ref JKQTPDatastoreModel "access via Qt's model view framework"
- external or internal datasets - external or internal datasets
- complete with GUI (table view) - complete with GUI (table view)
- built-in export capabilities for datatables (e.g. to CSV, SYLK, ...) - built-in export capabilities for datatables (e.g. to CSV, SYLK, ...)
- large variety of graphs that can be added to a plot, e.g.: - <b>\ref jkqtplotter_elements "large variety of graphs that can be added to a plot", e.g.:</b>
- scatter-plots (also parametrized color/size/symbol by a third data-column) - \ref jkqtplotter_linesymbolgraphs_simple "scatter-plots" (also \ref jkqtplotter_linesymbolgraphs_param "parametrized color/size/symbol by a third data-column")
- line graphs, step graphs, impulses - \ref jkqtplotter_linesymbolgraphs "line graphs, step graphs", \ref jkqtplotter_barssticks "impulses"
- filled curves - \ref jkqtplotter_filledgraphs "filled curves"
- barcharts (also stacked) - \ref jkqtplotter_barssticks "barcharts (also stacked)"
- extensive support for different styles of error indicators - extensive support for different styles of error indicators
- integrated mathematical function parser for function plots (with intelligent rendering algorithm) - \ref jkmp "integrated mathematical function parser for function plots (with intelligent rendering algorithm)"
- line/scatter graphs can also be based on C/C++ functions instead of data series (C++11 support!) - \ref jkqtplotter_functiongraphs "line/scatter graphs can also be based on C/C++ functions instead of data series (C++11 support!)"
- statistical plots (e.g. boxplots) - \ref jkqtplotter_statgraphs "statistical plots (e.g. boxplots)"
- extensive library of image plots (inclusing different color-scale modes, RGBA-plots, overlays/masks) - \ref jkqtplotter_imagelots_elements "extensive library of image plots" (inclusing different color-scale modes, RGBA-plots, overlays/masks)
- contour plots - \ref jkqtplotter_imagelots_contour "contour plots"
- geometric forms/annotations, see: \ref jkqtplotter_geoplots - \ref jkqtplotter_geoplots "geometric forms/annotations"
- can be easily extended by deriving a new graph from JKQTPPlotElement or JKQTPPlotObject - can be easily extended by deriving a new graph from JKQTPPlotElement or JKQTPPlotObject
- optional: OpenCV interface, see: \ref jkqtpopencvinterface - <b>\ref jkqtpopencvinterface "optional: OpenCV interface"</b>
- integrated LaTeX parser/renderer JKQTMathText: - <b>integrated LaTeX parser/renderer JKQTMathText :</b>
- pure C++ - pure C++
- no dependencies in particular no installed LaTeX required - no dependencies in particular no installed LaTeX required
- can be used independently of JKQTPlotter - can be used independently of JKQTPlotter
- see: \ref jkqtmathtext - for more details, see: \ref jkqtmathtext
- a second plotter widget JKQTFastPlotter: - <b>an additional, simplified but speed-optimized plotter widget JKQTFastPlotter :</b>
- is optimized for fast plotting, but is not as feature-rich as JKQTPlotter - is optimized for fast plotting, but is not as feature-rich as JKQTPlotter
- may be used independently of JKQTPlotter - may be used independently of JKQTPlotter
- \see jkqtfastplotter - for more details, see: \ref jkqtfastplotter
- extensive set of Examples and Tutorials, see: \ref exampleTutorialProjects - \ref exampleTutorialProjects "extensive set of Examples and Tutorials"
- extensive doxygen-generated <a href="http://jkriege2.github.io/JKQTPlotter/index.html">Online-Documentation (http://jkriege2.github.io/JKQTPlotter/index.html)</a> - extensive doxygen-generated <a href="http://jkriege2.github.io/JKQTPlotter/index.html">Online-Documentation (http://jkriege2.github.io/JKQTPlotter/index.html)</a>
- source code hosted&developed on GitHub <a href="https://github.com/jkriege2/JKQTPlotter">https://github.com/jkriege2/JKQTPlotter</a> (including continuous integration builds: <a href="https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master">https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master</a>) - source code hosted&developed on GitHub <a href="https://github.com/jkriege2/JKQTPlotter">https://github.com/jkriege2/JKQTPlotter</a> (including continuous integration builds: <a href="https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master">https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master</a>)

View File

@ -0,0 +1,12 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" enable-background="new 0 0 48 48">
<g fill="#37474F">
<rect x="9" y="20" width="30" height="13"/>
<ellipse cx="24" cy="33" rx="15" ry="6"/>
</g>
<path fill="#78909C" d="M23.1,8.2L0.6,18.1c-0.8,0.4-0.8,1.5,0,1.9l22.5,9.9c0.6,0.2,1.2,0.2,1.8,0l22.5-9.9c0.8-0.4,0.8-1.5,0-1.9 L24.9,8.2C24.3,7.9,23.7,7.9,23.1,8.2z"/>
<g fill="#37474F">
<path d="M43.2,20.4l-20-3.4c-0.5-0.1-1.1,0.3-1.2,0.8c-0.1,0.5,0.3,1.1,0.8,1.2L42,22.2V37c0,0.6,0.4,1,1,1 s1-0.4,1-1V21.4C44,20.9,43.6,20.5,43.2,20.4z"/>
<circle cx="43" cy="37" r="2"/>
<path d="M46,40c0,1.7-3,6-3,6s-3-4.3-3-6s1.3-3,3-3S46,38.3,46,40z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 731 B

View File

@ -0,0 +1,4 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" enable-background="new 0 0 48 48">
<path fill="#F44336" d="M21.2,44.8l-18-18c-1.6-1.6-1.6-4.1,0-5.7l18-18c1.6-1.6,4.1-1.6,5.7,0l18,18c1.6,1.6,1.6,4.1,0,5.7l-18,18 C25.3,46.4,22.7,46.4,21.2,44.8z"/>
<path fill="#fff" d="M21.6,32.7c0-0.3,0.1-0.6,0.2-0.9c0.1-0.3,0.3-0.5,0.5-0.7c0.2-0.2,0.5-0.4,0.8-0.5s0.6-0.2,1-0.2 s0.7,0.1,1,0.2c0.3,0.1,0.6,0.3,0.8,0.5c0.2,0.2,0.4,0.4,0.5,0.7c0.1,0.3,0.2,0.6,0.2,0.9s-0.1,0.6-0.2,0.9s-0.3,0.5-0.5,0.7 c-0.2,0.2-0.5,0.4-0.8,0.5c-0.3,0.1-0.6,0.2-1,0.2s-0.7-0.1-1-0.2s-0.5-0.3-0.8-0.5c-0.2-0.2-0.4-0.4-0.5-0.7S21.6,33.1,21.6,32.7z M25.8,28.1h-3.6L21.7,13h4.6L25.8,28.1z"/>
</svg>

After

Width:  |  Height:  |  Size: 691 B

BIN
doc/images/icon_code.cdr Normal file

Binary file not shown.

BIN
doc/images/icon_code.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
doc/images/icon_note.cdr Normal file

Binary file not shown.

BIN
doc/images/icon_note.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
doc/images/icon_note2.cdr Normal file

Binary file not shown.

BIN
doc/images/icon_see.cdr Normal file

Binary file not shown.

BIN
doc/images/icon_see.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

5
doc/images/info.svg Normal file
View File

@ -0,0 +1,5 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" enable-background="new 0 0 48 48">
<circle fill="#2196F3" cx="24" cy="24" r="21"/>
<rect x="22" y="22" fill="#fff" width="4" height="11"/>
<circle fill="#fff" cx="24" cy="16.5" r="2.5"/>
</svg>

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

4
doc/images/services.svg Normal file
View File

@ -0,0 +1,4 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" enable-background="new 0 0 48 48">
<path fill="#E65100" d="M25.6,34.4c0.1-0.4,0.1-0.9,0.1-1.4s0-0.9-0.1-1.4l2.8-2c0.3-0.2,0.4-0.6,0.2-0.9l-2.7-4.6 c-0.2-0.3-0.5-0.4-0.8-0.3L22,25.3c-0.7-0.6-1.5-1-2.4-1.4l-0.3-3.4c0-0.3-0.3-0.6-0.6-0.6h-5.3c-0.3,0-0.6,0.3-0.6,0.6L12.4,24 c-0.9,0.3-1.6,0.8-2.4,1.4l-3.1-1.4c-0.3-0.1-0.7,0-0.8,0.3l-2.7,4.6c-0.2,0.3-0.1,0.7,0.2,0.9l2.8,2c-0.1,0.4-0.1,0.9-0.1,1.4 s0,0.9,0.1,1.4l-2.8,2c-0.3,0.2-0.4,0.6-0.2,0.9l2.7,4.6c0.2,0.3,0.5,0.4,0.8,0.3l3.1-1.4c0.7,0.6,1.5,1,2.4,1.4l0.3,3.4 c0,0.3,0.3,0.6,0.6,0.6h5.3c0.3,0,0.6-0.3,0.6-0.6l0.3-3.4c0.9-0.3,1.6-0.8,2.4-1.4l3.1,1.4c0.3,0.1,0.7,0,0.8-0.3l2.7-4.6 c0.2-0.3,0.1-0.7-0.2-0.9L25.6,34.4z M16,38c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5c2.8,0,5,2.2,5,5C21,35.8,18.8,38,16,38z"/>
<path fill="#FFA000" d="M41.9,15.3C42,14.8,42,14.4,42,14s0-0.8-0.1-1.3l2.5-1.8c0.3-0.2,0.3-0.5,0.2-0.8l-2.5-4.3 c-0.2-0.3-0.5-0.4-0.8-0.2l-2.9,1.3c-0.7-0.5-1.4-0.9-2.2-1.3l-0.3-3.1C36,2.2,35.8,2,35.5,2h-4.9c-0.3,0-0.6,0.2-0.6,0.5l-0.3,3.1 c-0.8,0.3-1.5,0.7-2.2,1.3l-2.9-1.3c-0.3-0.1-0.6,0-0.8,0.2l-2.5,4.3c-0.2,0.3-0.1,0.6,0.2,0.8l2.5,1.8C24,13.2,24,13.6,24,14 s0,0.8,0.1,1.3l-2.5,1.8c-0.3,0.2-0.3,0.5-0.2,0.8l2.5,4.3c0.2,0.3,0.5,0.4,0.8,0.2l2.9-1.3c0.7,0.5,1.4,0.9,2.2,1.3l0.3,3.1 c0,0.3,0.3,0.5,0.6,0.5h4.9c0.3,0,0.6-0.2,0.6-0.5l0.3-3.1c0.8-0.3,1.5-0.7,2.2-1.3l2.9,1.3c0.3,0.1,0.6,0,0.8-0.2l2.5-4.3 c0.2-0.3,0.1-0.6-0.2-0.8L41.9,15.3z M33,19c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5c2.8,0,5,2.2,5,5C38,16.8,35.8,19,33,19z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

16
doc/images/survey.svg Normal file
View File

@ -0,0 +1,16 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" enable-background="new 0 0 48 48">
<path fill="#455A64" d="M36,4H26c0,1.1-0.9,2-2,2s-2-0.9-2-2H12C9.8,4,8,5.8,8,8v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4V8 C40,5.8,38.2,4,36,4z"/>
<path fill="#fff" d="M36,41H12c-0.6,0-1-0.4-1-1V8c0-0.6,0.4-1,1-1h24c0.6,0,1,0.4,1,1v32C37,40.6,36.6,41,36,41z"/>
<g fill="#90A4AE">
<path d="M26,4c0,1.1-0.9,2-2,2s-2-0.9-2-2h-7v4c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V4H26z"/>
<path d="M24,0c-2.2,0-4,1.8-4,4s1.8,4,4,4s4-1.8,4-4S26.2,0,24,0z M24,6c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2 S25.1,6,24,6z"/>
</g>
<g fill="#CFD8DC">
<rect x="21" y="20" width="12" height="2"/>
<rect x="15" y="19" width="4" height="4"/>
</g>
<g fill="#03A9F4">
<rect x="21" y="29" width="12" height="2"/>
<rect x="15" y="28" width="4" height="4"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 913 B

View File

@ -0,0 +1,134 @@
/* Customized Stylesheet for JKQTPlotter */
dl.section {
margin-left: 7px;
}
dl.note {
padding-left: 39px;
border-color: black;
border-width: 2px;
border-style: solid;
border-left-width: 4px;
border-left-color: #D0C000;
background-image: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
border-radius: 8px;
background-image: url(icon_note.png);
background-position: 3px 3px;
background-repeat: no-repeat;
min-height: 32px;
}
dl.see {
padding-left: 39px;
border-color: black;
border-width: 2px;
border-style: solid;
border-left-width: 4px;
border-left-color: #55AAD1;
background-image: linear-gradient(135deg, #fff1eb 0%, #ace0f9 100%);
border-radius: 8px;
background-image: url(icon_see.png);
background-position: 3px 3px;
background-repeat: no-repeat;
min-height: 32px;
}
div.fragment {
padding: 4px;
padding-left: 39px;
border-color: black;
border-width: 1px;
border-style: solid;
border-left-width: 8px;
border-left-color: #666699;
background-image: linear-gradient(to top, #e6e9f0 0%, #eef1f5 100%);
background-image: url(icon_code.png);
background-position: 3px 3px;
background-repeat: no-repeat;
min-height: 32px;
}
h2.memtitle {
padding: 8px;
border-top: 1px solid #A8B8D9;
border-left: 1px solid #A8B8D9;
border-right: 1px solid #A8B8D9;
border-bottom: 0px;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
margin-bottom: -1px;
background-image: url('nav_f.png');
background-repeat: repeat-x;
background-color: #E2E8F2;
line-height: 1.25;
font-weight: 300;
float: left;
margin: 0px;
margin-right: 15px;
width: auto;
}
h1, h2, h3, h4, h5, h6 {
margin-left: -5pt;
margin-bottom: 32px;
margin-right: 15px;
padding: 4px;
background: #eeeeee;
width: 75%;
}
h1 {
border-bottom: 2px solid black;
border-left: 2px solid black;
font-size: 22pt;
}
h2 {
border-bottom: 1.5px solid black;
border-left: 1.5px solid black;
font-size: 16pt;
font-weight: 150%;
}
h3 {
border-bottom: 1px solid black;
border-left: 1px solid black;
font-size: 14pt;
font-weight: 100%;
}
h2.groupheader {
border-left: 0px;
border-top: 0px;
border-bottom-width: 8pt;
background: #dbdbea;
font-size: 28pt;
}
div.title {
font-size: 28pt;
}
div.image {
padding: 4px;
text-align: left;
margin-left: 32pt;
}
div.caption {
margin-left: 64pt;
text-align: left;
}
table.params {
border: 1px solid black;
border-left-width: 8px;
border-left-color: #66001a;
width: 90%;
padding: 0px;
}
td.paramname {
margin: 0px;
}

View File

@ -39,12 +39,12 @@
#ifdef EMFENGINE_DLL #ifdef EMFENGINE_DLL
# ifdef EMFENGINE_DLL_BUILD # ifdef EMFENGINE_DLL_BUILD
# define EMFENGINELIB_EXPORT Q_DECL_EXPORT # define EMFENGINEJKQTP_LIB_EXPORT Q_DECL_EXPORT
# else # else
# define EMFENGINELIB_EXPORT Q_DECL_IMPORT # define EMFENGINEJKQTP_LIB_EXPORT Q_DECL_IMPORT
# endif # endif
#else #else
# define EMFENGINELIB_EXPORT # define EMFENGINEJKQTP_LIB_EXPORT
#endif #endif
#ifdef HAVE_GDIPLUS #ifdef HAVE_GDIPLUS
@ -120,7 +120,7 @@ private:
void resetClipping(); void resetClipping();
}; };
class EMFENGINELIB_EXPORT EmfPaintDevice : public QPaintDevice class EMFENGINEJKQTP_LIB_EXPORT EmfPaintDevice : public QPaintDevice
{ {
public: public:
EmfPaintDevice(const QSize& s, const QString& fileName); EmfPaintDevice(const QSize& s, const QString& fileName);

View File

@ -2,8 +2,8 @@
\mainpage QTeXEngine - TeX support for Qt \mainpage QTeXEngine - TeX support for Qt
QTeXEngine enables <a href="http://www.qtsoftware.com/">Qt</a> based applications to easily export graphics created using the QTeXEngine enables <a href="http://www.qtsoftware.com/">Qt</a> based applications to easily export graphics created using the
<a href="http://doc.trolltech.com/4.5/qpainter.html">QPainter</a> class to <a href="http://en.wikipedia.org/wiki/TeX">TeX</a>. <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> class to <a href="http://en.wikipedia.org/wiki/TeX">TeX</a>.
It is built on top of <a href="http://doc.trolltech.com/4.5/qpaintengine.html">QPaintEngine</a> It is built on top of <a href="http://doc.qt.io/qt-5/qpaintengine.html">QPaintEngine</a>
and uses the <a href="http://sourceforge.net/projects/pgf/">TikZ/Pgf</a> graphic systems for TeX. and uses the <a href="http://sourceforge.net/projects/pgf/">TikZ/Pgf</a> graphic systems for TeX.
\section license License \section license License
@ -28,7 +28,7 @@ and uses the <a href="http://sourceforge.net/projects/pgf/">TikZ/Pgf</a> graphic
Have a look at the QTeXEngine.pro project file. It is prepared for building Have a look at the QTeXEngine.pro project file. It is prepared for building
static libraries in Win32 and Unix/X11 environments. static libraries in Win32 and Unix/X11 environments.
If you don't know what to do with it, read the file \ref qtexengineinstall and/or If you don't know what to do with it, read the file \ref qtexengineinstall and/or
Trolltechs <a href="http://doc.trolltech.com/4.4/qmake-manual.html">qmake</a> manual. Trolltechs <a href="http://doc.qt.io/qt-5/qmake-manual.html">qmake</a> manual.
\section support Support \section support Support
If you are looking for technical support contact ion.vasilief@proindependent.com. If you are looking for technical support contact ion.vasilief@proindependent.com.

View File

@ -47,8 +47,7 @@ TestWidgetGraphs::TestWidgetGraphs(QWidget *parent) :
setLayout(layout); setLayout(layout);
resize(1000, 800); resize(1000, 800);
plotBot->synchronizeToMaster(plot, true, false); plotBot->synchronizeToMaster(plot, JKQTBasePlotter::sdXAxis, true, true, true);
connect(plot, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTPlotter*)), plotBot, SLOT(synchronizeXAxis(double,double,double,double,JKQTPlotter*)));
plot->getPlotter()->setGridPrinting(true); plot->getPlotter()->setGridPrinting(true);
plot->getPlotter()->addGridPrintingPlotter(0,1,plotBot->getPlotter()); plot->getPlotter()->addGridPrintingPlotter(0,1,plotBot->getPlotter());
plot->getPlotter()->addGridPrintingPlotter(0,2,plotBot2->getPlotter()); plot->getPlotter()->addGridPrintingPlotter(0,2,plotBot2->getPlotter());
@ -332,9 +331,9 @@ void TestWidgetGraphs::setESSymbol(int /*index*/)
void TestWidgetGraphs::setSortOrder2(int index) void TestWidgetGraphs::setSortOrder2(int index)
{ {
if (index==0) pltePlot2->setSortData(JKQTPXYGraph::Unsorted); if (index==0) pltePlot2->setDataSortOrder(JKQTPXYGraph::Unsorted);
if (index==1) pltePlot2->setSortData(JKQTPXYLineGraph::SortedX); if (index==1) pltePlot2->setDataSortOrder(JKQTPXYLineGraph::SortedX);
if (index==2) pltePlot2->setSortData(JKQTPXYLineGraph::SortedY); if (index==2) pltePlot2->setDataSortOrder(JKQTPXYLineGraph::SortedY);
plotBot->redrawPlot(); plotBot->redrawPlot();
} }

View File

@ -6,7 +6,7 @@ The source code of the main application can be found in [`test_multiplot.cpp`](
First three plots are generated and put into a [QGridLayout](http://doc.qt.io/qt-5/qgridlayout.html): First three plots are generated and put into a [QGridLayout](http://doc.qt.io/qt-5/qgridlayout.html):
```.cpp ```.cpp
// 1. create a widget // 1. create a widget
QWidget mainWidget; QWidget mainWidget;
mainWidget.setWindowTitle("JKQTPlotter(s) in a QGridLayout"); mainWidget.setWindowTitle("JKQTPlotter(s) in a QGridLayout");
@ -37,11 +37,11 @@ First three plots are generated and put into a [QGridLayout](http://doc.qt.io/qt
With this simple setup, all three plots would be arranged by the QLayout, but they were all independent. This example could be part of a data fitting application, where the main plot shows data and a fit curve. A plot below that will display the residulas (errors) of the fit. Now if a user zooms one of the plots, he would expect that athe x-axes of the two plots are synchronized. The same for a third plot on the rhs of the residuals, which will show a residual histogram. This linking of the axes can be achieved by the following code: With this simple setup, all three plots would be arranged by the QLayout, but they were all independent. This example could be part of a data fitting application, where the main plot shows data and a fit curve. A plot below that will display the residulas (errors) of the fit. Now if a user zooms one of the plots, he would expect that athe x-axes of the two plots are synchronized. The same for a third plot on the rhs of the residuals, which will show a residual histogram. This linking of the axes can be achieved by the following code:
```.cpp ```.cpp
// 3.4 synchronize width/x-axis of plotResid to width/x-axis of plotMain // 3.3 synchronize width/x-axis of plotResid to width/x-axis of plotMain
plotResid->getPlotter()->synchronizeToMaster(plotMain->getPlotter(), true, false, true, true); plotResid->synchronizeToMaster(plotMain, JKQTBasePlotter::sdXAxis, true, true, true);
// 3.5 synchronize y-axis of width/plotResidHist to y-axis of width/plotResid // 3.4 synchronize y-axis of width/plotResidHist to y-axis of width/plotResid
plotResidHist->getPlotter()->synchronizeToMaster(plotResid->getPlotter(), false, true, true, true); plotResidHist->synchronizeToMaster(plotResid, JKQTBasePlotter::sdYAxis, true, true, true);
``` ```
Finally: When printing or saving an image of the plots, the plotter will no know anything about the arrangement of the plots and the plots cannot be printed/drawn in the same arrangement as in the window. If you want to arrange the plots in the same layout in a printout, as in the window, you will have to tell the main plot, in which arrangement to print the plots: Finally: When printing or saving an image of the plots, the plotter will no know anything about the arrangement of the plots and the plots cannot be printed/drawn in the same arrangement as in the window. If you want to arrange the plots in the same layout in a printout, as in the window, you will have to tell the main plot, in which arrangement to print the plots:
@ -98,7 +98,9 @@ You push the print button (![test_multiplot](https://raw.githubusercontent.com/j
![test_multiplot](../../screenshots/test_multiplot_printpreview.png) ![test_multiplot](../../screenshots/test_multiplot_printpreview.png)
In addition this example also contains a Window that allows to control the plot layout and synchronization options:
![test_multiplot](../../screenshots/test_multiplot_controlwindow.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -11,6 +11,7 @@
#include "jkqtplotter/jkqtpgraphsbarchart.h" #include "jkqtplotter/jkqtpgraphsbarchart.h"
#include <random> #include <random>
#include <cmath> #include <cmath>
#include "test_multiplot_ui.h"
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
@ -38,10 +39,10 @@ int main(int argc, char* argv[])
layout->addWidget(plotResidHist, 1,1); layout->addWidget(plotResidHist, 1,1);
// 3.3 synchronize width/x-axis of plotResid to width/x-axis of plotMain // 3.3 synchronize width/x-axis of plotResid to width/x-axis of plotMain
plotResid->getPlotter()->synchronizeToMaster(plotMain->getPlotter(), true, false, true, true); plotResid->synchronizeToMaster(plotMain, JKQTBasePlotter::sdXAxis, true, true, true);
// 3.4 synchronize y-axis of width/plotResidHist to y-axis of width/plotResid // 3.4 synchronize y-axis of width/plotResidHist to y-axis of width/plotResid
plotResidHist->getPlotter()->synchronizeToMaster(plotResid->getPlotter(), false, true, true, true); plotResidHist->synchronizeToMaster(plotResid, JKQTBasePlotter::sdYAxis, true, true, true);
// 3.5 ensure that the plot are printed/exported in whole, when printing in plotMain // 3.5 ensure that the plot are printed/exported in whole, when printing in plotMain
plotMain->getPlotter()->setGridPrinting(true); plotMain->getPlotter()->setGridPrinting(true);
@ -146,6 +147,7 @@ int main(int argc, char* argv[])
// 7. scale plots automatically to data // 7. scale plots automatically to data
plotResidHist->setAbsoluteX(0, 20);
plotResid->zoomToFit(); plotResid->zoomToFit();
plotResidHist->zoomToFit(); plotResidHist->zoomToFit();
plotMain->zoomToFit(); plotMain->zoomToFit();
@ -155,5 +157,10 @@ int main(int argc, char* argv[])
mainWidget.move(32,32); mainWidget.move(32,32);
mainWidget.resize(800,600); mainWidget.resize(800,600);
// 9. create a second window, which controls the synchronization and layout between the plots
TestMultiplotUI controlWindow(plotMain, plotResid, plotResidHist, layout);
controlWindow.move(850,32);
controlWindow.show();
return app.exec(); return app.exec();
} }

View File

@ -1,36 +1,46 @@
# source code for this simple demo # source code for this simple demo
SOURCES = test_multiplot.cpp SOURCES = test_multiplot.cpp \
test_multiplot_ui.cpp
# configure Qt
CONFIG += link_prl qt # configure Qt
CONFIG += link_prl c++11 CONFIG += link_prl qt
QT += core gui xml svg CONFIG += link_prl c++11
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport QT += core gui xml svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
# output executable name
TARGET = test_multiplot # output executable name
TARGET = test_multiplot
# include JKQTPlotter source code
DEPENDPATH += . ../../lib # include JKQTPlotter source code
INCLUDEPATH += ../../lib DEPENDPATH += . ../../lib
CONFIG (debug, debug|release) { INCLUDEPATH += ../../lib
LIBS += -L../../staticlib/debug -ljkqtplotterlib_debug CONFIG (debug, debug|release) {
} else { LIBS += -L../../staticlib/debug -ljkqtplotterlib_debug
LIBS += -L../../staticlib/release -ljkqtplotterlib } else {
} LIBS += -L../../staticlib/release -ljkqtplotterlib
message("LIBS = $$LIBS") }
message("LIBS = $$LIBS")
win32-msvc* {
QMAKE_CXXFLAGS += /EHsc /std:c++14 win32-msvc* {
# To enable M_PI, M_E,... QMAKE_CXXFLAGS += /EHsc /std:c++14
DEFINES += _USE_MATH_DEFINES # To enable M_PI, M_E,...
# To fix error: C2338: va_start argument must not DEFINES += _USE_MATH_DEFINES
# have reference type and must not be parenthesized # To fix error: C2338: va_start argument must not
DEFINES += _CRT_NO_VA_START_VALIDATION # have reference type and must not be parenthesized
} DEFINES += _CRT_NO_VA_START_VALIDATION
}
# here you can activate some debug options
#DEFINES += SHOW_JKQTPLOTTER_DEBUG # here you can activate some debug options
#DEFINES += JKQTBP_AUTOTIMER #DEFINES += SHOW_JKQTPLOTTER_DEBUG
#DEFINES += JKQTBP_AUTOTIMER
FORMS += \
test_multiplot_ui.ui
HEADERS += \
test_multiplot_ui.h
RESOURCES += \
test_multiplot.qrc

View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>plotsymbol.png</file>
</qresource>
</RCC>

View File

@ -0,0 +1,33 @@
#include "test_multiplot_ui.h"
#include "ui_test_multiplot_ui.h"
TestMultiplotUI::TestMultiplotUI(JKQTPlotter *plotTop_, JKQTPlotter *plotBot_, JKQTPlotter *plotRight_, QGridLayout *plotLayout_, QWidget *parent) :
QDialog(parent),
plotTop(plotTop_),
plotBot(plotBot_),
plotRight(plotRight_),
plotLayout(plotLayout_),
ui(new Ui::TestMultiplotUI)
{
ui->setupUi(this);
}
TestMultiplotUI::~TestMultiplotUI()
{
delete ui;
}
void TestMultiplotUI::updatePlot()
{
plotLayout->setRowStretch(0, ui->spinRow0Stretch->value());
plotLayout->setRowStretch(1, ui->spinRow1Stretch->value());
plotLayout->setColumnStretch(0, ui->spinCol0Stretch->value());
plotLayout->setColumnStretch(1, ui->spinCol1Stretch->value());
plotBot->getPlotter()->resetMasterSynchronization();
plotRight->getPlotter()->resetMasterSynchronization();
plotBot->synchronizeToMaster(plotTop, JKQTBasePlotter::sdXAxis, ui->chkSyncWidthTopBot->isChecked(), ui->chkSyncZoomTopBot->isChecked(), ui->chkSyncZoomTopBot->isChecked());
plotRight->synchronizeToMaster(plotBot, JKQTBasePlotter::sdYAxis, ui->chkSyncHeightLeftRight->isChecked(), ui->chkSyncZoomLeftRight->isChecked(), ui->chkSyncZoomLeftRight->isChecked());
plotTop->getPlotter()->setShowKey(false);
plotBot->getYAxis()->setAxisLabel("");
}

View File

@ -0,0 +1,31 @@
#ifndef TEST_MULTIPLOT_UI_H
#define TEST_MULTIPLOT_UI_H
#include <QDialog>
#include "jkqtplotter/jkqtplotter.h"
#include <QGridLayout>
namespace Ui {
class TestMultiplotUI;
}
class TestMultiplotUI : public QDialog
{
Q_OBJECT
public:
explicit TestMultiplotUI(JKQTPlotter* plotTop_, JKQTPlotter* plotBot_, JKQTPlotter* plotRight_, QGridLayout* plotLayout_, QWidget *parent = nullptr);
~TestMultiplotUI();
protected slots:
void updatePlot();
private:
JKQTPlotter* plotTop;
JKQTPlotter* plotBot;
JKQTPlotter* plotRight;
QGridLayout* plotLayout;
Ui::TestMultiplotUI *ui;
};
#endif // TEST_MULTIPLOT_UI_H

View File

@ -0,0 +1,389 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TestMultiplotUI</class>
<widget class="QDialog" name="TestMultiplotUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>536</width>
<height>299</height>
</rect>
</property>
<property name="windowTitle">
<string>Set Multi-Plot Properties</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>96</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="test_multiplot.qrc">:/plotsymbol.png</pixmap>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QSpinBox" name="spinRow0Stretch">
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>96</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="test_multiplot.qrc">:/plotsymbol.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="label_4">
<property name="text">
<string>row stretch:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="spinCol0Stretch">
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>444</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="3">
<widget class="QSpinBox" name="spinCol1Stretch">
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QSpinBox" name="spinRow1Stretch">
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="0" column="5">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>col stretch:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>96</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="test_multiplot.qrc">:/plotsymbol.png</pixmap>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>226</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkSyncHeightLeftRight">
<property name="text">
<string>syncHeight</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkSyncZoomLeftRight">
<property name="text">
<string>syncZoom</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="chkSyncWidthTopBot">
<property name="text">
<string>syncWidth</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkSyncZoomTopBot">
<property name="text">
<string>syncZoom</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources>
<include location="test_multiplot.qrc"/>
</resources>
<connections>
<connection>
<sender>chkSyncWidthTopBot</sender>
<signal>toggled(bool)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>101</x>
<y>148</y>
</hint>
<hint type="destinationlabel">
<x>269</x>
<y>72</y>
</hint>
</hints>
</connection>
<connection>
<sender>chkSyncZoomTopBot</sender>
<signal>toggled(bool)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>194</x>
<y>145</y>
</hint>
<hint type="destinationlabel">
<x>275</x>
<y>109</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinCol0Stretch</sender>
<signal>valueChanged(int)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>145</x>
<y>279</y>
</hint>
<hint type="destinationlabel">
<x>292</x>
<y>145</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinCol1Stretch</sender>
<signal>valueChanged(int)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>356</x>
<y>276</y>
</hint>
<hint type="destinationlabel">
<x>385</x>
<y>101</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinRow0Stretch</sender>
<signal>valueChanged(int)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>481</x>
<y>90</y>
</hint>
<hint type="destinationlabel">
<x>388</x>
<y>50</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinRow1Stretch</sender>
<signal>valueChanged(int)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>477</x>
<y>204</y>
</hint>
<hint type="destinationlabel">
<x>386</x>
<y>129</y>
</hint>
</hints>
</connection>
<connection>
<sender>chkSyncHeightLeftRight</sender>
<signal>toggled(bool)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>238</x>
<y>199</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>43</y>
</hint>
</hints>
</connection>
<connection>
<sender>chkSyncZoomLeftRight</sender>
<signal>toggled(bool)</signal>
<receiver>TestMultiplotUI</receiver>
<slot>updatePlot()</slot>
<hints>
<hint type="sourcelabel">
<x>272</x>
<y>230</y>
</hint>
<hint type="destinationlabel">
<x>409</x>
<y>71</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>updatePlot()</slot>
</slots>
</ui>

View File

@ -25,9 +25,6 @@
*/ */
/** \file jkqtfastplotter.h
* \ingroup jkqtfastplotter
*/
#ifndef JKQTFASTPLOTTER_H #ifndef JKQTFASTPLOTTER_H
#define JKQTFASTPLOTTER_H #define JKQTFASTPLOTTER_H
@ -93,7 +90,7 @@ class JKQTFPPlot;
. .
*/ */
class LIB_EXPORT JKQTFastPlotter : public QGLWidget { class JKQTP_LIB_EXPORT JKQTFastPlotter : public QGLWidget {
Q_OBJECT Q_OBJECT
protected: protected:
/** \brief indicates whether to do full repaint (system and data) at the next repaint (any of the repaint meothods) */ /** \brief indicates whether to do full repaint (system and data) at the next repaint (any of the repaint meothods) */
@ -1158,7 +1155,7 @@ class LIB_EXPORT JKQTFastPlotter : public QGLWidget {
/*! \brief base class for all plots that may be plotted by JKQTFastPlotter /*! \brief base class for all plots that may be plotted by JKQTFastPlotter
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
*/ */
class LIB_EXPORT JKQTFPPlot: public QObject { class JKQTP_LIB_EXPORT JKQTFPPlot: public QObject {
Q_OBJECT Q_OBJECT
protected: protected:
/** \brief parent class, i.e. the plotter to plot on */ /** \brief parent class, i.e. the plotter to plot on */
@ -1200,7 +1197,7 @@ class LIB_EXPORT JKQTFPPlot: public QObject {
This class plots data as (x,y) points connected by straight lines. If errors for the y values are This class plots data as (x,y) points connected by straight lines. If errors for the y values are
provided, also y+/-yerr errorlines are drawn. provided, also y+/-yerr errorlines are drawn.
*/ */
class LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
public: public:
/** \brief used to store which datatype is used for the plot data */ /** \brief used to store which datatype is used for the plot data */
enum DataType { enum DataType {
@ -1466,7 +1463,7 @@ class LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
This class does not support y errors! This class does not support y errors!
*/ */
class LIB_EXPORT JKQTFPVCrossPlot: public JKQTFPLinePlot { class JKQTP_LIB_EXPORT JKQTFPVCrossPlot: public JKQTFPLinePlot {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -1525,7 +1522,7 @@ class LIB_EXPORT JKQTFPVCrossPlot: public JKQTFPLinePlot {
This class does not support y errors! This class does not support y errors!
*/ */
class LIB_EXPORT JKQTFPVBarPlot: public JKQTFPLinePlot { class JKQTP_LIB_EXPORT JKQTFPVBarPlot: public JKQTFPLinePlot {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -1560,7 +1557,7 @@ class LIB_EXPORT JKQTFPVBarPlot: public JKQTFPLinePlot {
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
*/ */
class LIB_EXPORT JKQTFPXRangePlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPXRangePlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
protected: protected:
/** \brief start of x range */ /** \brief start of x range */
@ -1754,7 +1751,7 @@ class LIB_EXPORT JKQTFPXRangePlot: public JKQTFPPlot {
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
*/ */
class LIB_EXPORT JKQTFPYRangePlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPYRangePlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
protected: protected:
/** \brief start of x range */ /** \brief start of x range */
@ -1947,7 +1944,7 @@ class LIB_EXPORT JKQTFPYRangePlot: public JKQTFPPlot {
/*! \brief a plot of a QImage /*! \brief a plot of a QImage
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
*/ */
class LIB_EXPORT JKQTFPQImagePlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPQImagePlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
protected: protected:
/** \brief image to plot */ /** \brief image to plot */
@ -2631,17 +2628,17 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
\see JKQTFPimagePlot_array2image() \see JKQTFPimagePlot_array2image()
*/ */
LIB_EXPORT QStringList JKQTFPimagePlot_getPalettes(); JKQTP_LIB_EXPORT QStringList JKQTFPimagePlot_getPalettes();
/*! \brief get QIcon representing the given palette /*! \brief get QIcon representing the given palette
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
\see JKQTFPimagePlot_array2image() \see JKQTFPimagePlot_array2image()
*/ */
LIB_EXPORT QIcon JKQTFPimagePlot_getPaletteIcon(int i); JKQTP_LIB_EXPORT QIcon JKQTFPimagePlot_getPaletteIcon(int i);
/*! \brief get QIcon representing the given palette /*! \brief get QIcon representing the given palette
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
\see JKQTFPimagePlot_array2image() \see JKQTFPimagePlot_array2image()
*/ */
LIB_EXPORT QIcon JKQTFPimagePlot_getPaletteIcon(JKQTFPColorPalette palette); JKQTP_LIB_EXPORT QIcon JKQTFPimagePlot_getPaletteIcon(JKQTFPColorPalette palette);
/*! \brief plots a given grayscale image with a given color palette /*! \brief plots a given grayscale image with a given color palette
@ -2652,7 +2649,7 @@ LIB_EXPORT QIcon JKQTFPimagePlot_getPaletteIcon(JKQTFPColorPalette palette);
. .
*/ */
class LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
protected: protected:
/** \brief image to plot */ /** \brief image to plot */
@ -3067,7 +3064,7 @@ inline void JKQTFPRGBImageOverlayPlot_array2image(T* dbl, int width, int height,
. .
*/ */
class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
protected: protected:
/** \brief image to plot */ /** \brief image to plot */
@ -3476,7 +3473,7 @@ class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
*/ */
class LIB_EXPORT JKQTFPimageOverlayPlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPimageOverlayPlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
public: public:
enum SymbolType { enum SymbolType {
@ -3661,7 +3658,7 @@ class LIB_EXPORT JKQTFPimageOverlayPlot: public JKQTFPPlot {
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
*/ */
class LIB_EXPORT JKQTFPQScaleBarXPlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPQScaleBarXPlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
public: public:
enum Position { enum Position {
@ -3809,7 +3806,7 @@ class LIB_EXPORT JKQTFPQScaleBarXPlot: public JKQTFPPlot {
\ingroup jkqtfastplotter \ingroup jkqtfastplotter
*/ */
class LIB_EXPORT JKQTFPQOverlayLinearGridPlot: public JKQTFPPlot { class JKQTP_LIB_EXPORT JKQTFPQOverlayLinearGridPlot: public JKQTFPPlot {
Q_OBJECT Q_OBJECT
protected: protected:

View File

@ -26,10 +26,6 @@
*/ */
/** \file jkqtmathtext.h
* \ingroup jkqtmathtext
*/
#ifndef JKQTMATHTEXT_H #ifndef JKQTMATHTEXT_H
#define JKQTMATHTEXT_H #define JKQTMATHTEXT_H
@ -53,7 +49,7 @@
/** \brief initialized Qt-ressources necessary for JKQTMathText /** \brief initialized Qt-ressources necessary for JKQTMathText
* \ingroup jkqtmathtext * \ingroup jkqtmathtext
*/ */
LIB_EXPORT void initJKQTMathTextResources(); JKQTP_LIB_EXPORT void initJKQTMathTextResources();
/*! \brief this class parses a LaTeX string and can then draw the contained text/equation onto a <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> /*! \brief this class parses a LaTeX string and can then draw the contained text/equation onto a <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a>
\ingroup jkqtmathtext \ingroup jkqtmathtext
@ -222,7 +218,7 @@ LIB_EXPORT void initJKQTMathTextResources();
*/ */
class LIB_EXPORT JKQTMathText : public QObject { class JKQTP_LIB_EXPORT JKQTMathText : public QObject {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -1498,7 +1494,7 @@ inline uint qHash(const JKQTMathText::tbrDataH& data) {
\see JKQTMathText \see JKQTMathText
*/ */
class LIB_EXPORT JKQTMathTextLabel: public QLabel { class JKQTP_LIB_EXPORT JKQTMathTextLabel: public QLabel {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTMathTextLabel(QWidget* parent=nullptr); explicit JKQTMathTextLabel(QWidget* parent=nullptr);

View File

@ -19,9 +19,6 @@
/** \file jkqtpbaseelements.h
* \ingroup jkqtpbaseplotter_elements
*/
#ifndef JKQTPBASEELEMENTS_H #ifndef JKQTPBASEELEMENTS_H
#define JKQTPBASEELEMENTS_H #define JKQTPBASEELEMENTS_H
@ -137,7 +134,7 @@ class JKQTBasePlotter;
nearest but \c ">=" to the given \c minTicks. The Algorithm is described in detail with the function nearest but \c ">=" to the given \c minTicks. The Algorithm is described in detail with the function
calcLinearTickSpacing(). To activate this automatic tick spacing you have to set <code>autoAxisSpacing=true</code>. calcLinearTickSpacing(). To activate this automatic tick spacing you have to set <code>autoAxisSpacing=true</code>.
*/ */
class LIB_EXPORT JKQTPCoordinateAxis: public QObject { class JKQTP_LIB_EXPORT JKQTPCoordinateAxis: public QObject {
Q_OBJECT Q_OBJECT
protected: protected:
public: public:
@ -915,7 +912,7 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
\ingroup jkqtpbaseplotter_elements \ingroup jkqtpbaseplotter_elements
*/ */
class LIB_EXPORT JKQTPVerticalAxis: public JKQTPCoordinateAxis { class JKQTP_LIB_EXPORT JKQTPVerticalAxis: public JKQTPCoordinateAxis {
Q_OBJECT Q_OBJECT
protected: protected:
public: public:
@ -956,7 +953,7 @@ class LIB_EXPORT JKQTPVerticalAxis: public JKQTPCoordinateAxis {
This axis may be draw at a user-supplied position (used e.g. for color bar axes) This axis may be draw at a user-supplied position (used e.g. for color bar axes)
*/ */
class LIB_EXPORT JKQTPVerticalIndependentAxis: public JKQTPVerticalAxis { class JKQTP_LIB_EXPORT JKQTPVerticalIndependentAxis: public JKQTPVerticalAxis {
Q_OBJECT Q_OBJECT
protected: protected:
public: public:
@ -996,7 +993,7 @@ class LIB_EXPORT JKQTPVerticalIndependentAxis: public JKQTPVerticalAxis {
\ingroup jkqtpbaseplotter_elements \ingroup jkqtpbaseplotter_elements
*/ */
class LIB_EXPORT JKQTPHorizontalAxis: public JKQTPCoordinateAxis { class JKQTP_LIB_EXPORT JKQTPHorizontalAxis: public JKQTPCoordinateAxis {
Q_OBJECT Q_OBJECT
protected: protected:
public: public:
@ -1038,7 +1035,7 @@ class LIB_EXPORT JKQTPHorizontalAxis: public JKQTPCoordinateAxis {
This axis may be draw at a user-supplied position (used e.g. for color bar axes) This axis may be draw at a user-supplied position (used e.g. for color bar axes)
*/ */
class LIB_EXPORT JKQTPHorizontalIndependentAxis: public JKQTPHorizontalAxis { class JKQTP_LIB_EXPORT JKQTPHorizontalIndependentAxis: public JKQTPHorizontalAxis {
Q_OBJECT Q_OBJECT
protected: protected:
public: public:

View File

@ -18,10 +18,6 @@
*/ */
/** \file jkqtpbaseplotter.cpp
* \ingroup jkqtpplotterclasses
*/
#include <QFileInfo> #include <QFileInfo>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QtGlobal> #include <QtGlobal>
@ -177,7 +173,8 @@ JKQTBasePlotter::JKQTBasePlotter(bool datastore_internal, QObject* parent, JKQTP
printDoUpdate=true; printDoUpdate=true;
emitPlotSignals=true; emitPlotSignals=true;
masterPlotter=nullptr; masterPlotterX=nullptr;
masterPlotterY=nullptr;
masterSynchronizeWidth=false; masterSynchronizeWidth=false;
masterSynchronizeHeight=false; masterSynchronizeHeight=false;
fontSizePrintMultiplier=1; fontSizePrintMultiplier=1;
@ -708,6 +705,7 @@ void JKQTBasePlotter::setXY(double xminn, double xmaxx, double yminn, double yma
double w=fabs(xmaxx-xminn)/axisAspectRatio; double w=fabs(xmaxx-xminn)/axisAspectRatio;
yAxis->setRange(mid-w/2.0, mid+w/2.0); yAxis->setRange(mid-w/2.0, mid+w/2.0);
} }
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);
} }
void JKQTBasePlotter::setX(double xminn, double xmaxx){ void JKQTBasePlotter::setX(double xminn, double xmaxx){
@ -717,6 +715,7 @@ void JKQTBasePlotter::setX(double xminn, double xmaxx){
double w=fabs(xmaxx-xminn)/axisAspectRatio; double w=fabs(xmaxx-xminn)/axisAspectRatio;
yAxis->setRange(mid-w/2.0, mid+w/2.0); yAxis->setRange(mid-w/2.0, mid+w/2.0);
} }
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);
} }
void JKQTBasePlotter::setY(double yminn, double ymaxx){ void JKQTBasePlotter::setY(double yminn, double ymaxx){
@ -726,19 +725,23 @@ void JKQTBasePlotter::setY(double yminn, double ymaxx){
double w=fabs(ymaxx-yminn)*axisAspectRatio; double w=fabs(ymaxx-yminn)*axisAspectRatio;
xAxis->setRange(mid-w/2.0, mid+w/2.0); xAxis->setRange(mid-w/2.0, mid+w/2.0);
} }
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);
} }
void JKQTBasePlotter::setAbsoluteX(double xminn, double xmaxx) { void JKQTBasePlotter::setAbsoluteX(double xminn, double xmaxx) {
xAxis->setAbsoluteRange(xminn, xmaxx); xAxis->setAbsoluteRange(xminn, xmaxx);
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);
} }
void JKQTBasePlotter::setAbsoluteY(double yminn, double ymaxx) { void JKQTBasePlotter::setAbsoluteY(double yminn, double ymaxx) {
yAxis->setAbsoluteRange(yminn, ymaxx); yAxis->setAbsoluteRange(yminn, ymaxx);
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);
} }
void JKQTBasePlotter::setAbsoluteXY(double xminn, double xmaxx, double yminn, double ymaxx) { void JKQTBasePlotter::setAbsoluteXY(double xminn, double xmaxx, double yminn, double ymaxx) {
xAxis->setAbsoluteRange(xminn, xmaxx); xAxis->setAbsoluteRange(xminn, xmaxx);
yAxis->setAbsoluteRange(yminn, ymaxx); yAxis->setAbsoluteRange(yminn, ymaxx);
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);
} }
void JKQTBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){ void JKQTBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
@ -746,6 +749,7 @@ void JKQTBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
JKQTPAutoOutputTimer jkaat(QString("JKQTBasePlotter[%1]::calcPlotScaling()").arg(objectName())); JKQTPAutoOutputTimer jkaat(QString("JKQTBasePlotter[%1]::calcPlotScaling()").arg(objectName()));
#endif #endif
//qDebug()<<"this="<<this<<" --> calcPlotScaling()";
if (emitSignals) emit beforePlotScalingRecalculate(); if (emitSignals) emit beforePlotScalingRecalculate();
//qDebug()<<"start JKQTBasePlotter::calcPlotScaling"; //qDebug()<<"start JKQTBasePlotter::calcPlotScaling";
@ -840,7 +844,7 @@ void JKQTBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
// read additional space required by graphs // read additional space required by graphs
for (int i=0; i<graphs.size(); i++) { for (int i=0; i<graphs.size(); i++) {
if (graphs[i]->getVisible()) { if (graphs[i]->isVisible()) {
int leftSpace, rightSpace, topSpace, bottomSpace; int leftSpace, rightSpace, topSpace, bottomSpace;
graphs[i]->getOutsideSize(painter, leftSpace, rightSpace, topSpace, bottomSpace); graphs[i]->getOutsideSize(painter, leftSpace, rightSpace, topSpace, bottomSpace);
iplotBorderBottom+=bottomSpace; iplotBorderBottom+=bottomSpace;
@ -854,14 +858,16 @@ void JKQTBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
// synchronize to a master-plotter // synchronize to a master-plotter
if (masterPlotter) { if (masterPlotterX) {
if (masterSynchronizeWidth) { if (masterSynchronizeWidth) {
iplotBorderLeft=masterPlotter->iplotBorderLeft; iplotBorderLeft=masterPlotterX->iplotBorderLeft;
iplotBorderRight=masterPlotter->iplotBorderRight; iplotBorderRight=masterPlotterX->iplotBorderRight;
} }
}
if (masterPlotterY) {
if (masterSynchronizeHeight) { if (masterSynchronizeHeight) {
iplotBorderTop=masterPlotter->iplotBorderTop; iplotBorderTop=masterPlotterY->iplotBorderTop;
iplotBorderBottom=masterPlotter->iplotBorderBottom; iplotBorderBottom=masterPlotterY->iplotBorderBottom;
} }
} }
@ -943,7 +949,8 @@ void JKQTBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
} }
if (emitPlotSignals) emit plotScalingRecalculated(); //if (emitPlotSignals) emit plotScalingRecalculated();
emit plotScalingRecalculated();
} }
@ -1144,7 +1151,7 @@ void JKQTBasePlotter::plotOverlays(JKQTPEnhancedPainter &painter) {
for (int j=0; j<overlays.size(); j++) { for (int j=0; j<overlays.size(); j++) {
JKQTPOverlayElement* g=overlays[j]; JKQTPOverlayElement* g=overlays[j];
if (g->getVisible()) g->draw(painter); if (g->isVisible()) g->draw(painter);
} }
if (useClipping) { if (useClipping) {
@ -3194,76 +3201,93 @@ void JKQTBasePlotter::setBorder(int left, int right, int top, int bottom){
if (emitPlotSignals) emit plotUpdated(); if (emitPlotSignals) emit plotUpdated();
} }
void JKQTBasePlotter::synchronizeToMaster(JKQTBasePlotter* master, bool synchronizeWidth, bool synchronizeHeight, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster) { void JKQTBasePlotter::synchronizeToMaster(JKQTBasePlotter* master, SynchronizationDirection synchronizeDirection, bool synchronizeAxisLength, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster) {
if (!master) { // remove old connections
resetMasterSynchronization(); if (masterPlotterX && (synchronizeDirection==sdXAxis || synchronizeDirection==sdXYAxes)) {
} disconnect(masterPlotterX, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
masterPlotter=master; this, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*)));
if (masterSynchronizeHeight!=synchronizeHeight && masterSynchronizeHeight) {
disconnect(masterPlotter, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
this, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
disconnect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), disconnect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
masterPlotter, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*))); masterPlotterX, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*)));
} }
if (masterSynchronizeWidth!=synchronizeWidth && masterSynchronizeWidth) { if (masterPlotterY && (synchronizeDirection==sdYAxis || synchronizeDirection==sdXYAxes)) {
disconnect(masterPlotter, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), disconnect(masterPlotterY, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
this, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*))); this, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
disconnect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), disconnect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
masterPlotter, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*))); masterPlotterY, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
} }
masterSynchronizeHeight=synchronizeHeight;
masterSynchronizeWidth=synchronizeWidth;
if (masterSynchronizeWidth) { // store new connection settings
if (synchronizeZoomingMasterToSlave) { if (synchronizeDirection==sdXAxis || synchronizeDirection==sdXYAxes) {
connect(master, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), masterPlotterX=master;
this, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*))); masterSynchronizeWidth=synchronizeAxisLength;
}
if (synchronizeDirection==sdYAxis || synchronizeDirection==sdXYAxes) {
masterPlotterY=master;
masterSynchronizeHeight=synchronizeAxisLength;
}
// connect widgets (if required)
if (master) {
if (synchronizeDirection==sdXAxis || synchronizeDirection==sdXYAxes) {
if (synchronizeZoomingMasterToSlave) {
connect(masterPlotterX, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
this, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*)));
}
if (synchronizeZoomingSlaveToMaster) {
connect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
masterPlotterX, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*)));
}
} }
if (synchronizeZoomingSlaveToMaster) { if (synchronizeDirection==sdYAxis || synchronizeDirection==sdXYAxes) {
connect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), if (synchronizeZoomingMasterToSlave) {
master, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*))); connect(masterPlotterY, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
this, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
}
if (synchronizeZoomingSlaveToMaster) {
connect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
masterPlotterY, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
}
} }
} }
if (masterSynchronizeWidth) {
if (synchronizeHeight) {
connect(master, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
this, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
}
if (synchronizeZoomingSlaveToMaster) {
connect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
master, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
}
}
} }
void JKQTBasePlotter::resetMasterSynchronization() { void JKQTBasePlotter::synchronizeXToMaster(JKQTBasePlotter *master, bool synchronizeAxisLength, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster)
masterPlotter=nullptr; {
masterSynchronizeHeight=false; synchronizeToMaster(master, sdXAxis, synchronizeAxisLength, synchronizeZoomingMasterToSlave, synchronizeZoomingSlaveToMaster);
masterSynchronizeWidth=false; }
disconnect(masterPlotter, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), void JKQTBasePlotter::synchronizeYToMaster(JKQTBasePlotter *master, bool synchronizeAxisLength, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster)
this, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*))); {
disconnect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), synchronizeToMaster(master, sdYAxis, synchronizeAxisLength, synchronizeZoomingMasterToSlave, synchronizeZoomingSlaveToMaster);
masterPlotter, SLOT(synchronizeXAxis(double,double,double,double,JKQTBasePlotter*))); }
disconnect(masterPlotter, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)),
this, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*))); void JKQTBasePlotter::resetMasterSynchronization(JKQTBasePlotter::SynchronizationDirection synchronizeDirection) {
disconnect(this, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTBasePlotter*)), synchronizeToMaster(nullptr, synchronizeDirection, false, false, false);
masterPlotter, SLOT(synchronizeYAxis(double,double,double,double,JKQTBasePlotter*)));
} }
void JKQTBasePlotter::synchronizeXAxis(double newxmin, double newxmax, double /*newymin*/, double /*newymax*/, JKQTBasePlotter * /*sender*/) { void JKQTBasePlotter::synchronizeXAxis(double newxmin, double newxmax, double /*newymin*/, double /*newymax*/, JKQTBasePlotter * /*sender*/) {
bool oldemitSignals=emitSignals;
emitSignals=false;
setX(newxmin, newxmax); setX(newxmin, newxmax);
emitSignals=oldemitSignals;
} }
void JKQTBasePlotter::synchronizeYAxis(double /*newxmin*/, double /*newxmax*/, double newymin, double newymax, JKQTBasePlotter * /*sender*/) { void JKQTBasePlotter::synchronizeYAxis(double /*newxmin*/, double /*newxmax*/, double newymin, double newymax, JKQTBasePlotter * /*sender*/) {
bool oldemitSignals=emitSignals;
emitSignals=false;
setY(newymin, newymax); setY(newymin, newymax);
emitSignals=oldemitSignals;
} }
void JKQTBasePlotter::synchronizeXYAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTBasePlotter * /*sender*/) { void JKQTBasePlotter::synchronizeXYAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTBasePlotter * /*sender*/) {
bool oldemitSignals=emitSignals;
emitSignals=false;
setXY(newxmin, newxmax, newymin, newymax); setXY(newxmin, newxmax, newymin, newymax);
emitSignals=oldemitSignals;
} }
size_t JKQTBasePlotter::addGraph(size_t xColumn, size_t yColumn, const QString& title, JKQTPGraphPlotstyle graphStyle) { size_t JKQTBasePlotter::addGraph(size_t xColumn, size_t yColumn, const QString& title, JKQTPGraphPlotstyle graphStyle) {
@ -3579,7 +3603,7 @@ void JKQTBasePlotter::plotGraphs(JKQTPEnhancedPainter& painter){
//int leftSpace, rightSpace, topSpace, bottomSpace; //int leftSpace, rightSpace, topSpace, bottomSpace;
JKQTPPlotElement* g=graphs[j]; JKQTPPlotElement* g=graphs[j];
//qDebug()<<" drawing JKQTPPlotElement"<<j<<g->getTitle()<<g->metaObject()->className(); //qDebug()<<" drawing JKQTPPlotElement"<<j<<g->getTitle()<<g->metaObject()->className();
if (g->getVisible()) g->draw(painter); if (g->isVisible()) g->draw(painter);
} }
if (useClipping) { if (useClipping) {
@ -3589,7 +3613,7 @@ void JKQTBasePlotter::plotGraphs(JKQTPEnhancedPainter& painter){
for (int j=0; j<graphs.size(); j++) { for (int j=0; j<graphs.size(); j++) {
int leftSpace, rightSpace, topSpace, bottomSpace; int leftSpace, rightSpace, topSpace, bottomSpace;
JKQTPPlotElement* g=graphs[j]; JKQTPPlotElement* g=graphs[j];
if (g->getVisible()) { if (g->isVisible()) {
g->getOutsideSize(painter, leftSpace, rightSpace, topSpace, bottomSpace); g->getOutsideSize(painter, leftSpace, rightSpace, topSpace, bottomSpace);
ibTop+=topSpace; ibTop+=topSpace;
ibLeft+=leftSpace; ibLeft+=leftSpace;
@ -3634,7 +3658,7 @@ void JKQTBasePlotter::plotKeyContents(JKQTPEnhancedPainter& painter, double x, d
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
jkaaot.write(QString("one-col: graph %1: %2").arg(i).arg(g->getTitle())); jkaaot.write(QString("one-col: graph %1: %2").arg(i).arg(g->getTitle()));
#endif #endif
if (!g->getTitle().isEmpty() && g->getVisible()) { if (!g->getTitle().isEmpty() && g->isVisible()) {
QSizeF fs=getTextSizeSize(keyFont,keyFontSize*fontSizeMultiplier,g->getTitle(),painter);// mt.getSize(painter); QSizeF fs=getTextSizeSize(keyFont,keyFontSize*fontSizeMultiplier,g->getTitle(),painter);// mt.getSize(painter);
double itheight=qMax(key_item_height*kfm.width('X'), fs.height()); double itheight=qMax(key_item_height*kfm.width('X'), fs.height());
QRectF rect(x, y+1.5*lineWidthMultiplier, key_line_length*kfm.width('X'), itheight-3.0*lineWidthMultiplier); QRectF rect(x, y+1.5*lineWidthMultiplier, key_line_length*kfm.width('X'), itheight-3.0*lineWidthMultiplier);
@ -3657,7 +3681,7 @@ void JKQTBasePlotter::plotKeyContents(JKQTPEnhancedPainter& painter, double x, d
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
jkaaot.write(QString("one-row: graph %1: %2").arg(i).arg(g->getTitle())); jkaaot.write(QString("one-row: graph %1: %2").arg(i).arg(g->getTitle()));
#endif #endif
if (!g->getTitle().isEmpty() && g->getVisible()) { if (!g->getTitle().isEmpty() && g->isVisible()) {
QSizeF fs=getTextSizeSize(keyFont,keyFontSize*fontSizeMultiplier,g->getTitle(),painter);// mt.getSize(painter); QSizeF fs=getTextSizeSize(keyFont,keyFontSize*fontSizeMultiplier,g->getTitle(),painter);// mt.getSize(painter);
double itheight=qMax(key_item_height*kfm.width('X'), fs.height()); double itheight=qMax(key_item_height*kfm.width('X'), fs.height());
QRectF rect(x, y+1.5*lineWidthMultiplier, key_line_length*kfm.width('X'), itheight-3.0*lineWidthMultiplier); QRectF rect(x, y+1.5*lineWidthMultiplier, key_line_length*kfm.width('X'), itheight-3.0*lineWidthMultiplier);
@ -3691,7 +3715,7 @@ void JKQTBasePlotter::plotKeyContents(JKQTPEnhancedPainter& painter, double x, d
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
jkaaot.write(QString("multi-col: graph %1: %2").arg(i).arg(g->getTitle())); jkaaot.write(QString("multi-col: graph %1: %2").arg(i).arg(g->getTitle()));
#endif #endif
if (!g->getTitle().isEmpty() && g->getVisible()) { if (!g->getTitle().isEmpty() && g->isVisible()) {
//QSizeF fs=getTextSizeSize(keyFont,keyFontSize*fontSizeMultiplier,g->getTitle(),painter);// mt.getSize(painter); //QSizeF fs=getTextSizeSize(keyFont,keyFontSize*fontSizeMultiplier,g->getTitle(),painter);// mt.getSize(painter);
double itheight=qMax(key_item_height*kfm.width('X'), key_text_height); double itheight=qMax(key_item_height*kfm.width('X'), key_text_height);
QRectF rect(xx, yy+1.5*lineWidthMultiplier, key_line_length*kfm.width('X'), itheight-3.0*lineWidthMultiplier); QRectF rect(xx, yy+1.5*lineWidthMultiplier, key_line_length*kfm.width('X'), itheight-3.0*lineWidthMultiplier);
@ -3755,7 +3779,7 @@ void JKQTBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
for (int i=0; i<graphs.size(); i++) { for (int i=0; i<graphs.size(); i++) {
if (graphs[i]->getTitle().isEmpty() || !graphs[i]->getVisible()) { if (graphs[i]->getTitle().isEmpty() || !graphs[i]->isVisible()) {
keyHeight--; keyHeight--;
} else { } else {
//mt.parse(graphs[i]->getTitle()); //mt.parse(graphs[i]->getTitle());
@ -3786,7 +3810,7 @@ void JKQTBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
for (int i=0; i<graphs.size(); i++) { for (int i=0; i<graphs.size(); i++) {
if (graphs[i]->getTitle().isEmpty() || !graphs[i]->getVisible()) { if (graphs[i]->getTitle().isEmpty() || !graphs[i]->isVisible()) {
keyWidth--; keyWidth--;
} else { } else {
//mt.parse(graphs[i]->getTitle()); //mt.parse(graphs[i]->getTitle());
@ -3822,7 +3846,7 @@ void JKQTBasePlotter::getKeyExtent(JKQTPEnhancedPainter& painter, double* width,
for (int i=0; i<graphs.size(); i++) { for (int i=0; i<graphs.size(); i++) {
if (graphs[i]->getTitle().isEmpty() || !graphs[i]->getVisible()) { if (graphs[i]->getTitle().isEmpty() || !graphs[i]->isVisible()) {
keyHeight--; keyHeight--;
} else { } else {
//mt.parse(graphs[i]->getTitle()); //mt.parse(graphs[i]->getTitle());
@ -3904,7 +3928,7 @@ void JKQTBasePlotter::getGraphsXMinMax(double& minx, double& maxx, double& small
maxx=0; maxx=0;
smallestGreaterZero=0; smallestGreaterZero=0;
for (int i=0; i<graphs.size(); i++) { for (int i=0; i<graphs.size(); i++) {
if (graphs[i]->getVisible()) { if (graphs[i]->isVisible()) {
double gminx=0; double gminx=0;
double gmaxx=0; double gmaxx=0;
double gsmallestGreaterZero=0; double gsmallestGreaterZero=0;
@ -3931,7 +3955,7 @@ void JKQTBasePlotter::getGraphsYMinMax(double& miny, double& maxy, double& small
maxy=0; maxy=0;
smallestGreaterZero=0; smallestGreaterZero=0;
for (int i=0; i<graphs.size(); i++) { for (int i=0; i<graphs.size(); i++) {
if (graphs[i]->getVisible()) { if (graphs[i]->isVisible()) {
double gminy=0; double gminy=0;
double gmaxy=0; double gmaxy=0;
double gsmallestGreaterZero=0; double gsmallestGreaterZero=0;
@ -4288,17 +4312,6 @@ bool JKQTBasePlotter::containsGraph(JKQTPPlotElement* gr) const {
return false; return false;
}; };
void JKQTBasePlotter::setGraphsDataRange(int datarange_start, int datarange_end) {
for (int i=0; i<graphs.size(); i++) {
JKQTPGraph* g=dynamic_cast<JKQTPGraph*>(graphs[i]);
if (g) {
g->setDatarangeStart(datarange_start);
g->setDatarange_end(datarange_end);
}
}
}
void JKQTBasePlotter::setUserSettigsFilename(const QString &filename, const QString &prefix) void JKQTBasePlotter::setUserSettigsFilename(const QString &filename, const QString &prefix)
{ {
userSettigsFilename=filename; userSettigsFilename=filename;

View File

@ -17,12 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** \file jkqtpbaseplotter.h
* \ingroup jkqtpplotterclasses
*/
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#include "jkqtplotter/jkqtpdatastorage.h" #include "jkqtplotter/jkqtpdatastorage.h"
#include "jkqtmathtext/jkqtmathtext.h" #include "jkqtmathtext/jkqtmathtext.h"
@ -63,11 +57,11 @@ class JKQTPPlotElement; // forward
/** \brief initialized Qt-ressources necessary for JKQTBasePlotter /** \brief initialized Qt-ressources necessary for JKQTBasePlotter
* \ingroup jkqtpplotterclasses */ * \ingroup jkqtpplotterclasses */
LIB_EXPORT void initJKQTBasePlotterResources(); JKQTP_LIB_EXPORT void initJKQTBasePlotterResources();
/** \brief virtual base-class for exporter classes that can be used to save data inot a file /** \brief virtual base-class for exporter classes that can be used to save data inot a file
* \ingroup jkqtpplotterclasses */ * \ingroup jkqtpplotterclasses */
class LIB_EXPORT JKQTPSaveDataAdapter { class JKQTP_LIB_EXPORT JKQTPSaveDataAdapter {
public: public:
virtual ~JKQTPSaveDataAdapter() ; virtual ~JKQTPSaveDataAdapter() ;
virtual QString getFilter() const=0; virtual QString getFilter() const=0;
@ -77,7 +71,7 @@ class LIB_EXPORT JKQTPSaveDataAdapter {
/** \brief Service from this class to implement a special QPaintDevice as a plugin, that can be registered to JKQTBasePlotter/JKQTPlotter /** \brief Service from this class to implement a special QPaintDevice as a plugin, that can be registered to JKQTBasePlotter/JKQTPlotter
* and then be used to export graphics, use registerPaintDeviceAdapter() to register such a plass * and then be used to export graphics, use registerPaintDeviceAdapter() to register such a plass
* \ingroup jkqtpplotterclasses*/ * \ingroup jkqtpplotterclasses*/
class LIB_EXPORT JKQTPPaintDeviceAdapter { class JKQTP_LIB_EXPORT JKQTPPaintDeviceAdapter {
public: public:
virtual ~JKQTPPaintDeviceAdapter() {} virtual ~JKQTPPaintDeviceAdapter() {}
virtual QString getFilter() const=0; virtual QString getFilter() const=0;
@ -111,7 +105,11 @@ class LIB_EXPORT JKQTPPaintDeviceAdapter {
* This class is NOT a widget, if you need a plotting widget, use JKQTPlotter. This class may be used to * This class is NOT a widget, if you need a plotting widget, use JKQTPlotter. This class may be used to
* plot using a JKQTPEnhancedPainter. * plot using a JKQTPEnhancedPainter.
* *
* \see JKQTPlotter * \see JKQTPlotter a QWidget class that displays a JKQTBasePlotter plot on a Qt Window.
*
*
* \tableofcontents
*
* *
* \section jkqtplotter_base_datastore Data Storage * \section jkqtplotter_base_datastore Data Storage
* As already mentioned this class does not provide means to draw graphs, but it contains a basic mechanism to associate * As already mentioned this class does not provide means to draw graphs, but it contains a basic mechanism to associate
@ -214,16 +212,91 @@ class LIB_EXPORT JKQTPPaintDeviceAdapter {
* . * .
* *
* *
* \subsection JKQTBASEPLOTTER_GRIDPRINTING Grid-Printing / Layouting Several Graphs * \section JKQTBASEPLOTTER_SYNCMULTIPLOT Synchronizing Several Plots
* As one often want's to combine different graphs, there is a possibility to combine this graph with more other graphs. *
* To do so one can think of the graphs to be part of a grid where each graph is contained in one cell. By default this * Often a single plot is not sufficient, but several plots need to be aligned with respect to each other:
* mechanism is deactivated. You can activate it by calling setGridPrinting(true). Then you can set the position of the *
* current graph by calling setGridPrintingCurrentX() and setGridPrintingCurrentY(). Add additional graphs by calling * \image html test_multiplot.png
* addGridPrintingPlotter(). The position of the current graph is 0,0 by default. Afterwards the save and print routines *
* will export/print all graphs, not just the current one. There will be no additional border between the graphs, as the * This can be achieved by putting several JKQTPlotter instances into a
* class expects the internal graph borders to be sufficient. * <a href="http://doc.qt.io/qt-5/layout.html">Qt Layout</a>. Then you can fill each plot differently and
* set the x-/y-range of each plot by hand. This method works for simple cases, but has several drawbacks:
* - Due to the independent and automatic layouting of each plot, the axes do not need to be aligned properly<br>
* \image html jkqtbaseplotter_synchronization_unequalaxes.png
* - When you print the plot, the printing does not know about the layout and the other plots in it. Therefor
* it will only print the plot itself.<br>
* \image html jkqtbaseplotter_synchronization_nogridprint.png "Printing with grid-printing-mode deactivated"<br>
* \image html jkqtbaseplotter_synchronization_withgridprint.png "Printing with grid-printing-mode activated"
* - when you zoom/pan in one of the plots (e.g. using the mouse), the other plots will not adapt their
* axes to match the new area, but especially in cases as in the image above it would be beneficial,
* that tha x-axis of the plot at the bottom follows the x-axis of the plot above etc.<br>
* \image html jkqtbaseplotter_synchronization_nonsyncedxrange.png
* .
*
*
* To overcome these limitations, JKQTPlotter (and JKQTBasePlotter) offer an API with which you can declare relations between
* different plots (one of them is made the master) and you can synchronize the axes of two plots, when
* zooming (also when calling e.g. zoomToFit() or setXY() ). This API is:
* - \ref JKQTBASEPLOTTER_SYNCMULTIPLOT_SYNC
* - \ref JKQTBASEPLOTTER_SYNCMULTIPLOT_GRIDPRINT
* .
*
* \subsection JKQTBASEPLOTTER_SYNCMULTIPLOT_SYNC Synchronizing Axis Range & Plot Width
*
* You can synchronize the plot width and axis range between two JKQTPlotter instaces using:
* - synchronizeToMaster() / JKQTBasePlotter::synchronizeToMaster() synchronizes the parent JKQTPlotter with another JKQTPlotter. With two boolean-parameters
* you can specify the axes to be synchronized. E.g. in the case above, you would call:
* \code
* // synchronize width/x-axis of plotResid to width/x-axis of plotMain
* plotResid->synchronizeToMaster(plotMain, JKQTBasePlotter::sdXAxis, true, true, true);
*
* // synchronize y-axis of width/plotResidHist to y-axis of width/plotResid
* plotResidHist->synchronizeToMaster(plotResid, JKQTBasePlotter::sdYAxis, true, true, true);
* \endcode
* This will synchronize the x-axes of the top (\c plotMain ) and bottom-left plot (\c plotResid ),
* as well as the y-axes of the bottom-left (\c plotResid ) and bottom-right plot (\c plotResidHist ).
* After this call they will have the same size in screen pixels and always span the same range
* in plot coordinates.
* - synchronizeXToMaster() / JKQTBasePlotter::synchronizeXToMaster() like synchronizeToMaster() / JKQTBasePlotter::synchronizeToMaster(),
* but synchronizes only the x-axes
* - synchronizeYToMaster() / JKQTBasePlotter::synchronizeYToMaster() like synchronizeToMaster() / JKQTBasePlotter::synchronizeToMaster(),
* but synchronizes only the y-axes
* - resetMasterSynchronization() / JKQTBasePlotter::resetMasterSynchronization() deletes all synchronizations
* from the JKQTPlotter
* .
*
* \see See \ref JKQTPlotterMultiPlotLayout for an extensive example of the functionality.
*
*
* \subsection JKQTBASEPLOTTER_SYNCMULTIPLOT_GRIDPRINT Grid Printing/Desclaring Relations between Plots
*
* Usually each JKQTPlotter/JKQTBasePlotter prints or exports only itself. But in many cases you might want to
* add several plots that form a grid layout and also want to export them as one image/print them on one page.
* To do this, JKQTPlotter/JKQTBasePlotter offers the <b>"grid printing" mode</b>. In this mode, you can declare
* relations between different JKQTPlotters/JKQTBasePlotters by putting them in a rectangular grid (like in a
* <a reh="http://doc.qt.io/qt-5/qgridlayout.html">QGridLayout</a>). then any export/print action will draw all (explicitly)
* decalred graphs.
*
* \image html jkqtplotter_gridprint.png
*
* The grid printing API is composed of these functions:
* - setGridPrinting() enables grid printing for this JKQTPlotter. If set to \c true , and you print afterwards,
* the printout (or export) will not only contain the plot itself, but also additional plots that were
* declared using addGridPrintingPlotter() (see below).
* - addGridPrintingPlotter() add a new plotter \a plotterOther for grid printing mode, at location \a x / \a y
* E.g. in the example shown above, you could call:
* \code
* plotMain->setGridPrinting(true);
* plotMain->addGridPrintingPlotter(0,1,plotResid);
* plotMain->addGridPrintingPlotter(1,1,plotResidHist);
* \endcode
* - setGridPrintingCurrentX() / setGridPrintingCurrentY() / setGridPrintingCurrentPos()
* sets the location of the calling plot inside the grid. <i>By default each plot assumes to be at (0,0).</i>
* - clearGridPrintingPlotters() clear all additional plotters for grid printing mode
* .
*
* \see See \ref JKQTPlotterMultiPlotLayout for an extensive example of the functionality.
* *
* \see \ref JKQTPLOTTER_SYNCMULTIPLOT
* *
* *
* \section jkqtplotter_base_defaultvalues Default Properties * \section jkqtplotter_base_defaultvalues Default Properties
@ -241,7 +314,7 @@ class LIB_EXPORT JKQTPPaintDeviceAdapter {
* These methods MAY (strictly optional and turned off by default) be called by saveSettings() and loadSettings(), if the property userSettigsFilename ( \copybrief userSettigsFilename )is * These methods MAY (strictly optional and turned off by default) be called by saveSettings() and loadSettings(), if the property userSettigsFilename ( \copybrief userSettigsFilename )is
* set (not-empty). In this case the suer settings are stored/loaded also everytime they are changed by the user or programmatically. * set (not-empty). In this case the suer settings are stored/loaded also everytime they are changed by the user or programmatically.
*/ */
class LIB_EXPORT JKQTBasePlotter: public QObject { class JKQTP_LIB_EXPORT JKQTBasePlotter: public QObject {
Q_OBJECT Q_OBJECT
public: public:
typedef QMap<QString, QList<QPointer<QAction> > > AdditionalActionsMap; typedef QMap<QString, QList<QPointer<QAction> > > AdditionalActionsMap;
@ -677,11 +750,13 @@ class LIB_EXPORT JKQTBasePlotter: public QObject {
QString currentDataFileFormat; QString currentDataFileFormat;
QString currentPrinter; QString currentPrinter;
/** \brief the master plotter, this plotter is connected to. */ /** \brief the master plotter for x-dimension, this plotter is connected to. */
JKQTBasePlotter* masterPlotter; JKQTBasePlotter *masterPlotterX;
/** \brief synchronize plot width with masterPlotter */ /** \brief the master plotter for y-dimension, this plotter is connected to. */
JKQTBasePlotter *masterPlotterY;
/** \brief synchronize plot width with masterPlotterX */
bool masterSynchronizeWidth; bool masterSynchronizeWidth;
/** \brief synchronize plot height with masterPlotter */ /** \brief synchronize plot height with masterPlotterY */
bool masterSynchronizeHeight; bool masterSynchronizeHeight;
@ -891,9 +966,6 @@ class LIB_EXPORT JKQTBasePlotter: public QObject {
zoomIn(1.0/factor); zoomIn(1.0/factor);
} }
/** \brief set the datarange of all current graphs to the given values */
void setGraphsDataRange(int datarange_start, int datarange_end);
/** \brief en-/disables the maintaining of the data aspect ratio */ /** \brief en-/disables the maintaining of the data aspect ratio */
void setMaintainAspectRatio(bool value) { void setMaintainAspectRatio(bool value) {
maintainAspectRatio=value; maintainAspectRatio=value;
@ -2158,27 +2230,58 @@ class LIB_EXPORT JKQTBasePlotter: public QObject {
void getGraphsYMinMax(double& miny, double& maxy, double& smallestGreaterZero); void getGraphsYMinMax(double& miny, double& maxy, double& smallestGreaterZero);
enum SynchronizationDirection {
sdXAxis,
sdYAxis,
sdXYAxes
};
/*! \brief synchronize the plot borders with a given plotter /*! \brief synchronize the plot borders (and zooming) with a given plotter (master --> slave/this)
This function allows two plotters to draw a graph with exactly the same height or width This function allows two plotters to draw a graph with exactly the same height or width
as in another graph. For example if you want to have two plotters which are positioned one as in another graph. For example if you want to have two plotters which are positioned one
above the other (and have the same widget widths, which could be guaranteed by a QLayout) above the other (and have the same widget widths, which could be guaranteed by a QLayout)
you may want to make sure that their plotWidth s are always the same. In this case call you may want to make sure that their plotWidth s are always the same. In this case call
\code plotter2->synchronizeToMaster(plotter1, true, false) \endcode of the lower plotter \c plotter2 . \code plotter2->synchronizeToMaster(plotter1, sdXAxis, true) \endcode of the lower plotter \c plotter2 .
Now whenever the size of plotter1 changes, also plotter2 is redrawn with the changed Now whenever the size of plotter1 changes, also plotter2 is redrawn with the changed
borders. borders.
\param master the plotter widget to synchronize to \param master the plotter widget to synchronize to
\param synchronizeWidth do you want the plot width to be synchronized? \param synchronizeDirection direction in which to synchronize
\param synchronizeHeight do you want the plot height to be synchronized? \param synchronizeAxisLength do you want the axis length to be synchronized?
\param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave \param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave
\param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master \param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master
\see synchronizeXToMaster(), synchronizeYToMaster(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void synchronizeToMaster(JKQTBasePlotter* master, bool synchronizeWidth, bool synchronizeHeight, bool synchronizeZoomingMasterToSlave=false, bool synchronizeZoomingSlaveToMaster=false); void synchronizeToMaster(JKQTBasePlotter* master, SynchronizationDirection synchronizeDirection, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true);
/*! \brief synchronize the plot x-axis width (and x-zooming) with a given master plotter (master --> slave/this)
\param master the plotter widget to synchronize to
\param synchronizeAxisLength do you want the axis length to be synchronized?
\param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave
\param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master
\note This is a short-cut to synchronizeToMaster() with \c synchronizeDirection=csXAxis
\see synchronizeToMaster(), synchronizeYToMaster(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/
void synchronizeXToMaster(JKQTBasePlotter* master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true);
/*! \brief synchronize the plot y-axis height (and y-zooming) with a given master plotter (master --> slave/this)
\param master the plotter widget to synchronize to
\param synchronizeAxisLength do you want the axis length to be synchronized?
\param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave
\param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master
\note This is a short-cut to synchronizeToMaster() with \c synchronizeDirection=csXAxis
\see synchronizeToMaster(), synchronizeXToMaster(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/
void synchronizeYToMaster(JKQTBasePlotter* master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true);
/** \brief switches any synchronization off, that has been created by synchronizeToMaster() */ /** \brief switches any synchronization off, that has been created by synchronizeToMaster() */
void resetMasterSynchronization(); void resetMasterSynchronization(SynchronizationDirection synchronizeDirection=sdXYAxes);
@ -2261,14 +2364,14 @@ class LIB_EXPORT JKQTBasePlotter: public QObject {
/** \brief internal tool class for text sizes /** \brief internal tool class for text sizes
* \internal */ * \internal */
struct LIB_EXPORT textSizeData { struct JKQTP_LIB_EXPORT textSizeData {
explicit textSizeData(); explicit textSizeData();
double ascent, descent, width, strikeoutPos; double ascent, descent, width, strikeoutPos;
}; };
/** \brief internal tool class for text-sizess in a plot key /** \brief internal tool class for text-sizess in a plot key
* \internal */ * \internal */
struct LIB_EXPORT textSizeKey { struct JKQTP_LIB_EXPORT textSizeKey {
explicit textSizeKey(const QFont& f, const QString& text, QPaintDevice *pd); explicit textSizeKey(const QFont& f, const QString& text, QPaintDevice *pd);
explicit textSizeKey(const QString& fontName, double fontSize, const QString& text, QPaintDevice *pd); explicit textSizeKey(const QString& fontName, double fontSize, const QString& text, QPaintDevice *pd);
QString text; QString text;

View File

@ -19,11 +19,6 @@
/** \file jkqtpdatastorage.cpp
* \ingroup jkqtpdatastorage
*/
#include "jkqtplotter/jkqtpdatastorage.h" #include "jkqtplotter/jkqtpdatastorage.h"
#include <QDebug> #include <QDebug>
#include <QtGlobal> #include <QtGlobal>

View File

@ -19,10 +19,6 @@
/** \file jkqtpdatastorage.h
* \ingroup jkqtpdatastorage
*/
#include "jkqtplottertools/jkqtp_imexport.h" #include "jkqtplottertools/jkqtp_imexport.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#include <vector> #include <vector>
@ -128,7 +124,7 @@ enum JKQTPDatastoreItemFormat {
* notion of data columns. This class provides a set of interface methods for this list: * notion of data columns. This class provides a set of interface methods for this list:
* *
*/ */
class LIB_EXPORT JKQTPDatastore{ class JKQTP_LIB_EXPORT JKQTPDatastore{
private: private:
/** \brief a std::vector that contains all items managed by this datastore */ /** \brief a std::vector that contains all items managed by this datastore */
QMap<size_t, JKQTPDatastoreItem*> items; QMap<size_t, JKQTPDatastoreItem*> items;
@ -596,7 +592,7 @@ class LIB_EXPORT JKQTPDatastore{
* *
* \see JKQTPDatastore * \see JKQTPDatastore
*/ */
class LIB_EXPORT JKQTPColumn { class JKQTP_LIB_EXPORT JKQTPColumn {
private: private:
/** \brief index of the item in the datastore that contains the data for this column */ /** \brief index of the item in the datastore that contains the data for this column */
size_t datastoreItem; size_t datastoreItem;
@ -743,7 +739,7 @@ class LIB_EXPORT JKQTPColumn {
* *
* \see JKQTPDatastore * \see JKQTPDatastore
*/ */
class LIB_EXPORT JKQTPDatastoreItem { class JKQTP_LIB_EXPORT JKQTPDatastoreItem {
private: private:
/** \brief a pointer to the actual data */ /** \brief a pointer to the actual data */
double* data; double* data;
@ -842,7 +838,7 @@ class LIB_EXPORT JKQTPDatastoreItem {
* *
* \see JKQTPDatastore * \see JKQTPDatastore
*/ */
class LIB_EXPORT JKQTPDatastoreModel: public QAbstractTableModel { class JKQTP_LIB_EXPORT JKQTPDatastoreModel: public QAbstractTableModel {
Q_OBJECT Q_OBJECT
public: public:
JKQTPDatastoreModel(JKQTPDatastore* datastore, QObject* parent=nullptr); JKQTPDatastoreModel(JKQTPDatastore* datastore, QObject* parent=nullptr);

View File

@ -18,10 +18,6 @@
*/ */
/** \file jkqtpelementsoverlay.h
* \ingroup jkqtplotter_overlays
*/
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
@ -41,7 +37,7 @@ class JKQTBasePlotter;
These simple primitive elements can be used to e.g. display fast changing indicators on the graph ... These simple primitive elements can be used to e.g. display fast changing indicators on the graph ...
*/ */
class LIB_EXPORT JKQTPOverlayElement : public QObject { class JKQTP_LIB_EXPORT JKQTPOverlayElement : public QObject {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayElement(JKQTBasePlotter *parent = 0); explicit JKQTPOverlayElement(JKQTBasePlotter *parent = 0);
@ -177,7 +173,7 @@ class LIB_EXPORT JKQTPOverlayElement : public QObject {
/*! \brief returns the property visible ( \copybrief visible ). /*! \brief returns the property visible ( \copybrief visible ).
\details Description of the parameter visible is: <BLOCKQUOTE>\copydoc visible </BLOCKQUOTE> \details Description of the parameter visible is: <BLOCKQUOTE>\copydoc visible </BLOCKQUOTE>
\see visible for more information */ \see visible for more information */
inline virtual bool getVisible() const inline virtual bool isVisible() const
{ {
return this->visible; return this->visible;
} }
@ -238,7 +234,7 @@ class LIB_EXPORT JKQTPOverlayElement : public QObject {
/*! \brief baseclass for a two-position overlay /*! \brief baseclass for a two-position overlay
\ingroup jkqtplotter_overlays \ingroup jkqtplotter_overlays
*/ */
class LIB_EXPORT JKQTPOverlayTwoPositionOverlay : public JKQTPOverlayElement { class JKQTP_LIB_EXPORT JKQTPOverlayTwoPositionOverlay : public JKQTPOverlayElement {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayTwoPositionOverlay(double x1, double y1, double x2, double y2, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayTwoPositionOverlay(double x1, double y1, double x2, double y2, JKQTBasePlotter *parent = 0);
@ -311,7 +307,7 @@ class LIB_EXPORT JKQTPOverlayTwoPositionOverlay : public JKQTPOverlayElement {
/*! \brief baseclass for one-coordinate indicator overlays (horizontal/vertical lines /*! \brief baseclass for one-coordinate indicator overlays (horizontal/vertical lines
\ingroup jkqtplotter_overlays \ingroup jkqtplotter_overlays
*/ */
class LIB_EXPORT JKQTPOverlayOneCoordOverlay : public JKQTPOverlayElement { class JKQTP_LIB_EXPORT JKQTPOverlayOneCoordOverlay : public JKQTPOverlayElement {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayOneCoordOverlay(double pos, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayOneCoordOverlay(double pos, JKQTBasePlotter *parent = 0);
@ -339,7 +335,7 @@ class LIB_EXPORT JKQTPOverlayOneCoordOverlay : public JKQTPOverlayElement {
/*! \brief baseclass for two-coordinate indicator overlays (horizontal/vertical lines /*! \brief baseclass for two-coordinate indicator overlays (horizontal/vertical lines
\ingroup jkqtplotter_overlays \ingroup jkqtplotter_overlays
*/ */
class LIB_EXPORT JKQTPOverlayTwoCoordOverlay : public JKQTPOverlayOneCoordOverlay { class JKQTP_LIB_EXPORT JKQTPOverlayTwoCoordOverlay : public JKQTPOverlayOneCoordOverlay {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayTwoCoordOverlay(double pos, double pos2, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayTwoCoordOverlay(double pos, double pos2, JKQTBasePlotter *parent = 0);
@ -370,7 +366,7 @@ class LIB_EXPORT JKQTPOverlayTwoCoordOverlay : public JKQTPOverlayOneCoordOverla
These simple primitive elements can be used to e.g. display fast changing indicators on the graph ... These simple primitive elements can be used to e.g. display fast changing indicators on the graph ...
*/ */
class LIB_EXPORT JKQTPOverlayVerticalLine : public JKQTPOverlayOneCoordOverlay { class JKQTP_LIB_EXPORT JKQTPOverlayVerticalLine : public JKQTPOverlayOneCoordOverlay {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayVerticalLine(double pos, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayVerticalLine(double pos, JKQTBasePlotter *parent = 0);
@ -387,7 +383,7 @@ class LIB_EXPORT JKQTPOverlayVerticalLine : public JKQTPOverlayOneCoordOverlay {
These simple primitive elements can be used to e.g. display fast changing indicators on the graph ... These simple primitive elements can be used to e.g. display fast changing indicators on the graph ...
*/ */
class LIB_EXPORT JKQTPOverlayVerticalRange : public JKQTPOverlayTwoCoordOverlay { class JKQTP_LIB_EXPORT JKQTPOverlayVerticalRange : public JKQTPOverlayTwoCoordOverlay {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayVerticalRange(double pos, double pos2, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayVerticalRange(double pos, double pos2, JKQTBasePlotter *parent = 0);
@ -419,7 +415,7 @@ class LIB_EXPORT JKQTPOverlayVerticalRange : public JKQTPOverlayTwoCoordOverlay
\ingroup jkqtplotter_overlays \ingroup jkqtplotter_overlays
*/ */
class LIB_EXPORT JKQTPOverlayLine : public JKQTPOverlayTwoPositionOverlay { class JKQTP_LIB_EXPORT JKQTPOverlayLine : public JKQTPOverlayTwoPositionOverlay {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayLine(double x1, double y1, double x2, double y2, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayLine(double x1, double y1, double x2, double y2, JKQTBasePlotter *parent = 0);
@ -450,7 +446,7 @@ class LIB_EXPORT JKQTPOverlayLine : public JKQTPOverlayTwoPositionOverlay {
\ingroup jkqtplotter_overlays \ingroup jkqtplotter_overlays
*/ */
class LIB_EXPORT JKQTPOverlayRectangle : public JKQTPOverlayTwoPositionOverlay { class JKQTP_LIB_EXPORT JKQTPOverlayRectangle : public JKQTPOverlayTwoPositionOverlay {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayRectangle(double x1, double y1, double x2, double y2, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayRectangle(double x1, double y1, double x2, double y2, JKQTBasePlotter *parent = 0);

View File

@ -123,13 +123,7 @@ void JKQTPXYLineGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -244,13 +238,7 @@ bool JKQTPXYLineErrorGraph::getXMinMax(double &minx, double &maxx, double &small
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -292,13 +280,7 @@ bool JKQTPXYLineErrorGraph::getYMinMax(double &miny, double &maxy, double &small
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -334,8 +316,8 @@ bool JKQTPXYLineErrorGraph::usesColumn(int c) const
void JKQTPXYLineErrorGraph::drawErrorsBefore(JKQTPEnhancedPainter &painter) void JKQTPXYLineErrorGraph::drawErrorsBefore(JKQTPEnhancedPainter &painter)
{ {
intSortData(); intSortData();
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0, 0, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0, 0, &sortedIndices);
} }
@ -449,13 +431,7 @@ void JKQTPStepHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -594,13 +570,7 @@ void JKQTPStepVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -1158,13 +1128,6 @@ void JKQTPXYParametrizedScatterGraph::draw(JKQTPEnhancedPainter &painter)
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -1366,13 +1329,6 @@ void JKQTPXYParametrizedScatterGraph::cbGetDataMinMax(double &dmin, double &dmax
if (colorColumn<0) return; if (colorColumn<0) return;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -1501,13 +1457,7 @@ bool JKQTPXYParametrizedErrorScatterGraph::getXMinMax(double &minx, double &maxx
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -1550,13 +1500,7 @@ bool JKQTPXYParametrizedErrorScatterGraph::getYMinMax(double &miny, double &maxy
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -1593,8 +1537,8 @@ bool JKQTPXYParametrizedErrorScatterGraph::usesColumn(int c) const
void JKQTPXYParametrizedErrorScatterGraph::drawErrorsBefore(JKQTPEnhancedPainter &painter) void JKQTPXYParametrizedErrorScatterGraph::drawErrorsBefore(JKQTPEnhancedPainter &painter)
{ {
intSortData(); intSortData();
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0, 0, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0, 0, &sortedIndices);
} }
bool JKQTPXYParametrizedErrorScatterGraph::intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter &/*painter*/, JKQTBasePlotter * /*parent*/, JKQTPGraph* /*parentGraph*/, int /*xColumn*/, int /*yColumn*/, int /*xErrorColumn*/, int /*yErrorColumn*/, JKQTPErrorPlotstyle /*xErrorStyle*/, JKQTPErrorPlotstyle /*yErrorStyle*/, int index, QColor &/*errorColor*/, QColor &/*errorFillColor*/) bool JKQTPXYParametrizedErrorScatterGraph::intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter &/*painter*/, JKQTBasePlotter * /*parent*/, JKQTPGraph* /*parentGraph*/, int /*xColumn*/, int /*yColumn*/, int /*xErrorColumn*/, int /*yErrorColumn*/, JKQTPErrorPlotstyle /*xErrorStyle*/, JKQTPErrorPlotstyle /*yErrorStyle*/, int index, QColor &/*errorColor*/, QColor &/*errorFillColor*/)

View File

@ -18,10 +18,6 @@
*/ */
/** \file jkqtpgraphs.h
* \ingroup jkqtplotter_linesymbolgraphs
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
#include <QPair> #include <QPair>
@ -47,11 +43,11 @@ class JKQTPDatastore;
/*! \brief This implements xy line plots. This also alows to draw symbols at the data points. /*! \brief This implements xy line plots. This also alows to draw symbols at the data points.
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_linesymbolgraphs_simple
\image html plot_lineplots.png \image html plot_lineplots.png
*/ */
class LIB_EXPORT JKQTPXYLineGraph: public JKQTPXYGraph { class JKQTP_LIB_EXPORT JKQTPXYLineGraph: public JKQTPXYGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -251,7 +247,7 @@ class LIB_EXPORT JKQTPXYLineGraph: public JKQTPXYGraph {
/*! \brief This implements xy scatter plots (like JKQTPXYLineGraph), but the color and size of the symbols may be taken from a column. /*! \brief This implements xy scatter plots (like JKQTPXYLineGraph), but the color and size of the symbols may be taken from a column.
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_linesymbolgraphs_param
set the properties sizeColumn and/or colorColumn to change the size and/or color of the symbols according to the values in the column. set the properties sizeColumn and/or colorColumn to change the size and/or color of the symbols according to the values in the column.
@ -262,7 +258,7 @@ class LIB_EXPORT JKQTPXYLineGraph: public JKQTPXYGraph {
\see JKQTPXYParametrizedErrorScatterGraph, \ref JKQTPlotterParamScatter , \ref JKQTPlotterParamScatterImage \see JKQTPXYParametrizedErrorScatterGraph, \ref JKQTPlotterParamScatter , \ref JKQTPlotterParamScatterImage
*/ */
class LIB_EXPORT JKQTPXYParametrizedScatterGraph: public JKQTPXYLineGraph, public JKQTPColorPaletteTools { class JKQTP_LIB_EXPORT JKQTPXYParametrizedScatterGraph: public JKQTPXYLineGraph, public JKQTPColorPaletteTools {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -485,13 +481,13 @@ class LIB_EXPORT JKQTPXYParametrizedScatterGraph: public JKQTPXYLineGraph, publi
/*! \brief This implements xy line plots with x and y error indicators. /*! \brief This implements xy line plots with x and y error indicators.
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_linesymbolgraphs_simple
\image html plot_errorbarlineplots.png \image html plot_errorbarlineplots.png
\image html plot_errorlinelineplots.png \image html plot_errorlinelineplots.png
\image html plot_errorpolygonlineplots.png \image html plot_errorpolygonlineplots.png
*/ */
class LIB_EXPORT JKQTPXYLineErrorGraph: public JKQTPXYLineGraph, public JKQTPXYGraphErrors { class JKQTP_LIB_EXPORT JKQTPXYLineErrorGraph: public JKQTPXYLineGraph, public JKQTPXYGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -520,7 +516,7 @@ class LIB_EXPORT JKQTPXYLineErrorGraph: public JKQTPXYLineGraph, public JKQTPXYG
/*! \brief This implements xy scatter plots (like JKQTPXYLineGraph), but the color and size of the symbols may be taken from a column. with errorbars /*! \brief This implements xy scatter plots (like JKQTPXYLineGraph), but the color and size of the symbols may be taken from a column. with errorbars
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_linesymbolgraphs_param
set the properties sizeColumn and/or colorColumn to change the size and/or color of the symbols according to the values in the column. set the properties sizeColumn and/or colorColumn to change the size and/or color of the symbols according to the values in the column.
@ -528,7 +524,7 @@ class LIB_EXPORT JKQTPXYLineErrorGraph: public JKQTPXYLineGraph, public JKQTPXYG
\see JKQTPXYParametrizedScatterGraph, \ref JKQTPlotterParamScatter \see JKQTPXYParametrizedScatterGraph, \ref JKQTPlotterParamScatter
*/ */
class LIB_EXPORT JKQTPXYParametrizedErrorScatterGraph: public JKQTPXYParametrizedScatterGraph, public JKQTPXYGraphErrors { class JKQTP_LIB_EXPORT JKQTPXYParametrizedErrorScatterGraph: public JKQTPXYParametrizedScatterGraph, public JKQTPXYGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
JKQTPXYParametrizedErrorScatterGraph(JKQTBasePlotter* parent=nullptr); JKQTPXYParametrizedErrorScatterGraph(JKQTBasePlotter* parent=nullptr);
@ -562,13 +558,13 @@ class LIB_EXPORT JKQTPXYParametrizedErrorScatterGraph: public JKQTPXYParametrize
/*! \brief This implements a step plot with values \f$ \left(x, f(x) \right) \f$ /*! \brief This implements a step plot with values \f$ \left(x, f(x) \right) \f$
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_linesymbolgraphs_simple
\image html jkqtplotter_simpletest_stepplots.png \image html jkqtplotter_simpletest_stepplots.png
\see JKQTPStepVerticalGraph, \ref JKQTPlotterStepPlot \see JKQTPStepVerticalGraph, \ref JKQTPlotterStepPlot
*/ */
class LIB_EXPORT JKQTPStepHorizontalGraph: public JKQTPXYGraph { class JKQTP_LIB_EXPORT JKQTPStepHorizontalGraph: public JKQTPXYGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -723,13 +719,13 @@ class LIB_EXPORT JKQTPStepHorizontalGraph: public JKQTPXYGraph {
/*! \brief This implements a step plot with values \f$ \left(f(y), y \right) \f$ /*! \brief This implements a step plot with values \f$ \left(f(y), y \right) \f$
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_linesymbolgraphs_simple
\image html plot_stepverplot1.png \image html plot_stepverplot1.png
\see JKQTPStepHorizontalGraph, \ref JKQTPlotterStepPlot \see JKQTPStepHorizontalGraph, \ref JKQTPlotterStepPlot
*/ */
class LIB_EXPORT JKQTPStepVerticalGraph: public JKQTPStepHorizontalGraph { class JKQTP_LIB_EXPORT JKQTPStepVerticalGraph: public JKQTPStepHorizontalGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -754,7 +750,7 @@ class LIB_EXPORT JKQTPStepVerticalGraph: public JKQTPStepHorizontalGraph {
\ingroup jkqtplotter_diverse \ingroup jkqtplotter_diverse
*/ */
class LIB_EXPORT JKQTPHorizontalRange: public JKQTPGraph { class JKQTP_LIB_EXPORT JKQTPHorizontalRange: public JKQTPGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -1119,7 +1115,7 @@ class LIB_EXPORT JKQTPHorizontalRange: public JKQTPGraph {
\ingroup jkqtplotter_diverse \ingroup jkqtplotter_diverse
*/ */
class LIB_EXPORT JKQTPVerticalRange: public JKQTPHorizontalRange { class JKQTP_LIB_EXPORT JKQTPVerticalRange: public JKQTPHorizontalRange {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -118,13 +118,7 @@ void JKQTPBarVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end+1, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -146,8 +140,8 @@ void JKQTPBarVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
for (int iii=imin; iii<imax; iii++) { for (int iii=imin; iii<imax; iii++) {
int i=qBound(imin, getDataIndex(iii), imax); int i=qBound(imin, getDataIndex(iii), imax);
double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i)); double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i));
int sr=datastore->getNextLowerIndex(xColumn, i, datarange_start, datarange_end); int sr=datastore->getNextLowerIndex(xColumn, i);
int lr=datastore->getNextHigherIndex(xColumn, i, datarange_start, datarange_end); int lr=datastore->getNextHigherIndex(xColumn, i);
double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i)); double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i));
double yv0=y0; double yv0=y0;
if (!qFuzzyIsNull(baseline)) yv0=transformY(baseline); if (!qFuzzyIsNull(baseline)) yv0=transformY(baseline);
@ -204,13 +198,6 @@ bool JKQTPBarVerticalGraph::getXMinMax(double& minx, double& maxx, double& small
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -221,8 +208,8 @@ bool JKQTPBarVerticalGraph::getXMinMax(double& minx, double& maxx, double& small
for (int i=imin; i<imax; i++) { for (int i=imin; i<imax; i++) {
double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i)); double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i));
int sr=datastore->getNextLowerIndex(xColumn, i, datarange_start, datarange_end); int sr=datastore->getNextLowerIndex(xColumn, i);
int lr=datastore->getNextHigherIndex(xColumn, i, datarange_start, datarange_end); int lr=datastore->getNextHigherIndex(xColumn, i);
double delta, deltap, deltam; double delta, deltap, deltam;
if (sr<0 && lr<0) { // only one x-value if (sr<0 && lr<0) { // only one x-value
@ -266,13 +253,6 @@ bool JKQTPBarVerticalGraph::getYMinMax(double& miny, double& maxy, double& small
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -386,13 +366,6 @@ void JKQTPBarHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end+1, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -415,8 +388,8 @@ void JKQTPBarHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
int i=qBound(imin, getDataIndex(iii), imax); int i=qBound(imin, getDataIndex(iii), imax);
double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i)); double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i));
double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i)); double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i));
int sr=datastore->getNextLowerIndex(yColumn, i, datarange_start, datarange_end); int sr=datastore->getNextLowerIndex(yColumn, i);
int lr=datastore->getNextHigherIndex(yColumn, i, datarange_start, datarange_end); int lr=datastore->getNextHigherIndex(yColumn, i);
double xv0=x0; double xv0=x0;
if (!qFuzzyIsNull(baseline)) xv0=transformX(baseline); if (!qFuzzyIsNull(baseline)) xv0=transformX(baseline);
if (hasStackPar) { if (hasStackPar) {
@ -477,13 +450,6 @@ bool JKQTPBarHorizontalGraph::getXMinMax(double& minx, double& maxx, double& sma
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(xColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(xColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -527,13 +493,6 @@ bool JKQTPBarHorizontalGraph::getYMinMax(double& miny, double& maxy, double& sma
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -545,8 +504,8 @@ bool JKQTPBarHorizontalGraph::getYMinMax(double& miny, double& maxy, double& sma
for (int i=imin; i<imax; i++) { for (int i=imin; i<imax; i++) {
double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i)); double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i));
double delta, deltap, deltam; double delta, deltap, deltam;
int sr=datastore->getNextLowerIndex(yColumn, i, datarange_start, datarange_end); int sr=datastore->getNextLowerIndex(yColumn, i);
int lr=datastore->getNextHigherIndex(yColumn, i, datarange_start, datarange_end); int lr=datastore->getNextHigherIndex(yColumn, i);
if (sr<0 && lr<0) { // only one y-value if (sr<0 && lr<0) { // only one y-value
deltam=0.5; deltam=0.5;
@ -662,13 +621,6 @@ bool JKQTPBarHorizontalErrorGraph::getXMinMax(double &minx, double &maxx, double
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -698,8 +650,8 @@ bool JKQTPBarHorizontalErrorGraph::getXMinMax(double &minx, double &maxx, double
void JKQTPBarHorizontalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter) void JKQTPBarHorizontalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
{ {
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0.0, shift); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0.0, shift);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0.0, shift, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0.0, shift, &sortedIndices);
} }
JKQTPBarVerticalErrorGraph::JKQTPBarVerticalErrorGraph(JKQTBasePlotter *parent): JKQTPBarVerticalErrorGraph::JKQTPBarVerticalErrorGraph(JKQTBasePlotter *parent):
@ -736,13 +688,6 @@ bool JKQTPBarVerticalErrorGraph::getYMinMax(double &miny, double &maxy, double &
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -784,13 +729,6 @@ bool JKQTPBarVerticalErrorGraph::getYMinMax(double &miny, double &maxy, double &
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -820,9 +758,9 @@ bool JKQTPBarVerticalErrorGraph::getYMinMax(double &miny, double &maxy, double &
void JKQTPBarVerticalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter) void JKQTPBarVerticalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
{ {
//plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, shift, 0.0); //plotErrorIndicators(painter, parent, this, xColumn, yColumn, shift, 0.0);
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, shift, 0.0); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, shift, 0.0);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, shift, 0, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, shift, 0, &sortedIndices);
} }
JKQTPBarVerticalStackableGraph::JKQTPBarVerticalStackableGraph(JKQTBasePlotter *parent): JKQTPBarVerticalStackableGraph::JKQTPBarVerticalStackableGraph(JKQTBasePlotter *parent):

View File

@ -17,11 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** \file jkqtpgraphsbarchart.h
* \ingroup jkqtplotter_barssticks
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
#include <QPair> #include <QPair>
@ -60,7 +55,7 @@
*/ */
class LIB_EXPORT JKQTPBarVerticalGraph: public JKQTPXYGraph { class JKQTP_LIB_EXPORT JKQTPBarVerticalGraph: public JKQTPXYGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -283,7 +278,7 @@ class LIB_EXPORT JKQTPBarVerticalGraph: public JKQTPXYGraph {
* \image html JKQTPBarVerticalGraphStacked.png * \image html JKQTPBarVerticalGraphStacked.png
* *
*/ */
class LIB_EXPORT JKQTPBarVerticalStackableGraph: public JKQTPBarVerticalGraph { class JKQTP_LIB_EXPORT JKQTPBarVerticalStackableGraph: public JKQTPBarVerticalGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -322,7 +317,7 @@ class LIB_EXPORT JKQTPBarVerticalStackableGraph: public JKQTPBarVerticalGraph {
* \image html plot_bargraphverploterr.png * \image html plot_bargraphverploterr.png
* *
*/ */
class LIB_EXPORT JKQTPBarVerticalErrorGraph: public JKQTPBarVerticalGraph, public JKQTPYGraphErrors { class JKQTP_LIB_EXPORT JKQTPBarVerticalErrorGraph: public JKQTPBarVerticalGraph, public JKQTPYGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -353,7 +348,7 @@ class LIB_EXPORT JKQTPBarVerticalErrorGraph: public JKQTPBarVerticalGraph, publi
\image html plot_bargraphhorplot.png \image html plot_bargraphhorplot.png
*/ */
class LIB_EXPORT JKQTPBarHorizontalGraph: public JKQTPBarVerticalGraph { class JKQTP_LIB_EXPORT JKQTPBarHorizontalGraph: public JKQTPBarVerticalGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -389,7 +384,7 @@ class LIB_EXPORT JKQTPBarHorizontalGraph: public JKQTPBarVerticalGraph {
* \image html JKQTPBarHorizontalGraphStacked.png * \image html JKQTPBarHorizontalGraphStacked.png
* *
*/ */
class LIB_EXPORT JKQTPBarHorizontalStackableGraph: public JKQTPBarHorizontalGraph { class JKQTP_LIB_EXPORT JKQTPBarHorizontalStackableGraph: public JKQTPBarHorizontalGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -428,7 +423,7 @@ class LIB_EXPORT JKQTPBarHorizontalStackableGraph: public JKQTPBarHorizontalGrap
* \image html plot_bargraphhorploterr.png * \image html plot_bargraphhorploterr.png
* *
*/ */
class LIB_EXPORT JKQTPBarHorizontalErrorGraph: public JKQTPBarHorizontalGraph, public JKQTPXGraphErrors { class JKQTP_LIB_EXPORT JKQTPBarHorizontalErrorGraph: public JKQTPBarHorizontalGraph, public JKQTPXGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -47,23 +47,16 @@ JKQTPPlotElement::JKQTPPlotElement(JKQTPlotter *parent):
setParent(parent); setParent(parent);
} }
JKQTPPlotElement::~JKQTPPlotElement()
= default;
JKQTPGraph::JKQTPGraph(JKQTBasePlotter* parent): JKQTPGraph::JKQTPGraph(JKQTBasePlotter* parent):
JKQTPPlotElement(parent) JKQTPPlotElement(parent)
{ {
datarange_start=datarange_end=-1;
} }
JKQTPGraph::JKQTPGraph(JKQTPlotter *parent): JKQTPGraph::JKQTPGraph(JKQTPlotter *parent):
JKQTPPlotElement(parent) JKQTPPlotElement(parent)
{ {
datarange_start=datarange_end=-1;
}
JKQTPGraph::~JKQTPGraph() }
= default;
QImage JKQTPPlotElement::generateKeyMarker(QSize size) QImage JKQTPPlotElement::generateKeyMarker(QSize size)
{ {
@ -81,6 +74,26 @@ QImage JKQTPPlotElement::generateKeyMarker(QSize size)
return img; return img;
} }
void JKQTPPlotElement::setTitle(const QString &__value)
{
this->title = __value;
}
QString JKQTPPlotElement::getTitle() const
{
return this->title;
}
void JKQTPPlotElement::setVisible(bool __value)
{
this->visible = __value;
}
bool JKQTPPlotElement::isVisible() const
{
return this->visible;
}
@ -108,12 +121,7 @@ bool JKQTPGraph::getDataMinMax(int column, double &minx, double &maxx, double &s
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=datastore->getColumn(column).getRows(); int imax=datastore->getColumn(column).getRows();
// interpret data ranges
if (imax<imin) {
int h=imin;
imin=imax;
imax=h;
}
if (imin<0) imin=0; if (imin<0) imin=0;
if (imax<0) imax=0; if (imax<0) imax=0;
@ -223,13 +231,6 @@ bool JKQTPXYGraph::getXMinMax(double& minx, double& maxx, double& smallestGreate
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -262,13 +263,6 @@ bool JKQTPXYGraph::getYMinMax(double& miny, double& maxy, double& smallestGreate
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -295,7 +289,7 @@ bool JKQTPXYGraph::usesColumn(int column) const
return (column==xColumn)||(column==yColumn); return (column==xColumn)||(column==yColumn);
} }
void JKQTPXYGraph::setSortData(int __value) { void JKQTPXYGraph::setDataSortOrder(int __value) {
sortData=(DataSortOrder)__value; sortData=(DataSortOrder)__value;
} }
@ -427,7 +421,7 @@ QColor JKQTPSingleColumnGraph::getKeyLabelColor()
return color; return color;
} }
void JKQTPSingleColumnGraph::setSortData(int __value) { void JKQTPSingleColumnGraph::setDataSortOrder(int __value) {
sortData=(DataSortOrder)__value; sortData=(DataSortOrder)__value;
if (__value>0) sortData=Sorted; if (__value>0) sortData=Sorted;
} }
@ -459,13 +453,6 @@ void JKQTPSingleColumnGraph::intSortData()
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=datastore->getColumn(dataColumn).getRows(); int imax=datastore->getColumn(dataColumn).getRows();
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -517,7 +504,7 @@ JKQTPGraphErrors::~JKQTPGraphErrors()
void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int datarange_start, int datarange_end, int xErrorColumnLower, int yErrorColumnLower, bool xErrorSymmetric, bool yErrorSymmetric, double xrelshift, double yrelshift, const QVector<int>* dataorder) { void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int xErrorColumnLower, int yErrorColumnLower, bool xErrorSymmetric, bool yErrorSymmetric, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
//std::cout<<"JKQTPGraphErrors::intPlotXYErrorIndicators(p, "<<parent<<", "<<xColumn<<", "<<yColumn<<", "<<xErrorColumn<<", "<<yErrorColumn<<", "<<xErrorStyle<<", "<<yErrorStyle<<", ...)\n"; //std::cout<<"JKQTPGraphErrors::intPlotXYErrorIndicators(p, "<<parent<<", "<<xColumn<<", "<<yColumn<<", "<<xErrorColumn<<", "<<yErrorColumn<<", "<<xErrorStyle<<", "<<yErrorStyle<<", ...)\n";
if (parent==nullptr) return; if (parent==nullptr) return;
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
@ -545,13 +532,6 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
if (yColumn>=0) imaxy=datastore->getColumn(static_cast<size_t>(yColumn)).getRows(); if (yColumn>=0) imaxy=datastore->getColumn(static_cast<size_t>(yColumn)).getRows();
int imax=qMin(imaxx, imaxy); int imax=qMin(imaxx, imaxy);
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -926,8 +906,8 @@ void JKQTPXGraphErrors::setXErrorColumnLower(int __value) {
} }
} }
void JKQTPXGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph *parentGraph, int xColumn, int yColumn, int datarange_start, int datarange_end, double xrelshift, double yrelshift, const QVector<int>* dataorder) { void JKQTPXGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph *parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, -1, xErrorStyle, JKQTPNoError, datarange_start, datarange_end, xErrorColumnLower, -1, xErrorSymmetric, true, xrelshift, yrelshift, dataorder); intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, -1, xErrorStyle, JKQTPNoError, xErrorColumnLower, -1, xErrorSymmetric, true, xrelshift, yrelshift, dataorder);
} }
double JKQTPXGraphErrors::getXErrorU(int i, JKQTPDatastore *ds) const double JKQTPXGraphErrors::getXErrorU(int i, JKQTPDatastore *ds) const
@ -962,8 +942,8 @@ JKQTPYGraphErrors::JKQTPYGraphErrors(QColor graphColor):
yErrorColumnLower=-1; yErrorColumnLower=-1;
} }
void JKQTPYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int datarange_start, int datarange_end, double xrelshift, double yrelshift, const QVector<int>* dataorder) { void JKQTPYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, -1, yErrorColumn, JKQTPNoError, yErrorStyle, datarange_start, datarange_end, -1, yErrorColumnLower, true, yErrorSymmetric, xrelshift, yrelshift, dataorder); intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, -1, yErrorColumn, JKQTPNoError, yErrorStyle, -1, yErrorColumnLower, true, yErrorSymmetric, xrelshift, yrelshift, dataorder);
} }
double JKQTPYGraphErrors::getYErrorU(int i, JKQTPDatastore *ds) const double JKQTPYGraphErrors::getYErrorU(int i, JKQTPDatastore *ds) const
@ -1003,8 +983,8 @@ JKQTPXYGraphErrors::JKQTPXYGraphErrors(QColor graphColor):
} }
void JKQTPXYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int datarange_start, int datarange_end, double xrelshift, double yrelshift, const QVector<int>* dataorder) { void JKQTPXYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
this->intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, yErrorColumn, xErrorStyle, yErrorStyle, datarange_start, datarange_end, xErrorColumnLower, yErrorColumnLower, xErrorSymmetric, yErrorSymmetric, xrelshift, yrelshift, dataorder); this->intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, yErrorColumn, xErrorStyle, yErrorStyle, xErrorColumnLower, yErrorColumnLower, xErrorSymmetric, yErrorSymmetric, xrelshift, yrelshift, dataorder);
} }
double JKQTPXYGraphErrors::getXErrorU(int i, JKQTPDatastore *ds) const double JKQTPXYGraphErrors::getXErrorU(int i, JKQTPDatastore *ds) const
@ -1060,13 +1040,6 @@ void JKQTPXYGraph::intSortData()
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;

View File

@ -18,10 +18,6 @@
*/ */
/** \file jkqtpgraphsbase.h
* \ingroup jkqtplotter_basegraphs
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
#include <QPair> #include <QPair>
@ -47,18 +43,22 @@ class JKQTPDatastore;
* - void draw(JKQTPEnhancedPainter& painter); * - void draw(JKQTPEnhancedPainter& painter);
* - void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect); * - void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect);
* - bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero); * - bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero);
* - void getGraphsYMinMax(double& miny, double& maxy); * - bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero);
* - QColor getKeyLabelColor()=0; * - QColor getKeyLabelColor()=0;
* - bool usesColumn(int column) const; * .
* .
* *
* Optionally you may also overwrite these functions to draw elements outside the actual plot area (like e.g. colorbars): * Optionally you may also overwrite these functions to draw elements outside the actual plot area (like e.g. colorbars):
* - void getOutsideSize(JKQTPEnhancedPainter& painter, int& leftSpace, int& rightSpace, int& topSpace, int& bottomSpace); * - void getOutsideSize(JKQTPEnhancedPainter& painter, int& leftSpace, int& rightSpace, int& topSpace, int& bottomSpace);
* - void drawOutside(JKQTPEnhancedPainter& painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace); * - void drawOutside(JKQTPEnhancedPainter& painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace);
* . * .
* *
* In addition this class provudes protected
* functions that do coordinate transforms based on the current coordinate system, of the paren
* JKQTPlotter (i.e. using the axes JKQTPLott:xAxis and JKQTPlotter::yAxis as basis for the plotting).
*
* \see \ref jkqtplotter_graphsgroup_classstructure
*/ */
class LIB_EXPORT JKQTPPlotElement: public QObject { class JKQTP_LIB_EXPORT JKQTPPlotElement: public QObject {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -67,7 +67,7 @@ class LIB_EXPORT JKQTPPlotElement: public QObject {
explicit JKQTPPlotElement(JKQTPlotter* parent); explicit JKQTPPlotElement(JKQTPlotter* parent);
/** \brief default wirtual destructor */ /** \brief default wirtual destructor */
virtual ~JKQTPPlotElement() ; virtual ~JKQTPPlotElement() = default;
/** \brief plots the graph to the plotter object specified as parent */ /** \brief plots the graph to the plotter object specified as parent */
virtual void draw(JKQTPEnhancedPainter& painter)=0; virtual void draw(JKQTPEnhancedPainter& painter)=0;
@ -91,34 +91,16 @@ class LIB_EXPORT JKQTPPlotElement: public QObject {
/** \brief returns the color to be used for the key label */ /** \brief returns the color to be used for the key label */
virtual QColor getKeyLabelColor()=0; virtual QColor getKeyLabelColor()=0;
/*! \brief sets the property title ( \copybrief title ) to the specified \a __value. /** \brief sets the title of the plot (for display in key!).
\details Description of the parameter title is: <BLOCKQUOTE>\copydoc title </BLOCKQUOTE> *
\see title for more information */ * \note If no title is supplied, no key entry is drawn. */
inline virtual void setTitle(const QString & __value) virtual void setTitle(const QString & __value);
{ /*! \brief returns the the title of the plot */
this->title = __value; virtual QString getTitle() const;
} /*! \brief sets whether the graph is visible in the plot */
/*! \brief returns the property title ( \copybrief title ). void virtual setVisible(bool __value);
\details Description of the parameter title is: <BLOCKQUOTE>\copydoc title </BLOCKQUOTE> /*! \brief returns whether the graph is visible in the plot */
\see title for more information */ bool virtual isVisible() const;
inline virtual QString getTitle() const
{
return this->title;
}
/*! \brief sets the property visible ( \copybrief visible ) to the specified \a __value.
\details Description of the parameter visible is: <BLOCKQUOTE>\copydoc visible </BLOCKQUOTE>
\see visible for more information */
inline virtual void setVisible(bool __value)
{
this->visible = __value;
}
/*! \brief returns the property visible ( \copybrief visible ).
\details Description of the parameter visible is: <BLOCKQUOTE>\copydoc visible </BLOCKQUOTE>
\see visible for more information */
inline virtual bool getVisible() const
{
return this->visible;
}
/** \brief returns the parent painter class */ /** \brief returns the parent painter class */
inline JKQTBasePlotter* getParent() { return parent; } inline JKQTBasePlotter* getParent() { return parent; }
@ -142,6 +124,53 @@ class LIB_EXPORT JKQTPPlotElement: public QObject {
virtual void drawOutside(JKQTPEnhancedPainter& painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace); virtual void drawOutside(JKQTPEnhancedPainter& painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace);
protected: protected:
/** \brief tool routine that transforms an x-coordinate (plot coordinate --> pixels) for this plot element */
virtual double transformX(double x) const;
/** \brief tool routine that transforms a y-coordinate (plot coordinate --> pixels) for this plot element */
virtual double transformY(double y) const;
/** \brief tool routine that backtransforms an x-coordinate (pixels --> plot coordinate) for this plot element */
virtual double backtransformX(double x) const;
/** \brief tool routine that backtransforms a y-coordinate (pixels --> plot coordinate) for this plot element */
virtual double backtransformY(double y) const;
/** \brief tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinate --> pixels) */
inline QPointF transform(const QPointF& x) {
return QPointF(transformX(x.x()), transformY(x.y()));
}
/** \brief tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --> plot coordinate) */
inline QPointF backTransform(const QPointF& x) {
return QPointF(backtransformX(x.x()), backtransformY(x.y()));
}
/** \brief tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinate --> pixels) */
inline QPointF transform(double x, double y) {
return transform(QPointF(x,y));
}
/** \brief tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --> plot coordinate) */
inline QPointF backTransform(double x, double y) {
return backTransform(QPointF(x,y));
}
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules (plot coordinate --> pixels) */
QVector<QPointF> transform(const QVector<QPointF>& x);
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules
* and returns a (non-closed) path consisting of lines (plot coordinate --> pixels) */
QPainterPath transformToLinePath(const QVector<QPointF>& x);
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules
* and returns a polygon (plot coordinate --> pixels) */
inline QPolygonF transformToPolygon(const QVector<QPointF>& x) {
return QPolygonF(transform(x));
}
/** \brief the plotter object this object belongs to */ /** \brief the plotter object this object belongs to */
JKQTBasePlotter* parent; JKQTBasePlotter* parent;
@ -150,52 +179,6 @@ class LIB_EXPORT JKQTPPlotElement: public QObject {
/** \brief indicates whether the graph is visible in the plot */ /** \brief indicates whether the graph is visible in the plot */
bool visible; bool visible;
/** \brief tool routine that transforms an x-coordinate for this plot element */
virtual double transformX(double x) const;
/** \brief tool routine that transforms a y-coordinate for this plot element */
virtual double transformY(double y) const;
/** \brief tool routine that backtransforms an x-coordinate for this plot element */
virtual double backtransformX(double x) const;
/** \brief tool routine that backtransforms a y-coordinate for this plot element */
virtual double backtransformY(double y) const;
/** \brief tool routine that transforms a QPointF according to the parent's transformation rules */
inline QPointF transform(const QPointF& x) {
return QPointF(transformX(x.x()), transformY(x.y()));
}
/** \brief tool routine that back-transforms a QPointF according to the parent's transformation rules */
inline QPointF backTransform(const QPointF& x) {
return QPointF(backtransformX(x.x()), backtransformY(x.y()));
}
/** \brief tool routine that transforms a QPointF according to the parent's transformation rules */
inline QPointF transform(double x, double y) {
return transform(QPointF(x,y));
}
/** \brief tool routine that back-transforms a QPointF according to the parent's transformation rules */
inline QPointF backTransform(double x, double y) {
return backTransform(QPointF(x,y));
}
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules */
QVector<QPointF> transform(const QVector<QPointF>& x);
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules
* and returns a (non-closed) path consisting of lines */
QPainterPath transformToLinePath(const QVector<QPointF>& x);
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules
* and returns a polygon */
inline QPolygonF transformToPolygon(const QVector<QPointF>& x) {
return QPolygonF(transform(x));
}
}; };
/** \brief this virtual base class of the (data-column based) graphs, /** \brief this virtual base class of the (data-column based) graphs,
@ -204,16 +187,19 @@ class LIB_EXPORT JKQTPPlotElement: public QObject {
* as basis for the graphs * as basis for the graphs
* \ingroup jkqtplotter_basegraphs * \ingroup jkqtplotter_basegraphs
* *
* This class adds several features to work with data columns. In addition this class adds protected * This class adds features to work with data columns.
* functions that do coordinate transforms based on the current coordinate system, of the paren * - There are two properties datarange_start and datarange_end. By default they are -1 and therefore ignored.
* JKQTPlotter (i.e. using the axes JKQTPLott:xAxis and JKQTPlotter::yAxis as basis for the plotting). * if they are != -1 the plotter only displays the datapoints with the indexes [datarange_start .. datarange_end]
* although there might be more data points available (range [0 .. maxDataPoints]). The datarange is cut at the
* full range, i.e. if datarange_end>maxDataPoints the plotter displays [datarange_start .. maxDataPoints].
* - Also there is a virtual function usesColumn() which checks whether a given column is used by this graph.
* Override this function in your derived graphs to indicate to JKQTPlotter / JKQTBasePlotter , which columns
* from the internal JKQTPDatastore are actually used. This information can be used e.g. for graph-specific data-export.
* .
* *
* There are two properties datarange_start and datarange_end. By default they are -1 and therefore ignored. * \see \ref jkqtplotter_graphsgroup_classstructure
* if they are != -1 the plotter only displays the datapoints with the indexes [datarange_start .. datarange_end]
* although there might be more data points available (range [0 .. maxDataPoints]). The datarange is cut at the
* full range, i.e. if datarange_end>maxDataPoints the plotter displays [datarange_start .. maxDataPoints].
*/ */
class LIB_EXPORT JKQTPGraph: public JKQTPPlotElement { class JKQTP_LIB_EXPORT JKQTPGraph: public JKQTPPlotElement {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -222,39 +208,15 @@ class LIB_EXPORT JKQTPGraph: public JKQTPPlotElement {
explicit JKQTPGraph(JKQTPlotter* parent); explicit JKQTPGraph(JKQTPlotter* parent);
/** \brief default wirtual destructor */ /** \brief default wirtual destructor */
virtual ~JKQTPGraph() ; virtual ~JKQTPGraph() = default ;
/*! \brief sets the property datarange_start ( \copybrief datarange_start ) to the specified \a __value. /** \brief returns \c true if the given column is used by the graph
\details Description of the parameter datarange_start is: <BLOCKQUOTE>\copydoc datarange_start </BLOCKQUOTE> *
\see datarange_start for more information */ * This virtual function indicates whether a given column is used by this graph.
inline virtual void setDatarangeStart(int __value) * Override this function in your derived graphs to indicate to JKQTPlotter / JKQTBasePlotter , which columns
{ * from the internal JKQTPDatastore are actually used. This information can be used e.g. for graph-specific data-export.
this->datarange_start = __value; */
}
/*! \brief returns the property datarange_start ( \copybrief datarange_start ).
\details Description of the parameter datarange_start is: <BLOCKQUOTE>\copydoc datarange_start </BLOCKQUOTE>
\see datarange_start for more information */
inline virtual int getDatarangeStart() const
{
return this->datarange_start;
}
/*! \brief sets the property datarange_end ( \copybrief datarange_end ) to the specified \a __value.
\details Description of the parameter datarange_end is: <BLOCKQUOTE>\copydoc datarange_end </BLOCKQUOTE>
\see datarange_end for more information */
inline virtual void setDatarange_end(int __value)
{
this->datarange_end = __value;
}
/*! \brief returns the property datarange_end ( \copybrief datarange_end ).
\details Description of the parameter datarange_end is: <BLOCKQUOTE>\copydoc datarange_end </BLOCKQUOTE>
\see datarange_end for more information */
inline virtual int getDatarange_end() const
{
return this->datarange_end;
}
/** \brief returns \c true if the given column is used by the graph */
virtual bool usesColumn(int column) const; virtual bool usesColumn(int column) const;
protected: protected:
@ -271,21 +233,17 @@ class LIB_EXPORT JKQTPGraph: public JKQTPPlotElement {
*/ */
virtual void drawErrorsAfter(JKQTPEnhancedPainter& /*painter*/); virtual void drawErrorsAfter(JKQTPEnhancedPainter& /*painter*/);
/** \brief start of the range of plot data. -1 switches the lower data range border off. */
int datarange_start;
/** \brief end of the range of plot data. -1 switches the upper data range border off. */
int datarange_end;
/** \brief get the maximum and minimum value of the given column /** \brief get the maximum and minimum value of the given column
* *
* The result is given in the two parameters which are call-by-reference parameters! * The result is given in the two parameters which are call-by-reference parameters!
*/ */
bool getDataMinMax(int column, double& minx, double& maxx, double& smallestGreaterZero); bool getDataMinMax(int column, double& minx, double& maxx, double& smallestGreaterZero);
protected:
friend class JKQTPGraphErrors; friend class JKQTPGraphErrors;
}; };
@ -297,8 +255,10 @@ class LIB_EXPORT JKQTPGraph: public JKQTPPlotElement {
* coordinate systems * coordinate systems
* \ingroup jkqtplotter_basegraphs * \ingroup jkqtplotter_basegraphs
* *
* \see \ref jkqtplotter_graphsgroup_classstructure
*
*/ */
class LIB_EXPORT JKQTPPlotObject: public JKQTPPlotElement { class JKQTP_LIB_EXPORT JKQTPPlotObject: public JKQTPPlotElement {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -321,19 +281,32 @@ class LIB_EXPORT JKQTPPlotObject: public JKQTPPlotElement {
that specify x and y coordinates for the single plot points. that specify x and y coordinates for the single plot points.
\ingroup jkqtplotter_basegraphs \ingroup jkqtplotter_basegraphs
This class implements basic management facilities for the data columns and implements the function This class implements basic management facilities for the data columns:
- bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero); - setXColumn(), setYColumn() to set the columns to be used for the graph data
- bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero); - setDataSortOrder() to specify whether and how the data should be sorted before drawing
\image html jkqtplotter_unsorted.png "Unsorted Data"
\image html jkqtplotter_sortedx.png "Data sorted along x-axis (DataSortOrder::SortedX)"
.
... and overrides/implements the functions:
- getXMinMax()
- getYMinMax()
- usesColumn()
. .
*/ */
class LIB_EXPORT JKQTPXYGraph: public JKQTPGraph { class JKQTP_LIB_EXPORT JKQTPXYGraph: public JKQTPGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief specifies how to sort the data in a JKQTPXYGraph before drawing
*
* \image html jkqtplotter_unsorted.png "Unsorted Data"
*
* \image html jkqtplotter_sortedx.png "Data sorted along x-axis (DataSortOrder::SortedX)"
*/
enum DataSortOrder { enum DataSortOrder {
Unsorted=0, Unsorted=0, /*!< \brief the data for a JKQTPXYGraph is not sorted before drawing */
SortedX=1, SortedX=1, /*!< \brief the data for a JKQTPXYGraph is sorted so the x-values appear in ascending before drawing */
SortedY=2 SortedY=2 /*!< \brief the data for a JKQTPXYGraph is sorted so the y-values appear in ascending before drawing */
}; };
@ -395,19 +368,19 @@ class LIB_EXPORT JKQTPXYGraph: public JKQTPGraph {
/*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. /*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value.
\details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE>
\see sortData for more information */ \see sortData for more information */
inline virtual void setSortData(const DataSortOrder & __value) inline virtual void setDataSortOrder(const DataSortOrder & __value)
{ {
this->sortData = __value; this->sortData = __value;
} }
/*! \brief returns the property sortData ( \copybrief sortData ). /*! \brief returns the property sortData ( \copybrief sortData ).
\details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE>
\see sortData for more information */ \see sortData for more information */
inline virtual DataSortOrder getSortData() const inline virtual DataSortOrder getDataSortOrder() const
{ {
return this->sortData; return this->sortData;
} }
/*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \see sortData for more information */ /*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \see sortData for more information */
void setSortData(int __value); void setDataSortOrder(int __value);
protected: protected:
@ -425,8 +398,10 @@ class LIB_EXPORT JKQTPXYGraph: public JKQTPGraph {
* *
* This function can beu used to get the correct datapoint after sorting the datapoints, * This function can beu used to get the correct datapoint after sorting the datapoints,
* As sorting is done by sorting an index and not reordering the data in the columns themselves. * As sorting is done by sorting an index and not reordering the data in the columns themselves.
*
* \see setDataSortOrder(), getDataSortOrder()
* */ * */
inline int getDataIndex(int i) { inline int getDataIndex(int i) {
if (sortData==Unsorted) return i; if (sortData==Unsorted) return i;
return sortedIndices.value(i,i); return sortedIndices.value(i,i);
} }
@ -438,18 +413,27 @@ class LIB_EXPORT JKQTPXYGraph: public JKQTPGraph {
\ingroup jkqtplotter_basegraphs \ingroup jkqtplotter_basegraphs
\see \ref jkqtplotter_graphsgroup_classstructure
*/ */
class LIB_EXPORT JKQTPSingleColumnGraph: public JKQTPGraph { class JKQTP_LIB_EXPORT JKQTPSingleColumnGraph: public JKQTPGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief specifies how to sort the data for a JKQTPSingleColumnGraph before drawing
*
* \image html jkqtplotter_unsorted.png "Unsorted Data"
*
* \image html jkqtplotter_sortedx.png "Data sorted along x-axis (DataSortOrder::SortedX)"
*/
enum DataSortOrder { enum DataSortOrder {
Unsorted=0, Unsorted=0, /*!< \brief the data for a JKQTPSingleColumnGraph is not sorted before drawing */
Sorted=1 Sorted=1 /*!< \brief the data for a JKQTPSingleColumnGraph is sorted (in ascending order) before drawing */
}; };
/** \brief specifies whether the data for a JKQTPSingleColumnGraph represent x-axis or y-axis values */
enum class DataDirection { enum class DataDirection {
X, X, /*!< \brief the data for a JKQTPSingleColumnGraph is data belonging to the x-axis of the plot */
Y Y /*!< \brief the data for a JKQTPSingleColumnGraph is data belonging to the y-axis of the plot */
}; };
/** \brief class constructor */ /** \brief class constructor */
@ -462,7 +446,7 @@ class LIB_EXPORT JKQTPSingleColumnGraph: public JKQTPGraph {
JKQTPSingleColumnGraph(int dataColumn, QColor color, Qt::PenStyle style, JKQTPlotter* parent); JKQTPSingleColumnGraph(int dataColumn, QColor color, Qt::PenStyle style, JKQTPlotter* parent);
JKQTPSingleColumnGraph(int dataColumn, QColor color, JKQTPlotter* parent); JKQTPSingleColumnGraph(int dataColumn, QColor color, JKQTPlotter* parent);
/** \brief returns the color to be used for the key label */ /** \brief returns the color to be used for the key label */
virtual QColor getKeyLabelColor(); virtual QColor getKeyLabelColor() override ;
/*! \brief sets the property dataColumn ( \copybrief dataColumn ) to the specified \a __value. /*! \brief sets the property dataColumn ( \copybrief dataColumn ) to the specified \a __value.
\details Description of the parameter dataColumn is: <BLOCKQUOTE>\copydoc dataColumn </BLOCKQUOTE> \details Description of the parameter dataColumn is: <BLOCKQUOTE>\copydoc dataColumn </BLOCKQUOTE>
@ -527,19 +511,19 @@ class LIB_EXPORT JKQTPSingleColumnGraph: public JKQTPGraph {
/*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. /*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value.
\details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE>
\see sortData for more information */ \see sortData for more information */
inline virtual void setSortData(const DataSortOrder & __value) inline virtual void setDataSortOrder(const DataSortOrder & __value)
{ {
this->sortData = __value; this->sortData = __value;
} }
/*! \brief returns the property sortData ( \copybrief sortData ). /*! \brief returns the property sortData ( \copybrief sortData ).
\details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE>
\see sortData for more information */ \see sortData for more information */
inline virtual DataSortOrder getSortData() const inline virtual DataSortOrder getDataSortOrder() const
{ {
return this->sortData; return this->sortData;
} }
/*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \see sortData for more information */ /*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \see sortData for more information */
void setSortData(int __value); void setDataSortOrder(int __value);
/** \copydoc JKQTPGraph::usesColumn() */ /** \copydoc JKQTPGraph::usesColumn() */
virtual bool usesColumn(int c) const override; virtual bool usesColumn(int c) const override;
@ -592,8 +576,13 @@ class LIB_EXPORT JKQTPSingleColumnGraph: public JKQTPGraph {
will add some public datamemebers and methods to your class that allow to specify the properties of the will add some public datamemebers and methods to your class that allow to specify the properties of the
error indicators (plot properties: color, width, ... and columns for the data). error indicators (plot properties: color, width, ... and columns for the data).
\image html jkqtplotter_simpletest_errorbarstyles.png "line-graphs with different types of error indicators"
\see \ref jkqtplotter_graphsgroup_classstructure_mixins
*/ */
class LIB_EXPORT JKQTPGraphErrors { class JKQTP_LIB_EXPORT JKQTPGraphErrors {
public: public:
/** \brief class contructor */ /** \brief class contructor */
JKQTPGraphErrors(QColor graphColor=QColor("black")); JKQTPGraphErrors(QColor graphColor=QColor("black"));
@ -705,11 +694,11 @@ class LIB_EXPORT JKQTPGraphErrors {
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is /** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. This method is called by * given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. This method is called by
* the JKQTPGraph descendents */ * the JKQTPGraph descendents */
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int datarange_start=-1, int datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int>* dataorder=nullptr)=0; virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int>* dataorder=nullptr)=0;
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is /** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */ * given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
void intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int datarange_start=-1, int datarange_end=-1, int xErrorColumnLower=-1, int yErrorColumnLower=-1, bool xErrorSymmetric=true, bool yErrorSymmetric=true, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr); void intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int xErrorColumnLower=-1, int yErrorColumnLower=-1, bool xErrorSymmetric=true, bool yErrorSymmetric=true, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr);
/** \brief this function can be used to set the color of the error indicators automatically /** \brief this function can be used to set the color of the error indicators automatically
* *
@ -729,9 +718,9 @@ class LIB_EXPORT JKQTPGraphErrors {
/*! \brief This class adds data fields for error indicators in x direction to a JKQTPGraph descendent. /*! \brief This class adds data fields for error indicators in x direction to a JKQTPGraph descendent.
\ingroup jkqtplotter_basegraphserrors \ingroup jkqtplotter_basegraphserrors
\see JKQTPGraphErrors \see JKQTPGraphErrors, \ref jkqtplotter_graphsgroup_classstructure_mixins
*/ */
class LIB_EXPORT JKQTPXGraphErrors: public JKQTPGraphErrors { class JKQTP_LIB_EXPORT JKQTPXGraphErrors: public JKQTPGraphErrors {
public: public:
/** \brief class contructor */ /** \brief class contructor */
JKQTPXGraphErrors(QColor graphColor=QColor("black")); JKQTPXGraphErrors(QColor graphColor=QColor("black"));
@ -788,7 +777,7 @@ class LIB_EXPORT JKQTPXGraphErrors: public JKQTPGraphErrors {
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is /** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */ * given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int datarange_start=-1, int datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override; virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override;
virtual double getXErrorU(int i, JKQTPDatastore* ds) const override; virtual double getXErrorU(int i, JKQTPDatastore* ds) const override;
virtual double getXErrorL(int i, JKQTPDatastore* ds) const override; virtual double getXErrorL(int i, JKQTPDatastore* ds) const override;
@ -798,10 +787,10 @@ class LIB_EXPORT JKQTPXGraphErrors: public JKQTPGraphErrors {
/*! \brief This class adds data fields for error indicators in y direction to a class. /*! \brief This class adds data fields for error indicators in y direction to a class.
\ingroup jkqtplotter_basegraphserrors \ingroup jkqtplotter_basegraphserrors
\see JKQTPGraphErrors \see JKQTPGraphErrors, \ref jkqtplotter_graphsgroup_classstructure_mixins
*/ */
class LIB_EXPORT JKQTPYGraphErrors: public JKQTPGraphErrors { class JKQTP_LIB_EXPORT JKQTPYGraphErrors: public JKQTPGraphErrors {
public: public:
/** \brief class contructor */ /** \brief class contructor */
JKQTPYGraphErrors(QColor graphColor=QColor("black")); JKQTPYGraphErrors(QColor graphColor=QColor("black"));
@ -857,7 +846,7 @@ class LIB_EXPORT JKQTPYGraphErrors: public JKQTPGraphErrors {
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is /** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */ * given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int datarange_start=-1, int datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override; virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override;
virtual double getYErrorU(int i, JKQTPDatastore* ds) const override; virtual double getYErrorU(int i, JKQTPDatastore* ds) const override;
virtual double getYErrorL(int i, JKQTPDatastore* ds) const override; virtual double getYErrorL(int i, JKQTPDatastore* ds) const override;
@ -866,10 +855,10 @@ class LIB_EXPORT JKQTPYGraphErrors: public JKQTPGraphErrors {
/*! \brief This class adds data fields for error indicators in x and y direction to a class. /*! \brief This class adds data fields for error indicators in x and y direction to a class.
\ingroup jkqtplotter_basegraphserrors \ingroup jkqtplotter_basegraphserrors
\see JKQTPGraphErrors \see JKQTPGraphErrors, \ref jkqtplotter_graphsgroup_classstructure_mixins
*/ */
class LIB_EXPORT JKQTPXYGraphErrors: public JKQTPGraphErrors { class JKQTP_LIB_EXPORT JKQTPXYGraphErrors: public JKQTPGraphErrors {
public: public:
/** \brief class contructor */ /** \brief class contructor */
JKQTPXYGraphErrors(QColor graphColor=QColor("black")); JKQTPXYGraphErrors(QColor graphColor=QColor("black"));
@ -977,7 +966,7 @@ class LIB_EXPORT JKQTPXYGraphErrors: public JKQTPGraphErrors {
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is /** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */ * given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int datarange_start=-1, int datarange_end=-1, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override; virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override;
virtual double getXErrorU(int i, JKQTPDatastore* ds) const override; virtual double getXErrorU(int i, JKQTPDatastore* ds) const override;
virtual double getXErrorL(int i, JKQTPDatastore* ds) const override; virtual double getXErrorL(int i, JKQTPDatastore* ds) const override;

View File

@ -126,13 +126,6 @@ void JKQTPBoxplotVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=datastore->getColumn(posColumn).getRows(); int imax=datastore->getColumn(posColumn).getRows();
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -262,13 +255,6 @@ bool JKQTPBoxplotVerticalGraph::getXMinMax(double& minx, double& maxx, double& s
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=datastore->getColumn(posColumn).getRows(); int imax=datastore->getColumn(posColumn).getRows();
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -312,13 +298,6 @@ bool JKQTPBoxplotVerticalGraph::getYMinMax(double& miny, double& maxy, double& s
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=datastore->getColumn(medianColumn).getRows(); int imax=datastore->getColumn(medianColumn).getRows();
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -362,7 +341,7 @@ bool JKQTPBoxplotVerticalGraph::usesColumn(int c) const
return (c==meanColumn)||(c==posColumn)||(c==medianColumn)||(c==minColumn)||(c==maxColumn)||(c==percentile25Column)||(c==percentile75Column); return (c==meanColumn)||(c==posColumn)||(c==medianColumn)||(c==minColumn)||(c==maxColumn)||(c==percentile25Column)||(c==percentile75Column);
} }
void JKQTPBoxplotVerticalGraph::setSortData(int __value) { void JKQTPBoxplotVerticalGraph::setDataSortOrder(int __value) {
sortData=(DataSortOrder)__value; sortData=(DataSortOrder)__value;
if (__value>0) sortData=Sorted; if (__value>0) sortData=Sorted;
} }
@ -467,13 +446,6 @@ bool JKQTPBoxplotHorizontalGraph::getXMinMax(double& miny, double& maxy, double&
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=datastore->getColumn(medianColumn).getRows(); int imax=datastore->getColumn(medianColumn).getRows();
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -523,13 +495,6 @@ bool JKQTPBoxplotHorizontalGraph::getYMinMax(double& minx, double& maxx, double&
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=datastore->getColumn(posColumn).getRows(); int imax=datastore->getColumn(posColumn).getRows();
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -597,13 +562,6 @@ void JKQTPBoxplotHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=datastore->getColumn(posColumn).getRows(); int imax=datastore->getColumn(posColumn).getRows();
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -1195,13 +1153,6 @@ void JKQTPBoxplotVerticalGraph::intSortData()
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=datastore->getColumn(posColumn).getRows(); int imax=datastore->getColumn(posColumn).getRows();
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;

View File

@ -18,10 +18,6 @@
*/ */
/** \file jkqtpgraphsboxplot.h
* \ingroup jkqtplotter_statgraphs
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
#include <QPair> #include <QPair>
@ -89,7 +85,7 @@
\see \ref JKQTPlotterBoxplotsGraphs \see \ref JKQTPlotterBoxplotsGraphs
*/ */
class LIB_EXPORT JKQTPBoxplotVerticalGraph: public JKQTPGraph { class JKQTP_LIB_EXPORT JKQTPBoxplotVerticalGraph: public JKQTPGraph {
Q_OBJECT Q_OBJECT
public: public:
@ -110,7 +106,7 @@ class LIB_EXPORT JKQTPBoxplotVerticalGraph: public JKQTPGraph {
/** \brief plots a key marker inside the specified rectangle \a rect */ /** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect); virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect);
/** \brief returns the color to be used for the key label */ /** \brief returns the color to be used for the key label */
virtual QColor getKeyLabelColor(); virtual QColor getKeyLabelColor() override;
/** \brief get the maximum and minimum x-value of the graph /** \brief get the maximum and minimum x-value of the graph
@ -130,19 +126,19 @@ class LIB_EXPORT JKQTPBoxplotVerticalGraph: public JKQTPGraph {
/*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. /*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value.
\details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE>
\see sortData for more information */ \see sortData for more information */
inline virtual void setSortData(const DataSortOrder & __value) inline virtual void setDataSortOrder(const DataSortOrder & __value)
{ {
this->sortData = __value; this->sortData = __value;
} }
/*! \brief returns the property sortData ( \copybrief sortData ). /*! \brief returns the property sortData ( \copybrief sortData ).
\details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE>
\see sortData for more information */ \see sortData for more information */
inline virtual DataSortOrder getSortData() const inline virtual DataSortOrder getDataSortOrder() const
{ {
return this->sortData; return this->sortData;
} }
/*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \see sortData for more information */ /*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \see sortData for more information */
void setSortData(int __value); void setDataSortOrder(int __value);
/*! \brief sets the property posColumn ( \copybrief posColumn ) to the specified \a __value. /*! \brief sets the property posColumn ( \copybrief posColumn ) to the specified \a __value.
\details Description of the parameter posColumn is: <BLOCKQUOTE>\copydoc posColumn </BLOCKQUOTE> \details Description of the parameter posColumn is: <BLOCKQUOTE>\copydoc posColumn </BLOCKQUOTE>
\see posColumn for more information */ \see posColumn for more information */
@ -463,7 +459,7 @@ class LIB_EXPORT JKQTPBoxplotVerticalGraph: public JKQTPGraph {
\see JKQTPBoxplotVerticalGraph \ref JKQTPlotterBoxplotsGraphs \see JKQTPBoxplotVerticalGraph \ref JKQTPlotterBoxplotsGraphs
*/ */
class LIB_EXPORT JKQTPBoxplotHorizontalGraph: public JKQTPBoxplotVerticalGraph { class JKQTP_LIB_EXPORT JKQTPBoxplotHorizontalGraph: public JKQTPBoxplotVerticalGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -510,7 +506,7 @@ class LIB_EXPORT JKQTPBoxplotHorizontalGraph: public JKQTPBoxplotVerticalGraph {
\image html boxplots.png \image html boxplots.png
*/ */
class LIB_EXPORT JKQTPBoxplotVerticalElement: public JKQTPPlotObject { class JKQTP_LIB_EXPORT JKQTPBoxplotVerticalElement: public JKQTPPlotObject {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -866,7 +862,7 @@ class LIB_EXPORT JKQTPBoxplotVerticalElement: public JKQTPPlotObject {
\see JKQTPBoxplotVerticalElement \see JKQTPBoxplotVerticalElement
*/ */
class LIB_EXPORT JKQTPBoxplotHorizontalElement: public JKQTPBoxplotVerticalElement { class JKQTP_LIB_EXPORT JKQTPBoxplotHorizontalElement: public JKQTPBoxplotVerticalElement {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -19,10 +19,6 @@
/** \file jkqtpgraphsevaluatedfunction.h
* \ingroup jkqtplotter_functiongraphs
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
#include <QPair> #include <QPair>
@ -69,7 +65,7 @@ typedef std::function<double(double)> jkqtpSimplePlotFunctionType;
the following image the following image
\image html plot_functionplots.png \image html plot_functionplots.png
*/ */
class LIB_EXPORT JKQTPXFunctionLineGraph: public JKQTPGraph { class JKQTP_LIB_EXPORT JKQTPXFunctionLineGraph: public JKQTPGraph {
Q_OBJECT Q_OBJECT
public: public:
@ -624,7 +620,7 @@ class LIB_EXPORT JKQTPXFunctionLineGraph: public JKQTPGraph {
\ingroup jkqtplotter_functiongraphs \ingroup jkqtplotter_functiongraphs
*/ */
class LIB_EXPORT JKQTPYFunctionLineGraph: public JKQTPXFunctionLineGraph { class JKQTP_LIB_EXPORT JKQTPYFunctionLineGraph: public JKQTPXFunctionLineGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -108,13 +108,6 @@ void JKQTPFilledCurveXGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=static_cast<int>(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows())); int imax=static_cast<int>(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()));
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -284,13 +277,6 @@ void JKQTPFilledCurveYGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=static_cast<int>(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows())); int imax=static_cast<int>(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()));
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -429,8 +415,8 @@ bool JKQTPFilledCurveXErrorGraph::usesColumn(int c) const
void JKQTPFilledCurveXErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter) void JKQTPFilledCurveXErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
{ {
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0, 0, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0, 0, &sortedIndices);
} }
@ -453,8 +439,8 @@ bool JKQTPFilledCurveYErrorGraph::usesColumn(int c) const
void JKQTPFilledCurveYErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter) void JKQTPFilledCurveYErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
{ {
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0, 0, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0, 0, &sortedIndices);
} }
@ -516,13 +502,6 @@ bool JKQTPFilledVerticalRangeGraph::getYMinMax(double &miny, double &maxy, doubl
JKQTPDatastore* datastore=parent->getDatastore(); JKQTPDatastore* datastore=parent->getDatastore();
int imin=0; int imin=0;
int imax=static_cast<int>(qMin(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()), datastore->getColumn(static_cast<size_t>(yColumn2)).getRows())); int imax=static_cast<int>(qMin(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()), datastore->getColumn(static_cast<size_t>(yColumn2)).getRows()));
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -584,13 +563,6 @@ void JKQTPFilledVerticalRangeGraph::draw(JKQTPEnhancedPainter &painter)
int imax=static_cast<int>(qMin(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()), datastore->getColumn(static_cast<size_t>(yColumn2)).getRows())); int imax=static_cast<int>(qMin(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()), datastore->getColumn(static_cast<size_t>(yColumn2)).getRows()));
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;

View File

@ -29,13 +29,13 @@
/*! \brief This implements filled curve plots where the area is filled between the plot line and the x-Axis. /*! \brief This implements filled curve plots where the area is filled between the plot line and the x-Axis.
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_filledgraphs
\image html jkqtplotter_simpletest_filledgraphs.png \image html jkqtplotter_simpletest_filledgraphs.png
\see \ref JKQTPlotterFilledGraphs \see \ref JKQTPlotterFilledGraphs
*/ */
class LIB_EXPORT JKQTPFilledCurveXGraph: public JKQTPXYGraph { class JKQTP_LIB_EXPORT JKQTPFilledCurveXGraph: public JKQTPXYGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -210,14 +210,14 @@ class LIB_EXPORT JKQTPFilledCurveXGraph: public JKQTPXYGraph {
/*! \brief This implements filled curve plots with y errors where the area is filled between the plot line and the x-Axis. /*! \brief This implements filled curve plots with y errors where the area is filled between the plot line and the x-Axis.
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_filledgraphs
\image html plot_filledcurvexerrorplots.png \image html plot_filledcurvexerrorplots.png
\see \ref JKQTPlotterFilledGraphs \see \ref JKQTPlotterFilledGraphs
*/ */
class LIB_EXPORT JKQTPFilledCurveXErrorGraph: public JKQTPFilledCurveXGraph, public JKQTPYGraphErrors { class JKQTP_LIB_EXPORT JKQTPFilledCurveXErrorGraph: public JKQTPFilledCurveXGraph, public JKQTPYGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -239,14 +239,14 @@ class LIB_EXPORT JKQTPFilledCurveXErrorGraph: public JKQTPFilledCurveXGraph, pub
/*! \brief This implements filled curve plots where the area is filled between the plot line and y-Axis /*! \brief This implements filled curve plots where the area is filled between the plot line and y-Axis
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_filledgraphs
\image html jkqtplotter_simpletest_filledgraphs_yaxis.png \image html jkqtplotter_simpletest_filledgraphs_yaxis.png
\see \ref JKQTPlotterFilledGraphs \see \ref JKQTPlotterFilledGraphs
*/ */
class LIB_EXPORT JKQTPFilledCurveYGraph: public JKQTPFilledCurveXGraph { class JKQTP_LIB_EXPORT JKQTPFilledCurveYGraph: public JKQTPFilledCurveXGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -261,13 +261,13 @@ class LIB_EXPORT JKQTPFilledCurveYGraph: public JKQTPFilledCurveXGraph {
/*! \brief This implements filled curve plots with y errors where the area is filled between the plot line and the x-Axis. /*! \brief This implements filled curve plots with y errors where the area is filled between the plot line and the x-Axis.
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_filledgraphs
\image html plot_filledcurveyerrorplots.png \image html plot_filledcurveyerrorplots.png
\see \ref JKQTPlotterFilledGraphs \see \ref JKQTPlotterFilledGraphs
*/ */
class LIB_EXPORT JKQTPFilledCurveYErrorGraph: public JKQTPFilledCurveYGraph, public JKQTPXGraphErrors { class JKQTP_LIB_EXPORT JKQTPFilledCurveYErrorGraph: public JKQTPFilledCurveYGraph, public JKQTPXGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -289,7 +289,7 @@ class LIB_EXPORT JKQTPFilledCurveYErrorGraph: public JKQTPFilledCurveYGraph, pub
/*! \brief This implements filled curve plots where the area is filled between two data columns for each x-value /*! \brief This implements filled curve plots where the area is filled between two data columns for each x-value
\ingroup jkqtplotter_linesymbolgraphs \ingroup jkqtplotter_filledgraphs
With setDrawlines(false): With setDrawlines(false):
\image html JKQTPFilledVerticalRangeGraph.png \image html JKQTPFilledVerticalRangeGraph.png
@ -301,7 +301,7 @@ class LIB_EXPORT JKQTPFilledCurveYErrorGraph: public JKQTPFilledCurveYGraph, pub
\see \ref JKQTPlotterDateTimeAxes \see \ref JKQTPlotterDateTimeAxes
*/ */
class LIB_EXPORT JKQTPFilledVerticalRangeGraph: public JKQTPXYGraph { class JKQTP_LIB_EXPORT JKQTPFilledVerticalRangeGraph: public JKQTPXYGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -18,11 +18,6 @@
*/ */
/** \file jkqtpgraphsgeometric.h
* \ingroup jkqtplotter_geoplots
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
#include <QPair> #include <QPair>
@ -40,7 +35,7 @@
\ingroup jkqtplotter_geoplots \ingroup jkqtplotter_geoplots
*/ */
class LIB_EXPORT JKQTPGeoBaseLine: public JKQTPPlotObject { class JKQTP_LIB_EXPORT JKQTPGeoBaseLine: public JKQTPPlotObject {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class contructor /*! \brief class contructor
@ -128,7 +123,7 @@ class LIB_EXPORT JKQTPGeoBaseLine: public JKQTPPlotObject {
\ingroup jkqtplotter_geoplots \ingroup jkqtplotter_geoplots
*/ */
class LIB_EXPORT JKQTPGeoBaseFilled: public JKQTPGeoBaseLine { class JKQTP_LIB_EXPORT JKQTPGeoBaseFilled: public JKQTPGeoBaseLine {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class contructor /*! \brief class contructor
@ -224,7 +219,7 @@ class LIB_EXPORT JKQTPGeoBaseFilled: public JKQTPGeoBaseLine {
\ingroup jkqtplotter_geoplots \ingroup jkqtplotter_geoplots
*/ */
class LIB_EXPORT JKQTPGeoSymbol: public JKQTPPlotObject { class JKQTP_LIB_EXPORT JKQTPGeoSymbol: public JKQTPPlotObject {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class contructor /*! \brief class contructor
@ -360,7 +355,7 @@ class LIB_EXPORT JKQTPGeoSymbol: public JKQTPPlotObject {
/** \brief plots a key marker inside the specified rectangle \a rect */ /** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect); virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect);
/** \brief returns the color to be used for the key label */ /** \brief returns the color to be used for the key label */
virtual QColor getKeyLabelColor(); virtual QColor getKeyLabelColor() override;
protected: protected:
double x,y; double x,y;
@ -384,7 +379,7 @@ class LIB_EXPORT JKQTPGeoSymbol: public JKQTPPlotObject {
\ingroup jkqtplotter_geoplots \ingroup jkqtplotter_geoplots
*/ */
class LIB_EXPORT JKQTPGeoText: public JKQTPPlotObject { class JKQTP_LIB_EXPORT JKQTPGeoText: public JKQTPPlotObject {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class contructor /*! \brief class contructor
@ -512,7 +507,7 @@ class LIB_EXPORT JKQTPGeoText: public JKQTPPlotObject {
\image html plot_geoline.png \image html plot_geoline.png
*/ */
class LIB_EXPORT JKQTPGeoLine: public JKQTPGeoBaseLine { class JKQTP_LIB_EXPORT JKQTPGeoLine: public JKQTPGeoBaseLine {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -620,7 +615,7 @@ class LIB_EXPORT JKQTPGeoLine: public JKQTPGeoBaseLine {
\image html plot_geoinfiniteline.png \image html plot_geoinfiniteline.png
*/ */
class LIB_EXPORT JKQTPGeoInfiniteLine: public JKQTPGeoBaseLine { class JKQTP_LIB_EXPORT JKQTPGeoInfiniteLine: public JKQTPGeoBaseLine {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -741,7 +736,7 @@ class LIB_EXPORT JKQTPGeoInfiniteLine: public JKQTPGeoBaseLine {
\image html plot_geolines.png \image html plot_geolines.png
*/ */
class LIB_EXPORT JKQTPGeoPolyLines: public JKQTPGeoBaseLine { class JKQTP_LIB_EXPORT JKQTPGeoPolyLines: public JKQTPGeoBaseLine {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -823,7 +818,7 @@ class LIB_EXPORT JKQTPGeoPolyLines: public JKQTPGeoBaseLine {
\image html plot_georectangle.png \image html plot_georectangle.png
*/ */
class LIB_EXPORT JKQTPGeoRectangle: public JKQTPGeoBaseFilled { class JKQTP_LIB_EXPORT JKQTPGeoRectangle: public JKQTPGeoBaseFilled {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -1008,7 +1003,7 @@ protected:
\image html plot_geopolygon.png \image html plot_geopolygon.png
*/ */
class LIB_EXPORT JKQTPGeoPolygon: public JKQTPGeoBaseFilled { class JKQTP_LIB_EXPORT JKQTPGeoPolygon: public JKQTPGeoBaseFilled {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -1103,7 +1098,7 @@ class LIB_EXPORT JKQTPGeoPolygon: public JKQTPGeoBaseFilled {
\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 \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
<a href="http://en.wikipedia.org/wiki/Ellipse#General_parametric_form">http://en.wikipedia.org/wiki/Ellipse#General_parametric_form</a> <a href="http://en.wikipedia.org/wiki/Ellipse#General_parametric_form">http://en.wikipedia.org/wiki/Ellipse#General_parametric_form</a>
*/ */
class LIB_EXPORT JKQTPGeoEllipse: public JKQTPGeoRectangle { class JKQTP_LIB_EXPORT JKQTPGeoEllipse: public JKQTPGeoRectangle {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -1219,7 +1214,7 @@ class LIB_EXPORT JKQTPGeoEllipse: public JKQTPGeoRectangle {
\image html plot_geoarc.png \image html plot_geoarc.png
*/ */
class LIB_EXPORT JKQTPGeoArc: public JKQTPGeoBaseLine { class JKQTP_LIB_EXPORT JKQTPGeoArc: public JKQTPGeoBaseLine {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -1399,7 +1394,7 @@ class LIB_EXPORT JKQTPGeoArc: public JKQTPGeoBaseLine {
\image html plot_geopie.png \image html plot_geopie.png
*/ */
class LIB_EXPORT JKQTPGeoPie: public JKQTPGeoEllipse { class JKQTP_LIB_EXPORT JKQTPGeoPie: public JKQTPGeoEllipse {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor
@ -1484,7 +1479,7 @@ class LIB_EXPORT JKQTPGeoPie: public JKQTPGeoEllipse {
\image html plot_geochord.png \image html plot_geochord.png
*/ */
class LIB_EXPORT JKQTPGeoChord: public JKQTPGeoPie { class JKQTP_LIB_EXPORT JKQTPGeoChord: public JKQTPGeoPie {
Q_OBJECT Q_OBJECT
public: public:
/*! \brief class constructor /*! \brief class constructor

View File

@ -22,11 +22,6 @@
#define jkqtpgraphsimage_H #define jkqtpgraphsimage_H
/** \file jkqtpgraphsimage.h
* \ingroup jkqtplotter_imagelots_elements
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
#include <QImage> #include <QImage>
@ -42,7 +37,7 @@
/*! \brief base class for plotting an image /*! \brief base class for plotting an image
\ingroup jkqtplotter_imagelots_elements \ingroup jkqtplotter_imagelots_elements
*/ */
class LIB_EXPORT JKQTPImageBase: public JKQTPGraph { class JKQTP_LIB_EXPORT JKQTPImageBase: public JKQTPGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -153,7 +148,7 @@ class LIB_EXPORT JKQTPImageBase: public JKQTPGraph {
\image html jkqtplotter_simpletest_imageplot.png \image html jkqtplotter_simpletest_imageplot.png
*/ */
class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase { class JKQTP_LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
Q_OBJECT Q_OBJECT
public: public:
/** \brief possible datatypes of the data array, plotted by this class. */ /** \brief possible datatypes of the data array, plotted by this class. */
@ -349,7 +344,7 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
\image html jkqtplotter_simpletest_rgbimageplot_qt.png \image html jkqtplotter_simpletest_rgbimageplot_qt.png
*/ */
class LIB_EXPORT JKQTPImage: public JKQTPImageBase { class JKQTP_LIB_EXPORT JKQTPImage: public JKQTPImageBase {
Q_OBJECT Q_OBJECT
public: public:
@ -415,7 +410,7 @@ class LIB_EXPORT JKQTPImage: public JKQTPImageBase {
\image html jkqtplotter_simpletest_imageplot_modifier.png \image html jkqtplotter_simpletest_imageplot_modifier.png
\image html jkqtplotter_simpletest_imageplot__smallscaletransparent.png \image html jkqtplotter_simpletest_imageplot__smallscaletransparent.png
*/ */
class LIB_EXPORT JKQTPMathImage: public JKQTPMathImageBase { class JKQTP_LIB_EXPORT JKQTPMathImage: public JKQTPMathImageBase {
Q_OBJECT Q_OBJECT
public: public:
@ -903,7 +898,7 @@ class LIB_EXPORT JKQTPMathImage: public JKQTPMathImageBase {
\image html jkqtplotter_simpletest_rgbimageplot_opencv.png \image html jkqtplotter_simpletest_rgbimageplot_opencv.png
*/ */
class LIB_EXPORT JKQTPRGBMathImage: public JKQTPMathImageBase { class JKQTP_LIB_EXPORT JKQTPRGBMathImage: public JKQTPMathImageBase {
Q_OBJECT Q_OBJECT
public: public:
using JKQTPMathImageBase::setData; using JKQTPMathImageBase::setData;
@ -1421,7 +1416,7 @@ class LIB_EXPORT JKQTPRGBMathImage: public JKQTPMathImageBase {
\image html jkqtplotter_simpletest_imageplot__smallscaletransparent.png \image html jkqtplotter_simpletest_imageplot__smallscaletransparent.png
*/ */
class LIB_EXPORT JKQTPColumnMathImage: public JKQTPMathImage { class JKQTP_LIB_EXPORT JKQTPColumnMathImage: public JKQTPMathImage {
Q_OBJECT Q_OBJECT
public: public:
@ -1485,7 +1480,7 @@ class LIB_EXPORT JKQTPColumnMathImage: public JKQTPMathImage {
\image html jkqtplotter_simpletest_rgbimageplot_opencv.png \image html jkqtplotter_simpletest_rgbimageplot_opencv.png
*/ */
class LIB_EXPORT JKQTPColumnRGBMathImage: public JKQTPRGBMathImage { class JKQTP_LIB_EXPORT JKQTPColumnRGBMathImage: public JKQTPRGBMathImage {
Q_OBJECT Q_OBJECT
public: public:
@ -1579,7 +1574,7 @@ class LIB_EXPORT JKQTPColumnRGBMathImage: public JKQTPRGBMathImage {
\ingroup jkqtplotter_imagelots_elements \ingroup jkqtplotter_imagelots_elements
*/ */
class LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase { class JKQTP_LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase {
Q_OBJECT Q_OBJECT
public: public:
@ -1711,7 +1706,7 @@ class LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase {
Also it is possible to draw other types of markers (cross, circles, ...) Also it is possible to draw other types of markers (cross, circles, ...)
*/ */
class LIB_EXPORT JKQTPOverlayImageEnhanced: public JKQTPOverlayImage { class JKQTP_LIB_EXPORT JKQTPOverlayImageEnhanced: public JKQTPOverlayImage {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -1824,7 +1819,7 @@ class LIB_EXPORT JKQTPOverlayImageEnhanced: public JKQTPOverlayImage {
Also it is possible to draw other types of markers (cross, circles, ...) Also it is possible to draw other types of markers (cross, circles, ...)
*/ */
class LIB_EXPORT JKQTPColumnOverlayImageEnhanced: public JKQTPOverlayImageEnhanced { class JKQTP_LIB_EXPORT JKQTPColumnOverlayImageEnhanced: public JKQTPOverlayImageEnhanced {
Q_OBJECT Q_OBJECT
public: public:
JKQTPColumnOverlayImageEnhanced(JKQTBasePlotter* parent=nullptr); JKQTPColumnOverlayImageEnhanced(JKQTBasePlotter* parent=nullptr);
@ -1876,7 +1871,7 @@ class LIB_EXPORT JKQTPColumnOverlayImageEnhanced: public JKQTPOverlayImageEnhanc
* *
* \image html JKQTPContour.png * \image html JKQTPContour.png
*/ */
class LIB_EXPORT JKQTPContour: public JKQTPMathImage { class JKQTP_LIB_EXPORT JKQTPContour: public JKQTPMathImage {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -81,13 +81,6 @@ void JKQTPImpulsesHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -195,13 +188,6 @@ void JKQTPImpulsesVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()); int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;
@ -282,8 +268,8 @@ bool JKQTPImpulsesHorizontalErrorGraph::usesColumn(int c) const
void JKQTPImpulsesHorizontalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter) void JKQTPImpulsesHorizontalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
{ {
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0, 0, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0, 0, &sortedIndices);
} }
JKQTPImpulsesVerticalErrorGraph::JKQTPImpulsesVerticalErrorGraph(JKQTBasePlotter *parent): JKQTPImpulsesVerticalErrorGraph::JKQTPImpulsesVerticalErrorGraph(JKQTBasePlotter *parent):
@ -305,7 +291,7 @@ bool JKQTPImpulsesVerticalErrorGraph::usesColumn(int c) const
void JKQTPImpulsesVerticalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter) void JKQTPImpulsesVerticalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
{ {
if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end); if (sortData==JKQTPXYGraph::Unsorted) plotErrorIndicators(painter, parent, this, xColumn, yColumn);
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, datarange_start, datarange_end, 0, 0, &sortedIndices); else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0, 0, &sortedIndices);
} }

View File

@ -31,7 +31,7 @@
\image html plot_impulsesxplots.png \image html plot_impulsesxplots.png
*/ */
class LIB_EXPORT JKQTPImpulsesHorizontalGraph: public JKQTPXYGraph { class JKQTP_LIB_EXPORT JKQTPImpulsesHorizontalGraph: public JKQTPXYGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -111,7 +111,7 @@ class LIB_EXPORT JKQTPImpulsesHorizontalGraph: public JKQTPXYGraph {
\image html plot_impulsesxerrorsplots.png \image html plot_impulsesxerrorsplots.png
*/ */
class LIB_EXPORT JKQTPImpulsesHorizontalErrorGraph: public JKQTPImpulsesHorizontalGraph, public JKQTPXGraphErrors { class JKQTP_LIB_EXPORT JKQTPImpulsesHorizontalErrorGraph: public JKQTPImpulsesHorizontalGraph, public JKQTPXGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -134,7 +134,7 @@ class LIB_EXPORT JKQTPImpulsesHorizontalErrorGraph: public JKQTPImpulsesHorizont
\image html plot_impulsesyplots.png \image html plot_impulsesyplots.png
*/ */
class LIB_EXPORT JKQTPImpulsesVerticalGraph: public JKQTPImpulsesHorizontalGraph { class JKQTP_LIB_EXPORT JKQTPImpulsesVerticalGraph: public JKQTPImpulsesHorizontalGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
@ -153,7 +153,7 @@ class LIB_EXPORT JKQTPImpulsesVerticalGraph: public JKQTPImpulsesHorizontalGraph
\image html plot_impulsesyerrorsplots.png \image html plot_impulsesyerrorsplots.png
*/ */
class LIB_EXPORT JKQTPImpulsesVerticalErrorGraph: public JKQTPImpulsesVerticalGraph, public JKQTPYGraphErrors { class JKQTP_LIB_EXPORT JKQTPImpulsesVerticalErrorGraph: public JKQTPImpulsesVerticalGraph, public JKQTPYGraphErrors {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -43,7 +43,7 @@ class JKQTPlotter;
Use the variable \c x in an equation to refer to the free parameter of the curve. Use the variable \c x in an equation to refer to the free parameter of the curve.
*/ */
class LIB_EXPORT JKQTPXParsedFunctionLineGraph: public JKQTPXFunctionLineGraph { class JKQTP_LIB_EXPORT JKQTPXParsedFunctionLineGraph: public JKQTPXFunctionLineGraph {
Q_OBJECT Q_OBJECT
public: public:
@ -129,7 +129,7 @@ class LIB_EXPORT JKQTPXParsedFunctionLineGraph: public JKQTPXFunctionLineGraph {
Use the variable \c y in an equation to refer to the free parameter of the curve (\c is also understood for convenience). Use the variable \c y in an equation to refer to the free parameter of the curve (\c is also understood for convenience).
*/ */
class LIB_EXPORT JKQTPYParsedFunctionLineGraph: public JKQTPYFunctionLineGraph { class JKQTP_LIB_EXPORT JKQTPYParsedFunctionLineGraph: public JKQTPYFunctionLineGraph {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -130,13 +130,6 @@ void JKQTPPeakStreamGraph::draw(JKQTPEnhancedPainter &painter)
int imax=static_cast<int>(datastore->getColumn(static_cast<size_t>(dataColumn)).getRows()); int imax=static_cast<int>(datastore->getColumn(static_cast<size_t>(dataColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;

View File

@ -18,9 +18,6 @@
*/ */
/** \file jkqtpgraphspeakstream.h
* \ingroup jkqtplotter_diverse
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
@ -45,7 +42,7 @@ class JKQTPDatastore;
\image html JKQTPPeakStreamGraphY.png "yPeaks=true" \image html JKQTPPeakStreamGraphY.png "yPeaks=true"
\image html JKQTPPeakStreamGraphX.png "yPeaks=false" \image html JKQTPPeakStreamGraphX.png "yPeaks=false"
*/ */
class LIB_EXPORT JKQTPPeakStreamGraph: public JKQTPSingleColumnGraph { class JKQTP_LIB_EXPORT JKQTPPeakStreamGraph: public JKQTPSingleColumnGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -114,13 +114,6 @@ void JKQTPSingleColumnSymbolsGraph::draw(JKQTPEnhancedPainter &painter)
int imax=static_cast<int>(datastore->getColumn(static_cast<size_t>(dataColumn)).getRows()); int imax=static_cast<int>(datastore->getColumn(static_cast<size_t>(dataColumn)).getRows());
int imin=0; int imin=0;
// interpret data ranges
if (datarange_start>-1) {
imin=qMin(datarange_start, static_cast<int>(imax));
}
if (datarange_end>-1) {
imax=qMin(datarange_end, static_cast<int>(imax));
}
if (imax<imin) { if (imax<imin) {
int h=imin; int h=imin;
imin=imax; imin=imax;

View File

@ -18,9 +18,6 @@
*/ */
/** \file jkqtpgraphssinglecolumnsymbols.h
* \ingroup jkqtplotter_linesymbolgraphs
*/
#include <QString> #include <QString>
#include <QPainter> #include <QPainter>
@ -51,7 +48,7 @@
\see \ref JKQTPlotterDistributionPlot \see \ref JKQTPlotterDistributionPlot
*/ */
class LIB_EXPORT JKQTPSingleColumnSymbolsGraph: public JKQTPSingleColumnGraph { class JKQTP_LIB_EXPORT JKQTPSingleColumnSymbolsGraph: public JKQTPSingleColumnGraph {
Q_OBJECT Q_OBJECT
public: public:
/** \brief describes how data from dataColumn of a JKQTPSingleColumnSymbolsGraph positioned at position */ /** \brief describes how data from dataColumn of a JKQTPSingleColumnSymbolsGraph positioned at position */

View File

@ -20,11 +20,6 @@
/** \file jkqtplotter.cpp
* \ingroup jkqtpplotterclasses
*/
#include <QFileInfo> #include <QFileInfo>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QtGlobal> #include <QtGlobal>
@ -635,7 +630,7 @@ void JKQTPlotter::initContextMenu()
if (tit.isEmpty()) tit=tr("Graph %1").arg(static_cast<int>(i)); if (tit.isEmpty()) tit=tr("Graph %1").arg(static_cast<int>(i));
QAction* act=new QAction(tit, menVisibleGroup); QAction* act=new QAction(tit, menVisibleGroup);
act->setCheckable(true); act->setCheckable(true);
act->setChecked(getPlotter()->getGraph(i)->getVisible()); act->setChecked(getPlotter()->getGraph(i)->isVisible());
act->setIcon(QIcon(QPixmap::fromImage(getPlotter()->getGraph(i)->generateKeyMarker(QSize(16,16))))); act->setIcon(QIcon(QPixmap::fromImage(getPlotter()->getGraph(i)->generateKeyMarker(QSize(16,16)))));
act->setData(static_cast<int>(i)); act->setData(static_cast<int>(i));
connect(act, SIGNAL(toggled(bool)), this, SLOT(reactGraphVisible(bool))); connect(act, SIGNAL(toggled(bool)), this, SLOT(reactGraphVisible(bool)));
@ -882,29 +877,42 @@ QSize JKQTPlotter::sizeHint() const {
return QWidget::sizeHint(); return QWidget::sizeHint();
} }
void JKQTPlotter::synchronizeToMaster(JKQTPlotter *master, JKQTBasePlotter::SynchronizationDirection synchronizeDirection, bool synchronizeAxisLength, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster)
{
if (masterPlotterX) disconnect(masterPlotterX->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated()));
if (masterPlotterY) disconnect(masterPlotterY->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated()));
plotter->synchronizeToMaster(master->getPlotter(), synchronizeDirection, synchronizeAxisLength, synchronizeZoomingMasterToSlave, synchronizeZoomingSlaveToMaster);
void JKQTPlotter::masterPlotScalingRecalculated() { if (synchronizeDirection==JKQTBasePlotter::sdXAxis || synchronizeDirection==JKQTBasePlotter::sdXYAxes) {
if (masterPlotter) { masterPlotterX=master;
if (plotter->getMasterSynchronizeHeight()||plotter->getMasterSynchronizeWidth()) { if (masterPlotterX) connect(masterPlotterX->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated()));
redrawPlot();
}
} }
} if (synchronizeDirection==JKQTBasePlotter::sdYAxis || synchronizeDirection==JKQTBasePlotter::sdXYAxes) {
masterPlotterY=master;
void JKQTPlotter::synchronizeToMaster(JKQTPlotter* master, bool synchronizeWidth, bool synchronizeHeight, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster) { if (masterPlotterY) connect(masterPlotterY->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated()));
if (!master) {
resetMasterSynchronization();
} }
plotter->synchronizeToMaster(master->getPlotter(), synchronizeWidth, synchronizeHeight, synchronizeZoomingMasterToSlave, synchronizeZoomingSlaveToMaster);
masterPlotter=master;
if (masterPlotter) connect(masterPlotter->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated()));
redrawPlot(); redrawPlot();
} }
void JKQTPlotter::resetMasterSynchronization() { void JKQTPlotter::synchronizeXToMaster(JKQTPlotter *master, bool synchronizeAxisLength, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster)
if (masterPlotter) disconnect(masterPlotter->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated())); {
plotter->resetMasterSynchronization(); synchronizeToMaster(master, JKQTBasePlotter::sdXAxis, synchronizeAxisLength, synchronizeZoomingMasterToSlave, synchronizeZoomingSlaveToMaster);
}
void JKQTPlotter::synchronizeYToMaster(JKQTPlotter *master, bool synchronizeAxisLength, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster)
{
synchronizeToMaster(master, JKQTBasePlotter::sdYAxis, synchronizeAxisLength, synchronizeZoomingMasterToSlave, synchronizeZoomingSlaveToMaster);
}
void JKQTPlotter::resetMasterSynchronization(JKQTBasePlotter::SynchronizationDirection synchronizeDirection)
{
synchronizeToMaster(nullptr, synchronizeDirection, false, false, false);
}
void JKQTPlotter::masterPlotScalingRecalculated() {
//qDebug()<<"this="<<this<<", sender="<<sender()<<" --> masterPlotScalingRecalculated()";
redrawPlot(); redrawPlot();
} }

View File

@ -18,12 +18,6 @@
*/ */
/** \file jkqtplotter.h
* \ingroup jkqtpplotterclasses
*
* A Qt based plotter for 2D scientific graphs.
*/
#include <QWidget> #include <QWidget>
#include <QVector> #include <QVector>
#include <QSettings> #include <QSettings>
@ -56,7 +50,7 @@
/** \brief initialized Qt-ressources necessary for JKQTPlotter /** \brief initialized Qt-ressources necessary for JKQTPlotter
* \ingroup jkqtpplotterclasses * \ingroup jkqtpplotterclasses
*/ */
LIB_EXPORT void initJKQTPlotterResources(); JKQTP_LIB_EXPORT void initJKQTPlotterResources();
/** \brief plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing) /** \brief plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
@ -80,58 +74,26 @@ LIB_EXPORT void initJKQTPlotterResources();
* *
* \image html test_multiplot.png * \image html test_multiplot.png
* *
* This can be achieved by putting several JKQTPlotter instances into a * In the Qt Window this is achieved by placing several JKQTPlotter objects into a <a href="http://doc.qt.io/qt-5/qgridlayout.html">QGridLayout</a>.
* <a href="http://doc.qt.io/qt-5/layout.html">Qt Layout</a>. Then you can fill each plot differently and * In order to support this alignment, also when exporting/printing a plot, and when the user interactions with the plot (e.g. zooming),
* set the x-/y-range of each plot by hand. This method works for simple cases, but has several drawbacks: * JKQTPlotter offers an API which allows to :
* - Due to the independent and automatic layouting of each plot, the axes do not need to be aligned properly * <ul>
* - When you print the plot, the printing does not know about the layout and will only print one of the * <li> <b>declare (grid-like) relations between plots for export/printing</b>
* several plots in your layout. * \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos() and \ref JKQTBASEPLOTTER_SYNCMULTIPLOT_SYNC</li>
* - when you zoom/pan in one of the plots (e.g. using the mouse), the other plots will not adapt their * <li> <b>synchronize axes/plots</b>
* axes to match the new area, but especially in cases as in the image above it would be beneficial, * \see synchronizeXToMaster(), synchronizeYToMaster(), resetMasterSynchronization() and \ref JKQTBASEPLOTTER_SYNCMULTIPLOT_GRIDPRINT</li>
* that tha x-axis of the plot at the bottom follows the x-axis of the plot above etc. * </ul>
* .
* *
* To overcome these limitations, JKQTPlotter offers an API with which you can declare relations between
* different plots (one of them is made the master) and you can synchronize the axes of two plots, when
* zooming (also when calling e.g. zoomToFit() or setXY() ). This API is:
* - <b>Declaring the Relations (forwarding to JKQTBasePlotter !):</b>
* - synchronizeToMaster() / JKQTBasePlotter::synchronizeToMaster() synchronizes the parent JKQTPlotter with another JKQTPlotter. With two boolean-parameters
* you can specify the axes to be synchronized. E.g. in the case above, you would call:
* \code
* // synchronize width/x-axis of plotResid to width/x-axis of plotMain
* plotResid->synchronizeToMaster(plotMain, true, false, true, true);
* *
* // synchronize y-axis of width/plotResidHist to y-axis of width/plotResid * \note This API adopts and extends the possibilities of JKQTBasePlotter. Please see the documentation there for details:
* plotResidHist->synchronizeToMaster(plotResid, false, true, true, true); * <ul>
* \endcode * <li> \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
* This will synchronize the x-axes of the top (\c plotMain ) and bottom-left plot (\c plotResid ), * <ul>
* as well as the y-axes of the bottom-left (\c plotResid ) and bottom-right plot (\c plotResidHist ). * <li> \ref JKQTBASEPLOTTER_SYNCMULTIPLOT_SYNC</li>
* After this call they will have the same size in screen pixels and always span the same range * <li> \ref JKQTBASEPLOTTER_SYNCMULTIPLOT_GRIDPRINT</li>
* in plot coordinates. * </ul>
* - resetMasterSynchronization() / JKQTBasePlotter::resetMasterSynchronization() deletes all synchronizations * </ul>
* from the JKQTPlotter
* .
* - <b>Synchronizing Axes (forwarding to JKQTBasePlotter !):</b>
* - setGridPrinting() enables grid printing for this JKQTPlotter. If set to \c true , and you print afterwards,
* the printout (or export) will not only contain the plot itself, but also additional plots that were
* declared using addGridPrintingPlotter() (see below).
* - addGridPrintingPlotter() add a new plotter \a plotterOther for grid printing mode, at location \a x / \a y
* E.g. in the example shown above, you could call:
* \code
* plotMain->setGridPrinting(true);
* plotMain->addGridPrintingPlotter(0,1,plotResid);
* plotMain->addGridPrintingPlotter(1,1,plotResidHist);
* \endcode
* - clearGridPrintingPlotters() clear all additional plotters for grid printing mode
* .
* These two functionalities are kept separate, so you can use them independently.
* *
* \note Note that the grid printing mode only allows to put plots to the right (positive x-values in addGridPrintingPlotter() )
* and to the bottom (positive y-values in addGridPrintingPlotter() ) of the current plot. Therefore the master plot
* needs to be the top-left plot of your grid and all plots need to be aligned in a grid (i.e. using
* <a href="http://doc.qt.io/qt-5/qgridlayout.html">QGridLayout</a>)
*
* \see See \ref JKQTPlotterMultiPlotLayout for an extensive example of the functionality.
* *
* *
* \section JKQTPLOTTER_USERINTERACTION User-Interactions/GUI Features * \section JKQTPLOTTER_USERINTERACTION User-Interactions/GUI Features
@ -327,7 +289,7 @@ LIB_EXPORT void initJKQTPlotterResources();
* \see \ref JKQTPlotterQtCreator * \see \ref JKQTPlotterQtCreator
* *
*/ */
class LIB_EXPORT JKQTPlotter: public QWidget { class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
Q_OBJECT Q_OBJECT
public: public:
/** \brief Availble action this JKQtPlotter can perform when mouse events occur. /** \brief Availble action this JKQtPlotter can perform when mouse events occur.
@ -437,73 +399,104 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/** \brief returns the size of the widget */ /** \brief returns the size of the widget */
QSize sizeHint() const; QSize sizeHint() const;
/*! \brief synchronize the plot borders with a given plotter
/*! \brief synchronize the plot borders (and zooming) with a given plotter (master --> slave/this)
This function allows two plotters to draw a graph with exactly the same height or width This function allows two plotters to draw a graph with exactly the same height or width
as in another graph. For example if you want to have two plotters which are positioned one as in another graph. For example if you want to have two plotters which are positioned one
above the other (and have the same widget widths, which could be guaranteed by a QLayout) above the other (and have the same widget widths, which could be guaranteed by a QLayout)
you may want to make sure that their plotWidth s are always the same. In this case call you may want to make sure that their plotWidth s are always the same. In this case call
\code plotter2->synchronizeToMaster(plotter1, true, false) \endcode of the lower plotter \c plotter2 . \code plotter2->synchronizeToMaster(plotter1, sdXAxis, true) \endcode of the lower plotter \c plotter2 .
Now whenever the size of plotter1 changes, also plotter2 is redrawn with the changed Now whenever the size of plotter1 changes, also plotter2 is redrawn with the changed
borders. borders.
\image html jkqtbaseplotter_synchronization.png "Different Synchronization Settings for synchronizeDirection=sdXAxis"
\param master the plotter widget to synchronize to \param master the plotter widget to synchronize to
\param synchronizeWidth do you want the plot width to be synchronized? \param synchronizeDirection direction in which to synchronize
\param synchronizeHeight do you want the plot height to be synchronized? \param synchronizeAxisLength do you want the axis length to be synchronized?
\param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave \param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave
\param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master \param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master
\see synchronizeXToMaster(), synchronizeYToMaster(), resetMasterSynchronization(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/
void synchronizeToMaster(JKQTPlotter* master, JKQTBasePlotter::SynchronizationDirection synchronizeDirection, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true);
/*! \brief synchronize the plot x-axis width (and x-zooming) with a given master plotter (master --> slave/this)
\param master the plotter widget to synchronize to
\param synchronizeAxisLength do you want the axis length to be synchronized?
\param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave
\param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master
\image html jkqtbaseplotter_synchronization.png "Different Synchronization Settings for synchronizeDirection=sdXAxis"
\note This is a short-cut to synchronizeToMaster() with \c synchronizeDirection=csXAxis
\see synchronizeToMaster(), synchronizeYToMaster(), resetMasterSynchronization(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/
void synchronizeXToMaster(JKQTPlotter* master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true);
/*! \brief synchronize the plot y-axis height (and y-zooming) with a given master plotter (master --> slave/this)
\param master the plotter widget to synchronize to
\param synchronizeAxisLength do you want the axis length to be synchronized?
\param synchronizeZoomingMasterToSlave if set, also zooming in the master leads to a modification of the linked axes in the slave
\param synchronizeZoomingSlaveToMaster if set, also zooming in the slave leads to a modification of the linked axes in the master
\note This function internally calls JKQTBasePlotter::synchronizeToMaster() \note This function internally calls JKQTBasePlotter::synchronizeToMaster()
\see synchronizeToMaster(), resetMasterSynchronization(), \ref JKQTPLOTTER_SYNCMULTIPLOT \note This is a short-cut to synchronizeToMaster() with \c synchronizeDirection=csXAxis
*/ \see synchronizeToMaster(), synchronizeXToMaster(), resetMasterSynchronization(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
void synchronizeToMaster(JKQTBasePlotter* master, bool synchronizeWidth, bool synchronizeHeight, bool synchronizeZoomingMasterToSlave=false, bool synchronizeZoomingSlaveToMaster=false);
*/
void synchronizeYToMaster(JKQTPlotter* master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true);
/** \brief switches any synchronization off, that has been created by synchronizeToMaster() /** \brief switches any synchronization off, that has been created by synchronizeToMaster()
* *
* \note This function internally calls JKQTBasePlotter::resetMasterSynchronization() * \note This function internally calls JKQTBasePlotter::synchronizeToMaster()
* \see synchronizeToMaster(), resetMasterSynchronization(), \ref JKQTPLOTTER_SYNCMULTIPLOT \see synchronizeToMaster(), synchronizeXToMaster(), resetMasterSynchronization(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void resetMasterSynchronization(); void resetMasterSynchronization(JKQTBasePlotter::SynchronizationDirection synchronizeDirection=JKQTBasePlotter::sdXYAxes);
/*! \brief enables grid-printing for this plot /*! \brief enables grid-printing for this plot
* *
* \note This function call forwards to JKQTBasePlotter::setGridPrinting() * \note This function call forwards to JKQTBasePlotter::setGridPrinting()
* \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), \ref JKQTPLOTTER_SYNCMULTIPLOT * \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void setGridPrinting(bool enabled); void setGridPrinting(bool enabled);
/** \brief add a new plotter \a plotterOther for grid printing mode, at location \a x / \a y /** \brief add a new plotter \a plotterOther for grid printing mode, at location \a x / \a y
* *
* \note This function call forwards to JKQTBasePlotter::addGridPrintingPlotter() * \note This function call forwards to JKQTBasePlotter::addGridPrintingPlotter()
* \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), \ref JKQTPLOTTER_SYNCMULTIPLOT * \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void addGridPrintingPlotter(size_t x, size_t y, JKQTPlotter* plotterOther) ; void addGridPrintingPlotter(size_t x, size_t y, JKQTPlotter* plotterOther) ;
/** \brief clear all additional plotters for grid printing mode /** \brief clear all additional plotters for grid printing mode
* *
* \note This function call forwards to JKQTBasePlotter::clearGridPrintingPlotters() * \note This function call forwards to JKQTBasePlotter::clearGridPrintingPlotters()
* \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), \ref JKQTPLOTTER_SYNCMULTIPLOT * \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void clearGridPrintingPlotters() ; void clearGridPrintingPlotters() ;
/** \brief set the x-position of this JKQTPlotter in the grid-printing grid /** \brief set the x-position of this JKQTPlotter in the grid-printing grid
* *
* \note This function call forwards to JKQTBasePlotter::setGridPrintingCurrentX() * \note This function call forwards to JKQTBasePlotter::setGridPrintingCurrentX()
* \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), setGridPrintingCurrentY(), \ref JKQTPLOTTER_SYNCMULTIPLOT * \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), setGridPrintingCurrentY(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void setGridPrintingCurrentX(size_t x); void setGridPrintingCurrentX(size_t x);
/** \brief set the y-position of this JKQTPlotter in the grid-printing grid /** \brief set the y-position of this JKQTPlotter in the grid-printing grid
* *
* \note This function call forwards to JKQTBasePlotter::setGridPrintingCurrentY() * \note This function call forwards to JKQTBasePlotter::setGridPrintingCurrentY()
* \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), setGridPrintingCurrentX(), \ref JKQTPLOTTER_SYNCMULTIPLOT * \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentPos(), setGridPrintingCurrentX(), \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void setGridPrintingCurrentY(size_t y); void setGridPrintingCurrentY(size_t y);
/** \brief set the x- and y-positions of this JKQTPlotter in the grid-printing grid /** \brief set the x- and y-positions of this JKQTPlotter in the grid-printing grid
* *
* \note This function call forwards to JKQTBasePlotter::setGridPrintingCurrentPos() * \note This function call forwards to JKQTBasePlotter::setGridPrintingCurrentPos()
* \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentX(), setGridPrintingCurrentY() \ref JKQTPLOTTER_SYNCMULTIPLOT * \see setGridPrinting(), addGridPrintingPlotter(), clearGridPrintingPlotters(), setGridPrintingCurrentX(), setGridPrintingCurrentY() \ref JKQTBASEPLOTTER_SYNCMULTIPLOT
*/ */
void setGridPrintingCurrentPos(size_t x, size_t y); void setGridPrintingCurrentPos(size_t x, size_t y);
@ -603,7 +596,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/** \brief returns the coordinate axis object for the y-axis as a const pointer */ /** \brief returns the coordinate axis object for the y-axis as a const pointer */
inline const JKQTPVerticalAxis* getYAxis() const { return plotter->getYAxis(); } inline const JKQTPVerticalAxis* getYAxis() const { return plotter->getYAxis(); }
/** \brief returns description of i'th graph */ /** \brief returns the \a i -th graph (of type JKQTPPlotElement) in this plotter instance */
inline JKQTPPlotElement* getGraph(size_t i) { return plotter->getGraph(i); } inline JKQTPPlotElement* getGraph(size_t i) { return plotter->getGraph(i); }
/** \brief returns the number of graphs */ /** \brief returns the number of graphs */
@ -624,13 +617,26 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
*/ */
inline void clearGraphs(bool deleteGraphs=true) { plotter->clearGraphs(deleteGraphs); } inline void clearGraphs(bool deleteGraphs=true) { plotter->clearGraphs(deleteGraphs); }
/** \brief add a new graph, returns it's position in the graphs list */ /** \brief add a new graph, returns it's position in the graphs list
*
* \param gr graph object (of type JKQTPPlotElement) to be added. \b Note: The JKQTPlotter takes ownership of graph \a gr .
* \return ID of the added graph object \a gr in the internal list of graphs
*
*/
inline size_t addGraph(JKQTPPlotElement* gr) { return plotter->addGraph(gr); } inline size_t addGraph(JKQTPPlotElement* gr) { return plotter->addGraph(gr); }
/** \brief move the given graph to the top, or add it, if it is not yet contained */ /** \brief move the given graph to the top, or add it, if it is not yet contained
*
* \param gr graph object (of type JKQTPPlotElement) to be moved (needs to be containing to the JKQTPlotter already!)
* \return ID of the added graph object \a gr in the internal list of graphs
*/
inline size_t moveGraphTop(JKQTPPlotElement* gr) { return plotter->moveGraphTop(gr); } inline size_t moveGraphTop(JKQTPPlotElement* gr) { return plotter->moveGraphTop(gr); }
/** \brief move the given graph to the top, or add it, if it is not yet contained */ /** \brief move the given graph to the top, or add it, if it is not yet contained
*
* \param gr graph object (of type JKQTPPlotElement) to be moved (needs to be containing to the JKQTPlotter already!)
* \return ID of the added graph object \a gr in the internal list of graphs
*/
inline size_t moveGraphBottom(JKQTPPlotElement* gr) { return plotter->moveGraphBottom(gr); } inline size_t moveGraphBottom(JKQTPPlotElement* gr) { return plotter->moveGraphBottom(gr); }
/** \brief add a new graphs from a QVector<JKQTPPlotElement*>, QList<JKQTPPlotElement*>, std::vector<JKQTPPlotElement*> ... or any standard-iterateable container with JKQTPPlotElement*-items */ /** \brief add a new graphs from a QVector<JKQTPPlotElement*>, QList<JKQTPPlotElement*>, std::vector<JKQTPPlotElement*> ... or any standard-iterateable container with JKQTPPlotElement*-items */
@ -791,11 +797,11 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/** \brief sets the mode if the standard context menu \see ContextMenuModes, \ref JKQTPLOTTER_USERMOUSEINTERACTION */ /** \brief sets the mode if the standard context menu \see ContextMenuModes, \ref JKQTPLOTTER_USERMOUSEINTERACTION */
void setContextMenuMode(ContextMenuModes mode); void setContextMenuMode(ContextMenuModes mode);
/** \brief may be connected to zoomChangedLocally() of a different plot and synchronizes the local x-axis to the other x-axis \see \ref JKQTPLOTTER_SYNCMULTIPLOT */ /** \brief may be connected to zoomChangedLocally() of a different plot and synchronizes the local x-axis to the other x-axis \see \ref JKQTBASEPLOTTER_SYNCMULTIPLOT */
void synchronizeXAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter* sender); void synchronizeXAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter* sender);
/** \brief may be connected to zoomChangedLocally() of a different plot and synchronizes the local y-axis to the other y-axis \see \ref JKQTPLOTTER_SYNCMULTIPLOT */ /** \brief may be connected to zoomChangedLocally() of a different plot and synchronizes the local y-axis to the other y-axis \see \ref JKQTBASEPLOTTER_SYNCMULTIPLOT */
void synchronizeYAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter* sender); void synchronizeYAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter* sender);
/** \brief may be connected to zoomChangedLocally() of a different plot and synchronizes the local x- and y-axis to the other x- and y-axis \see \ref JKQTPLOTTER_SYNCMULTIPLOT */ /** \brief may be connected to zoomChangedLocally() of a different plot and synchronizes the local x- and y-axis to the other x- and y-axis \see \ref JKQTBASEPLOTTER_SYNCMULTIPLOT */
void synchronizeXYAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter* sender); void synchronizeXYAxis(double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter* sender);
@ -965,7 +971,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/** \brief ties a MouseActionMode to a mouse-button and a keyboard-modifier /** \brief ties a MouseActionMode to a mouse-button and a keyboard-modifier
* \internal * \internal
*/ */
struct LIB_EXPORT MouseDragAction { struct JKQTP_LIB_EXPORT MouseDragAction {
/** \brief constructs an invalid object */ /** \brief constructs an invalid object */
MouseDragAction(); MouseDragAction();
MouseDragAction(Qt::MouseButton _mouseButton, Qt::KeyboardModifier _modifier, MouseDragActions _mode); MouseDragAction(Qt::MouseButton _mouseButton, Qt::KeyboardModifier _modifier, MouseDragActions _mode);
@ -1182,8 +1188,10 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/*! \brief default value for property property mousePositionTemplate. \see mousePositionTemplate for more information */ /*! \brief default value for property property mousePositionTemplate. \see mousePositionTemplate for more information */
QString default_mousePositionTemplate; QString default_mousePositionTemplate;
/** \brief the master plotter, this plotter is connected to. */ /** \brief the master plotter, this plotter is connected to in x-direction. */
QPointer<JKQTPlotter> masterPlotter; QPointer<JKQTPlotter> masterPlotterX;
/** \brief the master plotter, this plotter is connected to in y-direction. */
QPointer<JKQTPlotter> masterPlotterY;
/** \brief calculate the y-axis shift of the plot, so there is space for the potentially displayed mouse position label */ /** \brief calculate the y-axis shift of the plot, so there is space for the potentially displayed mouse position label */
int getPlotYOffset(); int getPlotYOffset();

View File

@ -19,10 +19,6 @@
/** \file jkqtpcomboboxes.cpp
* \ingroup jkqtpcomboboxes
*/
#include "jkqtplottergui/jkqtpcomboboxes.h" #include "jkqtplottergui/jkqtpcomboboxes.h"
#include "jkqtplotter/jkqtpbaseplotter.h" #include "jkqtplotter/jkqtpbaseplotter.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"

View File

@ -19,10 +19,6 @@
/** \file jkqtpcomboboxes.h
* \ingroup jkqtpcomboboxes
*/
#ifndef JKQTPCOMBOBOXES_H #ifndef JKQTPCOMBOBOXES_H
#define JKQTPCOMBOBOXES_H #define JKQTPCOMBOBOXES_H
@ -40,7 +36,7 @@
\image html JKQTPMathImageColorPaletteComboBox.png \image html JKQTPMathImageColorPaletteComboBox.png
*/ */
class LIB_EXPORT JKQTPMathImageColorPaletteComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPMathImageColorPaletteComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPMathImageColorPaletteComboBox(QWidget* parent=nullptr); JKQTPMathImageColorPaletteComboBox(QWidget* parent=nullptr);
@ -61,7 +57,7 @@ class LIB_EXPORT JKQTPMathImageColorPaletteComboBox: public QComboBox {
/*! \brief a QComboBox which shows JKQTPCADrawMode /*! \brief a QComboBox which shows JKQTPCADrawMode
\ingroup jkqtpcomboboxes \ingroup jkqtpcomboboxes
*/ */
class LIB_EXPORT JKQTPCADrawModeComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPCADrawModeComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPCADrawModeComboBox(QWidget* parent=nullptr); JKQTPCADrawModeComboBox(QWidget* parent=nullptr);
@ -77,7 +73,7 @@ class LIB_EXPORT JKQTPCADrawModeComboBox: public QComboBox {
/*! \brief a QComboBox which shows JKQTPCALabelType /*! \brief a QComboBox which shows JKQTPCALabelType
\ingroup jkqtpcomboboxes \ingroup jkqtpcomboboxes
*/ */
class LIB_EXPORT JKQTPCALabelTypeComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPCALabelTypeComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPCALabelTypeComboBox(QWidget* parent=nullptr); JKQTPCALabelTypeComboBox(QWidget* parent=nullptr);
@ -92,7 +88,7 @@ class LIB_EXPORT JKQTPCALabelTypeComboBox: public QComboBox {
/*! \brief a QComboBox which shows JKQTPLabelPosition /*! \brief a QComboBox which shows JKQTPLabelPosition
\ingroup jkqtpcomboboxes \ingroup jkqtpcomboboxes
*/ */
class LIB_EXPORT JKQTPLabelPositionComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPLabelPositionComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPLabelPositionComboBox(QWidget* parent=nullptr); JKQTPLabelPositionComboBox(QWidget* parent=nullptr);
@ -110,7 +106,7 @@ class LIB_EXPORT JKQTPLabelPositionComboBox: public QComboBox {
\image html JKQTPKeyPositionComboBox.png \image html JKQTPKeyPositionComboBox.png
*/ */
class LIB_EXPORT JKQTPKeyPositionComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPKeyPositionComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPKeyPositionComboBox(QWidget* parent=nullptr); JKQTPKeyPositionComboBox(QWidget* parent=nullptr);
@ -132,7 +128,7 @@ class LIB_EXPORT JKQTPKeyPositionComboBox: public QComboBox {
\image html JKQTPKeyLayoutComboBox.png \image html JKQTPKeyLayoutComboBox.png
*/ */
class LIB_EXPORT JKQTPKeyLayoutComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPKeyLayoutComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPKeyLayoutComboBox(QWidget* parent=nullptr); JKQTPKeyLayoutComboBox(QWidget* parent=nullptr);
@ -153,7 +149,7 @@ class LIB_EXPORT JKQTPKeyLayoutComboBox: public QComboBox {
\image html JKQTPErrorPlotstyleComboBox.png \image html JKQTPErrorPlotstyleComboBox.png
*/ */
class LIB_EXPORT JKQTPErrorPlotstyleComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPErrorPlotstyleComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPErrorPlotstyleComboBox(QWidget* parent=nullptr); JKQTPErrorPlotstyleComboBox(QWidget* parent=nullptr);
@ -172,7 +168,7 @@ class LIB_EXPORT JKQTPErrorPlotstyleComboBox: public QComboBox {
\image html JKQTPSymbolComboBox.png \image html JKQTPSymbolComboBox.png
*/ */
class LIB_EXPORT JKQTPSymbolComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPSymbolComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPSymbolComboBox(QWidget* parent=nullptr); JKQTPSymbolComboBox(QWidget* parent=nullptr);
@ -188,7 +184,7 @@ class LIB_EXPORT JKQTPSymbolComboBox: public QComboBox {
/*! \brief a QComboBox to select whether a line, symbols or both should be displayed /*! \brief a QComboBox to select whether a line, symbols or both should be displayed
\ingroup jkqtpcomboboxes \ingroup jkqtpcomboboxes
*/ */
class LIB_EXPORT JKQTPLinePlotStyleComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPLinePlotStyleComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPLinePlotStyleComboBox(QWidget* parent=nullptr); JKQTPLinePlotStyleComboBox(QWidget* parent=nullptr);
@ -209,7 +205,7 @@ class LIB_EXPORT JKQTPLinePlotStyleComboBox: public QComboBox {
/*! \brief a QComboBox to select whether a line, symbols or both should be displayed, in addition to JKQTPLinePlotStyleComboBox this may also have different symbol sizes! /*! \brief a QComboBox to select whether a line, symbols or both should be displayed, in addition to JKQTPLinePlotStyleComboBox this may also have different symbol sizes!
\ingroup jkqtpcomboboxes \ingroup jkqtpcomboboxes
*/ */
class LIB_EXPORT JKQTPLinePlotStyleWithSymbolSizeComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPLinePlotStyleWithSymbolSizeComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPLinePlotStyleWithSymbolSizeComboBox(QWidget* parent=nullptr); JKQTPLinePlotStyleWithSymbolSizeComboBox(QWidget* parent=nullptr);
@ -241,7 +237,7 @@ class LIB_EXPORT JKQTPLinePlotStyleWithSymbolSizeComboBox: public QComboBox {
\see JKQTPStepType \see JKQTPStepType
*/ */
class LIB_EXPORT JKQTPStepTypeComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPStepTypeComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPStepTypeComboBox(QWidget* parent=nullptr); JKQTPStepTypeComboBox(QWidget* parent=nullptr);
@ -259,7 +255,7 @@ class LIB_EXPORT JKQTPStepTypeComboBox: public QComboBox {
\see JKQTPMathImageBase::ModifierMode \see JKQTPMathImageBase::ModifierMode
*/ */
class LIB_EXPORT JKQTPImageModifierModeComboBox: public QComboBox { class JKQTP_LIB_EXPORT JKQTPImageModifierModeComboBox: public QComboBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPImageModifierModeComboBox(QWidget* parent=nullptr); JKQTPImageModifierModeComboBox(QWidget* parent=nullptr);

View File

@ -21,12 +21,6 @@ Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
/** \file jkqtpenhancedspinboxes.cpp
* \ingroup jkqtptools
*/
#include "jkqtplottergui/jkqtpenhancedspinboxes.h" #include "jkqtplottergui/jkqtpenhancedspinboxes.h"

View File

@ -18,11 +18,6 @@
*/ */
/** \file jkqtpenhancedspinboxes.h
* \ingroup jkqtptools_qtwidgets
*/
#ifndef jkqtpenhancedspinboxes_H_INCLUDED #ifndef jkqtpenhancedspinboxes_H_INCLUDED
#define jkqtpenhancedspinboxes_H_INCLUDED #define jkqtpenhancedspinboxes_H_INCLUDED
#include "jkqtplottertools/jkqtp_imexport.h" #include "jkqtplottertools/jkqtp_imexport.h"
@ -35,7 +30,7 @@
This class adds an event editingFinished() to QDoubleSpinBox. This class adds an event editingFinished() to QDoubleSpinBox.
*/ */
class LIB_EXPORT JKQTPEnhancedDoubleSpinBox : public QDoubleSpinBox { class JKQTP_LIB_EXPORT JKQTPEnhancedDoubleSpinBox : public QDoubleSpinBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPEnhancedDoubleSpinBox(QWidget* parent=nullptr); JKQTPEnhancedDoubleSpinBox(QWidget* parent=nullptr);
@ -53,7 +48,7 @@ class LIB_EXPORT JKQTPEnhancedDoubleSpinBox : public QDoubleSpinBox {
This class adds an event editingFinished() to QDoubleSpinBox. This class adds an event editingFinished() to QDoubleSpinBox.
*/ */
class LIB_EXPORT JKQTPEnhancedSpinBox : public QSpinBox { class JKQTP_LIB_EXPORT JKQTPEnhancedSpinBox : public QSpinBox {
Q_OBJECT Q_OBJECT
public: public:
JKQTPEnhancedSpinBox(QWidget* parent=nullptr); JKQTPEnhancedSpinBox(QWidget* parent=nullptr);

View File

@ -22,11 +22,6 @@ Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
/** \file JKQTPEnhancedTableView.cpp
* \ingroup jkqtptools
*/
#include "jkqtplottergui/jkqtpenhancedtableview.h" #include "jkqtplottergui/jkqtpenhancedtableview.h"
#include <QAction> #include <QAction>
#include <QApplication> #include <QApplication>

View File

@ -18,11 +18,6 @@
*/ */
/** \file jkqtpenhancedtableview.h
* \ingroup jkqtptools_qtwidgets
*/
#ifndef JKQTPEnhancedTableView_H_INCLUDED #ifndef JKQTPEnhancedTableView_H_INCLUDED
#define JKQTPEnhancedTableView_H_INCLUDED #define JKQTPEnhancedTableView_H_INCLUDED
#include "jkqtplottertools/jkqtp_imexport.h" #include "jkqtplottertools/jkqtp_imexport.h"
@ -43,7 +38,7 @@
\image html JKQTPEnhancedTableView.png \image html JKQTPEnhancedTableView.png
*/ */
class LIB_EXPORT JKQTPEnhancedTableView : public QTableView { class JKQTP_LIB_EXPORT JKQTPEnhancedTableView : public QTableView {
Q_OBJECT Q_OBJECT
public: public:
JKQTPEnhancedTableView(QWidget* parent=nullptr); JKQTPEnhancedTableView(QWidget* parent=nullptr);

View File

@ -19,10 +19,6 @@
/** \file jkqtpgraphsmodel.cpp
* \ingroup jkqtpgraphsmodel
*/
#include "jkqtplottergui/jkqtpgraphsmodel.h" #include "jkqtplottergui/jkqtpgraphsmodel.h"
#include "jkqtplotter/jkqtpbaseplotter.h" #include "jkqtplotter/jkqtpbaseplotter.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
@ -52,7 +48,7 @@ QVariant JKQTPGraphsModel::data(const QModelIndex &index, int role) const
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
if (index.row()<static_cast<int>(m_plotter->getGraphCount())) return m_plotter->getGraph(static_cast<size_t>(index.row()))->getTitle(); if (index.row()<static_cast<int>(m_plotter->getGraphCount())) return m_plotter->getGraph(static_cast<size_t>(index.row()))->getTitle();
} else if (role == Qt::CheckStateRole) { } else if (role == Qt::CheckStateRole) {
if (index.row()<static_cast<int>(m_plotter->getGraphCount())) return m_plotter->getGraph(static_cast<size_t>(index.row()))->getVisible()?Qt::Checked:Qt::Unchecked; if (index.row()<static_cast<int>(m_plotter->getGraphCount())) return m_plotter->getGraph(static_cast<size_t>(index.row()))->isVisible()?Qt::Checked:Qt::Unchecked;
} else if (role == Qt::DecorationRole) { } else if (role == Qt::DecorationRole) {
if (index.row()<static_cast<int>(m_plotter->getGraphCount())) { if (index.row()<static_cast<int>(m_plotter->getGraphCount())) {
return m_plotter->getGraph(static_cast<size_t>(index.row()))->generateKeyMarker(QSize(16,16)); return m_plotter->getGraph(static_cast<size_t>(index.row()))->generateKeyMarker(QSize(16,16));

View File

@ -19,10 +19,6 @@
/** \file jkqtpgraphsmodel.h
* \ingroup jkqtpgraphsmodel
*/
#ifndef jkqtpgraphsmodel_H #ifndef jkqtpgraphsmodel_H
#define jkqtpgraphsmodel_H #define jkqtpgraphsmodel_H

View File

@ -19,10 +19,6 @@
/** \file jkvanishqtoolbar.cpp
* \ingroup jkqtptools_qtwidgets
*/
#include "jkqtplottergui/jkvanishqtoolbar.h" #include "jkqtplottergui/jkvanishqtoolbar.h"
JKVanishQToolBar::JKVanishQToolBar(const QString &title, QWidget *parent): QToolBar(title, parent) { JKVanishQToolBar::JKVanishQToolBar(const QString &title, QWidget *parent): QToolBar(title, parent) {

View File

@ -19,23 +19,19 @@
/** \file jkvanishqtoolbar.h
* \ingroup jkqtptools_qtwidgets
*/
#ifndef jkvanishqtoolbar_H #ifndef jkvanishqtoolbar_H
#define jkvanishqtoolbar_H #define jkvanishqtoolbar_H
#include "jkqtplottertools/jkqtp_imexport.h" #include "jkqtplottertools/jkqtp_imexport.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#include <QToolBar> #include <QToolBar>
/** \brief a modified <a href="http://doc.trolltech.com/4.5/qtoolbar.html">QToolBar</a> which vanishes when the mouse leaves the toolbar. /** \brief a modified <a href="http://doc.qt.io/qt-5/qtoolbar.html">QToolBar</a> which vanishes when the mouse leaves the toolbar.
* \ingroup jkqtptools_qtwidgets * \ingroup jkqtptools_qtwidgets
* *
* \image html jkqtplotter_toolbar_hidden.png "Hidden Toolbar" * \image html jkqtplotter_toolbar_hidden.png "Hidden Toolbar"
* \image html jkqtplotter_toolbar_shown.png "Shown Toolbar" * \image html jkqtplotter_toolbar_shown.png "Shown Toolbar"
*/ */
class LIB_EXPORT JKVanishQToolBar: public QToolBar { class JKQTP_LIB_EXPORT JKVanishQToolBar: public QToolBar {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */

View File

@ -32,15 +32,15 @@
\code \code
#include "jkqtplottertools/jkqtp_imexport.h" #include "jkqtplottertools/jkqtp_imexport.h"
class LIB_EXPORT exportedClassName { class JKQTP_LIB_EXPORT exportedClassName {
... ...
}; };
LIB_EXPORT void exportedFunctionName(); JKQTP_LIB_EXPORT void exportedFunctionName();
\endcode \endcode
Then when compiling define the preprocessor symbol \c LIB_IN_DLL when exporting AND using the classes/functions. Then when compiling define the preprocessor symbol \c JKQTP_LIB_IN_DLL when exporting AND using the classes/functions.
When compiling the classes for export, also define the preprocessor symbol \c LIB_EXPORT_LIBRARY . When compiling the classes for export, also define the preprocessor symbol \c JKQTP_LIB_EXPORT_LIBRARY .
*/ */
@ -52,17 +52,17 @@
# endif # endif
#ifdef __WINDOWS__ #ifdef __WINDOWS__
# ifdef LIB_IN_DLL # ifdef JKQTP_LIB_IN_DLL
# if defined(LIB_EXPORT_LIBRARY) # if defined(JKQTP_LIB_EXPORT_LIBRARY)
# define LIB_EXPORT __declspec(dllexport) # define JKQTP_LIB_EXPORT __declspec(dllexport)
# else # else
# define LIB_EXPORT __declspec(dllimport) # define JKQTP_LIB_EXPORT __declspec(dllimport)
# endif # endif
# else # else
# define LIB_EXPORT # define JKQTP_LIB_EXPORT
# endif # endif
#else #else
# define LIB_EXPORT # define JKQTP_LIB_EXPORT
#endif #endif

View File

@ -23,10 +23,6 @@ Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
/** \file jkqtpdrawingtools.cpp
* \ingroup jkqtptools
*/
#include "jkqtplottertools/jkqtpdrawingtools.h" #include "jkqtplottertools/jkqtpdrawingtools.h"
#include "jkqtplottertools/jkqtpenhancedpainter.h" #include "jkqtplottertools/jkqtpenhancedpainter.h"

View File

@ -18,11 +18,6 @@
*/ */
/** \file jkqtpdrawingtools.h
* \ingroup jkqtptools_drawing
*/
#ifndef JKQTPDRAWINGTOOLS_H_INCLUDED #ifndef JKQTPDRAWINGTOOLS_H_INCLUDED
#define JKQTPDRAWINGTOOLS_H_INCLUDED #define JKQTPDRAWINGTOOLS_H_INCLUDED
#include "jkqtplottertools/jkqtp_imexport.h" #include "jkqtplottertools/jkqtp_imexport.h"
@ -43,7 +38,7 @@ class JKQTPEnhancedPainter; // forward
\param color color of the symbol lines \param color color of the symbol lines
\param fillColor color of the symbol filling \param fillColor color of the symbol filling
*/ */
LIB_EXPORT void JKQTPPlotSymbol(JKQTPEnhancedPainter& painter, double x, double y, JKQTPGraphSymbols symbol, double size, double symbolLineWidth, QColor color, QColor fillColor); JKQTP_LIB_EXPORT void JKQTPPlotSymbol(JKQTPEnhancedPainter& painter, double x, double y, JKQTPGraphSymbols symbol, double size, double symbolLineWidth, QColor color, QColor fillColor);
/*! \brief plot the specified symbol at pixel position x,y /*! \brief plot the specified symbol at pixel position x,y
\ingroup jkqtptools_drawing \ingroup jkqtptools_drawing
@ -57,7 +52,7 @@ LIB_EXPORT void JKQTPPlotSymbol(JKQTPEnhancedPainter& painter, double x, double
\param color color of the symbol lines \param color color of the symbol lines
\param fillColor color of the symbol filling \param fillColor color of the symbol filling
*/ */
LIB_EXPORT void JKQTPPlotSymbol(QPaintDevice& paintDevice, double x, double y, JKQTPGraphSymbols symbol, double size, double symbolLineWidth, QColor color, QColor fillColor); JKQTP_LIB_EXPORT void JKQTPPlotSymbol(QPaintDevice& paintDevice, double x, double y, JKQTPGraphSymbols symbol, double size, double symbolLineWidth, QColor color, QColor fillColor);
/*! \brief plot an arrow between positions (x1,y1) and (x2,y2) /*! \brief plot an arrow between positions (x1,y1) and (x2,y2)
@ -74,7 +69,7 @@ LIB_EXPORT void JKQTPPlotSymbol(QPaintDevice& paintDevice, double x, double y, J
\param color color of the symbol lines \param color color of the symbol lines
\param fillColor color of the symbol filling \param fillColor color of the symbol filling
*/ */
//LIB_EXPORT void JKQTPPlotArrow(JKQTPEnhancedPainter& painter, int x, int y, JKQTPGraphSymbols symbol, double size, double symbolLineWidth, QColor color, QColor fillColor); //JKQTP_LIB_EXPORT void JKQTPPlotArrow(JKQTPEnhancedPainter& painter, int x, int y, JKQTPGraphSymbols symbol, double size, double symbolLineWidth, QColor color, QColor fillColor);
/*! \brief draw an ellipse without setting pen or brush, or saving the painter! /*! \brief draw an ellipse without setting pen or brush, or saving the painter!
@ -94,7 +89,7 @@ LIB_EXPORT void JKQTPPlotSymbol(QPaintDevice& paintDevice, double x, double y, J
\note all angles are given in degrees [0..360] \note all angles are given in degrees [0..360]
*/ */
LIB_EXPORT QVector<QPointF> JKQTPDrawEllipse(double x, double y, double a, double b, double angle_start=0, double angle_end=360, double alpha=0, int controlPoints=180, QPointF* x_start=nullptr, QPointF* x_end=nullptr); JKQTP_LIB_EXPORT QVector<QPointF> JKQTPDrawEllipse(double x, double y, double a, double b, double angle_start=0, double angle_end=360, double alpha=0, int controlPoints=180, QPointF* x_start=nullptr, QPointF* x_end=nullptr);
#endif // JKQTPDRAWINGTOOLS_H_INCLUDED #endif // JKQTPDRAWINGTOOLS_H_INCLUDED

View File

@ -22,11 +22,6 @@ Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
/** \file jkqtptools.cpp
* \ingroup jkqtptools
*/
#include "jkqtplottertools/jkqtpenhancedpainter.h" #include "jkqtplottertools/jkqtpenhancedpainter.h"

View File

@ -17,10 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** \file jkqtpenhancedpainter.h
* \ingroup jkqtptools_drawing
*/
#ifndef JKQTPENHANCED_PAINTERS_H #ifndef JKQTPENHANCED_PAINTERS_H
#define JKQTPENHANCED_PAINTERS_H #define JKQTPENHANCED_PAINTERS_H
@ -34,7 +30,7 @@
*/ */
class LIB_EXPORT JKQTPEnhancedPainter : public QPainter { class JKQTP_LIB_EXPORT JKQTPEnhancedPainter : public QPainter {
Q_GADGET Q_GADGET
public: public:
JKQTPEnhancedPainter(QPaintDevice* device); JKQTPEnhancedPainter(QPaintDevice* device);

View File

@ -19,10 +19,6 @@
/** \file jkqtphighrestimer.h
* \ingroup jkqtptools_debugging
*/
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
#include <iostream> #include <iostream>

View File

@ -540,7 +540,7 @@ inline QList<T> JKQTPImagePlot_makeQList(const T& defaultVal, int N=1) {
\a lut needs to have \c lut_size) entries \a lut needs to have \c lut_size) entries
*/ */
void LIB_EXPORT JKQTPImagePlot_buildDefinedPaletteLinInterpolate(int* lut, QList<QPair<double, QRgb> > items, int lut_size=JKQTPImagePlot_LUTSIZE); void JKQTP_LIB_EXPORT JKQTPImagePlot_buildDefinedPaletteLinInterpolate(int* lut, QList<QPair<double, QRgb> > items, int lut_size=JKQTPImagePlot_LUTSIZE);
/*! \brief build a linearly interpolated palette in \a lut with \a N entries that are provided as (double, QRgb) value pairss in the variable arguments /*! \brief build a linearly interpolated palette in \a lut with \a N entries that are provided as (double, QRgb) value pairss in the variable arguments
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
@ -550,7 +550,7 @@ void LIB_EXPORT JKQTPImagePlot_buildDefinedPaletteLinInterpolate(int* lut, QList
\a lut needs to have \c lut_size) entries \a lut needs to have \c lut_size) entries
*/ */
void LIB_EXPORT JKQTPImagePlot_buildDefinedPaletteLinInterpolate(int* lut, int N, ...); void JKQTP_LIB_EXPORT JKQTPImagePlot_buildDefinedPaletteLinInterpolate(int* lut, int N, ...);
/*! \brief build a palette in \a lut with \a N entries that are provided in \a items /*! \brief build a palette in \a lut with \a N entries that are provided in \a items
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
@ -560,16 +560,16 @@ void LIB_EXPORT JKQTPImagePlot_buildDefinedPaletteLinInterpolate(int* lut, int N
\a lut needs to have \c JKQTPImagePlot_LUTSIZE) entries \a lut needs to have \c JKQTPImagePlot_LUTSIZE) entries
*/ */
void LIB_EXPORT JKQTPImagePlot_buildDefinedPalette(int* lut, QList<QPair<double, QRgb> > items); void JKQTP_LIB_EXPORT JKQTPImagePlot_buildDefinedPalette(int* lut, QList<QPair<double, QRgb> > items);
/*! \brief build a palette in \a lut with \a N entries that are provided as as (double, QRgb) value pairss in the variable arguments /*! \brief build a palette in \a lut with \a N entries that are provided as as (double, QRgb) value pairss in the variable arguments
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
*/ */
void LIB_EXPORT JKQTPImagePlot_buildDefinedPalette(int* lut, int N, ...); void JKQTP_LIB_EXPORT JKQTPImagePlot_buildDefinedPalette(int* lut, int N, ...);
/*! \brief return a list of all globally available LUTs /*! \brief return a list of all globally available LUTs
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QStringList LIB_EXPORT JKQTPImagePlot_getPredefinedPalettes(); QStringList JKQTP_LIB_EXPORT JKQTPImagePlot_getPredefinedPalettes();
@ -577,19 +577,19 @@ QStringList LIB_EXPORT JKQTPImagePlot_getPredefinedPalettes();
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
\internal \internal
*/ */
LIB_EXPORT int* JKQTPImagePlot_getCreateLUT(QList<int *> &lutstore, JKQTPMathImageColorPalette palette); JKQTP_LIB_EXPORT int* JKQTPImagePlot_getCreateLUT(QList<int *> &lutstore, JKQTPMathImageColorPalette palette);
/*! \brief frees a list of LUTs /*! \brief frees a list of LUTs
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
\internal \internal
*/ */
void LIB_EXPORT JKQTPImagePlot_freeLUTs(QList<int *> &lutstore); void JKQTP_LIB_EXPORT JKQTPImagePlot_freeLUTs(QList<int *> &lutstore);
/*! \brief internal global storage object for lookup-tables /*! \brief internal global storage object for lookup-tables
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
\internal \internal
*/ */
extern LIB_EXPORT QList<int*> global_jkqtpimagetools_lutstore; extern JKQTP_LIB_EXPORT QList<int*> global_jkqtpimagetools_lutstore;
/*! \brief convert a 2D image (as 1D array) into a QImage with given palette (see JKQTFPColorPalette) /*! \brief convert a 2D image (as 1D array) into a QImage with given palette (see JKQTFPColorPalette)
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
@ -752,31 +752,31 @@ inline void JKQTPImagePlot_array2image(const T* dbl_in, int width, int height, Q
/*! \brief generates a QImage with width \a width and height 1 for the i-th color palette (\a i is based on the list returned by JKQTPImagePlot_getPredefinedPalettes() ) /*! \brief generates a QImage with width \a width and height 1 for the i-th color palette (\a i is based on the list returned by JKQTPImagePlot_getPredefinedPalettes() )
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QImage LIB_EXPORT JKQTPMathImageGetPaletteImage(int i, int width); QImage JKQTP_LIB_EXPORT JKQTPMathImageGetPaletteImage(int i, int width);
/*! \brief generates a QImage with width \a width and height \a height for the i-th color palette (\a i is based on the list returned by JKQTPImagePlot_getPredefinedPalettes() ) /*! \brief generates a QImage with width \a width and height \a height for the i-th color palette (\a i is based on the list returned by JKQTPImagePlot_getPredefinedPalettes() )
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QImage LIB_EXPORT JKQTPMathImageGetPaletteImage(int i, int width, int height); QImage JKQTP_LIB_EXPORT JKQTPMathImageGetPaletteImage(int i, int width, int height);
/*! \brief generates a QImage with width \a width and height 1 for a specific JKQTPMathImageColorPalette /*! \brief generates a QImage with width \a width and height 1 for a specific JKQTPMathImageColorPalette
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QImage LIB_EXPORT JKQTPMathImageGetPaletteImage(JKQTPMathImageColorPalette palette, int width); QImage JKQTP_LIB_EXPORT JKQTPMathImageGetPaletteImage(JKQTPMathImageColorPalette palette, int width);
/*! \brief generates a QImage with width \a width and height \a height for a specific JKQTPMathImageColorPalette /*! \brief generates a QImage with width \a width and height \a height for a specific JKQTPMathImageColorPalette
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QImage LIB_EXPORT JKQTPMathImageGetPaletteImage(JKQTPMathImageColorPalette palette, int width, int height); QImage JKQTP_LIB_EXPORT JKQTPMathImageGetPaletteImage(JKQTPMathImageColorPalette palette, int width, int height);
/*! \brief generates a QImage with width \a width and height 1 for a lookup-table \a lut with \a lut_size entries /*! \brief generates a QImage with width \a width and height 1 for a lookup-table \a lut with \a lut_size entries
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QImage LIB_EXPORT JKQTPMathImageGetPaletteImage(int* lut, int lut_size, int width); QImage JKQTP_LIB_EXPORT JKQTPMathImageGetPaletteImage(int* lut, int lut_size, int width);
/*! \brief generates a QImage with width \a width and height \a height for a lookup-table \a lut with \a lut_size entries /*! \brief generates a QImage with width \a width and height \a height for a lookup-table \a lut with \a lut_size entries
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QImage LIB_EXPORT JKQTPMathImageGetAlphaPaletteImage(int* lut, int lut_size, int width, int height); QImage JKQTP_LIB_EXPORT JKQTPMathImageGetAlphaPaletteImage(int* lut, int lut_size, int width, int height);
/*! \brief generates a QIcon for the i-th color palette (\a i is based on the list returned by JKQTPImagePlot_getPredefinedPalettes() ) /*! \brief generates a QIcon for the i-th color palette (\a i is based on the list returned by JKQTPImagePlot_getPredefinedPalettes() )
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QIcon LIB_EXPORT JKQTPMathImageGetPaletteIcon(int i) ; QIcon JKQTP_LIB_EXPORT JKQTPMathImageGetPaletteIcon(int i) ;
/*! \brief generates a QIcon for a specific JKQTPMathImageColorPalette /*! \brief generates a QIcon for a specific JKQTPMathImageColorPalette
\ingroup jkqtplotter_imagelots_tools */ \ingroup jkqtplotter_imagelots_tools */
QIcon LIB_EXPORT JKQTPMathImageGetPaletteIcon(JKQTPMathImageColorPalette palette) ; QIcon JKQTP_LIB_EXPORT JKQTPMathImageGetPaletteIcon(JKQTPMathImageColorPalette palette) ;
@ -785,7 +785,7 @@ QIcon LIB_EXPORT JKQTPMathImageGetPaletteIcon(JKQTPMathImageColorPalette palette
/*! \brief if a class is derived from this class, it may use color bars /*! \brief if a class is derived from this class, it may use color bars
\ingroup jkqtplotter_imagelots_tools \ingroup jkqtplotter_imagelots_tools
*/ */
class LIB_EXPORT JKQTPColorPaletteTools { class JKQTP_LIB_EXPORT JKQTPColorPaletteTools {
public: public:
JKQTPColorPaletteTools(JKQTBasePlotter *parent); JKQTPColorPaletteTools(JKQTBasePlotter *parent);

View File

@ -19,10 +19,6 @@
/** \file jkqtpmathparser.cpp
* \ingroup jkmp
*/
#define COMPILING_THIS_JKMATHPARSER #define COMPILING_THIS_JKMATHPARSER
#include "jkqtplottertools/jkqtpmathparser.h" // class's header file #include "jkqtplottertools/jkqtpmathparser.h" // class's header file
#include <iostream> #include <iostream>

View File

@ -38,15 +38,11 @@
* \ingroup jkmp * \ingroup jkmp
*/ */
/** /**
* \defgroup jkmpErrorhandling error handling * \defgroup jkmpErrorhandling error handling
* \ingroup jkmp * \ingroup jkmp
*/ */
/** \file jkqtpmathparser.h
* \ingroup jkmp
*/
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
#include <string> #include <string>

View File

@ -21,12 +21,6 @@ Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
/** \file jkqtptools.cpp
* \ingroup jkqtptools
*/
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#include "jkqtplottertools/jkqtpenhancedpainter.h" #include "jkqtplottertools/jkqtpenhancedpainter.h"
#include <cmath> #include <cmath>

View File

@ -18,10 +18,6 @@
*/ */
/** \file jkqtptools.h
* \ingroup jkqtptools
*/
#ifndef JKQTPTOOLS_H_INCLUDED #ifndef JKQTPTOOLS_H_INCLUDED
#define JKQTPTOOLS_H_INCLUDED #define JKQTPTOOLS_H_INCLUDED
@ -96,21 +92,21 @@ inline bool JKQTPIsOKFloat(T v) {
/** \brief converts a QT::PenStyle into a string /** \brief converts a QT::PenStyle into a string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString jkqtp_QPenStyle2String(Qt::PenStyle style); JKQTP_LIB_EXPORT QString jkqtp_QPenStyle2String(Qt::PenStyle style);
/** \brief converts a QString into a Qt::PenStyle /** \brief converts a QString into a Qt::PenStyle
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT Qt::PenStyle jkqtp_String2QPenStyle(const QString& style); JKQTP_LIB_EXPORT Qt::PenStyle jkqtp_String2QPenStyle(const QString& style);
/** \brief converts a QT::BrushStyle into a string /** \brief converts a QT::BrushStyle into a string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString jkqtp_QBrushStyle2String(Qt::BrushStyle style); JKQTP_LIB_EXPORT QString jkqtp_QBrushStyle2String(Qt::BrushStyle style);
/** \brief converts a QString into a Qt::BrushStyle /** \brief converts a QString into a Qt::BrushStyle
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT Qt::BrushStyle jkqtp_String2QBrushStyle(const QString& style); JKQTP_LIB_EXPORT Qt::BrushStyle jkqtp_String2QBrushStyle(const QString& style);
@ -128,12 +124,12 @@ enum JKQTPCADrawMode {
/** \brief converts a JKQTPCADrawMode variable into a human-readable string /** \brief converts a JKQTPCADrawMode variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPCADrawMode2String(JKQTPCADrawMode pos); JKQTP_LIB_EXPORT QString JKQTPCADrawMode2String(JKQTPCADrawMode pos);
/** \brief converts a string into a JKQTPCADrawMode /** \brief converts a string into a JKQTPCADrawMode
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPCADrawMode String2JKQTPCADrawMode(const QString& pos); JKQTP_LIB_EXPORT JKQTPCADrawMode String2JKQTPCADrawMode(const QString& pos);
/** \brief display mode for the axis labels /** \brief display mode for the axis labels
@ -160,23 +156,23 @@ enum JKQTPLabelTickMode {
/** \brief converts a JKQTPLabelTickMode variable into a human-readable string /** \brief converts a JKQTPLabelTickMode variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPLabelTickMode2String(JKQTPLabelTickMode pos); JKQTP_LIB_EXPORT QString JKQTPLabelTickMode2String(JKQTPLabelTickMode pos);
/** \brief converts a string into a JKQTPLabelTickMode /** \brief converts a string into a JKQTPLabelTickMode
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPLabelTickMode String2JKQTPLabelTickMode(const QString& pos); JKQTP_LIB_EXPORT JKQTPLabelTickMode String2JKQTPLabelTickMode(const QString& pos);
/** \brief converts a JKQTPCALabelType variable into a human-readable string /** \brief converts a JKQTPCALabelType variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPCALabelType2String(JKQTPCALabelType pos); JKQTP_LIB_EXPORT QString JKQTPCALabelType2String(JKQTPCALabelType pos);
/** \brief converts a string into a JKQTPCALabelType /** \brief converts a string into a JKQTPCALabelType
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPCALabelType String2JKQTPCALabelType(const QString& pos); JKQTP_LIB_EXPORT JKQTPCALabelType String2JKQTPCALabelType(const QString& pos);
/** \brief position of the axis labels /** \brief position of the axis labels
* \ingroup jkqtptools * \ingroup jkqtptools
@ -191,12 +187,12 @@ enum JKQTPLabelPosition {
/** \brief converts a JKQTPLabelPosition variable into a human-readable string /** \brief converts a JKQTPLabelPosition variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPLabelPosition2String(JKQTPLabelPosition pos); JKQTP_LIB_EXPORT QString JKQTPLabelPosition2String(JKQTPLabelPosition pos);
/** \brief converts a string into a JKQTPLabelPosition /** \brief converts a string into a JKQTPLabelPosition
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPLabelPosition String2JKQTPLabelPosition(const QString& pos); JKQTP_LIB_EXPORT JKQTPLabelPosition String2JKQTPLabelPosition(const QString& pos);
/** \brief position of the key /** \brief position of the key
* \ingroup jkqtptools * \ingroup jkqtptools
@ -220,12 +216,12 @@ enum JKQTPKeyPosition {
/** \brief converts a JKQTPLabelPosition variable into a human-readable string /** \brief converts a JKQTPLabelPosition variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPKeyPosition2String(JKQTPKeyPosition pos); JKQTP_LIB_EXPORT QString JKQTPKeyPosition2String(JKQTPKeyPosition pos);
/** \brief converts a string into a JKQTPLabelPosition /** \brief converts a string into a JKQTPLabelPosition
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPKeyPosition String2JKQTPKeyPosition(const QString& pos); JKQTP_LIB_EXPORT JKQTPKeyPosition String2JKQTPKeyPosition(const QString& pos);
/** \brief layout of the key /** \brief layout of the key
* \ingroup jkqtptools * \ingroup jkqtptools
@ -240,12 +236,12 @@ enum JKQTPKeyLayout {
/** \brief converts a JKQTPKeyLayout variable into a human-readable string /** \brief converts a JKQTPKeyLayout variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPKeyLayout2String(JKQTPKeyLayout pos); JKQTP_LIB_EXPORT QString JKQTPKeyLayout2String(JKQTPKeyLayout pos);
/** \brief converts a String into a JKQTPKeyLayout /** \brief converts a String into a JKQTPKeyLayout
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPKeyLayout String2JKQTPKeyLayout(const QString& pos); JKQTP_LIB_EXPORT JKQTPKeyLayout String2JKQTPKeyLayout(const QString& pos);
@ -300,12 +296,12 @@ enum JKQTPErrorPlotstyle {
/** \brief converts a JKQTPErrorPlotstyle variable into a human-readable string /** \brief converts a JKQTPErrorPlotstyle variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPErrorPlotstyle2String(JKQTPErrorPlotstyle pos); JKQTP_LIB_EXPORT QString JKQTPErrorPlotstyle2String(JKQTPErrorPlotstyle pos);
/** \brief converts a String into a JKQTPErrorPlotstyle /** \brief converts a String into a JKQTPErrorPlotstyle
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPErrorPlotstyle String2JKQTPErrorPlotstyle(const QString& pos); JKQTP_LIB_EXPORT JKQTPErrorPlotstyle String2JKQTPErrorPlotstyle(const QString& pos);
/** \brief plot styles for a graph /** \brief plot styles for a graph
* \ingroup jkqtptools * \ingroup jkqtptools
@ -356,16 +352,16 @@ enum JKQTPGraphSymbols {
/** \brief converts a JKQTPGraphSymbols variable into a identifier string /** \brief converts a JKQTPGraphSymbols variable into a identifier string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPGraphSymbols2String(JKQTPGraphSymbols pos); JKQTP_LIB_EXPORT QString JKQTPGraphSymbols2String(JKQTPGraphSymbols pos);
/** \brief converts a JKQTPGraphSymbols variable into a human-readable string /** \brief converts a JKQTPGraphSymbols variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPGraphSymbols2NameString(JKQTPGraphSymbols pos); JKQTP_LIB_EXPORT QString JKQTPGraphSymbols2NameString(JKQTPGraphSymbols pos);
/** \brief converts a String into a JKQTPGraphSymbols /** \brief converts a String into a JKQTPGraphSymbols
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPGraphSymbols String2JKQTPGraphSymbols(const QString& pos); JKQTP_LIB_EXPORT JKQTPGraphSymbols String2JKQTPGraphSymbols(const QString& pos);
/** \brief convert a double to a string, using the loacle "C" /** \brief convert a double to a string, using the loacle "C"
@ -395,7 +391,7 @@ inline QString JKQTPDoubleToQString(double value, int prec = 10, char f = 'g', Q
/** \brief rotate a rectangle by given angle (rotates all points around the center of the rectangle and returns it as a QPolygonF) /** \brief rotate a rectangle by given angle (rotates all points around the center of the rectangle and returns it as a QPolygonF)
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QPolygonF jkqtpRotateRect(QRectF r, double angle); JKQTP_LIB_EXPORT QPolygonF jkqtpRotateRect(QRectF r, double angle);
@ -500,7 +496,7 @@ inline void jkqtpSort(T* input, T2* input2, int N, T* output=nullptr, T2* output
/** \brief RAII construct that times its lifetime, outputting properly indented qDebug()-message /** \brief RAII construct that times its lifetime, outputting properly indented qDebug()-message
* \ingroup jkqtptools_debugging * \ingroup jkqtptools_debugging
*/ */
class LIB_EXPORT JKQTPAutoOutputTimer : public QElapsedTimer class JKQTP_LIB_EXPORT JKQTPAutoOutputTimer : public QElapsedTimer
{ {
public: public:
explicit JKQTPAutoOutputTimer(const QString& message); explicit JKQTPAutoOutputTimer(const QString& message);
@ -516,61 +512,61 @@ class LIB_EXPORT JKQTPAutoOutputTimer : public QElapsedTimer
/** \brief convert a string to lower-case characters /** \brief convert a string to lower-case characters
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_tolower(const std::string& s); JKQTP_LIB_EXPORT std::string jkqtp_tolower(const std::string& s);
/** \brief convert a string to a boolean /** \brief convert a string to a boolean
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT bool jkqtp_strtobool(const std::string& data); JKQTP_LIB_EXPORT bool jkqtp_strtobool(const std::string& data);
/** \brief convert a string to upper-case /** \brief convert a string to upper-case
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_toupper(const std::string& s); JKQTP_LIB_EXPORT std::string jkqtp_toupper(const std::string& s);
/** \brief std::string wrapper around sprintf() /** \brief std::string wrapper around sprintf()
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_format(const std::string& templ, ...); JKQTP_LIB_EXPORT std::string jkqtp_format(const std::string& templ, ...);
/** \brief convert a number of bytes to a string, formatting e.g. 1024 as 1kB, ... /** \brief convert a number of bytes to a string, formatting e.g. 1024 as 1kB, ...
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_bytestostr(double bytes); JKQTP_LIB_EXPORT std::string jkqtp_bytestostr(double bytes);
/** \brief convert an integer to a string /** \brief convert an integer to a string
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_inttostr(long data); JKQTP_LIB_EXPORT std::string jkqtp_inttostr(long data);
/** \brief convert an integer to a hex string /** \brief convert an integer to a hex string
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_inttohex(long data); JKQTP_LIB_EXPORT std::string jkqtp_inttohex(long data);
/** \brief convert an unsigned int to a string /** \brief convert an unsigned int to a string
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_uinttostr(unsigned long data); JKQTP_LIB_EXPORT std::string jkqtp_uinttostr(unsigned long data);
/** \brief convert a double to a string /** \brief convert a double to a string
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_floattostr(double data, int past_comma=-1, bool remove_trail0=false, double belowIsZero=1e-16); JKQTP_LIB_EXPORT std::string jkqtp_floattostr(double data, int past_comma=-1, bool remove_trail0=false, double belowIsZero=1e-16);
/** \brief convert a double to a string, encoding powers of ten as characters, e.g. \c jkqtp_floattounitstr(1000,"g") will result in "1kg" /** \brief convert a double to a string, encoding powers of ten as characters, e.g. \c jkqtp_floattounitstr(1000,"g") will result in "1kg"
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_floattounitstr(double dataa, const std::string& unitname); JKQTP_LIB_EXPORT std::string jkqtp_floattounitstr(double dataa, const std::string& unitname);
/** \brief convert a boolean to a string /** \brief convert a boolean to a string
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_booltostr(bool data); JKQTP_LIB_EXPORT std::string jkqtp_booltostr(bool data);
/** \brief converts a RGBA color into a string /** \brief converts a RGBA color into a string
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
* *
* This returns a QString which contains the name of named colors and the RGBA values in a QT readable form othertwise. * This returns a QString which contains the name of named colors and the RGBA values in a QT readable form othertwise.
*/ */
LIB_EXPORT std::string jkqtp_rgbtostring(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255); JKQTP_LIB_EXPORT std::string jkqtp_rgbtostring(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255);
/** \brief converts a QColor into a string using the jkqtp_rgbtostring() method. /** \brief converts a QColor into a string using the jkqtp_rgbtostring() method.
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
@ -584,24 +580,24 @@ inline QString jkqtp_QColor2String(QColor color) {
/** \brief clean a string to be usable as a variable name, e.g. in an expression parser, or a C++-expression /** \brief clean a string to be usable as a variable name, e.g. in an expression parser, or a C++-expression
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_to_valid_variable_name(const std::string& input); JKQTP_LIB_EXPORT std::string jkqtp_to_valid_variable_name(const std::string& input);
/** \brief convert a double to a string, encoding powers of ten as characters, e.g. \c jkqtp_floattounitstr(1000) will result in "1k" /** \brief convert a double to a string, encoding powers of ten as characters, e.g. \c jkqtp_floattounitstr(1000) will result in "1k"
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_floattounitstr(double data, int past_comma=5, bool remove_trail0=false); JKQTP_LIB_EXPORT std::string jkqtp_floattounitstr(double data, int past_comma=5, bool remove_trail0=false);
/** \brief convert a double to a string, encoding powers of ten as exponent in LaTeX notation (e.g. <code>-1.23\cdot 10^{-5}</code>) /** \brief convert a double to a string, encoding powers of ten as exponent in LaTeX notation (e.g. <code>-1.23\cdot 10^{-5}</code>)
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_floattolatexstr(double data, int past_comma=5, bool remove_trail0=false, double belowIsZero=1e-16, double minNoExponent=1e-3, double maxNoExponent=1e4); JKQTP_LIB_EXPORT std::string jkqtp_floattolatexstr(double data, int past_comma=5, bool remove_trail0=false, double belowIsZero=1e-16, double minNoExponent=1e-3, double maxNoExponent=1e4);
/** \brief convert a double to a string, encoding powers of ten as exponent with HTML tags /** \brief convert a double to a string, encoding powers of ten as exponent with HTML tags
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_floattohtmlstr(double data, int past_comma=5, bool remove_trail0=false, double belowIsZero=1e-16, double minNoExponent=1e-3, double maxNoExponent=1e4); JKQTP_LIB_EXPORT std::string jkqtp_floattohtmlstr(double data, int past_comma=5, bool remove_trail0=false, double belowIsZero=1e-16, double minNoExponent=1e-3, double maxNoExponent=1e4);
/** \brief convert a character to a string /** \brief convert a character to a string
* \ingroup jkqtptools_string * \ingroup jkqtptools_string
*/ */
LIB_EXPORT std::string jkqtp_chartostr(char data); JKQTP_LIB_EXPORT std::string jkqtp_chartostr(char data);
/** \brief wandelt einen Datentyp in einen double um, wird von JKQTPDatastore zur Wandlung benutzt /** \brief wandelt einen Datentyp in einen double um, wird von JKQTPDatastore zur Wandlung benutzt
* \ingroup jkqtptools * \ingroup jkqtptools
@ -640,11 +636,11 @@ enum JKQTPStepType {
/** \brief converts a JKQTPStepType variable into a human-readable string /** \brief converts a JKQTPStepType variable into a human-readable string
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT QString JKQTPStepType2String(JKQTPStepType pos); JKQTP_LIB_EXPORT QString JKQTPStepType2String(JKQTPStepType pos);
/** \brief converts a String into a JKQTPStepType /** \brief converts a String into a JKQTPStepType
* \ingroup jkqtptools * \ingroup jkqtptools
*/ */
LIB_EXPORT JKQTPStepType String2JKQTPStepType(const QString& pos); JKQTP_LIB_EXPORT JKQTPStepType String2JKQTPStepType(const QString& pos);
#endif // JKQTPTOOLS_H_INCLUDED #endif // JKQTPTOOLS_H_INCLUDED

View File

@ -97,7 +97,7 @@ QString jkVariantListToString(const QList<QVariant>& data, const QString& separa
return r; return r;
} }
LIB_EXPORT QString jkqtp_filenameize(const QString& data) { JKQTP_LIB_EXPORT QString jkqtp_filenameize(const QString& data) {
QString r; QString r;
QString data1=data.simplified(); QString data1=data.simplified();
for (int i=0; i<data1.size(); i++) { for (int i=0; i<data1.size(); i++) {

View File

@ -20,10 +20,6 @@
/** \file jkqtptools.h
* \ingroup tools
*/
#ifndef JKQTTOOLS_H #ifndef JKQTTOOLS_H
#define JKQTTOOLS_H #define JKQTTOOLS_H
@ -42,7 +38,7 @@
\param widget the widget to store \param widget the widget to store
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString("")); JKQTP_LIB_EXPORT void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString(""));
/*! \brief load the geometry of a given widget to a QSettings /*! \brief load the geometry of a given widget to a QSettings
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
@ -53,7 +49,7 @@ LIB_EXPORT void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, const
\param[out] widget the widget to change \param[out] widget the widget to change
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString("")); JKQTP_LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString(""));
/*! \brief load the geometry of a given widget to a QSettings /*! \brief load the geometry of a given widget to a QSettings
@ -67,7 +63,7 @@ LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, const
\param defaultSize default size of the widget \param defaultSize default size of the widget
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, const QString& prefix=QString("")); JKQTP_LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, const QString& prefix=QString(""));
/*! \brief store the geometry of a given widget to a QSettings /*! \brief store the geometry of a given widget to a QSettings
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
@ -78,7 +74,7 @@ LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoin
\param widget the widget to store \param widget the widget to store
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jksaveSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString("")); JKQTP_LIB_EXPORT void jksaveSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString(""));
/*! \brief load the geometry of a given widget to a QSettings /*! \brief load the geometry of a given widget to a QSettings
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
@ -89,21 +85,21 @@ LIB_EXPORT void jksaveSplitter(QSettings& settings, QSplitter* splitter, const Q
\param[out] plitter the plitter to change \param[out] plitter the plitter to change
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jkloadSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString("")); JKQTP_LIB_EXPORT void jkloadSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString(""));
/*! \brief convert a QList<QVariant> to a string /*! \brief convert a QList<QVariant> to a string
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
*/ */
LIB_EXPORT QString jkVariantListToString(const QList<QVariant>& data, const QString& separator=QString(", ")); JKQTP_LIB_EXPORT QString jkVariantListToString(const QList<QVariant>& data, const QString& separator=QString(", "));
/*! \brief filename-ize a string, i.e. replace every non-number and non-character (and also not <code> _ -</code>) character to \c _ /*! \brief filename-ize a string, i.e. replace every non-number and non-character (and also not <code> _ -</code>) character to \c _
\ingroup tools */ \ingroup tools */
LIB_EXPORT QString jkqtp_filenameize(const QString& data); JKQTP_LIB_EXPORT QString jkqtp_filenameize(const QString& data);
/** \brief create a valid variable name from the string, i.e. a string with only characters and digits and \c '_'. ALso the first character has to be a charcter. /** \brief create a valid variable name from the string, i.e. a string with only characters and digits and \c '_'. ALso the first character has to be a charcter.
\ingroup tools */ \ingroup tools */
LIB_EXPORT QString jkqtp_toValidVariableName(const QString& input); JKQTP_LIB_EXPORT QString jkqtp_toValidVariableName(const QString& input);
#endif // JKQTTOOLS_H #endif // JKQTTOOLS_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -6,8 +6,8 @@ CONFIG+=dll
CONFIG += create_prl CONFIG += create_prl
win32 { win32 {
DEFINES += LIB_IN_DLL DEFINES += JKQTP_LIB_IN_DLL
DEFINES += LIB_EXPORT_LIBRARY DEFINES += JKQTP_LIB_EXPORT_LIBRARY
} }
include(../lib/jkqtfastplotter.pri) include(../lib/jkqtfastplotter.pri)

View File

@ -6,8 +6,8 @@ CONFIG+=dll
CONFIG += create_prl CONFIG += create_prl
win32 { win32 {
DEFINES += LIB_IN_DLL DEFINES += JKQTP_LIB_IN_DLL
DEFINES += LIB_EXPORT_LIBRARY DEFINES += JKQTP_LIB_EXPORT_LIBRARY
} }
include(../lib/jkqtmathtext.pri) include(../lib/jkqtmathtext.pri)

View File

@ -6,8 +6,8 @@ CONFIG += dll
CONFIG += create_prl CONFIG += create_prl
win32 { win32 {
DEFINES += LIB_IN_DLL DEFINES += JKQTP_LIB_IN_DLL
DEFINES += LIB_EXPORT_LIBRARY DEFINES += JKQTP_LIB_EXPORT_LIBRARY
} }
include(../lib/jkqtplotter.pri) include(../lib/jkqtplotter.pri)