JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches

a speed optimized plotter class More...

#include <jkqtfastplotter.h>

Inheritance diagram for JKQTFastPlotter:
[legend]
Collaboration diagram for JKQTFastPlotter:
[legend]

Public Slots

void copyImage ()
 copy the current plot image to the clipboard
 
void redrawPlot ()
 replot everything (slowest possible plotting)
 
void redrawPlotImmediate ()
 replot everything (slowest possible plotting) and forces a repaint calling QWidget::repaint()
 
void setXMax (double value)
 set xMax
 
void setXMin (double value)
 set xMin
 
void setYMax (double value)
 set yMax
 
void setYMin (double value)
 set yMin
 
void updateData ()
 replot only the data
 
void updateDataImmediate ()
 replot only the data, forces a redraw by calling QWidget::repaint()

 

Signals

void clicked (double x, double y)
 emitted whenever the mouse is clicked inside the plot
 
void clicked (double x, double y, Qt::KeyboardModifiers modifiers)
 emitted whenever the mouse is clicked inside the plot
 
void doubleClicked (double x, double y)
 emitted whenever the mouse is double-clicked inside the plot
 
void doubleClicked (double x, double y, Qt::KeyboardModifiers modifiers)
 emitted whenever the mouse is double-clicked inside the plot
 
void mouseDragFinished (double x_start, double y_start, double x_end, double y_end, Qt::KeyboardModifiers modifiers)
 emitted after the mouse has been dragged with the left button clicked
 
void mouseDragged (double x_start, double y_start, double x_end, double y_end, Qt::KeyboardModifiers modifiers)
 emitted when the mouse has been dragged with the left button clicked
 
void mouseMoved (double x, double y)
 emitted whenever the mouse is clicked inside the plot
 
void plotterSizesChanged ()
 emitted whenever the graph sizes (borders, plotWidth, plotHeight) change
 
void replotting ()
 emitted whenever the graph is replotted
 

Public Member Functions

 JKQTFastPlotter (QWidget *parent=nullptr)
 class constructor
 
void addPlot (JKQTFPPlot *g)
 add a new graph
 
void clearPlots (bool remove=false)
 clear all plots in the graph
 
void deletePlot (int id, bool remove=false)
 remove given graph
 
void deletePlot (JKQTFPPlot *g, bool remove=false)
 remove given graph
 
bool doesMaintainAspectRatio () const
 indicates whether to maintain a specific aspect ratio
 
void draw (QPainter *painter, QColor background, QSize *size)
 draw the contents onto any QPainter, starting at (0,0), returns the size of the whole plot in size, if supplied with the suppliedbackground color
 
void draw (QPainter *painter, QSize *size=nullptr)
 draw the contents onto any QPainter, starting at (0,0), returns the size of the whole plot in size, if supplied with the default background color
 
double getAspectRatio () const
 aspect ratio of the plot, only used when maintainAspectRation is true
 
QColor getBackgroundColor () const
 color of the background
 
bool getDragLine () const
 
QPen getDragShapePen () const
 
bool getDrawGrid () const
 indicates whether to draw a grid
 
bool getDrawSystemBox () const
 indicates whether to draw a system box
 
bool getDrawZeroAxes () const
 indicates whether to draw axes at x=0/y=0
 
QColor getGridColor () const
 color of the coordinate grid
 
Qt::PenStyle getGridStyle () const
 style of the coordinate grid
 
double getGridWidth () const
 width of the coordinate grid (in pixel)
 
int getInternalPlotBorderBottom () const
 internally calculated: free space between widget bottom border and plot bottom border
 
int getInternalPlotBorderLeft () const
 internally calculated: free space between widget left border and plot left border
 
int getInternalPlotBorderRight () const
 internally calculated: free space between widget right border and plot left border
 
int getInternalPlotBorderTop () const
 internally calculated: free space between widget top border and plot bottom border
 
QString getLabelFontName () const
 font name of the axis labels
 
double getLabelFontSize () const
 font size (in points) of the axis labels
 
QColor getPlotBackgroundColor () const
 color of the plot's background
 
int getPlotBorderBottom () const
 free space between widget bottom border and plot bottom border

 
int getPlotBorderLeft () const
 free space between widget left border and plot left border

 
int getPlotBorderRight () const
 free space between widget right border and plot left border
 
int getPlotBorderTop () const
 free space between widget top border and plot bottom border
 
int getPlotHeight () const
 plot height in pt inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)
 
int getPlotNum (JKQTFPPlot *g)
 return the internal number (0..N-1) of the given plot, or -1
 
int getPlotWidth () const
 plot width in pt inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)
 
JKQTFastPlottergetSynchronizeX () const
 synchronize x-axis settings to this plotter
 
JKQTFastPlottergetSynchronizeY () const
 synchronize y-axis settings to this plotter
 
QColor getSystemColor () const
 color of the coordinate system
 
double getSystemWidth () const
 width of the coordinate (in pixel)
 
QString getTickFontName () const
 font name of the tick labels
 
double getTickFontSize () const
 font size (in points) of the tick labels
 
double getTickLength () const
 length of an axis tick (pixels)
 
QString getXAxisLabel () const
 label of x axis
 
bool getXAxisLabelVisible () const
 plot x axis label
 
bool getXAxisLog () const
 is x axis logarithmic?
 
double getXMax () const
 maximum value of x axis
 
double getXMin () const
 minimum value of x axis
 
double getXTickDistance () const
 distance between two labels on x axis
 
double getXZeroTick () const
 a label position from which axis label plotting is started for the x axis
 
QString getYAxisLabel () const
 label of y axis
 
bool getYAxisLabelVisible () const
 plot y axis label
 
bool getYAxisLog () const
 is x axis logarithmic?
 
double getYMax () const
 maximum value of y axis
 
double getYMin () const
 minimum value of y axis
 
double getYTickDistance () const
 distance between two labels on y axis
 
double getYZeroTick () const
 a label position from which axis label plotting is started for the y axis
 
bool isPlotUpdateEnabled () const
 if false the plotting won't be performed (may be used to set more than one parameter without replot
 
double p2x (long x)
 return x coordinate from x-pixel
 
double p2y (long y)
 return y coordinate from y-pixel
 
void setAspectRatio (double __value)
 aspect ratio of the plot, only used when maintainAspectRation is true
 
void setBackgroundColor (const QColor &__value)
 color of the background
 
void setDragLine (bool __value)
 
void setDragShapePen (const QPen &__value)
 
void setDrawGrid (bool __value)
 indicates whether to draw a grid
 
void setDrawSystemBox (bool __value)
 indicates whether to draw a system box
 
void setDrawZeroAxes (bool __value)
 indicates whether to draw axes at x=0/y=0
 
void setGridColor (const QColor &__value)
 color of the coordinate grid
 
void setGridStyle (Qt::PenStyle __value)
 style of the coordinate grid
 
void setGridWidth (double __value)
 width of the coordinate grid (in pixel)
 
void setLabelFontName (const QString &__value)
 font name of the axis labels
 
void setLabelFontSize (double __value)
 font size (in points) of the axis labels
 
void setMaintainAspectRatio (bool __value)
 indicates whether to maintain a specific aspect ratio
 
void setPlotBackgroundColor (const QColor &__value)
 color of the plot's background
 
void setPlotBorderBottom (int __value)
 free space between widget bottom border and plot bottom border

 
void setPlotBorderLeft (int __value)
 free space between widget left border and plot left border

 
void setPlotBorderRight (int __value)
 free space between widget right border and plot left border
 
void setPlotBorderTop (int __value)
 free space between widget top border and plot bottom border
 
void setPlotUpdateEnabled (bool __value)
 if false the plotting won't be performed (may be used to set more than one parameter without replot
 
void setSynchronizeX (JKQTFastPlotter *__value)
 synchronize x-axis settings to this plotter
 
void setSynchronizeY (JKQTFastPlotter *__value)
 synchronize y-axis settings to this plotter
 
void setSystemColor (const QColor &__value)
 color of the coordinate system
 
void setSystemWidth (double __value)
 width of the coordinate (in pixel)
 
void setTickFontName (const QString &__value)
 font name of the tick labels
 
void setTickFontSize (double __value)
 font size (in points) of the tick labels
 
void setTickLength (double __value)
 length of an axis tick (pixels)
 
void setXAxisLabel (const QString &__value)
 label of x axis
 
void setXAxisLabelVisible (bool __value)
 plot x axis label
 
void setXRange (double min, double max, bool logarithmic=false)
 set the properties of the x axis
 
void setXTickDistance (double __value)
 distance between two labels on x axis
 
void setXYRange (double xmin, double xmax, double ymin, double ymax, bool xlogarithmic=false, bool ylogarithmic=false)
 set the properties of both axes
 
void setXZeroTick (double __value)
 a label position from which axis label plotting is started for the x axis
 
void setYAxisLabel (const QString &__value)
 label of y axis
 
void setYAxisLabelVisible (bool __value)
 plot y axis label
 
void setYRange (double min, double max, bool logarithmic=false)
 set the properties of the y axis
 
void setYTickDistance (double __value)
 distance between two labels on y axis
 
void setYZeroTick (double __value)
 a label position from which axis label plotting is started for the y axis
 
double x2p (double x)
 return x-pixel coordinate from x coordinate
 
double y2p (double y)
 return y-pixel coordinate from y coordinate
 

Static Public Attributes

static const double ABS_MIN_LINEWIDTH
 smallest allowed line width for JKQTFastPlotter
 
static const size_t LUTSIZE
 size of the lookup tables used by JKQTFPimagePlot_array2image()
 

Protected Member Functions

void calcPlotScaling ()
 recalculate the scaling of the plot
 
QSize minimumSizeHint () const override
 
virtual void mouseDoubleClickEvent (QMouseEvent *event) override
 event handler for a double click
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 event handler for a mouse move
 
virtual void mousePressEvent (QMouseEvent *event) override
 event handler for a mouse button press
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 event handler for a mouse button is released
 
virtual void paintEvent (QPaintEvent *event) override
 this simply paints the stored image to the widget's surface
 
void plotGraphs (QPainter &painter)
 paint the graphs
 
void plotSystem (QPainter &painter)
 paint the coordinate system
 
virtual void resizeEvent (QResizeEvent *event) override
 resizes the internal representation (image) of the graphs
 

Protected Attributes

QAction * actCopyImage
 
double aspectRatio
 aspect ratio of the plot, only used when maintainAspectRation is true
 
QColor backgroundColor
 color of the background
 
QColor default_backgroundColor
 default value for property backgroundColor.
 
bool default_drawGrid
 default value for property drawGrid.
 
bool default_drawSystemBox
 default value for property drawSystemBox.
 
bool default_drawZeroAxes
 default value for property drawZeroAxes.
 
QColor default_gridColor
 default value for property gridColor.
 
Qt::PenStyle default_gridStyle
 default value for property gridStyle.
 
double default_gridWidth
 default value for property gridWidth.
 
QString default_labelFontName
 default value for property labelFontName.
 
double default_labelFontSize
 default value for property labelFontSize.
 
QColor default_plotBackgroundColor
 default value for property plotBackgroundColor.
 
int default_plotBorderBottom
 default value for property plotBorderBottom.
 
int default_plotBorderLeft
 default value for property plotBorderLeft.
 
int default_plotBorderRight
 default value for property plotBorderRight.
 
int default_plotBorderTop
 default value for property plotBorderTop.
 
QColor default_systemColor
 default value for property systemColor.
 
double default_systemWidth
 default value for property systemWidth.
 
QString default_tickFontName
 default value for property tickFontName.
 
double default_tickFontSize
 default value for property tickFontSize.
 
double default_tickLength
 default value for property tickLength.
 
bool doDrawing
 if false the plotting won't be performed (may be used to set more than one parameter without replot
 
bool doFullRepaint
 indicates whether to do full repaint (system and data) at the next repaint (any of the repaint meothods)
 
bool dragging
 
bool dragLine
 
QPen dragShapePen
 
bool drawGrid
 indicates whether to draw a grid
 
bool drawSystemBox
 indicates whether to draw a system box
 
bool drawZeroAxes
 indicates whether to draw axes at x=0/y=0
 
QColor gridColor
 color of the coordinate grid
 
Qt::PenStyle gridStyle
 style of the coordinate grid
 
double gridWidth
 width of the coordinate grid (in pixel)
 
QImage image
 this stores the currently displayed plot
 
int internalPlotBorderBottom
 internally calculated: free space between widget bottom border and plot bottom border
 
int internalPlotBorderLeft
 internally calculated: free space between widget left border and plot left border
 
int internalPlotBorderRight
 internally calculated: free space between widget right border and plot left border
 
int internalPlotBorderTop
 internally calculated: free space between widget top border and plot bottom border
 
QString labelFontName
 font name of the axis labels
 
double labelFontSize
 font size (in points) of the axis labels
 
bool maintainAspectRatio
 indicates whether to maintain a specific aspect ratio
 
QPoint mouseDragEnd
 
QPoint mouseDragStart
 
QMutex mutexRepaint
 mutex to lock global widget repaint
 
QMutex mutexRepaintData
 mutex to lock data repaint
 
QMutex mutexRepaintSystem
 mutex to lock system repaint
 
QImage oldImage
 this can be used when drawing a zoom rectangle to store an unchanged copy of the currently displayed image.
 
QColor plotBackgroundColor
 color of the plot's background
 
int plotBorderBottom
 free space between widget bottom border and plot bottom border

 
int plotBorderLeft
 free space between widget left border and plot left border

 
int plotBorderRight
 free space between widget right border and plot left border
 
int plotBorderTop
 free space between widget top border and plot bottom border
 
int plotHeight
 plot height in pt inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)
 
QVector< JKQTFPPlot * > plots
 list of plots in this graph
 
int plotWidth
 plot width in pt inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)
 
JKQTFastPlottersynchronizeX
 synchronize x-axis settings to this plotter
 
JKQTFastPlottersynchronizeY
 synchronize y-axis settings to this plotter
 
QColor systemColor
 color of the coordinate system
 
QImage systemImage
 this stores the currently displayed coordinate system
 
double systemWidth
 width of the coordinate (in pixel)
 
QString tickFontName
 font name of the tick labels
 
double tickFontSize
 font size (in points) of the tick labels
 
double tickLength
 length of an axis tick (pixels)
 
QString xAxisLabel
 label of x axis
 
bool xAxisLabelVisible
 plot x axis label
 
bool xAxisLog
 is x axis logarithmic?
 
double xMax
 maximum value of x axis
 
double xMin
 minimum value of x axis
 
double xOffset
 x axis offset (calculated internally)

 
double xScale
 x axis scaling factor (calculated internally)

 
double xTickDistance
 distance between two labels on x axis
 
double xWidth
 width of plot on x axis (calculated internally)

 
double xZeroTick
 a label position from which axis label plotting is started for the x axis
 
QString yAxisLabel
 label of y axis
 
bool yAxisLabelVisible
 plot y axis label
 
bool yAxisLog
 is x axis logarithmic?
 
double yMax
 maximum value of y axis
 
double yMin
 minimum value of y axis
 
double yOffset
 y axis offset (calculated internally)

 
double yScale
 y axis scaling factor (calculated internally)

 
double yTickDistance
 distance between two labels on y axis
 
double yWidth
 width of plot on y axis (calculated internally)

 
double yZeroTick
 a label position from which axis label plotting is started for the y axis
 

Detailed Description

a speed optimized plotter class

Deprecated:
The class JKQTFastPlotter and all its support classes are deprecated and will be removed in future versions.

This plotter class is (in contrast to JKQTPlotter) optimized for speed. It allows to plot function graphs/data in a simple manner. The focus of design was not on a nice output (athough this is not unimportant), but on the speed of the output. So the class may be used to di quick plotting of data, i.e. in fast image sequence applications.

These measures were taken to increase speed:

  • The coordinate system is drawn onto an internal image which is only updated, when the size of the widget or a property of the coordinate system changes. When only the data changes, just the data plot has to be updated.
  • The class uses an internal buffer with the complete image, so a repaint does not always trigger a complete repaint of all elements, but just measns painting the internal image to the screen. This also allows to plot selections ... over the plot, without having to replot the plots.
  • The definition of the coordinate system as well as the definition the system ticks ... is reduced to the absolute minimum.
  • The method setPlotUpdateEnabled() allows to prevent replotting of the class contents, e.g. when you want to set a multitude of parameters without triggering a replot every time.

The class supports these features:

  • coordinate axes may be linear or logarithmic.
  • ticks and tick labels are drawn by a simple algorithm: The user has to supply two values: zeroTick is a tick value that exists in any case (i.e. 0) and tickDistance which contains the distance between two ticks (only applicable to linear axes). Then the class starts to draw at zeroTick and move on to zeroTick+tickDistance and zeroTick-tickDistance until min / max of the axis is reached. For logarithmic axes the class uses zeroTick*10 and zeroTick/10
  • plot may contain a grid (x and y grid may be switched on/off separately).
  • plots are represented by descendents of JKQTFPPlot and the plotting code is completely contained therein (and should be speed optimized).
  • it is possible to keep a specified aspect ratio
  • it is possible to couple different plots in a way, that they are plottetd with the same width/height both in pixel and world coordinates by using plotterSizesChanged() and synchronizeX() / synchronizeY().
See also
An example for the usage of this class can be found here: Example (JKQTFastPlotter)

Constructor & Destructor Documentation

◆ JKQTFastPlotter()

JKQTFastPlotter::JKQTFastPlotter ( QWidget *  parent = nullptr)

class constructor

Member Function Documentation

◆ addPlot()

void JKQTFastPlotter::addPlot ( JKQTFPPlot g)

add a new graph

◆ calcPlotScaling()

void JKQTFastPlotter::calcPlotScaling ( )
protected

recalculate the scaling of the plot

◆ clearPlots()

void JKQTFastPlotter::clearPlots ( bool  remove = false)

clear all plots in the graph

Parameters
removeif true the object will also be deleted from memory, not just from the list

◆ clicked [1/2]

void JKQTFastPlotter::clicked ( double  x,
double  y 
)
signal

emitted whenever the mouse is clicked inside the plot

◆ clicked [2/2]

void JKQTFastPlotter::clicked ( double  x,
double  y,
Qt::KeyboardModifiers  modifiers 
)
signal

emitted whenever the mouse is clicked inside the plot

◆ copyImage

void JKQTFastPlotter::copyImage ( )
slot

copy the current plot image to the clipboard

◆ deletePlot() [1/2]

void JKQTFastPlotter::deletePlot ( int  id,
bool  remove = false 
)

remove given graph

Parameters
idspecifies the graph to delete
removeif true the object will also be deleted from memory, not just from the list

◆ deletePlot() [2/2]

void JKQTFastPlotter::deletePlot ( JKQTFPPlot g,
bool  remove = false 
)

remove given graph

Parameters
gspecifies the graph to delete
removeif true the object will also be deleted from memory, not just from the list

◆ doesMaintainAspectRatio()

bool JKQTFastPlotter::doesMaintainAspectRatio ( ) const
inline

indicates whether to maintain a specific aspect ratio

◆ doubleClicked [1/2]

void JKQTFastPlotter::doubleClicked ( double  x,
double  y 
)
signal

emitted whenever the mouse is double-clicked inside the plot

◆ doubleClicked [2/2]

void JKQTFastPlotter::doubleClicked ( double  x,
double  y,
Qt::KeyboardModifiers  modifiers 
)
signal

emitted whenever the mouse is double-clicked inside the plot

◆ draw() [1/2]

void JKQTFastPlotter::draw ( QPainter *  painter,
QColor  background,
QSize *  size 
)

draw the contents onto any QPainter, starting at (0,0), returns the size of the whole plot in size, if supplied with the suppliedbackground color

◆ draw() [2/2]

void JKQTFastPlotter::draw ( QPainter *  painter,
QSize *  size = nullptr 
)

draw the contents onto any QPainter, starting at (0,0), returns the size of the whole plot in size, if supplied with the default background color

◆ getAspectRatio()

double JKQTFastPlotter::getAspectRatio ( ) const
inline

aspect ratio of the plot, only used when maintainAspectRation is true

The aspect ratio is defined as width/height of the plot in pt. So if you want to have a plot spanning x=0..20 and y=0..10 where each 1x1 square should be as wide as high you will have to set aspectRatio to 2 .

Note
Note that aspect ratios only make sense for linear-linear plots. This will be ignored if any one axis is logarithmic.

◆ getBackgroundColor()

QColor JKQTFastPlotter::getBackgroundColor ( ) const
inline

color of the background

◆ getDragLine()

bool JKQTFastPlotter::getDragLine ( ) const
inline

◆ getDragShapePen()

QPen JKQTFastPlotter::getDragShapePen ( ) const
inline

◆ getDrawGrid()

bool JKQTFastPlotter::getDrawGrid ( ) const
inline

indicates whether to draw a grid

◆ getDrawSystemBox()

bool JKQTFastPlotter::getDrawSystemBox ( ) const
inline

indicates whether to draw a system box

◆ getDrawZeroAxes()

bool JKQTFastPlotter::getDrawZeroAxes ( ) const
inline

indicates whether to draw axes at x=0/y=0

◆ getGridColor()

QColor JKQTFastPlotter::getGridColor ( ) const
inline

color of the coordinate grid

◆ getGridStyle()

Qt::PenStyle JKQTFastPlotter::getGridStyle ( ) const
inline

style of the coordinate grid

◆ getGridWidth()

double JKQTFastPlotter::getGridWidth ( ) const
inline

width of the coordinate grid (in pixel)

◆ getInternalPlotBorderBottom()

int JKQTFastPlotter::getInternalPlotBorderBottom ( ) const
inline

internally calculated: free space between widget bottom border and plot bottom border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ getInternalPlotBorderLeft()

int JKQTFastPlotter::getInternalPlotBorderLeft ( ) const
inline

internally calculated: free space between widget left border and plot left border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ getInternalPlotBorderRight()

int JKQTFastPlotter::getInternalPlotBorderRight ( ) const
inline

internally calculated: free space between widget right border and plot left border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ getInternalPlotBorderTop()

int JKQTFastPlotter::getInternalPlotBorderTop ( ) const
inline

internally calculated: free space between widget top border and plot bottom border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ getLabelFontName()

QString JKQTFastPlotter::getLabelFontName ( ) const
inline

font name of the axis labels

◆ getLabelFontSize()

double JKQTFastPlotter::getLabelFontSize ( ) const
inline

font size (in points) of the axis labels

◆ getPlotBackgroundColor()

QColor JKQTFastPlotter::getPlotBackgroundColor ( ) const
inline

color of the plot's background

Note
the background is not drawn if this color is set to QColor(Qt::transparent) !

◆ getPlotBorderBottom()

int JKQTFastPlotter::getPlotBorderBottom ( ) const
inline

free space between widget bottom border and plot bottom border

◆ getPlotBorderLeft()

int JKQTFastPlotter::getPlotBorderLeft ( ) const
inline

free space between widget left border and plot left border

◆ getPlotBorderRight()

int JKQTFastPlotter::getPlotBorderRight ( ) const
inline

free space between widget right border and plot left border

◆ getPlotBorderTop()

int JKQTFastPlotter::getPlotBorderTop ( ) const
inline

free space between widget top border and plot bottom border

◆ getPlotHeight()

int JKQTFastPlotter::getPlotHeight ( ) const
inline

plot height in pt inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)

◆ getPlotNum()

int JKQTFastPlotter::getPlotNum ( JKQTFPPlot g)

return the internal number (0..N-1) of the given plot, or -1

◆ getPlotWidth()

int JKQTFastPlotter::getPlotWidth ( ) const
inline

plot width in pt inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)

◆ getSynchronizeX()

JKQTFastPlotter * JKQTFastPlotter::getSynchronizeX ( ) const
inline

synchronize x-axis settings to this plotter

◆ getSynchronizeY()

JKQTFastPlotter * JKQTFastPlotter::getSynchronizeY ( ) const
inline

synchronize y-axis settings to this plotter

◆ getSystemColor()

QColor JKQTFastPlotter::getSystemColor ( ) const
inline

color of the coordinate system

◆ getSystemWidth()

double JKQTFastPlotter::getSystemWidth ( ) const
inline

width of the coordinate (in pixel)

◆ getTickFontName()

QString JKQTFastPlotter::getTickFontName ( ) const
inline

font name of the tick labels

◆ getTickFontSize()

double JKQTFastPlotter::getTickFontSize ( ) const
inline

font size (in points) of the tick labels

◆ getTickLength()

double JKQTFastPlotter::getTickLength ( ) const
inline

length of an axis tick (pixels)

◆ getXAxisLabel()

QString JKQTFastPlotter::getXAxisLabel ( ) const
inline

label of x axis

◆ getXAxisLabelVisible()

bool JKQTFastPlotter::getXAxisLabelVisible ( ) const
inline

plot x axis label

◆ getXAxisLog()

bool JKQTFastPlotter::getXAxisLog ( ) const
inline

is x axis logarithmic?

◆ getXMax()

double JKQTFastPlotter::getXMax ( ) const
inline

maximum value of x axis

◆ getXMin()

double JKQTFastPlotter::getXMin ( ) const
inline

minimum value of x axis

◆ getXTickDistance()

double JKQTFastPlotter::getXTickDistance ( ) const
inline

distance between two labels on x axis

◆ getXZeroTick()

double JKQTFastPlotter::getXZeroTick ( ) const
inline

a label position from which axis label plotting is started for the x axis

◆ getYAxisLabel()

QString JKQTFastPlotter::getYAxisLabel ( ) const
inline

label of y axis

◆ getYAxisLabelVisible()

bool JKQTFastPlotter::getYAxisLabelVisible ( ) const
inline

plot y axis label

◆ getYAxisLog()

bool JKQTFastPlotter::getYAxisLog ( ) const
inline

is x axis logarithmic?

◆ getYMax()

double JKQTFastPlotter::getYMax ( ) const
inline

maximum value of y axis

◆ getYMin()

double JKQTFastPlotter::getYMin ( ) const
inline

minimum value of y axis

◆ getYTickDistance()

double JKQTFastPlotter::getYTickDistance ( ) const
inline

distance between two labels on y axis

◆ getYZeroTick()

double JKQTFastPlotter::getYZeroTick ( ) const
inline

a label position from which axis label plotting is started for the y axis

◆ isPlotUpdateEnabled()

bool JKQTFastPlotter::isPlotUpdateEnabled ( ) const
inline

if false the plotting won't be performed (may be used to set more than one parameter without replot

◆ minimumSizeHint()

QSize JKQTFastPlotter::minimumSizeHint ( ) const
overrideprotected

◆ mouseDoubleClickEvent()

virtual void JKQTFastPlotter::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprotectedvirtual

event handler for a double click

◆ mouseDragFinished

void JKQTFastPlotter::mouseDragFinished ( double  x_start,
double  y_start,
double  x_end,
double  y_end,
Qt::KeyboardModifiers  modifiers 
)
signal

emitted after the mouse has been dragged with the left button clicked

◆ mouseDragged

void JKQTFastPlotter::mouseDragged ( double  x_start,
double  y_start,
double  x_end,
double  y_end,
Qt::KeyboardModifiers  modifiers 
)
signal

emitted when the mouse has been dragged with the left button clicked

◆ mouseMoved

void JKQTFastPlotter::mouseMoved ( double  x,
double  y 
)
signal

emitted whenever the mouse is clicked inside the plot

◆ mouseMoveEvent()

virtual void JKQTFastPlotter::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

event handler for a mouse move

◆ mousePressEvent()

virtual void JKQTFastPlotter::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

event handler for a mouse button press

◆ mouseReleaseEvent()

virtual void JKQTFastPlotter::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

event handler for a mouse button is released

◆ p2x()

double JKQTFastPlotter::p2x ( long  x)
inline

return x coordinate from x-pixel

◆ p2y()

double JKQTFastPlotter::p2y ( long  y)
inline

return y coordinate from y-pixel

◆ paintEvent()

virtual void JKQTFastPlotter::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

this simply paints the stored image to the widget's surface

◆ plotGraphs()

void JKQTFastPlotter::plotGraphs ( QPainter &  painter)
protected

paint the graphs

◆ plotSystem()

void JKQTFastPlotter::plotSystem ( QPainter &  painter)
protected

paint the coordinate system

◆ plotterSizesChanged

void JKQTFastPlotter::plotterSizesChanged ( )
signal

emitted whenever the graph sizes (borders, plotWidth, plotHeight) change

◆ redrawPlot

void JKQTFastPlotter::redrawPlot ( )
slot

replot everything (slowest possible plotting)

◆ redrawPlotImmediate

void JKQTFastPlotter::redrawPlotImmediate ( )
slot

replot everything (slowest possible plotting) and forces a repaint calling QWidget::repaint()

◆ replotting

void JKQTFastPlotter::replotting ( )
signal

emitted whenever the graph is replotted

◆ resizeEvent()

virtual void JKQTFastPlotter::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

resizes the internal representation (image) of the graphs

◆ setAspectRatio()

void JKQTFastPlotter::setAspectRatio ( double  __value)
inline

aspect ratio of the plot, only used when maintainAspectRation is true

The aspect ratio is defined as width/height of the plot in pt. So if you want to have a plot spanning x=0..20 and y=0..10 where each 1x1 square should be as wide as high you will have to set aspectRatio to 2 .

Note
Note that aspect ratios only make sense for linear-linear plots. This will be ignored if any one axis is logarithmic.

◆ setBackgroundColor()

void JKQTFastPlotter::setBackgroundColor ( const QColor &  __value)
inline

color of the background

◆ setDragLine()

void JKQTFastPlotter::setDragLine ( bool  __value)
inline

◆ setDragShapePen()

void JKQTFastPlotter::setDragShapePen ( const QPen &  __value)
inline

◆ setDrawGrid()

void JKQTFastPlotter::setDrawGrid ( bool  __value)
inline

indicates whether to draw a grid

◆ setDrawSystemBox()

void JKQTFastPlotter::setDrawSystemBox ( bool  __value)
inline

indicates whether to draw a system box

◆ setDrawZeroAxes()

void JKQTFastPlotter::setDrawZeroAxes ( bool  __value)
inline

indicates whether to draw axes at x=0/y=0

◆ setGridColor()

void JKQTFastPlotter::setGridColor ( const QColor &  __value)
inline

color of the coordinate grid

◆ setGridStyle()

void JKQTFastPlotter::setGridStyle ( Qt::PenStyle  __value)
inline

style of the coordinate grid

◆ setGridWidth()

void JKQTFastPlotter::setGridWidth ( double  __value)
inline

width of the coordinate grid (in pixel)

◆ setLabelFontName()

void JKQTFastPlotter::setLabelFontName ( const QString &  __value)
inline

font name of the axis labels

◆ setLabelFontSize()

void JKQTFastPlotter::setLabelFontSize ( double  __value)
inline

font size (in points) of the axis labels

◆ setMaintainAspectRatio()

void JKQTFastPlotter::setMaintainAspectRatio ( bool  __value)
inline

indicates whether to maintain a specific aspect ratio

◆ setPlotBackgroundColor()

void JKQTFastPlotter::setPlotBackgroundColor ( const QColor &  __value)
inline

color of the plot's background

Note
the background is not drawn if this color is set to QColor(Qt::transparent) !

◆ setPlotBorderBottom()

void JKQTFastPlotter::setPlotBorderBottom ( int  __value)
inline

free space between widget bottom border and plot bottom border

◆ setPlotBorderLeft()

void JKQTFastPlotter::setPlotBorderLeft ( int  __value)
inline

free space between widget left border and plot left border

◆ setPlotBorderRight()

void JKQTFastPlotter::setPlotBorderRight ( int  __value)
inline

free space between widget right border and plot left border

◆ setPlotBorderTop()

void JKQTFastPlotter::setPlotBorderTop ( int  __value)
inline

free space between widget top border and plot bottom border

◆ setPlotUpdateEnabled()

void JKQTFastPlotter::setPlotUpdateEnabled ( bool  __value)
inline

if false the plotting won't be performed (may be used to set more than one parameter without replot

◆ setSynchronizeX()

void JKQTFastPlotter::setSynchronizeX ( JKQTFastPlotter __value)
inline

synchronize x-axis settings to this plotter

◆ setSynchronizeY()

void JKQTFastPlotter::setSynchronizeY ( JKQTFastPlotter __value)
inline

synchronize y-axis settings to this plotter

◆ setSystemColor()

void JKQTFastPlotter::setSystemColor ( const QColor &  __value)
inline

color of the coordinate system

◆ setSystemWidth()

void JKQTFastPlotter::setSystemWidth ( double  __value)
inline

width of the coordinate (in pixel)

◆ setTickFontName()

void JKQTFastPlotter::setTickFontName ( const QString &  __value)
inline

font name of the tick labels

◆ setTickFontSize()

void JKQTFastPlotter::setTickFontSize ( double  __value)
inline

font size (in points) of the tick labels

◆ setTickLength()

void JKQTFastPlotter::setTickLength ( double  __value)
inline

length of an axis tick (pixels)

◆ setXAxisLabel()

void JKQTFastPlotter::setXAxisLabel ( const QString &  __value)
inline

label of x axis

◆ setXAxisLabelVisible()

void JKQTFastPlotter::setXAxisLabelVisible ( bool  __value)
inline

plot x axis label

◆ setXMax

void JKQTFastPlotter::setXMax ( double  value)
slot

set xMax

◆ setXMin

void JKQTFastPlotter::setXMin ( double  value)
slot

set xMin

◆ setXRange()

void JKQTFastPlotter::setXRange ( double  min,
double  max,
bool  logarithmic = false 
)

set the properties of the x axis

◆ setXTickDistance()

void JKQTFastPlotter::setXTickDistance ( double  __value)
inline

distance between two labels on x axis

◆ setXYRange()

void JKQTFastPlotter::setXYRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax,
bool  xlogarithmic = false,
bool  ylogarithmic = false 
)

set the properties of both axes

◆ setXZeroTick()

void JKQTFastPlotter::setXZeroTick ( double  __value)
inline

a label position from which axis label plotting is started for the x axis

◆ setYAxisLabel()

void JKQTFastPlotter::setYAxisLabel ( const QString &  __value)
inline

label of y axis

◆ setYAxisLabelVisible()

void JKQTFastPlotter::setYAxisLabelVisible ( bool  __value)
inline

plot y axis label

◆ setYMax

void JKQTFastPlotter::setYMax ( double  value)
slot

set yMax

◆ setYMin

void JKQTFastPlotter::setYMin ( double  value)
slot

set yMin

◆ setYRange()

void JKQTFastPlotter::setYRange ( double  min,
double  max,
bool  logarithmic = false 
)

set the properties of the y axis

◆ setYTickDistance()

void JKQTFastPlotter::setYTickDistance ( double  __value)
inline

distance between two labels on y axis

◆ setYZeroTick()

void JKQTFastPlotter::setYZeroTick ( double  __value)
inline

a label position from which axis label plotting is started for the y axis

◆ updateData

void JKQTFastPlotter::updateData ( )
slot

replot only the data

This internally calls QWidget::update(), so no immediate repaint() is forced! If you want an immediate update, call updateDataImmediate() instead!

◆ updateDataImmediate

void JKQTFastPlotter::updateDataImmediate ( )
slot

replot only the data, forces a redraw by calling QWidget::repaint()

◆ x2p()

double JKQTFastPlotter::x2p ( double  x)
inline

return x-pixel coordinate from x coordinate

◆ y2p()

double JKQTFastPlotter::y2p ( double  y)
inline

return y-pixel coordinate from y coordinate

Member Data Documentation

◆ ABS_MIN_LINEWIDTH

const double JKQTFastPlotter::ABS_MIN_LINEWIDTH
static

smallest allowed line width for JKQTFastPlotter

◆ actCopyImage

QAction* JKQTFastPlotter::actCopyImage
protected

◆ aspectRatio

double JKQTFastPlotter::aspectRatio
protected

aspect ratio of the plot, only used when maintainAspectRation is true

The aspect ratio is defined as width/height of the plot in pt. So if you want to have a plot spanning x=0..20 and y=0..10 where each 1x1 square should be as wide as high you will have to set aspectRatio to 2 .

Note
Note that aspect ratios only make sense for linear-linear plots. This will be ignored if any one axis is logarithmic.

◆ backgroundColor

QColor JKQTFastPlotter::backgroundColor
protected

color of the background

◆ default_backgroundColor

QColor JKQTFastPlotter::default_backgroundColor
protected

default value for property backgroundColor.

See also
backgroundColor for more information

◆ default_drawGrid

bool JKQTFastPlotter::default_drawGrid
protected

default value for property drawGrid.

See also
drawGrid for more information

◆ default_drawSystemBox

bool JKQTFastPlotter::default_drawSystemBox
protected

default value for property drawSystemBox.

See also
drawSystemBox for more information

◆ default_drawZeroAxes

bool JKQTFastPlotter::default_drawZeroAxes
protected

default value for property drawZeroAxes.

See also
drawZeroAxes for more information

◆ default_gridColor

QColor JKQTFastPlotter::default_gridColor
protected

default value for property gridColor.

See also
gridColor for more information

◆ default_gridStyle

Qt::PenStyle JKQTFastPlotter::default_gridStyle
protected

default value for property gridStyle.

See also
gridStyle for more information

◆ default_gridWidth

double JKQTFastPlotter::default_gridWidth
protected

default value for property gridWidth.

See also
gridWidth for more information

◆ default_labelFontName

QString JKQTFastPlotter::default_labelFontName
protected

default value for property labelFontName.

See also
labelFontName for more information

◆ default_labelFontSize

double JKQTFastPlotter::default_labelFontSize
protected

default value for property labelFontSize.

See also
labelFontSize for more information

◆ default_plotBackgroundColor

QColor JKQTFastPlotter::default_plotBackgroundColor
protected

default value for property plotBackgroundColor.

See also
plotBackgroundColor for more information

◆ default_plotBorderBottom

int JKQTFastPlotter::default_plotBorderBottom
protected

default value for property plotBorderBottom.

See also
plotBorderBottom for more information

◆ default_plotBorderLeft

int JKQTFastPlotter::default_plotBorderLeft
protected

default value for property plotBorderLeft.

See also
plotBorderLeft for more information

◆ default_plotBorderRight

int JKQTFastPlotter::default_plotBorderRight
protected

default value for property plotBorderRight.

See also
plotBorderRight for more information

◆ default_plotBorderTop

int JKQTFastPlotter::default_plotBorderTop
protected

default value for property plotBorderTop.

See also
plotBorderTop for more information

◆ default_systemColor

QColor JKQTFastPlotter::default_systemColor
protected

default value for property systemColor.

See also
systemColor for more information

◆ default_systemWidth

double JKQTFastPlotter::default_systemWidth
protected

default value for property systemWidth.

See also
systemWidth for more information

◆ default_tickFontName

QString JKQTFastPlotter::default_tickFontName
protected

default value for property tickFontName.

See also
tickFontName for more information

◆ default_tickFontSize

double JKQTFastPlotter::default_tickFontSize
protected

default value for property tickFontSize.

See also
tickFontSize for more information

◆ default_tickLength

double JKQTFastPlotter::default_tickLength
protected

default value for property tickLength.

See also
tickLength for more information

◆ doDrawing

bool JKQTFastPlotter::doDrawing
protected

if false the plotting won't be performed (may be used to set more than one parameter without replot

◆ doFullRepaint

bool JKQTFastPlotter::doFullRepaint
protected

indicates whether to do full repaint (system and data) at the next repaint (any of the repaint meothods)

◆ dragging

bool JKQTFastPlotter::dragging
protected

◆ dragLine

bool JKQTFastPlotter::dragLine
protected

◆ dragShapePen

QPen JKQTFastPlotter::dragShapePen
protected

◆ drawGrid

bool JKQTFastPlotter::drawGrid
protected

indicates whether to draw a grid

◆ drawSystemBox

bool JKQTFastPlotter::drawSystemBox
protected

indicates whether to draw a system box

◆ drawZeroAxes

bool JKQTFastPlotter::drawZeroAxes
protected

indicates whether to draw axes at x=0/y=0

◆ gridColor

QColor JKQTFastPlotter::gridColor
protected

color of the coordinate grid

◆ gridStyle

Qt::PenStyle JKQTFastPlotter::gridStyle
protected

style of the coordinate grid

◆ gridWidth

double JKQTFastPlotter::gridWidth
protected

width of the coordinate grid (in pixel)

◆ image

QImage JKQTFastPlotter::image
protected

this stores the currently displayed plot

◆ internalPlotBorderBottom

int JKQTFastPlotter::internalPlotBorderBottom
protected

internally calculated: free space between widget bottom border and plot bottom border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ internalPlotBorderLeft

int JKQTFastPlotter::internalPlotBorderLeft
protected

internally calculated: free space between widget left border and plot left border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ internalPlotBorderRight

int JKQTFastPlotter::internalPlotBorderRight
protected

internally calculated: free space between widget right border and plot left border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ internalPlotBorderTop

int JKQTFastPlotter::internalPlotBorderTop
protected

internally calculated: free space between widget top border and plot bottom border

Note
This is the actual border used for plotting, as it may be different from what the user supplied. Note also that this is at least as huge as the suer supplied border value!

◆ labelFontName

QString JKQTFastPlotter::labelFontName
protected

font name of the axis labels

◆ labelFontSize

double JKQTFastPlotter::labelFontSize
protected

font size (in points) of the axis labels

◆ LUTSIZE

const size_t JKQTFastPlotter::LUTSIZE
static

size of the lookup tables used by JKQTFPimagePlot_array2image()

◆ maintainAspectRatio

bool JKQTFastPlotter::maintainAspectRatio
protected

indicates whether to maintain a specific aspect ratio

◆ mouseDragEnd

QPoint JKQTFastPlotter::mouseDragEnd
protected

◆ mouseDragStart

QPoint JKQTFastPlotter::mouseDragStart
protected

◆ mutexRepaint

QMutex JKQTFastPlotter::mutexRepaint
protected

mutex to lock global widget repaint

◆ mutexRepaintData

QMutex JKQTFastPlotter::mutexRepaintData
protected

mutex to lock data repaint

◆ mutexRepaintSystem

QMutex JKQTFastPlotter::mutexRepaintSystem
protected

mutex to lock system repaint

◆ oldImage

QImage JKQTFastPlotter::oldImage
protected

this can be used when drawing a zoom rectangle to store an unchanged copy of the currently displayed image.

◆ plotBackgroundColor

QColor JKQTFastPlotter::plotBackgroundColor
protected

color of the plot's background

Note
the background is not drawn if this color is set to QColor(Qt::transparent) !

◆ plotBorderBottom

int JKQTFastPlotter::plotBorderBottom
protected

free space between widget bottom border and plot bottom border

◆ plotBorderLeft

int JKQTFastPlotter::plotBorderLeft
protected

free space between widget left border and plot left border

◆ plotBorderRight

int JKQTFastPlotter::plotBorderRight
protected

free space between widget right border and plot left border

◆ plotBorderTop

int JKQTFastPlotter::plotBorderTop
protected

free space between widget top border and plot bottom border

◆ plotHeight

int JKQTFastPlotter::plotHeight
protected

plot height in pt inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)

◆ plots

QVector<JKQTFPPlot*> JKQTFastPlotter::plots
protected

list of plots in this graph

◆ plotWidth

int JKQTFastPlotter::plotWidth
protected

plot width in pt inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)

◆ synchronizeX

JKQTFastPlotter* JKQTFastPlotter::synchronizeX
protected

synchronize x-axis settings to this plotter

◆ synchronizeY

JKQTFastPlotter* JKQTFastPlotter::synchronizeY
protected

synchronize y-axis settings to this plotter

◆ systemColor

QColor JKQTFastPlotter::systemColor
protected

color of the coordinate system

◆ systemImage

QImage JKQTFastPlotter::systemImage
protected

this stores the currently displayed coordinate system

◆ systemWidth

double JKQTFastPlotter::systemWidth
protected

width of the coordinate (in pixel)

◆ tickFontName

QString JKQTFastPlotter::tickFontName
protected

font name of the tick labels

◆ tickFontSize

double JKQTFastPlotter::tickFontSize
protected

font size (in points) of the tick labels

◆ tickLength

double JKQTFastPlotter::tickLength
protected

length of an axis tick (pixels)

◆ xAxisLabel

QString JKQTFastPlotter::xAxisLabel
protected

label of x axis

◆ xAxisLabelVisible

bool JKQTFastPlotter::xAxisLabelVisible
protected

plot x axis label

◆ xAxisLog

bool JKQTFastPlotter::xAxisLog
protected

is x axis logarithmic?

◆ xMax

double JKQTFastPlotter::xMax
protected

maximum value of x axis

◆ xMin

double JKQTFastPlotter::xMin
protected

minimum value of x axis

◆ xOffset

double JKQTFastPlotter::xOffset
protected

x axis offset (calculated internally)

◆ xScale

double JKQTFastPlotter::xScale
protected

x axis scaling factor (calculated internally)

◆ xTickDistance

double JKQTFastPlotter::xTickDistance
protected

distance between two labels on x axis

◆ xWidth

double JKQTFastPlotter::xWidth
protected

width of plot on x axis (calculated internally)

◆ xZeroTick

double JKQTFastPlotter::xZeroTick
protected

a label position from which axis label plotting is started for the x axis

◆ yAxisLabel

QString JKQTFastPlotter::yAxisLabel
protected

label of y axis

◆ yAxisLabelVisible

bool JKQTFastPlotter::yAxisLabelVisible
protected

plot y axis label

◆ yAxisLog

bool JKQTFastPlotter::yAxisLog
protected

is x axis logarithmic?

◆ yMax

double JKQTFastPlotter::yMax
protected

maximum value of y axis

◆ yMin

double JKQTFastPlotter::yMin
protected

minimum value of y axis

◆ yOffset

double JKQTFastPlotter::yOffset
protected

y axis offset (calculated internally)

◆ yScale

double JKQTFastPlotter::yScale
protected

y axis scaling factor (calculated internally)

◆ yTickDistance

double JKQTFastPlotter::yTickDistance
protected

distance between two labels on y axis

◆ yWidth

double JKQTFastPlotter::yWidth
protected

width of plot on y axis (calculated internally)

◆ yZeroTick

double JKQTFastPlotter::yZeroTick
protected

a label position from which axis label plotting is started for the y axis


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