2018-12-02 21:08:43 +08:00
|
|
|
/*
|
2019-01-12 23:01:55 +08:00
|
|
|
Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This software is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License (LGPL) as published by
|
2019-02-08 00:24:46 +08:00
|
|
|
the Free Software Foundation, either version 2.1 of the License, or
|
2018-12-02 21:08:43 +08:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License (LGPL) for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License (LGPL)
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "jkqtplottertools/jkqtp_imexport.h"
|
2018-12-19 00:13:18 +08:00
|
|
|
#include "jkqtplotter/jkqtpgraphsbase.h"
|
2019-02-08 00:24:46 +08:00
|
|
|
#include "jkqtplotter/jkqtpgraphsbaseerrors.h"
|
2019-04-22 19:27:50 +08:00
|
|
|
#include "jkqtplotter/jkqtpgraphsspecialline.h"
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2018-12-19 00:13:18 +08:00
|
|
|
#ifndef jkqtpgraphsfilledcurve_H
|
|
|
|
#define jkqtpgraphsfilledcurve_H
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief This implements filled curve plots where the area is filled between the plot line and the x-Axis.
|
2019-02-03 21:04:48 +08:00
|
|
|
\ingroup jkqtplotter_filledgraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-01-29 05:14:27 +08:00
|
|
|
\image html jkqtplotter_simpletest_filledgraphs.png
|
|
|
|
|
|
|
|
\see \ref JKQTPlotterFilledGraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2019-04-22 19:27:50 +08:00
|
|
|
class JKQTP_LIB_EXPORT JKQTPFilledCurveXGraph: public JKQTPSpecialLineHorizontalGraph {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPFilledCurveXGraph(JKQTBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPFilledCurveXGraph(JKQTPlotter* parent);
|
2018-12-02 21:08:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief This implements filled curve plots with y errors where the area is filled between the plot line and the x-Axis.
|
2019-02-03 21:04:48 +08:00
|
|
|
\ingroup jkqtplotter_filledgraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
\image html plot_filledcurvexerrorplots.png
|
2019-01-29 05:14:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
\see \ref JKQTPlotterFilledGraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2019-02-03 21:04:48 +08:00
|
|
|
class JKQTP_LIB_EXPORT JKQTPFilledCurveXErrorGraph: public JKQTPFilledCurveXGraph, public JKQTPYGraphErrors {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPFilledCurveXErrorGraph(JKQTBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPFilledCurveXErrorGraph(JKQTPlotter* parent);
|
2019-01-20 17:49:29 +08:00
|
|
|
/** \copydoc JKQTPGraph::usesColumn() */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual bool usesColumn(int c) const override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/** \brief this function is used to plot error inidcators before plotting the graphs. */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual void drawErrorsAfter(JKQTPEnhancedPainter& painter) override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief This implements filled curve plots where the area is filled between the plot line and y-Axis
|
2019-02-03 21:04:48 +08:00
|
|
|
\ingroup jkqtplotter_filledgraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-01-29 05:14:27 +08:00
|
|
|
\image html jkqtplotter_simpletest_filledgraphs_yaxis.png
|
|
|
|
|
|
|
|
\see \ref JKQTPlotterFilledGraphs
|
|
|
|
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2019-04-22 19:27:50 +08:00
|
|
|
class JKQTP_LIB_EXPORT JKQTPFilledCurveYGraph: public JKQTPSpecialLineVerticalGraph {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPFilledCurveYGraph(JKQTBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPFilledCurveYGraph(JKQTPlotter* parent);
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
|
2018-12-02 21:08:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief This implements filled curve plots with y errors where the area is filled between the plot line and the x-Axis.
|
2019-02-03 21:04:48 +08:00
|
|
|
\ingroup jkqtplotter_filledgraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
\image html plot_filledcurveyerrorplots.png
|
2019-01-29 05:14:27 +08:00
|
|
|
|
|
|
|
\see \ref JKQTPlotterFilledGraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2019-02-03 21:04:48 +08:00
|
|
|
class JKQTP_LIB_EXPORT JKQTPFilledCurveYErrorGraph: public JKQTPFilledCurveYGraph, public JKQTPXGraphErrors {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPFilledCurveYErrorGraph(JKQTBasePlotter* parent=nullptr);
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPFilledCurveYErrorGraph(JKQTPlotter* parent);
|
2019-01-20 17:49:29 +08:00
|
|
|
/** \copydoc JKQTPGraph::usesColumn() */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual bool usesColumn(int c) const override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/** \brief this function is used to plot error inidcators before plotting the graphs. */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual void drawErrorsAfter(JKQTPEnhancedPainter& painter) override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief This implements filled curve plots where the area is filled between two data columns for each x-value
|
2019-02-03 21:04:48 +08:00
|
|
|
\ingroup jkqtplotter_filledgraphs
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-01-26 20:00:40 +08:00
|
|
|
With setDrawlines(false):
|
2019-01-20 17:49:29 +08:00
|
|
|
\image html JKQTPFilledVerticalRangeGraph.png
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-01-26 20:00:40 +08:00
|
|
|
With setDrawlines(true):
|
2019-01-20 17:49:29 +08:00
|
|
|
\image html JKQTPFilledVerticalRangeGraph_WithLines.png
|
2019-01-29 05:14:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\see \ref JKQTPlotterDateTimeAxes
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2019-04-22 19:27:50 +08:00
|
|
|
class JKQTP_LIB_EXPORT JKQTPFilledVerticalRangeGraph: public JKQTPXYGraph, public JKQTPGraphLineStyleMixin, public JKQTPGraphFillStyleMixin {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPFilledVerticalRangeGraph(JKQTBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPFilledVerticalRangeGraph(JKQTPlotter* parent);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief get the maximum and minimum y-value of the graph
|
|
|
|
*
|
|
|
|
* The result is given in the two parameters which are call-by-reference parameters!
|
|
|
|
*/
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
/** \copydoc JKQTPGraph::usesColumn() */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual bool usesColumn(int column) const override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
/** \brief plots the graph to the plotter object specified as parent */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual void draw(JKQTPEnhancedPainter& painter) override;
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief plots a key marker inside the specified rectangle \a rect */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect) override;
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief returns the color to be used for the key label */
|
2019-04-22 19:27:50 +08:00
|
|
|
virtual QColor getKeyLabelColor() const override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-02-08 00:24:46 +08:00
|
|
|
/*! \copydoc yColumn2
|
|
|
|
\see see yColumn2 for details */
|
2019-04-22 19:27:50 +08:00
|
|
|
void setYColumn2(int __value);
|
2019-02-08 00:24:46 +08:00
|
|
|
/*! \copydoc yColumn2
|
|
|
|
\see see yColumn2 for details */
|
2019-04-22 19:27:50 +08:00
|
|
|
int getYColumn2() const;
|
2019-01-26 20:00:40 +08:00
|
|
|
/*! \brief sets the property yColumn2 ( \copybrief yColumn2 ) to the specified \a __value, where __value is static_cast'ed from size_t to int.
|
2019-01-25 05:49:10 +08:00
|
|
|
\details Description of the parameter yColumn2 is: <BLOCKQUOTE>\copydoc yColumn2 </BLOCKQUOTE>
|
2019-02-08 00:24:46 +08:00
|
|
|
\see yColumn2 for more information */
|
2019-04-22 19:27:50 +08:00
|
|
|
void setYColumn2 (size_t __value);
|
|
|
|
|
2019-02-08 00:24:46 +08:00
|
|
|
/*! \copydoc drawLine
|
2019-04-22 19:27:50 +08:00
|
|
|
\see see drawLine for details */
|
|
|
|
void setDrawLine(bool __value);
|
2019-02-08 00:24:46 +08:00
|
|
|
/*! \copydoc drawLine
|
2019-04-22 19:27:50 +08:00
|
|
|
\see see drawLine for details */
|
|
|
|
bool getDrawLine() const;
|
|
|
|
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
/** \brief the column that contains the second y-component of the range */
|
|
|
|
int yColumn2;
|
2019-04-22 19:27:50 +08:00
|
|
|
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief indicates whether to draw a line or not */
|
|
|
|
bool drawLine;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-19 00:13:18 +08:00
|
|
|
#endif // jkqtpgraphsfilledcurve_H
|