COPASI API
4.16.103
|
#include <CopasiPlot.h>
Public Slots | |
virtual void | replot () |
Signals | |
void | replotSignal () |
Public Member Functions | |
virtual bool | compile (std::vector< CCopasiContainer * > listOfContainer, const CCopasiDataModel *pDataModel) |
CopasiPlot (const CPlotSpecification *plotspec, QWidget *parent=NULL) | |
virtual void | finish () |
bool | initFromSpec (const CPlotSpecification *plotspec) |
virtual void | output (const Activity &activity) |
bool | saveData (const std::string &filename) |
virtual void | separate (const Activity &activity) |
void | setCurvesVisibility (const bool &visibility) |
virtual | ~CopasiPlot () |
![]() | |
virtual void | close () |
COutputInterface () | |
COutputInterface (const COutputInterface &src) | |
virtual const std::set< const CCopasiObject * > & | getObjects () const |
virtual void | output (const Activity &) |
virtual void | separate (const Activity &) |
virtual | ~COutputInterface () |
Public Attributes | |
QwtPlotZoomer * | mpZoomer |
Protected Attributes | |
bool | mReplotFinished |
![]() | |
std::set< const CCopasiObject * > | mObjects |
Private Slots | |
void | showCurve (QwtPlotItem *item, bool on) |
Private Member Functions | |
void | clearBuffers () |
CopasiPlot (QWidget *parent=NULL) | |
void | resizeCurveData (const size_t &activity) |
void | setAxisUnits (const C_INT32 &index, const CCopasiObject *pObject) |
void | updateCurves (const size_t &activity) |
void | updatePlot () |
Private Attributes | |
std::map< std::string, C2DPlotCurve * > | mCurveMap |
CVector< C2DPlotCurve * > | mCurves |
std::vector< std::vector < CVector< double > * > > | mData |
size_t | mDataAfter |
size_t | mDataBefore |
size_t | mDataDuring |
std::vector< std::vector < std::pair< Activity, size_t > > > | mDataIndex |
std::vector< size_t > | mDataSize |
bool | mHaveAfter |
bool | mHaveBefore |
bool | mHaveDuring |
bool | mIgnoreUpdate |
QMutex | mMutex |
CCopasiTimeVariable | mNextPlotTime |
std::map< Activity, std::map < const CCopasiObject *, size_t > > | mObjectIndex |
std::vector< std::vector< bool > > | mObjectInteger |
std::vector< std::vector < const C_FLOAT64 * > > | mObjectValues |
const CPlotSpecification * | mpPlotSpecification |
std::vector< std::vector < const CCopasiObject * > > | mSaveCurveObjects |
std::vector< const CCopasiObject * > | mSaveHistogramObjects |
Static Private Attributes | |
static C_FLOAT64 | MissingValue = std::numeric_limits<C_FLOAT64>::quiet_NaN() |
Additional Inherited Members | |
![]() | |
enum | Activity { BEFORE = 0x01, DURING = 0x02, AFTER = 0x04 } |
Definition at line 221 of file CopasiPlot.h.
|
private |
Default constructor which may never be called.
QWidget* | parent (default: NULL) |
Definition at line 762 of file CopasiPlot.cpp.
CopasiPlot::CopasiPlot | ( | const CPlotSpecification * | plotspec, |
QWidget * | parent = NULL |
||
) |
Specific constructor
const | CPlotSpecification* plotspec |
QWidget* | parent (default: NULL) |
Definition at line 779 of file CopasiPlot.cpp.
References ActivitySize, initFromSpec(), mData, mDataIndex, mDataSize, mObjectInteger, mObjectValues, mpZoomer, replot(), replotSignal(), and showCurve().
|
virtual |
|
private |
Clear all allocate buffers and set reset values
Definition at line 1675 of file CopasiPlot.cpp.
References ActivitySize, mData, mDataAfter, mDataBefore, mDataDuring, mDataIndex, mDataSize, mHaveAfter, mHaveBefore, mHaveDuring, mObjectIndex, mObjectInteger, COutputInterface::mObjects, mObjectValues, mSaveCurveObjects, and mSaveHistogramObjects.
Referenced by compile(), and ~CopasiPlot().
|
virtual |
compile the object list from name vector
std::vector< | CCopasiContainer * > listOfContainer |
const | CCopasiDataModel* pDataModel |
Reimplemented from COutputInterface.
Definition at line 1035 of file CopasiPlot.cpp.
References ActivitySize, COutputInterface::AFTER, CVectorCore< CType >::array(), CPlotItem::bandedGraph, COutputInterface::BEFORE, C_FLOAT64, clearBuffers(), CPlotItem::curve2d, COutputInterface::DURING, fatalError, CPlotItem::getActivity(), CPlotItem::getChannels(), CCopasiTimeVariable::getCurrentWallTime(), CPlotSpecification::getItems(), CPlotItem::getNumChannels(), CPlotItem::getType(), CCopasiObject::getValuePointer(), CPlotItem::histoItem1d, CCopasiObject::isValueDbl(), CCopasiObject::isValueInt(), MCCopasiTask, mCurves, mData, mDataIndex, mHaveAfter, mHaveBefore, mHaveDuring, MissingValue, mNextPlotTime, mObjectIndex, mObjectInteger, COutputInterface::mObjects, mObjectValues, mpPlotSpecification, mReplotFinished, mSaveCurveObjects, mSaveHistogramObjects, CCopasiDataModel::ObjectFromName(), setAxisUnits(), CVectorCore< CType >::size(), CCopasiVector< T >::size(), and CCopasiMessage::WARNING.
Referenced by PlotWindow::compile().
|
virtual |
Finish the output
Reimplemented from COutputInterface.
Definition at line 1270 of file CopasiPlot.cpp.
References mNextPlotTime, mpZoomer, and replot().
Referenced by PlotWindow::finish().
bool CopasiPlot::initFromSpec | ( | const CPlotSpecification * | plotspec | ) |
Initialize the the plot from the specification
const | CPlotSpecification* plotspec |
Definition at line 836 of file CopasiPlot.cpp.
References CVectorCore< CType >::array(), CPlotItem::bandedGraph, CCopasiVector< T >::begin(), C_FLOAT64, C_INT32, CPlotItem::curve2d, CCopasiVector< T >::end(), FROM_UTF8, CQPlotColors::getColor(), CPlotSpecification::getItems(), CPlotItem::getTitle(), C2DPlotCurve::getType(), CPlotItem::histoItem1d, CPlotSpecification::isLogX(), CPlotSpecification::isLogY(), mCurveMap, mCurves, mIgnoreUpdate, mMutex, mpPlotSpecification, mpZoomer, pdelete, CVector< CType >::resize(), C2DPlotCurve::setIncrement(), showCurve(), and CCopasiVector< T >::size().
Referenced by CopasiPlot(), and PlotWindow::initFromSpec().
Perform an output event for the current activity
const | Activity & activity |
Definition at line 1197 of file CopasiPlot.cpp.
References ActivitySize, COutputInterface::AFTER, COutputInterface::BEFORE, C_INT32, COutputInterface::DURING, mData, mDataAfter, mDataBefore, mDataDuring, mDataSize, mHaveAfter, mHaveBefore, mHaveDuring, mObjectInteger, mObjectValues, resizeCurveData(), and updatePlot().
Referenced by PlotWindow::output().
|
virtualslot |
Definition at line 1726 of file CopasiPlot.cpp.
References C_INVALID_INDEX, CCopasiTimeVariable::getCurrentWallTime(), CCopasiTimeVariable::getMicroSeconds(), mMutex, mNextPlotTime, mReplotFinished, and updateCurves().
Referenced by CopasiPlot(), finish(), setCurvesVisibility(), showCurve(), PlotWindow::toggleLogX(), and PlotWindow::toggleLogY().
|
signal |
Referenced by CopasiPlot(), and updatePlot().
|
private |
Resize the curve data
Definition at line 1306 of file CopasiPlot.cpp.
References CVectorCore< CType >::array(), CPlotItem::bandedGraph, CPlotItem::curve2d, fatalError, CPlotItem::histoItem1d, mCurves, mData, mDataIndex, pdelete, and CVectorCore< CType >::size().
Referenced by output(), and separate().
bool CopasiPlot::saveData | ( | const std::string & | filename | ) |
Save tab delimited data to file
const | std::string & filename |
Definition at line 1393 of file CopasiPlot.cpp.
References ActivitySize, COutputInterface::AFTER, CVectorCore< CType >::array(), COutputInterface::BEFORE, C_INT32, COutputInterface::DURING, CLocaleString::fromUtf8(), CPlotItem::histoItem1d, mCurves, mData, mDataAfter, mDataBefore, mDataDuring, mDataSize, MissingValue, mObjectIndex, COutputInterface::mObjects, mSaveCurveObjects, mSaveHistogramObjects, CVectorCore< CType >::size(), CHistoCurveData::size(), CHistoCurveData::x(), and CHistoCurveData::y().
Referenced by PlotWindow::slotSaveData().
Introduce an additional separator into the output
const | Activity & activity |
Definition at line 1233 of file CopasiPlot.cpp.
References ActivitySize, COutputInterface::AFTER, COutputInterface::BEFORE, C_INT32, COutputInterface::DURING, mData, mDataAfter, mDataBefore, mDataDuring, mDataSize, mHaveAfter, mHaveBefore, mHaveDuring, MissingValue, resizeCurveData(), and updatePlot().
Referenced by PlotWindow::separate().
|
private |
Set the units of the indexed axis based on the type of the object.
const | C_INT32 & index |
const | CCopasiObject * pObject |
Definition at line 1712 of file CopasiPlot.cpp.
References FROM_UTF8, and CCopasiObject::getUnits().
Referenced by compile().
void CopasiPlot::setCurvesVisibility | ( | const bool & | visibility | ) |
Shows or hide all curves depending on whether visibility is false or true
const | bool & visibility |
Definition at line 1656 of file CopasiPlot.cpp.
References mCurveMap, mIgnoreUpdate, and replot().
Referenced by PlotWindow::slotDeselectAll(), and PlotWindow::slotSelectAll().
|
privateslot |
Slot used to turn curves on and of through the legend buttons.
QwtPlotItem | *item |
bool | on |
Definition at line 1643 of file CopasiPlot.cpp.
References mIgnoreUpdate, and replot().
Referenced by CopasiPlot(), and initFromSpec().
|
private |
Tell the curves where the data is located. It must be called after reallocating the memory for the curve data.
Definition at line 1283 of file CopasiPlot.cpp.
References ActivitySize, CVectorCore< CType >::array(), C_INT32, C_INVALID_INDEX, mCurves, mDataSize, and CVectorCore< CType >::size().
Referenced by replot().
|
private |
Redraw the plot
Definition at line 1370 of file CopasiPlot.cpp.
References mReplotFinished, and replotSignal().
Referenced by output(), and separate().
|
private |
A map between a specification identified by its key and a curve
Definition at line 391 of file CopasiPlot.h.
Referenced by initFromSpec(), and setCurvesVisibility().
|
private |
The list of curves
Definition at line 386 of file CopasiPlot.h.
Referenced by compile(), initFromSpec(), resizeCurveData(), saveData(), and updateCurves().
|
private |
Vector that contains pointers to vectors of data in the selected columns.
Definition at line 344 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), CopasiPlot(), output(), resizeCurveData(), saveData(), and separate().
|
private |
Count of data lines recorded during activity AFTER.
Definition at line 416 of file CopasiPlot.h.
Referenced by clearBuffers(), output(), saveData(), and separate().
|
private |
Vector of the activity of each item (curve) Map of curve to the index to the corresponding histogram. Count of data lines recorded during activity BEFORE.
Definition at line 406 of file CopasiPlot.h.
Referenced by clearBuffers(), output(), saveData(), and separate().
|
private |
Count of data lines recorded during activity DURING.
Definition at line 411 of file CopasiPlot.h.
Referenced by clearBuffers(), output(), saveData(), and separate().
|
private |
Map curve and channel to index pair indicating where the data is stored.
Definition at line 375 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), CopasiPlot(), and resizeCurveData().
|
private |
Vector of actual data lines in the local buffers
Definition at line 370 of file CopasiPlot.h.
Referenced by clearBuffers(), CopasiPlot(), output(), saveData(), separate(), and updateCurves().
|
private |
Flag indicating whether there are any curves recording data during activity AFTER.
Definition at line 434 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), output(), and separate().
|
private |
Flag indicating whether there are any curves recording data during activity BEFORE.
Definition at line 422 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), output(), and separate().
|
private |
Flag indicating whether there are any curves recording data during activity DURING.
Definition at line 428 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), output(), and separate().
|
private |
Indicates whether redrawing/updating shall be suppressed during initialization.
Definition at line 449 of file CopasiPlot.h.
Referenced by initFromSpec(), setCurvesVisibility(), and showCurve().
The value for missing objects
Definition at line 334 of file CopasiPlot.h.
Referenced by compile(), saveData(), and separate().
|
private |
Mutex preventing access to data during reallocation.
Definition at line 339 of file CopasiPlot.h.
Referenced by initFromSpec(), and replot().
|
private |
The next time a plot update is performed
Definition at line 444 of file CopasiPlot.h.
|
private |
Map activity and object to index indicating where data is stored within the current activity.
Definition at line 381 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), and saveData().
|
private |
Vector of bool indicating whether the current object value is integer
Definition at line 354 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), CopasiPlot(), and output().
|
private |
Vector of pointers to the current object values
Definition at line 349 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), CopasiPlot(), and output().
|
private |
Pointer to the specification for the plot.
Definition at line 439 of file CopasiPlot.h.
Referenced by compile(), and initFromSpec().
QwtPlotZoomer* CopasiPlot::mpZoomer |
Pointer to the zooming engine for the plot.
Definition at line 455 of file CopasiPlot.h.
Referenced by CopasiPlot(), finish(), initFromSpec(), and PlotWindow::slotZoomOut().
|
protected |
Definition at line 458 of file CopasiPlot.h.
Referenced by compile(), replot(), and updatePlot().
|
private |
The order of 2d curve objects used when the data is saved. The first object in each vector is the object for the X axis.
Definition at line 360 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), and saveData().
|
private |
The order of histogram objects used when the data is saved.
Definition at line 365 of file CopasiPlot.h.
Referenced by clearBuffers(), compile(), and saveData().