MeVisLab Toolbox Reference
mlRasterFunctionList.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_RASTER_FUNCTION_LIST_H
14#define ML_RASTER_FUNCTION_LIST_H
15
16
18
19// This class maintains a list of raster functions.
20// It uses an stl vector to manage the list.
21// The class is derived from Base to have a common base class
22// for some classes and to have the possibility to add persistence
23// to the object later.
24
25//ML-includes
26#include "mlBaseInit.h"
27#include "mlRasterFunction.h"
28
30
31//--------------------------------------------------------------------------------
33//--------------------------------------------------------------------------------
35
36public:
39
41 ~RasterFunctionList() override {};
42
44 //virtual std::vector<RasterFunction> &getList() { return objects; }
45
47 virtual size_t getListSize()
48 { return objects.size(); }
49
51 virtual void setListElement(size_t idx, const RasterFunction &elem)
52 { objects[idx]=elem; }
53
55 virtual void appendToList(const RasterFunction &elem)
56 { objects.push_back(elem); }
57
59 virtual const RasterFunction &getListElement(size_t idx)
60 { return objects[idx]; }
61
63 std::string persistentState() const override { return {}; }
64
65 void setPersistentState(const std::string& /*state*/) override { }
66
70
73 void setValue(MLssize_t index, const RasterFunction& obj);
74
76 void removeValue(MLssize_t index = -1);
77
79 void clear();
80
81private:
82
83 //--------------------------------------------------------------------------------
86 //--------------------------------------------------------------------------------
88
90 std::vector<RasterFunction> objects;
91};
92
94
95#endif // of __mlRasterFunctionList_H
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Definition mlBase.h:59
Base object class to handle a list of raster functions.
void clear()
Clears the inner list.
std::string persistentState() const override
Persistence support. Still unimplemented, only for later usage.
virtual void appendToList(const RasterFunction &elem)
Permits access to the list of raster functions.
void setPersistentState(const std::string &) override
Restores the object's internal state from a string that had been previously generated using persisten...
RasterFunction * getPtr(MLssize_t index=-1)
Returns pointer to the RasterFunction at given index index.
RasterFunctionList()
Constructor. It does nothing, i.e. an empty list is created.
void setValue(MLssize_t index, const RasterFunction &obj)
Sets new raster function obj at index index, index -1 sets the last element.
virtual const RasterFunction & getListElement(size_t idx)
Permits access to the list of raster functions.
void removeValue(MLssize_t index=-1)
Remove RasterFunction from list. If index is -1 the last element is removed.
virtual void setListElement(size_t idx, const RasterFunction &elem)
Permits access to the list of raster functions.
~RasterFunctionList() override
Destructor. It removes all handled raster functions and the list.
virtual size_t getListSize()
Permits access to the list of raster functions.
Base object to handle implicit or explicit functions to draw into subimages.
#define MLBASEEXPORT
defined Header file mlBaseInit.h
Definition mlBaseInit.h:22
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#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:566