MeVisLab Toolbox Reference
|
Base object class CurveList with a list of CurveData (smart) object pointers. More...
#include <mlCurveList.h>
Public Member Functions | |
CurveList * | deepCopy () const override |
Creates a deep copy of the given object. More... | |
Curve data access | |
const std::vector< CurveDataPtr > & | getCurveList () |
Access vector of CurveData pointers directly. More... | |
CurveDataPtr | getCurveData (MLssize_t index) |
Get pointer to CurveData object at index. More... | |
CurveDataPtr | takeCurve (MLssize_t index) |
Take pointer to CurveData object at index (i.e. More... | |
void | appendCurve (CurveDataPtr curve) |
Append CurveData object. More... | |
void | insertCurve (MLssize_t index, CurveDataPtr curve) |
Insert CurveData object at index. index is automatically clamped to the valid range. More... | |
void | removeCurves (size_t index, size_t count) |
Remove a range of CurveData. The range is automatically restricted to the valid range of elements. More... | |
Get curve list properties | |
MLssize_t | getNumCurves () const |
Get number of curve objects. More... | |
double | getXMin () const |
Get overall minimum X data value. More... | |
double | getXMax () const |
Get overall maximum X data value. More... | |
double | getYMin () const |
Get overall minimum Y data value. More... | |
double | getYMax () const |
Get overall maximum Y data value. More... | |
void | getXYRange (double *xMin, double *xMax, double *yMin, double *yMax) const |
Get overall X and Y value ranges (NULL pointers are allowed) More... | |
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): More... | |
![]() | |
RefCountedBase () | |
Constructor. More... | |
RefCountedBase (const RefCountedBase &) | |
Explicit copy constructor. More... | |
virtual void | incRefCount () const |
Increases the reference count. More... | |
virtual void | decRefCount () const |
Decreases the reference count (object will be deleted if the reference count is decremented to 0). More... | |
bool | isRefCountedBase () const override |
Returns whether the instance is derived from RefCountedBase. More... | |
![]() | |
EventSource () | |
EventSource (const EventSource &evSource) | |
~EventSource () override | |
void | addEventListener (BaseEventCallback *cb, void *userData) |
Adds event listener callback to this Base object. More... | |
void | removeEventListener (BaseEventCallback *cb, void *userData) |
Removes event listener callback from this Base object. More... | |
bool | hasEventListeners () const |
Checks whether 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. More... | |
![]() | |
Base () | |
Constructor. More... | |
virtual | ~Base () |
Destructor. More... | |
bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
Checks whether this object's type is equal to or derived from one of the types given in the argument. More... | |
virtual std::string | detailString () const |
Returns a string describing this object. More... | |
virtual bool | implementsPersistence (PersistenceInterface) const |
Override this method to declare which persistence interfaces are implemented by your derived class. More... | |
virtual std::string | persistentState () const |
Returns a string describing the object's internal state. More... | |
virtual void | setPersistentState (const std::string &state) |
Restores the object's internal state from a string that had been previously generated using persistentState(). More... | |
virtual void | writeTo (AbstractPersistenceOutputStream *) const |
Writes the objects state to the data stream object. More... | |
virtual void | readFrom (AbstractPersistenceInputStream *, int) |
Reads the objects state from the data stream object. More... | |
Protected Member Functions | |
~CurveList () override=default | |
Destructor shouldn't be called directly anymore, always use the CurveListPtr smart-pointer. More... | |
![]() | |
~RefCountedBase () override | |
Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More... | |
![]() | |
void | sendEvent (BaseEvent *event, void *skipListener=nullptr) |
Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More... | |
Protected Attributes | |
std::vector< CurveDataPtr > | _curveList |
List of curve object pointers. More... | |
![]() | |
std::atomic_int_least32_t | _refCount |
Reference count. More... | |
Initialization, destructor | |
CurveList () | |
Default constructor. More... | |
CurveList (const CurveList &curveList, bool deepCopyArg=false) | |
Copy constructor. The curve objects are only copied if deepCopy is set to true. More... | |
CurveList & | operator= (const CurveList &srcCurveList) |
Assignment operator, copying the pointers to the curve objects, not the objects themselves. More... | |
void | clear () |
Clear list of CurveData objects, Objects are automatically deleted if the last reference is gone. More... | |
void | reserve (size_t n) |
Reserve entries in curve list (for optimization) More... | |
MLBASEEXPORT friend bool | operator== (const CurveList &x, const CurveList &y) |
MLBASEEXPORT friend bool | operator!= (const CurveList &x, const CurveList &y) |
Additional Inherited Members | |
![]() | |
enum | PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream } |
This enum describes the different persistence interfaces available. More... | |
![]() | |
static void | updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase) |
Helper method that handles incrementing/decrementing of the reference count if base instances support it. More... | |
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.
|
overrideprotecteddefault |
Destructor shouldn't be called directly anymore, always use the CurveListPtr smart-pointer.
ml::CurveList::CurveList | ( | ) |
Default constructor.
ml::CurveList::CurveList | ( | const CurveList & | curveList, |
bool | deepCopyArg = false |
||
) |
Copy constructor. The curve objects are only copied if deepCopy is set to true.
|
overridevirtual |
void ml::CurveList::appendCurve | ( | CurveDataPtr | curve | ) |
Append CurveData object.
void ml::CurveList::clear | ( | ) |
Clear list of CurveData objects, Objects are automatically deleted if the last reference is gone.
|
inlineoverridevirtual |
Creates a deep copy of the given object.
The default implementation returns a NULL pointer and has to be overridden 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.
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.
const std::vector<CurveDataPtr>& ml::CurveList::getCurveList | ( | ) |
Access vector of CurveData pointers directly.
MLssize_t ml::CurveList::getNumCurves | ( | ) | const |
Get number of curve objects.
double ml::CurveList::getXMax | ( | ) | const |
Get overall maximum X data value.
double ml::CurveList::getXMin | ( | ) | const |
Get overall minimum X data value.
void ml::CurveList::getXYRange | ( | double * | xMin, |
double * | xMax, | ||
double * | yMin, | ||
double * | yMax | ||
) | const |
Get overall X and Y value ranges (NULL pointers are allowed)
double ml::CurveList::getYMax | ( | ) | const |
Get overall maximum Y data value.
double ml::CurveList::getYMin | ( | ) | const |
Get overall minimum Y data value.
void ml::CurveList::insertCurve | ( | MLssize_t | index, |
CurveDataPtr | curve | ||
) |
Insert CurveData object at index. index is automatically clamped to the valid range.
ml::CurveList::ML_SET_ADDSTATE_VERSION | ( | 1 | ) |
Assignment operator, copying the pointers to the curve objects, not the objects themselves.
|
overridevirtual |
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.
void ml::CurveList::reserve | ( | size_t | n | ) |
Reserve entries in curve list (for optimization)
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.
|
friend |
|
friend |
|
protected |
List of curve object pointers.
Definition at line 136 of file mlCurveList.h.