2018-12-02 21:08:43 +08:00
|
|
|
/*
|
2020-08-26 18:58:23 +08:00
|
|
|
Copyright (c) 2008-2020 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/>.
|
|
|
|
*/
|
|
|
|
|
2022-04-25 04:07:39 +08:00
|
|
|
#ifndef jkqtpgraphsimpulses_H
|
|
|
|
#define jkqtpgraphsimpulses_H
|
|
|
|
|
2019-06-22 20:21:32 +08:00
|
|
|
#include "jkqtplotter/jkqtplotter_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/jkqtpgraphsbasestylingmixins.h"
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-19 21:21:33 +08:00
|
|
|
/** \brief This is a base class for all impulse graphs
|
|
|
|
* \ingroup jkqtplotter_barssticks
|
|
|
|
*
|
|
|
|
* \see JKQTPImpulsesHorizontalGraph, JKQTPImpulsesVerticalGraph
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2020-09-19 21:21:33 +08:00
|
|
|
class JKQTPLOTTER_LIB_EXPORT JKQTPImpulsesGraphBase: public JKQTPXYBaselineGraph, public JKQTPGraphLineStyleMixin, public JKQTPGraphSymbolStyleMixin{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
|
|
|
JKQTPImpulsesGraphBase(JKQTBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
|
2020-09-19 21:21:33 +08:00
|
|
|
/** \brief returns the color to be used for the key label */
|
|
|
|
virtual QColor getKeyLabelColor() const override;
|
2020-09-21 19:47:54 +08:00
|
|
|
/** \copydoc drawSymbols */
|
2020-09-19 21:21:33 +08:00
|
|
|
bool getDrawSymbols() const;
|
2019-04-22 19:27:50 +08:00
|
|
|
|
2020-09-19 21:21:33 +08:00
|
|
|
public slots:
|
2020-09-21 19:47:54 +08:00
|
|
|
/** \brief color of symbols and impulses in one call */
|
2020-09-19 21:21:33 +08:00
|
|
|
virtual void setColor(QColor c);
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2020-09-21 19:47:54 +08:00
|
|
|
/** \copydoc drawSymbols */
|
2020-09-19 21:21:33 +08:00
|
|
|
void setDrawSymbols(bool __value);
|
|
|
|
|
|
|
|
protected:
|
2018-12-02 21:08:43 +08:00
|
|
|
|
2020-09-19 21:21:33 +08:00
|
|
|
/** \brief indicates whether to draw symbols at the top of the impulse
|
2019-04-22 19:27:50 +08:00
|
|
|
*
|
2019-06-21 04:24:47 +08:00
|
|
|
* \image html impulsesplot_symbols.png
|
2019-04-22 19:27:50 +08:00
|
|
|
*/
|
2020-09-19 21:21:33 +08:00
|
|
|
bool drawSymbols;
|
2018-12-02 21:08:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-09-19 21:21:33 +08:00
|
|
|
/** \brief This implements an impulse plot with impulses in direction of the X axis (i.e. from y=0 to y=f(x) )
|
|
|
|
* \ingroup jkqtplotter_barssticks
|
|
|
|
*
|
|
|
|
* \image html plot_impulsesxplots.png
|
|
|
|
*
|
|
|
|
* \see JKQTPImpulsesVerticalGraph, \ref JKQTPlotterImpulsePlots
|
|
|
|
*/
|
|
|
|
class JKQTPLOTTER_LIB_EXPORT JKQTPImpulsesHorizontalGraph: public JKQTPImpulsesGraphBase {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
|
|
|
JKQTPImpulsesHorizontalGraph(JKQTBasePlotter* parent=nullptr);
|
|
|
|
/** \brief class constructor */
|
|
|
|
JKQTPImpulsesHorizontalGraph(JKQTPlotter* parent);
|
|
|
|
|
|
|
|
/** \brief plots the graph to the plotter object specified as parent */
|
|
|
|
virtual void draw(JKQTPEnhancedPainter& painter) override;
|
|
|
|
/** \brief plots a key marker inside the specified rectangle \a rect */
|
|
|
|
virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
};
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
|
2019-06-13 16:27:06 +08:00
|
|
|
|
2020-09-19 21:21:33 +08:00
|
|
|
/** \brief This implements an impulse plot with impulses in direction of the X axis (i.e. from x=0 to x=f(y) )
|
|
|
|
* \ingroup jkqtplotter_barssticks
|
|
|
|
*
|
|
|
|
* \image html plot_impulsesxerrorsplots.png
|
|
|
|
*
|
|
|
|
* \see jkqtpstatAddXErrorImpulsesGraph(), JKQTPImpulsesHorizontalGraph, \ref JKQTPlotterImpulsePlots
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2019-06-22 20:21:32 +08:00
|
|
|
class JKQTPLOTTER_LIB_EXPORT JKQTPImpulsesHorizontalErrorGraph: public JKQTPImpulsesHorizontalGraph, public JKQTPXGraphErrors {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPImpulsesHorizontalErrorGraph(JKQTBasePlotter* parent=nullptr);
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPImpulsesHorizontalErrorGraph(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 an impulse plot with impulses in direction of the Y axis (i.e. from y=0 to y=f(x) )
|
2019-01-13 01:53:16 +08:00
|
|
|
\ingroup jkqtplotter_barssticks
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
\image html plot_impulsesyplots.png
|
2019-06-13 16:27:06 +08:00
|
|
|
|
|
|
|
\see \ref JKQTPlotterImpulsePlots
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2020-09-19 21:21:33 +08:00
|
|
|
class JKQTPLOTTER_LIB_EXPORT JKQTPImpulsesVerticalGraph: public JKQTPImpulsesGraphBase {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPImpulsesVerticalGraph(JKQTBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPImpulsesVerticalGraph(JKQTPlotter* parent);
|
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;
|
2020-09-19 21:21:33 +08:00
|
|
|
/** \brief plots a key marker inside the specified rectangle \a rect */
|
|
|
|
virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect) override;
|
2018-12-02 21:08:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief This implements an impulse plot with impulses in direction of the X axis (i.e. from x=0 to x=f(y) )
|
2019-01-13 01:53:16 +08:00
|
|
|
\ingroup jkqtplotter_barssticks
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
\image html plot_impulsesyerrorsplots.png
|
2019-06-13 16:27:06 +08:00
|
|
|
|
|
|
|
\see JKQTPImpulsesVerticalGraph, jkqtpstatAddYErrorImpulsesGraph(), \ref JKQTPlotterImpulsePlots
|
2018-12-02 21:08:43 +08:00
|
|
|
*/
|
2019-06-22 20:21:32 +08:00
|
|
|
class JKQTPLOTTER_LIB_EXPORT JKQTPImpulsesVerticalErrorGraph: public JKQTPImpulsesVerticalGraph, public JKQTPYGraphErrors {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPImpulsesVerticalErrorGraph(JKQTBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPImpulsesVerticalErrorGraph(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
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-19 00:13:18 +08:00
|
|
|
#endif // jkqtpgraphsimpulses_H
|