JKQTPlotter
an extensive Qt4/Qt5 Plotter framework (including a fast variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies

this is the virtual base class of all JKQTPPlotElement's in a JKQTPlotter plot that represent geometric forms or annotations. They have extended coordinate transform capabilities, because in addition to using the plot coordinates, you can also choose to use different other coordinate systems More...

#include <jkqtpgraphsbase.h>

Inheritance diagram for JKQTPPlotObject:
Collaboration diagram for JKQTPPlotObject:

Public Member Functions

 JKQTPPlotObject (JKQTBasePlotter *parent=nullptr)
 class constructor More...
 
 JKQTPPlotObject (JKQTPlotter *parent)
 class constructor More...
 
virtual ~JKQTPPlotObject ()
 default wirtual destructor More...
 
- Public Member Functions inherited from JKQTPPlotElement
 JKQTPPlotElement (JKQTBasePlotter *parent=nullptr)
 class constructor More...
 
 JKQTPPlotElement (JKQTPlotter *parent)
 class constructor More...
 
virtual ~JKQTPPlotElement ()=default
 default wirtual destructor More...
 
virtual void draw (JKQTPEnhancedPainter &painter)=0
 plots the graph to the plotter object specified as parent More...
 
virtual void drawKeyMarker (JKQTPEnhancedPainter &painter, QRectF &rect)=0
 plots a key marker inside the specified rectangle rect More...
 
virtual void drawOutside (JKQTPEnhancedPainter &painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace)
 plots outside the actual plot field of view (e.g. color bars, scale bars, ...) More...
 
QImage generateKeyMarker (QSize size=QSize(16, 16))
 returns an image with a key marker inside
More...
 
virtual QColor getKeyLabelColor () const =0
 returns the color to be used for the key label More...
 
virtual void getOutsideSize (JKQTPEnhancedPainter &painter, int &leftSpace, int &rightSpace, int &topSpace, int &bottomSpace)
 if the graph plots outside the actual plot field of view (e.g. color bars, scale bars, ...) More...
 
JKQTBasePlottergetParent ()
 returns the parent painter class More...
 
virtual QString getTitle () const
 returns the the title of the plot More...
 
virtual bool getXMinMax (double &minx, double &maxx, double &smallestGreaterZero)=0
 get the maximum and minimum x-value of the graph More...
 
virtual bool getYMinMax (double &miny, double &maxy, double &smallestGreaterZero)=0
 get the maximum and minimum y-value of the graph More...
 
virtual double hitTest (const QPointF &posSystem, QPointF *closestSpotSystem=nullptr, QString *label=nullptr, HitTestMode mode=HitTestXY) const
 returns the closest distance of the plot element to the (screen pixel) position pos, or NAN More...
 
virtual bool isHighlighted () const
 returns whether the graph is shown in a highlighted style in the plot More...
 
virtual bool isVisible () const
 returns whether the graph is visible in the plot More...
 
virtual void setHighlighted (bool __value)
 sets whether the graph is drawn in a highlighted style in the plot More...
 
virtual void setParent (JKQTBasePlotter *parent)
 sets the parent painter class More...
 
virtual void setParent (JKQTPlotter *parent)
 sets the parent painter class More...
 
virtual void setTitle (const QString &__value)
 sets the title of the plot (for display in key!). More...
 
virtual void setVisible (bool __value)
 sets whether the graph is visible in the plot More...
 

Additional Inherited Members

- Public Types inherited from JKQTPPlotElement
enum  HitTestMode {
  HitTestXY,
  HitTestXOnly,
  HitTestYOnly
}
 modes of operation for the function hitTest() More...
 
- Protected Member Functions inherited from JKQTPPlotElement
void addHitTestData (const HitTestLocation &loc)
 clear the internal datastore for hitTest() More...
 
void addHitTestData (const QPointF &pos_, const QString &label_)
 clear the internal datastore for hitTest() More...
 
void addHitTestData (const QPointF &pos_, int index_, const QString &label_)
 clear the internal datastore for hitTest() More...
 
void addHitTestData (const QPointF &pos_, int index_=-1, JKQTPDatastore *datastore=nullptr)
 clear the internal datastore for hitTest(), this variant uses formatHitTestDefaultLabel() to auto-generate the label More...
 
void addHitTestData (double x_, double y_, const QString &label_)
 add a new point on the graph to the internal datastore for hitTest() More...
 
void addHitTestData (double x_, double y_, int index_, const QString &label_)
 clear the internal datastore for hitTest() More...
 
void addHitTestData (double x_, double y_, int index_=-1, JKQTPDatastore *datastore=nullptr)
 add a new point on the graph to the internal datastore for hitTest(), this variant uses formatHitTestDefaultLabel() to auto-generate the label More...
 
QPointF backTransform (const QPointF &x) const
 tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --> plot coordinate) More...
 
QPointF backTransform (double x, double y) const
 tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --> plot coordinate) More...
 
virtual double backtransformX (double x) const
 tool routine that backtransforms an x-coordinate (pixels --> plot coordinate) for this plot element More...
 
virtual double backtransformY (double y) const
 tool routine that backtransforms a y-coordinate (pixels --> plot coordinate) for this plot element More...
 
void clearHitTestData ()
 clear the internal datastore for hitTest() More...
 
virtual QString formatHitTestDefaultLabel (double x, double y, int index=-1, JKQTPDatastore *datastore=nullptr) const
 tool-function for hitTest(), which formats a default label, taking into account the x- and y-position (both provided) and optionally the errors of these positions. More...
 
void reserveHitTestData (int points)
 reserve list entries for up to points graph points in the internal datastore for hitTest() More...
 
QPointF transform (const QPointF &x) const
 tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinate --> pixels) More...
 
QVector< QPointF > transform (const QVector< QPointF > &x) const
 tool routine that transforms a QVector<QPointF> according to the parent's transformation rules (plot coordinate --> pixels) More...
 
QPointF transform (double x, double y) const
 tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinate --> pixels) More...
 
QPainterPath transformToLinePath (const QVector< QPointF > &x) const
 tool routine that transforms a QVector<QPointF> according to the parent's transformation rules and returns a (non-closed) path consisting of lines (plot coordinate --> pixels) More...
 
QPolygonF transformToPolygon (const QVector< QPointF > &x) const
 tool routine that transforms a QVector<QPointF> according to the parent's transformation rules and returns a polygon (plot coordinate --> pixels) More...
 
QVector< double > transformX (const QVector< double > &x) const
 transform all x-coordinates in a vector x More...
 
virtual double transformX (double x) const
 tool routine that transforms an x-coordinate (plot coordinate --> pixels) for this plot element More...
 
QVector< double > transformY (const QVector< double > &x) const
 transform all y-coordinates in a vector x More...
 
virtual double transformY (double y) const
 tool routine that transforms a y-coordinate (plot coordinate --> pixels) for this plot element More...
 
- Protected Attributes inherited from JKQTPPlotElement
bool highlighted
 indicates whether the graph is shown in a "highlghted" in the plot More...
 
QVector< HitTestLocationm_hitTestData
 dataset with graph-points and associated data fro the function hitTest() More...
 
JKQTBasePlotterparent
 the plotter object this object belongs to More...
 
int parentPlotStyle
 internal storage for the used parent plot style More...
 
QString title
 title of the plot (for display in key!). If no title is supplied, no key entry is drawn. More...
 
bool visible
 indicates whether the graph is visible in the plot More...
 

Detailed Description

this is the virtual base class of all JKQTPPlotElement's in a JKQTPlotter plot that represent geometric forms or annotations. They have extended coordinate transform capabilities, because in addition to using the plot coordinates, you can also choose to use different other coordinate systems

See also
Graph Class Structure

Constructor & Destructor Documentation

◆ JKQTPPlotObject() [1/2]

JKQTPPlotObject::JKQTPPlotObject ( JKQTBasePlotter parent = nullptr)
explicit

class constructor

◆ JKQTPPlotObject() [2/2]

JKQTPPlotObject::JKQTPPlotObject ( JKQTPlotter parent)
explicit

class constructor

◆ ~JKQTPPlotObject()

virtual JKQTPPlotObject::~JKQTPPlotObject ( )
virtual

default wirtual destructor


The documentation for this class was generated from the following file: