MeVisLab Toolbox Reference
ml::CurveList Class Reference

Base object class CurveList with a list of CurveData (smart) object pointers. More...

#include <mlCurveList.h>

Inheritance diagram for ml::CurveList:
ml::RefCountedBase ml::EventSource ml::Base

Public Member Functions

CurveListdeepCopy () const override
 Set addStateToTree version number that can be accessed via getAddStateVersion()
 
Curve data access
const std::vector< CurveDataPtr > & getCurveList ()
 Access vector of CurveData pointers directly.
 
CurveDataPtr getCurveData (MLssize_t index)
 Get pointer to CurveData object at index.
 
CurveDataPtr takeCurve (MLssize_t index)
 Take pointer to CurveData object at index (i.e.
 
void appendCurve (CurveDataPtr curve)
 Append CurveData object.
 
void insertCurve (MLssize_t index, CurveDataPtr curve)
 Insert CurveData object at index. index is automatically clamped to the valid range.
 
void removeCurves (size_t index, size_t count)
 Remove a range of CurveData. The range is automatically restricted to the valid range of elements.
 
Get curve list properties
MLssize_t getNumCurves () const
 Get number of curve objects.
 
double getXMin () const
 Get overall minimum X data value.
 
double getXMax () const
 Get overall maximum X data value.
 
double getYMin () const
 Get overall minimum Y data value.
 
double getYMax () const
 Get overall maximum Y data value.
 
void getXYRange (double *xMin, double *xMax, double *yMin, double *yMax) const
 Get overall X and Y value ranges (NULL pointers are allowed)
 
void addStateToTree (TreeNode *parent) const override
 
 ML_SET_ADDSTATE_VERSION (1)
 
void readStateFromTree (TreeNode *parent) override
 Implement import functionality (as used by the LoadBase module):
 
- Public Member Functions inherited from ml::RefCountedBase
 RefCountedBase ()
 Constructor.
 
 RefCountedBase (const RefCountedBase &)
 Explicit copy constructor.
 
virtual void incRefCount () const
 Increase reference count.
 
virtual void decRefCount () const
 Decrease ref count (object will be deleted if ref count is decremented to 0)
 
bool isRefCountedBase () const override
 Returns if the instance is derived from RefCountedBase.
 
- Public Member Functions inherited from ml::EventSource
 EventSource ()
 
 EventSource (const EventSource &evSource)
 
 ~EventSource () override
 
void addEventListener (BaseEventCallback *cb, void *userData)
 add event listener callback to this Base object - the userData will be the first argument when the callback is called
 
void removeEventListener (BaseEventCallback *cb, void *userData)
 remove event listener callback from this Base object - arguments must be the same as for the addEventListener call
 
bool hasEventListeners () const
 check if any event listeners have been added to this Base object; this can be used to skip the sendEvent call (and the potentially expensive building of the event object) altogether
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor.
 
virtual ~Base ()
 Destructor.
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Check if this object's type is equal to or derived from one of the types given in the argument.
 
virtual std::string detailString () const
 Return a string describing this object.
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class.
 
virtual std::string persistentState () const
 Returns a string describing the object's internal state.
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState().
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Write the objects state to the data stream object.
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object.
 

Protected Member Functions

 ~CurveList () override=default
 Destructor shouldn't be called directly anymore, always use the CurveListPtr smart-pointer.
 
- Protected Member Functions inherited from ml::RefCountedBase
 ~RefCountedBase () override
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h.
 
- Protected Member Functions inherited from ml::EventSource
void sendEvent (BaseEvent *event, void *skipListener=nullptr)
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h.
 

Protected Attributes

std::vector< CurveDataPtr_curveList
 List of curve object pointers.
 
- Protected Attributes inherited from ml::RefCountedBase
MLint32 _refCount
 Reference count.
 

Initialization, destructor

 CurveList ()
 Default constructor.
 
 CurveList (const CurveList &curveList, bool deepCopyArg=false)
 Copy constructor. The curve objects are only copied if deepCopy is set to true.
 
CurveListoperator= (const CurveList &srcCurveList)
 Assignment operator, copying the pointers to the curve objects, not the objects themselves.
 
void clear ()
 Clear list of CurveData objects, Objects are automatically deleted if the last reference is gone.
 
void reserve (size_t n)
 Reserve entries in curve list (for optimization)
 
MLBASEEXPORT friend bool operator== (const CurveList &x, const CurveList &y)
 
MLBASEEXPORT friend bool operator!= (const CurveList &x, const CurveList &y)
 

Additional Inherited Members

- Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
 
- Static Public Member Functions inherited from ml::RefCountedBase
static void updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase)
 Helper method that handles inc/dec of ref count if base instances support it.
 

Detailed Description

Base object class CurveList with a list of CurveData (smart) object pointers.

The CurveData objects are deleted automatically when they are not referenced with a CurveDataPtr anymore.

Definition at line 43 of file mlCurveList.h.

Constructor & Destructor Documentation

◆ ~CurveList()

ml::CurveList::~CurveList ( )
overrideprotecteddefault

Destructor shouldn't be called directly anymore, always use the CurveListPtr smart-pointer.

◆ CurveList() [1/2]

ml::CurveList::CurveList ( )

Default constructor.

◆ CurveList() [2/2]

ml::CurveList::CurveList ( const CurveList & curveList,
bool deepCopyArg = false )

Copy constructor. The curve objects are only copied if deepCopy is set to true.

Member Function Documentation

◆ addStateToTree()

void ml::CurveList::addStateToTree ( TreeNode * parent) const
overridevirtual

Persistence Implement export functionality (as used by the SaveBase module):

Reimplemented from ml::Base.

◆ appendCurve()

void ml::CurveList::appendCurve ( CurveDataPtr curve)

Append CurveData object.

◆ clear()

void ml::CurveList::clear ( )

Clear list of CurveData objects, Objects are automatically deleted if the last reference is gone.

◆ deepCopy()

CurveList * ml::CurveList::deepCopy ( ) const
inlineoverridevirtual

Set addStateToTree version number that can be accessed via getAddStateVersion()

Creates a deep copy of the given object. The default implementation returns a NULL pointer and has to be overloaded by derived classes. It can be used to clone Base objects without knowledge of the exact type of object.

Reimplemented from ml::Base.

Definition at line 130 of file mlCurveList.h.

◆ getCurveData()

CurveDataPtr ml::CurveList::getCurveData ( MLssize_t index)

Get pointer to CurveData object at index.

If index is not in the valid range, an empty pointer is returned.

◆ getCurveList()

const std::vector< CurveDataPtr > & ml::CurveList::getCurveList ( )

Access vector of CurveData pointers directly.

◆ getNumCurves()

MLssize_t ml::CurveList::getNumCurves ( ) const

Get number of curve objects.

◆ getXMax()

double ml::CurveList::getXMax ( ) const

Get overall maximum X data value.

◆ getXMin()

double ml::CurveList::getXMin ( ) const

Get overall minimum X data value.

◆ getXYRange()

void ml::CurveList::getXYRange ( double * xMin,
double * xMax,
double * yMin,
double * yMax ) const

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

◆ getYMax()

double ml::CurveList::getYMax ( ) const

Get overall maximum Y data value.

◆ getYMin()

double ml::CurveList::getYMin ( ) const

Get overall minimum Y data value.

◆ insertCurve()

void ml::CurveList::insertCurve ( MLssize_t index,
CurveDataPtr curve )

Insert CurveData object at index. index is automatically clamped to the valid range.

◆ ML_SET_ADDSTATE_VERSION()

ml::CurveList::ML_SET_ADDSTATE_VERSION ( 1 )

◆ operator=()

CurveList & ml::CurveList::operator= ( const CurveList & srcCurveList)

Assignment operator, copying the pointers to the curve objects, not the objects themselves.

◆ readStateFromTree()

void ml::CurveList::readStateFromTree ( TreeNode * parent)
overridevirtual

Implement import functionality (as used by the LoadBase module):

Reimplemented from ml::Base.

◆ removeCurves()

void ml::CurveList::removeCurves ( size_t index,
size_t count )

Remove a range of CurveData. The range is automatically restricted to the valid range of elements.

◆ reserve()

void ml::CurveList::reserve ( size_t n)

Reserve entries in curve list (for optimization)

◆ takeCurve()

CurveDataPtr ml::CurveList::takeCurve ( MLssize_t index)

Take pointer to CurveData object at index (i.e.

remove it from list). If index is not in the valid range, an empty pointer is returned.

Friends And Related Symbol Documentation

◆ operator!=

◆ operator==

Member Data Documentation

◆ _curveList

std::vector<CurveDataPtr> ml::CurveList::_curveList
protected

List of curve object pointers.

Definition at line 136 of file mlCurveList.h.


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