Relacs Plot Library
0.9.8
|
#include <multiplot.h>
Public Slots | |
void | popRanges (void) |
void | resetRanges (void) |
Signals | |
void | changedRanges (int id) |
void | resizePlots (QResizeEvent *qre) |
Public Member Functions | |
MultiPlot (int plots, int columns, bool horizontal, Plot::KeepMode keep=Plot::Copy, QWidget *parent=0) | |
MultiPlot (int plots, int columns, bool horizontal=true, QWidget *parent=0) | |
MultiPlot (int plots, Plot::KeepMode keep, QWidget *parent=0) | |
MultiPlot (int plots, QWidget *parent=0) | |
MultiPlot (QWidget *parent=0) | |
~MultiPlot (void) | |
void | lock (void) |
bool | tryLock (int timeoutms=1) |
void | unlock (void) |
void | setDataMutex (QMutex *mutex) |
void | setDataMutex (QReadWriteLock *mutex) |
void | clearDataMutex (void) |
int | size (void) const |
bool | empty (void) const |
void | resize (int plots, Plot::KeepMode keep=Plot::Copy) |
void | resize (int plots, int columns, bool horizontal, Plot::KeepMode keep=Plot::Copy) |
void | clear (void) |
void | erase (int index) |
Plot & | operator[] (int i) |
Plot & | back (void) |
Plot & | front (void) |
void | layout (int columns, bool horizontal=true) |
void | layout (void) |
void | setCommonXRange (int plot1, int plot2) |
void | setCommonXRange (void) |
void | setCommonYRange (int plot1, int plot2) |
void | setCommonYRange (void) |
void | setCommonRange (int plot1, int plot2) |
void | setCommonRange (void) |
virtual QSize | sizeHint (void) const |
virtual QSize | minimumSizeHint (void) const |
void | draw (void) |
void | setDrawBackground (void) |
void | clearPlots (void) |
void | enableMouse (void) |
void | disableMouse (void) |
Protected Slots | |
void | setRanges (int id) |
Protected Member Functions | |
void | paintEvent (QPaintEvent *qpe) |
void | resizeEvent (QResizeEvent *qre) |
void | customEvent (QEvent *qce) |
void | doResize (int plots, Plot::KeepMode keep) |
void | doClear (void) |
void | doErase (int index) |
virtual void | mousePressEvent (QMouseEvent *qme) |
virtual void | mouseReleaseEvent (QMouseEvent *qme) |
virtual void | mouseDoubleClickEvent (QMouseEvent *qme) |
virtual void | mouseMoveEvent (QMouseEvent *qme) |
Having several Plots in a single widget.
MultiPlot | ( | int | plots, |
int | columns, | ||
bool | horizontal, | ||
Plot::KeepMode | keep = Plot::Copy , |
||
QWidget * | parent = 0 |
||
) |
Constructs plots plots with KeepMode keep. If you set keep to Plot::Pointer and you are using multible threads, then you need to provide a mutex for locking the data via setDataMutex().
MultiPlot | ( | int | plots, |
int | columns, | ||
bool | horizontal = true , |
||
QWidget * | parent = 0 |
||
) |
Constructs plots plots.
References Plot::Copy.
MultiPlot | ( | int | plots, |
Plot::KeepMode | keep, | ||
QWidget * | parent = 0 |
||
) |
Constructs plots plots with KeepMode keep. If you set keep to Plot::Pointer and you are using multible threads, then you need to provide a mutex for locking the data via setDataMutex().
MultiPlot | ( | int | plots, |
QWidget * | parent = 0 |
||
) |
References Plot::Copy.
MultiPlot | ( | QWidget * | parent = 0 | ) |
References Plot::Copy.
~MultiPlot | ( | void | ) |
References MultiPlot::clear().
void lock | ( | void | ) |
Lock the plot mutex.
Referenced by Plot::mouseAnalyse(), Plot::mouseSelect(), Plot::mouseSetCursor(), Plot::mouseZoomMoveFirstX(), Plot::mouseZoomMoveFirstY(), and Plot::mouseZoomMovePlot().
bool tryLock | ( | int | timeoutms = 1 | ) |
Try to lock the plot mutex for at maximum timeoutms milliseconds.
void unlock | ( | void | ) |
Unlock the plot mutex.
Referenced by Plot::mouseAnalyse(), Plot::mouseSelect(), Plot::mouseSetCursor(), Plot::mouseZoomMoveFirstX(), Plot::mouseZoomMoveFirstY(), and Plot::mouseZoomMovePlot().
void setDataMutex | ( | QMutex * | mutex | ) |
Provide a mutex for all subplots that is used to lock access to all data while they are plotted. If you want to change the mutex, you first have to disable the mutex by calling clearDataMutex().
Referenced by MultiPlot::setDataMutex().
void setDataMutex | ( | QReadWriteLock * | mutex | ) |
Provide a mutex for all subplots that is used to lock reading access to all data while they are plotted. If you want to change the mutex, you first have to disable the mutex by calling clearDataMutex().
References MultiPlot::setDataMutex().
void clearDataMutex | ( | void | ) |
Disables the data mutex and the data mutexes of the subplots.
int size | ( | void | ) | const |
The number of Plots in the MultiPlot widget.
Referenced by MultiPlot::doResize().
void resize | ( | int | plots, |
Plot::KeepMode | keep = Plot::Copy |
||
) |
Change the number of plots to plots. The zoom-stacks of all plots are reset (Plot::resetRanges() ) and the common X and Y ranges are cleared.
References MultiPlot::doResize().
Referenced by MultiPlot::resize().
void resize | ( | int | plots, |
int | columns, | ||
bool | horizontal, | ||
Plot::KeepMode | keep = Plot::Copy |
||
) |
Change the number of plots to plots and update the layout. The zoom-stacks of all plots are reset (Plot::resetRanges() ) and the common X and Y ranges are cleared.
References MultiPlot::layout(), and MultiPlot::resize().
void clear | ( | void | ) |
Remove all Plots from the MultiPlot widget.
References MultiPlot::doClear().
Referenced by MultiPlot::~MultiPlot().
void erase | ( | int | index | ) |
Remove Plot number index from the MultiPlot widget.
References MultiPlot::doErase().
|
inline |
The Plot-widget i.
void layout | ( | int | columns, |
bool | horizontal = true |
||
) |
References MultiPlot::layout().
void layout | ( | void | ) |
Referenced by MultiPlot::layout(), and MultiPlot::resize().
void setCommonXRange | ( | int | plot1, |
int | plot2 | ||
) |
void setCommonXRange | ( | void | ) |
Referenced by MultiPlot::setCommonRange().
void setCommonYRange | ( | int | plot1, |
int | plot2 | ||
) |
void setCommonYRange | ( | void | ) |
Referenced by MultiPlot::setCommonRange().
void setCommonRange | ( | int | plot1, |
int | plot2 | ||
) |
References MultiPlot::setCommonXRange(), and MultiPlot::setCommonYRange().
void setCommonRange | ( | void | ) |
References MultiPlot::setCommonXRange(), and MultiPlot::setCommonYRange().
|
virtual |
Give a hint for the prefered size of this widget.
References relacs::ceil().
|
virtual |
Give a hint for the minimum size of this widget.
References relacs::ceil().
void draw | ( | void | ) |
Draw the Plots.
Referenced by Plot::draw().
void setDrawBackground | ( | void | ) |
To be called from a Plot to request to redraw the background.
Referenced by Plot::setOrigin(), and Plot::setSize().
void clearPlots | ( | void | ) |
Clear each Plot from data, i.e. call Plot::clear() for each Plot.
void enableMouse | ( | void | ) |
Enable mouse support for all subplots.
void disableMouse | ( | void | ) |
Disable mouse support for all subplots.
|
signal |
Ranges of some plots have been changed due to a change in plot id. The plot range was changed by the user. Both the MultiPlot mutex and the mutex of the Plot that initiated the changed ranges are locked.
Referenced by MultiPlot::setRanges().
|
signal |
This signal is emitted whenever the MultiPlot widget receives a resizeEvent() before processing it. Can be used to change e.g. the origin and size of the plots.
Referenced by MultiPlot::resizeEvent().
|
slot |
Set the ranges of all stacks according to the last zoom-stack entry and remove it from the stack.
|
slot |
Clears the zoom stack of all plots.
|
protected |
Paints the entire plot.
References Plot::draw(), Plot::scale(), Plot::tryLockData(), and Plot::unlockData().
|
protected |
References MultiPlot::resizePlots().
|
protected |
References MultiPlot::doClear(), MultiPlot::doErase(), and MultiPlot::doResize().
|
protected |
References MultiPlot::doClear(), MultiPlot::setRanges(), and MultiPlot::size().
Referenced by MultiPlot::customEvent(), and MultiPlot::resize().
|
protected |
Referenced by MultiPlot::clear(), MultiPlot::customEvent(), and MultiPlot::doResize().
|
protected |
Referenced by MultiPlot::customEvent(), and MultiPlot::erase().
|
protectedvirtual |
The Qt mouse event handler for a mouse press event. Dispatches the event to the appropriate Plot.
|
protectedvirtual |
The Qt mouse event handler for a mouse release event. Dispatches the event to the appropriate Plot.
|
protectedvirtual |
The Qt mouse event handler for a mouse doouble click event. Dispatches the event to the appropriate Plot.
|
protectedvirtual |
The Qt mouse event handler for a mouse move event. Dispatches the event to the appropriate Plot.
|
protectedslot |
References MultiPlot::changedRanges().
Referenced by MultiPlot::doResize().