MeVisLabToolboxReference
ml::CurveData Class Reference

Base object class representing a single curve object, consisting of zero or one X- and any number of Y-data series. More...

#include <mlCurveData.h>

Inheritance diagram for ml::CurveData:
ml::Base

List of all members.

Public Types

enum  {
  ctyLine, ctyArea, ctyDeltaArea, ctyLineDeltaArea,
  ctyErrorBar
}
 Curve type constants. More...

Public Member Functions

virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node.
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node.
 ML_SET_ADDSTATE_VERSION (1)
virtual CurveDatadeepCopy () const
 Create a deep copy of the CurveDate.
Initialization, destructor
 CurveData ()
 Default constructor.
 CurveData (const CurveData &curveData)
 Copy constructor, series data is copied.
virtual ~CurveData ()
 Destructor:
virtual CurveDataoperator= (const CurveData &srcCurve)
 Assignment operator, series data is copied.
Set curve data
virtual void clearData ()
 Clear curve data.
virtual void clear ()
 Clear curve data and reset curve properties.
virtual void setX (MLssize_t nPoints=0, double *data=0, MLssize_t step=1)
 Set X-series to nPoints double values copied from the source array data.
virtual void setY (MLssize_t nPoints, double *data, MLssize_t step=1)
 Set Y data to a single series of nPoints double values copied from the source array data.
virtual void setY (MLssize_t iSeries, MLssize_t nPoints, double *data, MLssize_t step=1)
 Set the iSeries-th Y-series to nPoints double values copied from the source array data.
virtual void setXValue (double value, MLssize_t iPoint)
 Set X-series value at index iPoint to value (ignored if index is out of range).
virtual void setYValue (double value, MLssize_t iSeries, MLssize_t iPoint)
 Set Y value at index iPoint in iSeries-th Y series to value (ignored if indices are out of range).
virtual void setYValue (double value, MLssize_t iPoint)
 Set Y value at index iPoint in first Y series to value (ignored if index is out of range).
virtual void resizeX (MLssize_t nPoints)
 Change length of X-series. New values are initialized to zero.
virtual void resizeY (MLssize_t nPoints)
 Change length of first Y-series. New values are initialized to zero.
virtual void resizeY (MLssize_t iSeries, MLssize_t nPoints)
 Change length of iSeries-th Y-series. New values are initialized to zero.
Get curve data
virtual MLssize_t getPoints ()
 Get number of data points (i.e. minimum length of all X- and Y-series)
virtual MLssize_t getNumSeries ()
 Get number of Y-series.
virtual double getXValue (MLssize_t iPoint)
 Get X-value at index iPoint, return 0 if index is out of range.
virtual double getYValue (MLssize_t iSeries, MLssize_t iPoint)
 Get Y value at index iPoint in iSeries-th Y series, 0 if out of range.
virtual double getYValue (MLssize_t iPoint)
 Get Y value at index iPoint in first Y series, 0 if out of range.
Set curve properties
virtual void setXRange (double xMin, double xMax)
 Explicitly set X value range to xMin ... xMax.
virtual void setAutoXRange ()
 Set X value range to 'automatic', i.e. dependent on X series data.
virtual void setYRange (double yMin, double yMax)
 Explicitly set Y value range to yMin ... yMax.
virtual void setAutoYRange ()
 Set Y value range to 'automatic', i.e. dependent on Y series data.
virtual void setCurveType (int type)
 Set curve type (use cty* curve type constants)
virtual void setCurveStyle (int style)
 Set curve style (= index into a style palette used for drawing)
virtual void setTitle (std::string title)
 Set curve title.
virtual void setUnit (std::string unit)
 Set curve unit.
virtual void setSymbol (std::string symbol)
 Set curve symbol.
Get curve properties
bool isAutoX ()
 Return true if X data is generated automatically (numbered 0, 1, ...)
virtual double getXMin ()
 Get minimum X data value.
virtual double getXMax ()
 Get maximum X data value.
virtual double getYMin ()
 Get minimum Y data value.
virtual double getYMax ()
 Get maximum Y data value.
virtual void getXYRange (double *xMin, double *xMax, double *yMin, double *yMax)
 Get X and Y value ranges (NULL pointers are allowed)
virtual int getCurveType ()
 Get curve type (equal to one of the cty* curve type constants)
virtual int getCurveStyle ()
 Get curve style (= index into a style palette used for drawing)
virtual std::string getTitle ()
 Get curve title.
virtual std::string getUnit ()
 Get curve unit.
virtual std::string getSymbol ()
 Get curve symbol.

Protected Member Functions

virtual void setXChanged ()
 Invalidate automatic X series properties.
virtual void setYChanged ()
 Invalidate automatic Y series properties.
virtual void setSeries (CurveSeries &v, MLssize_t nPoints, double *data, MLssize_t step)
 Set series data.
virtual void updateData ()
 Update callback.
virtual void updateAutoX ()
 Update automatically generated X data.
virtual void updateXRange ()
 Update automatically generated X range.
virtual void updateYRange ()
 Update automatically generated Y range.

Protected Attributes

CurveSeries _xData
 X series data.
std::vector< CurveSeries_yData
 Y series data.
bool _autoX
 Flag for automatically generated X data.
bool _autoXRange
 Flag for automatic X value ranges.
bool _autoYRange
 Flag for automatic Y value ranges.
bool _validXRange
 Flag indicating up-to-date X range values.
bool _validYRange
 Flag indicating up-to-date Y range values.
int _curveType
 Curve type (equal to one of the cty* curve type constants)
int _curveStyle
 Curve style (= index into a style palette used for drawing)
std::string _title
 Curve title.
std::string _unit
 Curve unit.
std::string _symbol
 Curve symbol.
X/Y range values
double _xMin
double _xMax
double _yMin
double _yMax

Deprecated methods.

void setX (MLssize_t nPoints, float *data, MLssize_t step=1)
void setY (MLssize_t nPoints, float *data, MLssize_t step=1)
 compatibility method
void setY (MLssize_t iSeries, MLssize_t nPoints, float *data, MLssize_t step=1)
 compatibility method
void getXYRange (float *xMin, float *xMax, float *yMin, float *yMax)
 compatibility method
void setSeries (CurveSeries &v, MLssize_t nPoints, float *data, MLssize_t step)
 compatibility method

Detailed Description

Base object class representing a single curve object, consisting of zero or one X- and any number of Y-data series.

All X- and Y-series should have the same number of elements. Together, they represent a series of (x, y1, y2, ...) tupels. If no X-series is specified, an automatic series (0, 1, ...) is generated automatically. The expected number and the meaning of the different Y-series depends on the curve type: For curve types requiring a single Y-series (e.g. ctyLine), all Y-series are considered as independent curves defined over the same set of X-coordinates. For curve types requiring pairs or triples of Y-series (e.g. ctyDeltaArea, ctyErrorBar), consecutive Y-series are grouped to pairs or triples, resp. The X- and Y-series data stored in a CurveData object are owned by the object.

Definition at line 52 of file mlCurveData.h.


Member Enumeration Documentation

anonymous enum

Curve type constants.

Enumerator:
ctyLine 

Single line, represented by a single Y-series.

ctyArea 

Shaded area under/above single line.

ctyDeltaArea 

Shaded area between two lines, represented by a pair of Y-series.

ctyLineDeltaArea 

Line and shaded area between two lines, represented by a triple of Y-series.

ctyErrorBar 

Line and error bars, represented by a triple of Y-series.

Definition at line 57 of file mlCurveData.h.


Constructor & Destructor Documentation

ml::CurveData::CurveData ( )

Default constructor.

ml::CurveData::CurveData ( const CurveData curveData)

Copy constructor, series data is copied.

virtual ml::CurveData::~CurveData ( ) [inline, virtual]

Destructor:

Definition at line 76 of file mlCurveData.h.


Member Function Documentation

virtual void ml::CurveData::addStateToTree ( TreeNode ) const [virtual]

Attaches the object state as children of the given parent node.

Reimplemented from ml::Base.

virtual void ml::CurveData::clear ( ) [virtual]

Clear curve data and reset curve properties.

virtual void ml::CurveData::clearData ( ) [virtual]

Clear curve data.

virtual CurveData* ml::CurveData::deepCopy ( ) const [inline, virtual]

Create a deep copy of the CurveDate.

Reimplemented from ml::Base.

Definition at line 225 of file mlCurveData.h.

virtual int ml::CurveData::getCurveStyle ( ) [virtual]

Get curve style (= index into a style palette used for drawing)

virtual int ml::CurveData::getCurveType ( ) [virtual]

Get curve type (equal to one of the cty* curve type constants)

virtual MLssize_t ml::CurveData::getNumSeries ( ) [virtual]

Get number of Y-series.

virtual MLssize_t ml::CurveData::getPoints ( ) [virtual]

Get number of data points (i.e. minimum length of all X- and Y-series)

virtual std::string ml::CurveData::getSymbol ( ) [virtual]

Get curve symbol.

virtual std::string ml::CurveData::getTitle ( ) [virtual]

Get curve title.

virtual std::string ml::CurveData::getUnit ( ) [virtual]

Get curve unit.

virtual double ml::CurveData::getXMax ( ) [virtual]

Get maximum X data value.

virtual double ml::CurveData::getXMin ( ) [virtual]

Get minimum X data value.

virtual double ml::CurveData::getXValue ( MLssize_t  iPoint) [virtual]

Get X-value at index iPoint, return 0 if index is out of range.

virtual void ml::CurveData::getXYRange ( double *  xMin,
double *  xMax,
double *  yMin,
double *  yMax 
) [virtual]

Get X and Y value ranges (NULL pointers are allowed)

void ml::CurveData::getXYRange ( float *  xMin,
float *  xMax,
float *  yMin,
float *  yMax 
)

compatibility method

virtual double ml::CurveData::getYMax ( ) [virtual]

Get maximum Y data value.

virtual double ml::CurveData::getYMin ( ) [virtual]

Get minimum Y data value.

virtual double ml::CurveData::getYValue ( MLssize_t  iPoint) [virtual]

Get Y value at index iPoint in first Y series, 0 if out of range.

virtual double ml::CurveData::getYValue ( MLssize_t  iSeries,
MLssize_t  iPoint 
) [virtual]

Get Y value at index iPoint in iSeries-th Y series, 0 if out of range.

bool ml::CurveData::isAutoX ( ) [inline]

Return true if X data is generated automatically (numbered 0, 1, ...)

Definition at line 188 of file mlCurveData.h.

ml::CurveData::ML_SET_ADDSTATE_VERSION ( )
virtual CurveData& ml::CurveData::operator= ( const CurveData srcCurve) [virtual]

Assignment operator, series data is copied.

virtual void ml::CurveData::readStateFromTree ( TreeNode ) [virtual]

Reads the object state from the children of the given parent node.

Reimplemented from ml::Base.

virtual void ml::CurveData::resizeX ( MLssize_t  nPoints) [virtual]

Change length of X-series. New values are initialized to zero.

virtual void ml::CurveData::resizeY ( MLssize_t  nPoints) [virtual]

Change length of first Y-series. New values are initialized to zero.

virtual void ml::CurveData::resizeY ( MLssize_t  iSeries,
MLssize_t  nPoints 
) [virtual]

Change length of iSeries-th Y-series. New values are initialized to zero.

virtual void ml::CurveData::setAutoXRange ( ) [virtual]

Set X value range to 'automatic', i.e. dependent on X series data.

virtual void ml::CurveData::setAutoYRange ( ) [virtual]

Set Y value range to 'automatic', i.e. dependent on Y series data.

virtual void ml::CurveData::setCurveStyle ( int  style) [virtual]

Set curve style (= index into a style palette used for drawing)

virtual void ml::CurveData::setCurveType ( int  type) [virtual]

Set curve type (use cty* curve type constants)

virtual void ml::CurveData::setSeries ( CurveSeries v,
MLssize_t  nPoints,
double *  data,
MLssize_t  step 
) [protected, virtual]

Set series data.

void ml::CurveData::setSeries ( CurveSeries v,
MLssize_t  nPoints,
float *  data,
MLssize_t  step 
) [protected]

compatibility method

virtual void ml::CurveData::setSymbol ( std::string  symbol) [virtual]

Set curve symbol.

virtual void ml::CurveData::setTitle ( std::string  title) [virtual]

Set curve title.

virtual void ml::CurveData::setUnit ( std::string  unit) [virtual]

Set curve unit.

void ml::CurveData::setX ( MLssize_t  nPoints,
float *  data,
MLssize_t  step = 1 
)
Deprecated:
compatibility method
virtual void ml::CurveData::setX ( MLssize_t  nPoints = 0,
double *  data = 0,
MLssize_t  step = 1 
) [virtual]

Set X-series to nPoints double values copied from the source array data.

The optional step value specifies the array index difference between two consecutive X-series values. Hence, the data array is expected to contain at least (nPoints-1)*step+1 values. If no X data is specified, the X values are generated automatically as numbers 0, 1, ...

virtual void ml::CurveData::setXChanged ( ) [protected, virtual]

Invalidate automatic X series properties.

virtual void ml::CurveData::setXRange ( double  xMin,
double  xMax 
) [virtual]

Explicitly set X value range to xMin ... xMax.

virtual void ml::CurveData::setXValue ( double  value,
MLssize_t  iPoint 
) [virtual]

Set X-series value at index iPoint to value (ignored if index is out of range).

virtual void ml::CurveData::setY ( MLssize_t  iSeries,
MLssize_t  nPoints,
double *  data,
MLssize_t  step = 1 
) [virtual]

Set the iSeries-th Y-series to nPoints double values copied from the source array data.

If this series does not yet exist, it is created. The optional step value specifies the array index difference between two consecutive Y-series values. Hence, the data array is expected to contain at least (nPoints-1)*step+1 values.

virtual void ml::CurveData::setY ( MLssize_t  nPoints,
double *  data,
MLssize_t  step = 1 
) [virtual]

Set Y data to a single series of nPoints double values copied from the source array data.

All previous Y-series are replaced by the new series. The optional step value specifies the array index difference between two consecutive Y-series values. Hence, the data array is expected to contain at least (nPoints-1)*step+1 values.

void ml::CurveData::setY ( MLssize_t  nPoints,
float *  data,
MLssize_t  step = 1 
)

compatibility method

void ml::CurveData::setY ( MLssize_t  iSeries,
MLssize_t  nPoints,
float *  data,
MLssize_t  step = 1 
)

compatibility method

virtual void ml::CurveData::setYChanged ( ) [protected, virtual]

Invalidate automatic Y series properties.

virtual void ml::CurveData::setYRange ( double  yMin,
double  yMax 
) [virtual]

Explicitly set Y value range to yMin ... yMax.

virtual void ml::CurveData::setYValue ( double  value,
MLssize_t  iPoint 
) [virtual]

Set Y value at index iPoint in first Y series to value (ignored if index is out of range).

virtual void ml::CurveData::setYValue ( double  value,
MLssize_t  iSeries,
MLssize_t  iPoint 
) [virtual]

Set Y value at index iPoint in iSeries-th Y series to value (ignored if indices are out of range).

virtual void ml::CurveData::updateAutoX ( ) [protected, virtual]

Update automatically generated X data.

virtual void ml::CurveData::updateData ( ) [inline, protected, virtual]

Update callback.

This method is called before any automatic properties are updated. A derived class may overload this method to make sure that the series data is up-to-date.

Definition at line 239 of file mlCurveData.h.

virtual void ml::CurveData::updateXRange ( ) [protected, virtual]

Update automatically generated X range.

virtual void ml::CurveData::updateYRange ( ) [protected, virtual]

Update automatically generated Y range.


Member Data Documentation

bool ml::CurveData::_autoX [protected]

Flag for automatically generated X data.

Definition at line 277 of file mlCurveData.h.

bool ml::CurveData::_autoXRange [protected]

Flag for automatic X value ranges.

Definition at line 280 of file mlCurveData.h.

bool ml::CurveData::_autoYRange [protected]

Flag for automatic Y value ranges.

Definition at line 282 of file mlCurveData.h.

int ml::CurveData::_curveStyle [protected]

Curve style (= index into a style palette used for drawing)

Definition at line 297 of file mlCurveData.h.

int ml::CurveData::_curveType [protected]

Curve type (equal to one of the cty* curve type constants)

Definition at line 295 of file mlCurveData.h.

std::string ml::CurveData::_symbol [protected]

Curve symbol.

Definition at line 304 of file mlCurveData.h.

std::string ml::CurveData::_title [protected]

Curve title.

Definition at line 300 of file mlCurveData.h.

std::string ml::CurveData::_unit [protected]

Curve unit.

Definition at line 302 of file mlCurveData.h.

bool ml::CurveData::_validXRange [protected]

Flag indicating up-to-date X range values.

Definition at line 285 of file mlCurveData.h.

bool ml::CurveData::_validYRange [protected]

Flag indicating up-to-date Y range values.

Definition at line 287 of file mlCurveData.h.

X series data.

Definition at line 272 of file mlCurveData.h.

double ml::CurveData::_xMax [protected]

Definition at line 290 of file mlCurveData.h.

double ml::CurveData::_xMin [protected]

Definition at line 290 of file mlCurveData.h.

std::vector<CurveSeries> ml::CurveData::_yData [protected]

Y series data.

Definition at line 274 of file mlCurveData.h.

double ml::CurveData::_yMax [protected]

Definition at line 290 of file mlCurveData.h.

double ml::CurveData::_yMin [protected]

Definition at line 290 of file mlCurveData.h.


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