2018-12-02 21:08:43 +08:00
|
|
|
/*
|
|
|
|
Copyright (c) 2008-2018 Jan W. Krieger (<jan@jkrieger.de>)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(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"
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
|
2018-12-19 00:13:18 +08:00
|
|
|
#ifndef jkqtpgraphsimpulses_H
|
|
|
|
#define jkqtpgraphsimpulses_H
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-12 06:00:43 +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) )
|
2018-12-02 21:08:43 +08:00
|
|
|
\ingroup jkqtplotter_plots
|
|
|
|
|
|
|
|
\image html plot_impulsesxplots.png
|
|
|
|
*/
|
2018-12-12 06:00:43 +08:00
|
|
|
class LIB_EXPORT JKQTPimpulsesHorizontalGraph: public JKQTPxyGraph {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2018-12-12 06:00:43 +08:00
|
|
|
JKQTPimpulsesHorizontalGraph(JKQtBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2018-12-12 06:00:43 +08:00
|
|
|
JKQTPimpulsesHorizontalGraph(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;
|
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 */
|
2018-12-28 05:52:00 +08:00
|
|
|
virtual QColor getKeyLabelColor() override;
|
2018-12-02 21:08:43 +08:00
|
|
|
|
|
|
|
JKQTPGET_SET_MACRO(QColor, color)
|
|
|
|
JKQTPGET_SET_MACRO(double, lineWidth)
|
|
|
|
JKQTPGET_SET_MACRO(double, baseline)
|
|
|
|
|
|
|
|
/** \brief color of the graph */
|
|
|
|
QColor color;
|
|
|
|
/** \brief width (pixels) of the lines */
|
|
|
|
double lineWidth;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/** \brief which plot style to use from the parent plotter (via JKQtPlotterBase::getPlotStyle() and JKQtPlotterBase::getNextStyle() ) */
|
|
|
|
int parentPlotStyle;
|
|
|
|
|
|
|
|
/** \brief baseline of the plot (NOTE: 0 is interpreted as until plot border in log-mode!!!)
|
|
|
|
*/
|
|
|
|
double baseline;
|
|
|
|
QPen getPen(JKQTPEnhancedPainter &painter) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \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_plots
|
|
|
|
|
|
|
|
\image html plot_impulsesxerrorsplots.png
|
|
|
|
*/
|
2018-12-12 06:00:43 +08:00
|
|
|
class LIB_EXPORT JKQTPimpulsesHorizontalErrorGraph: public JKQTPimpulsesHorizontalGraph, public JKQTPxGraphErrors {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2018-12-12 06:00:43 +08:00
|
|
|
JKQTPimpulsesHorizontalErrorGraph(JKQtBasePlotter* parent=nullptr);
|
|
|
|
JKQTPimpulsesHorizontalErrorGraph(JKQtPlotter* parent);
|
2018-12-02 21:08:43 +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) )
|
|
|
|
\ingroup jkqtplotter_plots
|
|
|
|
|
|
|
|
\image html plot_impulsesyplots.png
|
|
|
|
*/
|
2018-12-12 06:00:43 +08:00
|
|
|
class LIB_EXPORT JKQTPimpulsesVerticalGraph: public JKQTPimpulsesHorizontalGraph {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
2018-12-12 06:00:43 +08:00
|
|
|
JKQTPimpulsesVerticalGraph(JKQtBasePlotter* parent=nullptr);
|
2018-12-02 21:08:43 +08:00
|
|
|
/** \brief class constructor */
|
2018-12-12 06:00:43 +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;
|
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) )
|
|
|
|
\ingroup jkqtplotter_plots
|
|
|
|
|
|
|
|
\image html plot_impulsesyerrorsplots.png
|
|
|
|
*/
|
2018-12-12 06:00:43 +08:00
|
|
|
class LIB_EXPORT JKQTPimpulsesVerticalErrorGraph: public JKQTPimpulsesVerticalGraph, public JKQTPyGraphErrors {
|
2018-12-02 21:08:43 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/** \brief class constructor */
|
|
|
|
JKQTPimpulsesVerticalErrorGraph(JKQtBasePlotter* parent=nullptr);
|
|
|
|
/** \brief class constructor */
|
|
|
|
JKQTPimpulsesVerticalErrorGraph(JKQtPlotter* parent);
|
|
|
|
/** \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
|