2015-07-11 18:56:02 +08:00
/*
2019-01-12 23:01:55 +08:00
Copyright ( c ) 2008 - 2019 Jan W . Krieger ( < jan @ jkrieger . de > )
2015-07-11 18:56:02 +08:00
2015-07-12 22:34:27 +08:00
2015-07-11 18:56:02 +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
2015-07-11 18:56:02 +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 <QString>
# include <QPainter>
# include <QPair>
2019-06-20 22:06:31 +08:00
# include "jkqtplotter/graphs/jkqtpscatter.h"
2019-04-22 19:27:50 +08:00
# include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
2019-05-30 04:40:02 +08:00
# include "jkqtplotter/jkqtptools.h"
2019-06-22 20:21:32 +08:00
# include "jkqtplotter/jkqtplotter_imexport.h"
2018-11-26 03:25:44 +08:00
# include "jkqtmathtext/jkqtmathtext.h"
2015-07-11 18:56:02 +08:00
2018-12-19 00:13:18 +08:00
# ifndef jkqtpgraphsgeometric_H_INCLUDED
# define jkqtpgraphsgeometric_H_INCLUDED
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used as base class for geometric drawing
2015-07-11 18:56:02 +08:00
elements that only consist of lines ( i . e . no filling of any kind is done )
\ ingroup jkqtplotter_geoplots
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoBaseLine : public JKQTPPlotObject , public JKQTPGraphLineStyleMixin {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class contructor
\ param color color of drawing
\ param style line style of drawing
\ param lineWidth lineWidth of drawing
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
*/
2019-01-20 17:49:29 +08:00
explicit JKQTPGeoBaseLine ( QColor color , double lineWidth , Qt : : PenStyle style = Qt : : SolidLine , JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class contructor
\ param color color of drawing
\ param style line style of drawing
\ param lineWidth lineWidth of drawing
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
*/
2019-01-20 23:15:10 +08:00
explicit JKQTPGeoBaseLine ( QColor color , double lineWidth , Qt : : PenStyle style , JKQTPlotter * parent ) ;
2019-04-22 19:27:50 +08:00
/*! \brief class contructor
*/
explicit JKQTPGeoBaseLine ( JKQTBasePlotter * parent ) ;
/*! \brief class contructor
*/
explicit JKQTPGeoBaseLine ( JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
2015-07-11 18:56:02 +08:00
2019-01-08 04:00:56 +08:00
/** \brief sets the alpha-channel of the \a color (i.e. its transparency) */
virtual void setAlpha ( float alpha ) ;
2019-04-22 19:27:50 +08:00
/** \brief set line color */
virtual void setColor ( QColor c ) ;
2019-01-08 04:00:56 +08:00
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
protected :
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used as base class for geometric drawing
2015-07-11 18:56:02 +08:00
elements that only consist of lines ( i . e . no filling of any kind is done )
\ ingroup jkqtplotter_geoplots
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoBaseFilled : public JKQTPGeoBaseLine , public JKQTPGraphFillStyleMixin {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class contructor
\ param color color of drawing
2019-01-08 04:00:56 +08:00
\ param fillColor color of the filling in the drawing
2015-07-11 18:56:02 +08:00
\ param style line style of drawing
\ param fillStyle filling style of the graph
\ param lineWidth lineWidth of drawing
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoBaseFilled ( QColor color , QColor fillColor , double lineWidth , Qt : : PenStyle style = Qt : : SolidLine , Qt : : BrushStyle fillStyle = Qt : : SolidPattern , JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class contructor
\ param color color of drawing
2019-01-08 04:00:56 +08:00
\ param fillColor color of the filling in the drawing
2015-08-02 19:36:54 +08:00
\ param style line style of drawing
\ param fillStyle filling style of the graph
\ param lineWidth lineWidth of drawing
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoBaseFilled ( QColor color , QColor fillColor , double lineWidth , Qt : : PenStyle style , Qt : : BrushStyle fillStyle , JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class contructor
\ param color color of drawing
2019-01-08 04:00:56 +08:00
\ param fillColor color of the filling in the drawing
2015-08-02 19:36:54 +08:00
\ param style line style of drawing
\ param lineWidth lineWidth of drawing
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoBaseFilled ( QColor color , QColor fillColor , double lineWidth , Qt : : PenStyle style , JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class contructor
\ param color color of drawing
2019-01-08 04:00:56 +08:00
\ param fillColor color of the filling in the drawing
2015-08-02 19:36:54 +08:00
\ param lineWidth lineWidth of drawing
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoBaseFilled ( QColor color , QColor fillColor , double lineWidth , JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class contructor
\ param color color of drawing
2019-01-08 04:00:56 +08:00
\ param fillColor color of the filling in the drawing
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoBaseFilled ( QColor color , QColor fillColor , JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
2019-01-08 04:00:56 +08:00
/** \brief sets the alpha-channel of the \a color and \a fillColor (i.e. its transparency) to the same value */
virtual void setAlpha ( float alpha ) override ;
/** \brief sets the alpha-channel of the \a color and \a fillColor (i.e. its transparency) */
virtual void setAlpha ( float alphaLine , float alphaFill ) ;
2019-04-22 19:27:50 +08:00
/** \brief set line and fill color */
virtual void setColor ( QColor c ) override ;
2019-01-08 04:00:56 +08:00
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
protected :
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This virtual JKQTPGraph descendent may be used to display a single symbol (marker).
2019-01-08 04:00:56 +08:00
\ ingroup jkqtplotter_geoplots
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoSymbol : public JKQTPPlotObject , public JKQTPGraphSymbolStyleMixin {
2019-01-08 04:00:56 +08:00
Q_OBJECT
public :
/*! \brief class contructor
\ param parent parent plotter widget
\ param x x - coordinate of symbol center
\ param y y - coordinate of symbol center
\ param symbol symbol type
\ param symbolSize size of the symbol in pt
\ param color color of drawing
\ param fillColor fill color of the symbol ( if filled )
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoSymbol ( JKQTBasePlotter * parent , double x , double y , JKQTPGraphSymbols symbol = JKQTPCross , double symbolSize = 10 , QColor color = QColor ( " black " ) , QColor fillColor = QColor ( " grey " ) ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class contructor
\ param parent parent plotter widget
\ param x x - coordinate of symbol center
\ param y y - coordinate of symbol center
\ param symbol symbol type
\ param symbolSize size of the symbol in pt
\ param color color of drawing
\ param fillColor fill color of the symbol ( if filled )
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoSymbol ( JKQTPlotter * parent , double x , double y , JKQTPGraphSymbols symbol = JKQTPCross , double symbolSize = 10 , QColor color = QColor ( " black " ) , QColor fillColor = QColor ( " grey " ) ) ;
2019-01-08 04:00:56 +08:00
2019-04-22 19:27:50 +08:00
/*! set the symbol color and symbol fill color */
virtual void setColor ( QColor c ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
void setX ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
double getX ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
void setY ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
double getY ( ) const ;
2019-01-08 04:00:56 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPGraph::getXMinMax() */
2019-04-22 19:27:50 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPGraph::getYMinMax() */
2019-04-22 19:27:50 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2019-01-08 04:00:56 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2019-04-22 19:27:50 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2019-01-08 04:00:56 +08:00
/** \brief plots a key marker inside the specified rectangle \a rect */
2019-04-22 19:27:50 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2019-01-08 04:00:56 +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 ;
2019-01-08 04:00:56 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief x-position (in plot coordinates) of the symbol (symbol center) */
double x ;
/** \brief y-position (in plot coordinates) of the symbol (symbol center) */
double y ;
2019-01-08 04:00:56 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to display text. It uses the JKQTMathText
2015-07-11 18:56:02 +08:00
class in order to display LaTeX formulas .
\ ingroup jkqtplotter_geoplots
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoText : public JKQTPPlotObject , public JKQTPGraphTextStyleMixin {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class contructor
\ param parent parent plotter widget
\ param x x - coordinate of text
\ param y y - coordinate of text
\ param text the text to display
\ param color color of drawing
\ param fontSize base font size of text
*/
2019-04-22 19:27:50 +08:00
JKQTPGeoText ( JKQTBasePlotter * parent , double x , double y , const QString & text , double fontSize , QColor color ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class contructor
\ param parent parent plotter widget
\ param x x - coordinate of text
\ param y y - coordinate of text
\ param text the text to display
\ param color color of drawing
\ param fontSize base font size of text
*/
2019-04-22 19:27:50 +08:00
JKQTPGeoText ( JKQTPlotter * parent , double x , double y , const QString & text , double fontSize , QColor color ) ;
/*! \brief class contructor
\ param parent parent plotter widget
\ param x x - coordinate of text
\ param y y - coordinate of text
\ param text the text to display
*/
JKQTPGeoText ( JKQTBasePlotter * parent , double x , double y , const QString & text ) ;
/*! \brief class contructor
\ param parent parent plotter widget
\ param x x - coordinate of text
\ param y y - coordinate of text
\ param text the text to display
*/
JKQTPGeoText ( JKQTPlotter * parent , double x , double y , const QString & text ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc text */
2019-04-22 19:27:50 +08:00
void setText ( const QString & __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc text */
2019-04-22 19:27:50 +08:00
QString getText ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
void setX ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
double getX ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
void setY ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
double getY ( ) const ;
/** \brief set line and fill color */
virtual void setColor ( QColor c ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief x-position (in plot coordinates) of the text (left/baseline) */
double x ;
/** \brief y-position (in plot coordinates) of the text (left/baseline) */
double y ;
2015-07-11 18:56:02 +08:00
2019-02-08 00:24:46 +08:00
/** \brief the text to display */
2015-07-11 18:56:02 +08:00
QString text ;
/** \brief return a pen, that may be used for drawing */
QPen getPen ( JKQTPEnhancedPainter & painter ) ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw a line
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_geoline . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoLine : public JKQTPGeoBaseLine {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
\ param x1 x - coordinate of first point of line
\ param y1 y - coordinate of first point of line
\ param x2 x - coordinate of second point of line
\ param y2 y - coordinate of second point of line
\ param color color of line
\ param lineWidth width of line
\ param style line style
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
*/
2019-04-22 19:27:50 +08:00
JKQTPGeoLine ( JKQTBasePlotter * parent , double x1 , double y1 , double x2 , double y2 , QColor color , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param x1 x - coordinate of first point of line
\ param y1 y - coordinate of first point of line
\ param x2 x - coordinate of second point of line
\ param y2 y - coordinate of second point of line
\ param color color of line
\ param lineWidth width of line
\ param style line style
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
*/
2019-04-22 19:27:50 +08:00
JKQTPGeoLine ( JKQTPlotter * parent , double x1 , double y1 , double x2 , double y2 , QColor color , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-04-22 19:27:50 +08:00
\ param x1 x - coordinate of first point of line
\ param y1 y - coordinate of first point of line
\ param x2 x - coordinate of second point of line
\ param y2 y - coordinate of second point of line
*/
JKQTPGeoLine ( JKQTBasePlotter * parent , double x1 , double y1 , double x2 , double y2 ) ;
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-04-22 19:27:50 +08:00
\ param x1 x - coordinate of first point of line
\ param y1 y - coordinate of first point of line
\ param x2 x - coordinate of second point of line
\ param y2 y - coordinate of second point of line
*/
JKQTPGeoLine ( JKQTPlotter * parent , double x1 , double y1 , double x2 , double y2 ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc x1 */
2019-04-22 19:27:50 +08:00
void setX1 ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x1 */
2019-04-22 19:27:50 +08:00
double getX1 ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y1 */
2019-04-22 19:27:50 +08:00
void setY1 ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y1 */
2019-04-22 19:27:50 +08:00
double getY1 ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x2 */
2019-04-22 19:27:50 +08:00
void setX2 ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x2 */
2019-04-22 19:27:50 +08:00
double getX2 ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y2 */
2019-04-22 19:27:50 +08:00
void setY2 ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y2 */
2019-04-22 19:27:50 +08:00
double getY2 ( ) const ;
2015-07-11 18:56:02 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief x-coordinate of first point of line */
double x1 ;
/** \brief y-coordinate of first point of line */
double y1 ;
/** \brief x-coordinate of second point of line */
double x2 ;
/** \brief y-coordinate of second point of line */
double y2 ;
2015-07-11 18:56:02 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw an infinite line
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
an infinite line has a starting point and then goes on in a given direction
until the end of the plotting range .
\ image html plot_geoinfiniteline . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoInfiniteLine : public JKQTPGeoBaseLine {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
\ param x x - coordinate of start point of line
\ param y y - coordinate of start point of line
\ param dx x - direction of the line
\ param dy y - direction of the line
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoInfiniteLine ( JKQTBasePlotter * parent , double x , double y , double dx , double dy , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param x x - coordinate of start point of line
\ param y y - coordinate of start point of line
\ param dx x - direction of the line
\ param dy y - direction of the line
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoInfiniteLine ( JKQTPlotter * parent , double x , double y , double dx , double dy , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
void setX ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
double getX ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
void setY ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
double getY ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc dx */
2019-04-22 19:27:50 +08:00
void setDx ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc dx */
2019-04-22 19:27:50 +08:00
double getDx ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc dy */
2019-04-22 19:27:50 +08:00
void setDy ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc dy */
2019-04-22 19:27:50 +08:00
double getDy ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc two_sided */
2019-04-22 19:27:50 +08:00
void setTwoSided ( bool __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc two_sided */
2019-04-22 19:27:50 +08:00
bool getTwoSided ( ) const ;
2015-07-11 18:56:02 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief x-coordinate of a point on the line */
double x ;
/** \brief y-coordinate of a point on the line */
double y ;
/** \brief x-component of the slope of the line */
double dx ;
/** \brief y-component of the slope of the line */
double dy ;
2015-07-11 18:56:02 +08:00
/** \brief indicates whether the line ends at the given point \f$ (x,y) \f$ (false, default),
* or is infinite in both directions ( true ) */
bool two_sided ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw a poly line
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_geolines . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolyLines : public JKQTPGeoBaseLine {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param points points on the polygon
2015-07-11 18:56:02 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoPolyLines ( JKQTBasePlotter * parent , const QVector < QPointF > & points , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param points points on the polygon
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoPolyLines ( JKQTPlotter * parent , const QVector < QPointF > & points , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoPolyLines ( JKQTBasePlotter * parent , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoPolyLines ( JKQTPlotter * parent , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc points */
2019-04-22 19:27:50 +08:00
void setPoints ( const QVector < QPointF > & __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc points */
2019-04-22 19:27:50 +08:00
QVector < QPointF > getPoints ( ) const ;
2015-07-11 18:56:02 +08:00
/** \brief append a point to the polygon */
2019-04-22 19:27:50 +08:00
void appendPoint ( const QPointF & p ) ;
2015-07-11 18:56:02 +08:00
/** \brief append a point to the polygon */
2019-04-22 19:27:50 +08:00
void appendPoint ( const double x , const double y ) ;
2015-07-11 18:56:02 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief list with all points on the poly-line */
2015-07-11 18:56:02 +08:00
QVector < QPointF > points ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw a rectangle
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_georectangle . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoRectangle : public JKQTPGeoBaseFilled {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
\ param x x - coordinate of center of rectangle
\ param y y - coordinate of center of rectangle
\ param width width of rectangle
\ param height of rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoRectangle ( JKQTBasePlotter * parent , double x , double y , double width , double height , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param x x - coordinate of center of rectangle
\ param y y - coordinate of center of rectangle
\ param width width of rectangle
\ param height of rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoRectangle ( JKQTPlotter * parent , double x , double y , double width , double height , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param x x - coordinate of center of rectangle
\ param y y - coordinate of center of rectangle
\ param width width of rectangle
\ param height of rectangle
\ param angle rotation angle of the rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoRectangle ( JKQTBasePlotter * parent , double x , double y , double width , double height , double angle , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param x x - coordinate of center of rectangle
\ param y y - coordinate of center of rectangle
\ param width width of rectangle
\ param height of rectangle
\ param angle rotation angle of the rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoRectangle ( JKQTPlotter * parent , double x , double y , double width , double height , double angle , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param bottomleft bottom left corner of rectangle
\ param topright top right corner of rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoRectangle ( JKQTBasePlotter * parent , QPointF bottomleft , QPointF topright , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param bottomleft bottom left corner of rectangle
\ param topright top right corner of rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoRectangle ( JKQTPlotter * parent , QPointF bottomleft , QPointF topright , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
void setX ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
double getX ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
void setY ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
double getY ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc width */
2019-04-22 19:27:50 +08:00
void setWidth ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc width */
2019-04-22 19:27:50 +08:00
double getWidth ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc height */
2019-04-22 19:27:50 +08:00
void setHeight ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc height */
2019-04-22 19:27:50 +08:00
double getHeight ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angle */
2019-04-22 19:27:50 +08:00
void setAngle ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angle */
2019-04-22 19:27:50 +08:00
double getAngle ( ) const ;
/** \brief set the rectangle using the bottom-left corner, as well as its width and height */
2019-01-26 20:00:40 +08:00
void setBottomleftrectangle ( double x , double y , double width , double height ) ;
2015-07-11 18:56:02 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief x-coordinate of a center of the rectangle */
double x ;
/** \brief y-coordinate of a center of the rectangle */
double y ;
/** \brief width of a center of the rectangle */
double width ;
/** \brief height of a center of the rectangle */
double height ;
/** \brief rotation angle of rectangle [degrees] around (x,y) */
2019-01-08 04:00:56 +08:00
double angle ;
2015-07-11 18:56:02 +08:00
/** \brief returns the transformation matrix used for this rectangle */
QMatrix getMatrix ( ) ;
/** \brief returns a QPolygonF which represents the rectangle after rotation, but still in the world coordinate system, not in the screen/widget system */
QPolygonF getPolygon ( ) ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw a polygon
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_geopolygon . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolygon : public JKQTPGeoBaseFilled {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param points points on the polygon
2015-07-11 18:56:02 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
2019-01-08 04:00:56 +08:00
\ param fillColor color of the filling
\ param fillStyle style of the filling
2015-07-11 18:56:02 +08:00
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoPolygon ( JKQTBasePlotter * parent , const QVector < QPointF > & points , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param points points on the polygon
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor color of the filling
\ param fillStyle style of the filling
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoPolygon ( JKQTPlotter * parent , const QVector < QPointF > & points , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
2019-01-08 04:00:56 +08:00
\ param fillColor color of the filling
\ param fillStyle style of the filling
2015-08-02 19:36:54 +08:00
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoPolygon ( JKQTBasePlotter * parent , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor color of the filling
\ param fillStyle style of the filling
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoPolygon ( JKQTPlotter * parent , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc points */
2019-04-22 19:27:50 +08:00
void setPoints ( const QVector < QPointF > & __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc points */
2019-04-22 19:27:50 +08:00
QVector < QPointF > getPoints ( ) const ;
2015-07-11 18:56:02 +08:00
/** \brief append a point to the polygon */
2019-04-22 19:27:50 +08:00
void appendPoint ( const QPointF & p ) ;
2015-07-11 18:56:02 +08:00
/** \brief append a point to the polygon */
2019-04-22 19:27:50 +08:00
void appendPoint ( const double x , const double y ) ;
2015-07-11 18:56:02 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief list with all points on the polygon */
2015-07-11 18:56:02 +08:00
QVector < QPointF > points ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw an ellipse
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_geoellipse . png
\ 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>
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoEllipse : public JKQTPGeoRectangle {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of ellipse
\ param fillStyle filling style of ellipse
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoEllipse ( JKQTBasePlotter * parent , double x , double y , double width , double height , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-07-11 18:56:02 +08:00
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of ellipse
\ param fillStyle filling style of ellipse
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoEllipse ( JKQTPlotter * parent , double x , double y , double width , double height , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param x x - coordinate of center of rectangle
\ param y y - coordinate of center of rectangle
\ param width width of rectangle
\ param height of rectangle
\ param angle rotation angle of the rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoEllipse ( JKQTBasePlotter * parent , double x , double y , double width , double height , double angle , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param x x - coordinate of center of rectangle
\ param y y - coordinate of center of rectangle
\ param width width of rectangle
\ param height of rectangle
\ param angle rotation angle of the rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoEllipse ( JKQTPlotter * parent , double x , double y , double width , double height , double angle , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param bottomleft bottom left corner of rectangle
\ param topright top right corner of rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoEllipse ( JKQTBasePlotter * parent , QPointF bottomleft , QPointF topright , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2019-01-08 04:00:56 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2019-01-08 04:00:56 +08:00
\ param bottomleft bottom left corner of rectangle
\ param topright top right corner of rectangle
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of rectangle
\ param fillStyle filling style of rectangle
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoEllipse ( JKQTPlotter * parent , QPointF bottomleft , QPointF topright , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc controlPoints */
2019-04-22 19:27:50 +08:00
void setControlPoints ( const unsigned int & __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc controlPoints */
2019-04-22 19:27:50 +08:00
unsigned int getControlPoints ( ) const ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief number of steps/control points to draw the ellipse */
unsigned int controlPoints ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw an arc
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_geoarc . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoArc : public JKQTPGeoBaseLine {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
2019-05-18 02:46:52 +08:00
\ param angleStart if we only draw an arc , this is the starting angle in degrees
\ param angleStop if we only draw an arc , this is the ending angle in degrees
2015-07-11 18:56:02 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoArc ( JKQTBasePlotter * parent , double x , double y , double width , double height , double angleStart , double angleStop , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
2019-05-18 02:46:52 +08:00
\ param angleStart if we only draw an arc , this is the starting angle in degrees
\ param angleStop if we only draw an arc , this is the ending angle in degrees
2015-08-02 19:36:54 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoArc ( JKQTPlotter * parent , double x , double y , double width , double height , double angleStart , double angleStop , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc controlPoints */
2019-04-22 19:27:50 +08:00
void setControlPoints ( const unsigned int & __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc controlPoints */
2019-04-22 19:27:50 +08:00
unsigned int getControlPoints ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStart */
2019-04-22 19:27:50 +08:00
void setAngleStart ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStart */
2019-04-22 19:27:50 +08:00
double getAngleStart ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStop */
2019-04-22 19:27:50 +08:00
void setAngleStop ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStop */
2019-04-22 19:27:50 +08:00
double getAngleStop ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
void setX ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc x */
2019-04-22 19:27:50 +08:00
double getX ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
void setY ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc y */
2019-04-22 19:27:50 +08:00
double getY ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc width */
2019-04-22 19:27:50 +08:00
void setWidth ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc width */
2019-04-22 19:27:50 +08:00
double getWidth ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc height */
2019-04-22 19:27:50 +08:00
void setHeight ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc height */
2019-04-22 19:27:50 +08:00
double getHeight ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angle */
2019-04-22 19:27:50 +08:00
void setAngle ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angle */
2019-04-22 19:27:50 +08:00
double getAngle ( ) const ;
2015-07-11 18:56:02 +08:00
protected :
2019-04-22 19:27:50 +08:00
/** \brief x-coordinate of a center of the rectangle */
double x ;
/** \brief y-coordinate of a center of the rectangle */
double y ;
/** \brief width of a center of the rectangle */
double width ;
/** \brief height of a center of the rectangle */
double height ;
/** \brief rotation angle of rectangle [degrees] around (x,y) */
2019-01-08 04:00:56 +08:00
double angle ;
2015-07-11 18:56:02 +08:00
/** \brief if we only draw an arc, this is the starting angle in degrees */
double angleStart ;
/** \brief if we only draw an arc, this is the ending angle in degrees */
double angleStop ;
2019-04-22 19:27:50 +08:00
/** \brief number of steps/control points to draw the ellipse */
unsigned int controlPoints ;
2015-07-11 18:56:02 +08:00
/** \brief closing mode for arcs: secand or pie */
/** \brief returns the transformation matrix used for this rectangle */
QMatrix getMatrix ( ) ;
/** \brief returns a QPolygonF which represents the rectangle after rotation, but still in the world coordinate system, not in the screen/widget system */
QPolygonF getPolygon ( ) ;
2019-04-22 19:27:50 +08:00
2015-07-11 18:56:02 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw a pie
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_geopie . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPie : public JKQTPGeoEllipse {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
2019-05-18 02:46:52 +08:00
\ param angleStart if we only draw an arc , this is the starting angle in degrees
\ param angleStop if we only draw an arc , this is the ending angle in degrees
2015-07-11 18:56:02 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of ellipse
\ param fillStyle filling style of ellipse
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoPie ( JKQTBasePlotter * parent , double x , double y , double width , double height , double angleStart , double angleStop , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
2019-05-18 02:46:52 +08:00
\ param angleStart if we only draw an arc , this is the starting angle in degrees
\ param angleStop if we only draw an arc , this is the ending angle in degrees
2015-08-02 19:36:54 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of ellipse
\ param fillStyle filling style of ellipse
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoPie ( JKQTPlotter * parent , double x , double y , double width , double height , double angleStart , double angleStop , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStart */
2019-04-22 19:27:50 +08:00
void setAngleStart ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStart */
2019-04-22 19:27:50 +08:00
double getAngleStart ( ) const ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStop */
2019-04-22 19:27:50 +08:00
void setAngleStop ( double __value ) ;
2019-05-19 04:41:38 +08:00
/*! \copydoc angleStop */
2019-04-22 19:27:50 +08:00
double getAngleStop ( ) const ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief if we only draw an arc, this is the starting angle */
double angleStart ;
/** \brief if we only draw an arc, this is the ending angle */
double angleStop ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief This JKQTPPlotObject is used to draw a chord
2015-07-11 18:56:02 +08:00
\ ingroup jkqtplotter_geoplots
\ image html plot_geochord . png
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoChord : public JKQTPGeoPie {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-07-11 18:56:02 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
2019-05-18 02:46:52 +08:00
\ param angleStart if we only draw an arc , this is the starting angle in degrees
\ param angleStop if we only draw an arc , this is the ending angle in degrees
2015-07-11 18:56:02 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of ellipse
\ param fillStyle filling style of ellipse
*/
2019-01-20 17:49:29 +08:00
JKQTPGeoChord ( JKQTBasePlotter * parent , double x , double y , double width , double height , double angleStart , double angleStop , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-08-02 19:36:54 +08:00
/*! \brief class constructor
2019-05-30 17:19:56 +08:00
\ param parent the parent plotter object
2015-08-02 19:36:54 +08:00
\ param x x - coordinate of center of ellipse
\ param y y - coordinate of center of ellipse
\ param width width of ellipse ( 2 * half axis )
\ param height of ellipse ( 2 * half axis )
2019-05-18 02:46:52 +08:00
\ param angleStart if we only draw an arc , this is the starting angle in degrees
\ param angleStop if we only draw an arc , this is the ending angle in degrees
2015-08-02 19:36:54 +08:00
\ param color color of line
\ param lineWidth width of line
\ param style line style
\ param fillColor filling color of ellipse
\ param fillStyle filling style of ellipse
*/
2019-01-20 23:15:10 +08:00
JKQTPGeoChord ( JKQTPlotter * parent , double x , double y , double width , double height , double angleStart , double angleStop , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getXMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPPlotObject::getYMinMax() */
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +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 ;
2015-07-11 18:56:02 +08:00
} ;
2018-12-19 00:13:18 +08:00
# endif // jkqtpgraphsgeometric_H_INCLUDED