MeVisLab Toolbox Reference
mlCurveList.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_CURVE_LIST_H
14 #define ML_CURVE_LIST_H
15 
16 
19 
20 // Classes:
21 // - CurveList: A list of CurveData object pointers (legacy).
22 // - CurveDataBaseList: A list of CurveData object pointers implemented via a BaseList (recommended).
23 
24 // ML includes
25 #include "mlBase.h"
26 #include "mlModuleIncludes.h"
27 #include "mlTreeNode.h"
28 #include "mlBaseInit.h"
29 
30 
31 #include "mlCurveData.h"
32 
33 
34 ML_START_NAMESPACE
35 
36 
37 // ------------------------------------------------------------------
38 // Base object class CurveList
39 
44 // ------------------------------------------------------------------
45 class MLBASEEXPORT CurveList : public Base
46 {
47 public:
48 
49  // --------------------------------------------
51  // --------------------------------------------
53 
57  CurveList (const CurveList &curveList, bool deepCopyArg = false);
58 
60  ~CurveList () override {}
61 
63  virtual CurveList &operator = (const CurveList &srcCurveList);
64 
65  MLBASEEXPORT friend bool operator==(const CurveList& x, const CurveList& y);
66  MLBASEEXPORT friend bool operator!=(const CurveList& x, const CurveList& y);
67 
69  virtual void clear ();
70 
72 
73 
74  // --------------------------------------------
76  // --------------------------------------------
78 
80  virtual std::vector<CurveData*> &getCurveList ();
82  virtual CurveData *getCurveData (MLssize_t iCurve);
83 
85 
86 
87  // --------------------------------------------
89  // --------------------------------------------
91 
93  virtual MLssize_t getNumCurves ();
94 
96  virtual double getXMin ();
98  virtual double getXMax ();
100  virtual double getYMin ();
102  virtual double getYMax ();
104  virtual void getXYRange (double *xMin, double *xMax, double *yMin, double *yMax);
105 
107 
110  void addStateToTree(TreeNode* parent) const override;
111  // Set current version number
114  void readStateFromTree(TreeNode* parent) override;
116 
117  CurveList* deepCopy() const override { return new CurveList(*this, /*deepCopy=*/true); };
118 
119 #if ML_DEPRECATED_SINCE(3,5,0)
122 
125  ML_DEPRECATED void getXYRange (float *xMin, float *xMax, float *yMin, float *yMax);
126 
128 #endif
129 
130 protected:
131 
133  std::vector<CurveData*> _curveList;
134 
135 private:
138 };
139 
140 
141 
142 // ------------------------------------------------------------------
143 // Class CurveDataBaseList
144 
147 // ------------------------------------------------------------------
149 {
150 
151  private:
154 };
155 
156 
157 ML_END_NAMESPACE
158 
159 
160 #endif
161 // __mlCurveList_H
#define ML_DEPRECATED
Definition: CSOGroup.h:371
Base object class BaseList which stores a list of BaseContainerItem entries.
Definition: mlBaseList.h:205
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Definition: mlBase.h:62
Base object class list as alternative implementation for CurveData, essentially a container for Base ...
Definition: mlCurveList.h:149
Base object class representing a single curve object, consisting of zero or one X- and any number of ...
Definition: mlCurveData.h:56
Base object class CurveList with a list of CurveData object pointers.
Definition: mlCurveList.h:46
virtual double getYMin()
Get overall minimum Y data value.
CurveList()
Default constructor.
void addStateToTree(TreeNode *parent) const override
virtual void clear()
Initialize data (referenced curve objects are not deleted)
virtual MLssize_t getNumCurves()
Get number of curve objects.
CurveList(const CurveList &curveList, bool deepCopyArg=false)
Copy constructor. The curve objects are only copied if deepCopy is set to true.
void readStateFromTree(TreeNode *parent) override
Implement import functionality (as used by the LoadBase module):
~CurveList() override
Destructor, referenced curve objects are not deleted.
Definition: mlCurveList.h:60
MLBASEEXPORT friend bool operator==(const CurveList &x, const CurveList &y)
virtual double getYMax()
Get overall maximum Y data value.
virtual void getXYRange(double *xMin, double *xMax, double *yMin, double *yMax)
Get overall X and Y value ranges (NULL pointers are allowed)
virtual double getXMax()
Get overall maximum X data value.
virtual CurveData * getCurveData(MLssize_t iCurve)
Get pointer to iCurve-th CurveData object.
CurveList * deepCopy() const override
Set addStateToTree version number that can be accessed via getAddStateVersion()
Definition: mlCurveList.h:117
virtual double getXMin()
Get overall minimum X data value.
virtual std::vector< CurveData * > & getCurveList()
Get vector of CurveData object pointers.
ML_SET_ADDSTATE_VERSION(1)
MLBASEEXPORT friend bool operator!=(const CurveList &x, const CurveList &y)
std::vector< CurveData * > _curveList
List of curve object pointers.
Definition: mlCurveList.h:117
The class TreeNode is the abstract base class for the import/export of ML objects.
Definition: mlTreeNode.h:170
#define MLBASEEXPORT
defined Header file mlBaseInit.h
Definition: mlBaseInit.h:22
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
SSIZE_T MLssize_t
The signed ML size type which is a signed 32 bit size_t on 32 bit platforms and 64 bit one on 64 bit ...
Definition: mlTypeDefs.h:654