2020-08-26 16:36:07 +08:00
/*
Copyright ( c ) 2008 - 2020 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.1 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 <QString>
# include <QPainter>
# include <QPair>
# include "jkqtplotter/graphs/jkqtpgeobase.h"
# include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
# include "jkqtplotter/jkqtptools.h"
# include "jkqtplotter/jkqtplotter_imexport.h"
# include "jkqtmathtext/jkqtmathtext.h"
# ifndef jkqtpgeoshapes_H_INCLUDED
# define jkqtpgeoshapes_H_INCLUDED
2020-09-21 19:15:57 +08:00
/** \brief This JKQTPGeometricPlotElement is used to draw a rectangle
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* \ ingroup jkqtplotter_geoplots
*
* \ image html plot_georectangle . png
*
2020-09-21 19:15:57 +08:00
* \ note This class support JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve . If set ,
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* and non - linear axes are chosen , the corner points of the rectangle will be possibly
* connected by curves , instead of straight lines . In the mode
2020-09-21 19:15:57 +08:00
* JKQTPGeometricPlotElement : : DrawMode : : DrawAsGraphicElement the corners are connected by straight
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* lines , independent of the linearity or non - linearity of the coordinate axes .
*
* \ see \ ref JKQTPlotterGeometricGraphs
2020-08-26 16:36:07 +08:00
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoRectangle : public JKQTPGeoBaseFilled {
Q_OBJECT
public :
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
*/
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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
*/
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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param center center of rectangle
* \ param size width and heigt 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
JKQTPGeoRectangle ( JKQTBasePlotter * parent , const QPointF & center , const QSizeF & size , double angle , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param center center of rectangle
* \ param size width and heigt 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
JKQTPGeoRectangle ( JKQTPlotter * parent , const QPointF & center , const QSizeF & size , double angle , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param center center of rectangle
* \ param size width and heigt 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
*/
JKQTPGeoRectangle ( JKQTBasePlotter * parent , const QPointF & center , const QSizeF & size , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param center center of rectangle
* \ param size width and heigt 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
*/
JKQTPGeoRectangle ( JKQTPlotter * parent , const QPointF & center , const QSizeF & size , QColor color = QColor ( " black " ) , double lineWidth = 1 , Qt : : PenStyle style = Qt : : SolidLine , QColor fillColor = QColor ( " transparent " ) , Qt : : BrushStyle fillStyle = Qt : : SolidPattern , DrawMode drawMode = DrawAsGraphicElement ) ;
2020-08-26 16:36:07 +08:00
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getYMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief plots the graph to the plotter object specified as parent
*
2020-09-21 19:15:57 +08:00
* \ note This function support JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve . If set ,
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* and non - linear axes are chosen , the corner points of the rectangle will be possibly
* connected by curves , instead of straight lines .
*/
2020-08-26 16:36:07 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2020-09-21 19:47:54 +08:00
/** \copydoc x */
2020-08-26 16:36:07 +08:00
void setX ( double __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc x */
2020-08-26 16:36:07 +08:00
double getX ( ) const ;
2020-09-21 19:47:54 +08:00
/** \copydoc y */
2020-08-26 16:36:07 +08:00
void setY ( double __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc y */
2020-08-26 16:36:07 +08:00
double getY ( ) const ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief returns the center point of the rectangle */
QPointF getCenter ( ) const ;
/** \brief sets the center point of the rectangle */
void setCenter ( const QPointF & center ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc width */
2020-08-26 16:36:07 +08:00
void setWidth ( double __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc width */
2020-08-26 16:36:07 +08:00
double getWidth ( ) const ;
2020-09-21 19:47:54 +08:00
/** \copydoc height */
2020-08-26 16:36:07 +08:00
void setHeight ( double __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc height */
2020-08-26 16:36:07 +08:00
double getHeight ( ) const ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief returns the size (width and height) of the rectangle */
QSizeF getSize ( ) const ;
/** \brief sets the size (width and height) of the rectangle */
void setSize ( const QSizeF & size ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc angle */
2020-08-26 16:36:07 +08:00
void setAngle ( double __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc angle */
2020-08-26 16:36:07 +08:00
double getAngle ( ) const ;
/** \brief set the rectangle using the bottom-left corner, as well as its width and height */
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
void setBottomLeftRectangle ( double x , double y , double width , double height ) ;
/** \brief set the rectangle using the bottom-left corner, as well as its width and height */
void setBottomLeftRectangle ( const QRectF & rect ) ;
/** \brief returns the rectangle using the bottom-left corner, as well as its width and height, ignoring the rotation angle!!!
*
* This is equivalent to
* \ code
* QRectF result ( x - width / 2.0 , y - height / 2.0 , width , height ) ;
* \ endcode
*/
QRectF getBottomLeftRectangle ( ) const ;
protected :
2020-08-26 16:36:07 +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) */
double angle ;
/** \brief returns the transformation matrix used for this rectangle */
QTransform getTransform ( ) ;
/** \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 ( ) ;
} ;
2020-09-21 19:15:57 +08:00
/** \brief This JKQTPGeometricPlotElement is used to draw a polygon
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* \ ingroup jkqtplotter_geoplots
*
* \ image html plot_geopolygon . png
*
2020-09-21 19:15:57 +08:00
* \ note This function support JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve . If set ,
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* and non - linear axes are chosen , the points of the polygon will be possibly
* connected by curves , instead of straight lines .
*
* \ see \ ref JKQTPlotterGeometricGraphs
*
2020-08-26 16:36:07 +08:00
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolygon : public JKQTPGeoBaseFilled {
Q_OBJECT
public :
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
2020-08-26 16:36:07 +08:00
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getYMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief plots the graph to the plotter object specified as parent
*
2020-09-21 19:15:57 +08:00
* \ note This function support JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve . If set ,
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* and non - linear axes are chosen , the points of the polygon will be possibly
* connected by curves , instead of straight lines .
*/
2020-08-26 16:36:07 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2020-09-21 19:47:54 +08:00
/** \copydoc points */
2020-08-26 16:36:07 +08:00
void setPoints ( const QVector < QPointF > & __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc points */
2020-08-26 16:36:07 +08:00
QVector < QPointF > getPoints ( ) const ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief append a point to the polygon \see points */
2020-08-26 16:36:07 +08:00
void appendPoint ( const QPointF & p ) ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief append a point to the polygon \see points */
2020-08-26 16:36:07 +08:00
void appendPoint ( const double x , const double y ) ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief returns the number of points \see points */
int getPointCount ( ) const ;
/** \brief returns the i-th of point \see points */
const QPointF & getPoint ( int i ) const ;
/** \brief returns the i-th of point \see points */
QPointF & getPoint ( int i ) ;
/** \brief overwrites the i-th point \see points */
void setPoint ( int i , const QPointF & point ) ;
/** \brief deletes the i-the point \see points */
void removePoint ( int i ) ;
/** \brief returns an iterator to the first point \see points */
QVector < QPointF > : : iterator pointsBegin ( ) ;
/** \brief returns an iterator after the last point \see points */
QVector < QPointF > : : iterator pointsEnd ( ) ;
/** \brief returns a constant iterator to the first point \see points */
QVector < QPointF > : : const_iterator pointsCBegin ( ) const ;
/** \brief returns a constant iterator after the last point \see points*/
QVector < QPointF > : : const_iterator pointsCEnd ( ) const ;
2020-08-26 16:36:07 +08:00
protected :
/** \brief list with all points on the polygon */
QVector < QPointF > points ;
} ;
2020-09-21 19:15:57 +08:00
/** \brief This JKQTPGeometricPlotElement is used to draw an ellipse
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* \ ingroup jkqtplotter_geoplots
*
* \ image html plot_geoellipse . png
*
* \ image html plot_geoellipse_rotated . png
*
2020-09-21 19:15:57 +08:00
* \ note This function support the JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve only .
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* This means that ellipses are always treated as mathematical curves , as no meaningful
* parametrization for ellipses on non - linear axes could be found ! In the mode
2020-09-21 19:15:57 +08:00
* JKQTPGeometricPlotElement : : DrawMode : : DrawAsGraphicElement the points are connected by straight
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* lines , independent of the linearity or non - linearity of the coordinate axes .
*
* \ 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>
*
* \ see \ ref JKQTPlotterGeometricGraphs , JKQTPGeoPie , JKQTPGeoChord , JKQTPGeoArc
2020-08-26 16:36:07 +08:00
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoEllipse : public JKQTPGeoRectangle {
Q_OBJECT
public :
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param x x - coordinate of center of ellipse
* \ param y y - coordinate of center of ellipse
* \ param width width of rectangle
* \ param height of rectangle
* \ param angle rotation angle of the ellipse
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param x x - coordinate of center of ellipse
* \ param y y - coordinate of center of ellipse
* \ param width width of rectangle
* \ param height of rectangle
* \ param angle rotation angle of the ellipse
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param bottomleft bottom left corner of ellipse
* \ param topright top right corner of ellipse
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ param bottomleft bottom left corner of ellipse
* \ param topright top right corner of ellipse
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
2020-08-26 16:36:07 +08:00
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief plots the graph to the plotter object specified as parent
*
2020-09-21 19:15:57 +08:00
* \ note This function support the JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve only .
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* This means that ellipses are always treated as mathematical curves , as no meaningful
* parametrization for ellipses on non - linear axes could be found ! */
2020-08-26 16:36:07 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
protected :
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief drawing modes for drawInternal() */
enum class InternalDrawMode {
Ellipse ,
Pie ,
Chord
} ;
2020-08-26 16:36:07 +08:00
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief inertnal draw function, can draw an ellipse, a pie or a chord! */
void drawInternal ( JKQTPEnhancedPainter & painter , double angleStart = 0 , double angleStop = 0 , InternalDrawMode mode = InternalDrawMode : : Ellipse ) ;
} ;
2020-08-26 16:36:07 +08:00
2020-09-21 19:15:57 +08:00
/** \brief This JKQTPGeometricPlotElement is used to draw a pie
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* \ ingroup jkqtplotter_geoplots
*
*
* A pie on linear and log - log axes ( start angle : 10 deg and end - angle 110 deg ) :
* \ image html plot_geopie . png
*
* Here is the code to generate the plots above :
* \ code
* plot - > addGraph ( new JKQTPGeoRectangle ( plot , 3.5 , 0.5 , 0.9 , 0.9 , QColor ( " silver " ) , 1 , Qt : : PenStyle : : DashLine ) ) ;
* plot - > addGraph ( new JKQTPGeoEllipse ( plot , 3.5 , 0.5 , 0.9 , 0.9 , QColor ( " silver " ) , 1 , Qt : : PenStyle : : DashLine ) ) ;
* plot - > addGraph ( new JKQTPGeoPie ( plot , 3.5 , 0.5 , 0.9 , 0.9 , 10 , 110 , QColor ( " blue " ) , 4 , Qt : : PenStyle : : SolidLine , QColor ( " lightblue " ) ) ) ;
* plot - > addGraph ( new JKQTPGeoSymbol ( plot , 3.5 , 0.5 , JKQTPCircle , 5 , QColor ( " grey " ) ) ) ;
* plot - > addGraph ( new JKQTPGeoLine ( plot , 3.5 , 0.5 , 3.5 + 0.5 * cos ( 10.0 / 180.0 * JKQTPSTATISTICS_PI ) , 0.5 + 0.5 * sin ( 10.0 / 180.0 * JKQTPSTATISTICS_PI ) , QColor ( " grey " ) ) ) ;
* plot - > addGraph ( new JKQTPGeoText ( plot , 3.5 + 0.55 * cos ( 10.0 / 180.0 * JKQTPSTATISTICS_PI ) , 0.5 + 0.55 * sin ( 10.0 / 180.0 * JKQTPSTATISTICS_PI ) , " 10 \\ degree " , 10 , QColor ( " grey " ) ) ) ;
* plot - > addGraph ( new JKQTPGeoLine ( plot , 3.5 , 0.5 , 3.5 + 0.5 * cos ( 110.0 / 180.0 * JKQTPSTATISTICS_PI ) , 0.5 + 0.5 * sin ( 110.0 / 180.0 * JKQTPSTATISTICS_PI ) , QColor ( " grey " ) ) ) ;
* plot - > addGraph ( new JKQTPGeoText ( plot , 3.5 + 0.55 * cos ( 110.0 / 180.0 * JKQTPSTATISTICS_PI ) , 0.5 + 0.55 * sin ( 110.0 / 180.0 * JKQTPSTATISTICS_PI ) , " 110 \\ degree " , 10 , QColor ( " grey " ) ) ) ;
* \ endcode
*
2020-09-21 19:15:57 +08:00
* \ note This function support the JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve only .
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* This means that pies are always treated as mathematical curves , as no meaningful
* parametrization for pies on non - linear axes could be found !
*
* \ see \ ref JKQTPlotterGeometricGraphs , JKQTPGeoEllipse , JKQTPGeoChord , JKQTPGeoArc
2020-08-26 16:36:07 +08:00
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPie : public JKQTPGeoEllipse {
Q_OBJECT
public :
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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 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
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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 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
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
2020-08-26 16:36:07 +08:00
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getYMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief plots the graph to the plotter object specified as parent
*
2020-09-21 19:15:57 +08:00
* \ note This function support the JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve only .
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* This means that pies are always treated as mathematical curves , as no meaningful
* parametrization for pies on non - linear axes could be found ! */
2020-08-26 16:36:07 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2020-09-21 19:47:54 +08:00
/** \copydoc angleStart */
2020-08-26 16:36:07 +08:00
void setAngleStart ( double __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc angleStart */
2020-08-26 16:36:07 +08:00
double getAngleStart ( ) const ;
2020-09-21 19:47:54 +08:00
/** \copydoc angleStop */
2020-08-26 16:36:07 +08:00
void setAngleStop ( double __value ) ;
2020-09-21 19:47:54 +08:00
/** \copydoc angleStop */
2020-08-26 16:36:07 +08:00
double getAngleStop ( ) const ;
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 ;
} ;
2020-09-21 19:15:57 +08:00
/** \brief This JKQTPGeometricPlotElement is used to draw a chord
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* \ ingroup jkqtplotter_geoplots
*
* A chord on linear and log - log axes ( start angle : 10 deg and end - angle 110 deg ) :
*
* \ image html plot_geochord . png
*
2020-09-21 19:15:57 +08:00
* \ note This function support the JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve only .
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* This means that chords are always treated as mathematical curves , as no meaningful
* parametrization for chords on non - linear axes could be found !
*
* \ see \ ref JKQTPlotterGeometricGraphs , JKQTPGeoPie , JKQTPGeoEllipse , JKQTPGeoArc
2020-08-26 16:36:07 +08:00
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoChord : public JKQTPGeoPie {
Q_OBJECT
public :
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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 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
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
/** \brief class constructor
*
* \ param parent the parent plotter object
* \ 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 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
* \ 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
2020-08-26 16:36:07 +08:00
*/
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +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 , DrawMode drawMode = DrawAsGraphicElement ) ;
2020-08-26 16:36:07 +08:00
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2020-09-21 19:15:57 +08:00
/** \copydoc JKQTPGeometricPlotElement::getYMinMax() */
2020-08-26 16:36:07 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
/** \brief plots the graph to the plotter object specified as parent
*
2020-09-21 19:15:57 +08:00
* \ note This function support the JKQTPGeometricPlotElement : : DrawMode : : DrawAsMathematicalCurve only .
- improved: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)
- improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)
- new: all geometric objects can either be drawn as graphic element (i.e. lines are straight line, even on non-linear axes), or as mathematical curve (i.e. on non-linear axes, lines become the appropriate curve representing the linear function, connecting the given start/end-points). The only exceptions are ellipses (and the derived arcs,pies,chords), which are always drawn as mathematical curves
2020-09-04 05:08:52 +08:00
* This means that chords are always treated as mathematical curves , as no meaningful
* parametrization for chords on non - linear axes could be found !
*/
2020-08-26 16:36:07 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
} ;
# endif // jkqtpgeoshapes_H_INCLUDED