MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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{
36
37public:
40
42 ~RasterFunctionList() override {};
43
45 // virtual std::vector<RasterFunction> &getList() { return objects; }
46
48 virtual size_t getListSize()
49 {
50 return objects.size();
51 }
52
54 virtual void setListElement(size_t idx, const RasterFunction& elem)
55 {
56 objects[idx] = elem;
57 }
58
60 virtual void appendToList(const RasterFunction& elem)
61 {
62 objects.push_back(elem);
63 }
64
66 virtual const RasterFunction& getListElement(size_t idx)
67 {
68 return objects[idx];
69 }
70
72 std::string persistentState() const override
73 {
74 return {};
75 }
76
77 void setPersistentState(const std::string& /*state*/) override
78 {}
79
83
86 void setValue(MLssize_t index, const RasterFunction& obj);
87
89 void removeValue(MLssize_t index = -1);
90
92 void clear();
93
94private:
95 //--------------------------------------------------------------------------------
98 //--------------------------------------------------------------------------------
100
102 std::vector<RasterFunction> objects;
103};
104
106
107#endif // of __mlRasterFunctionList_H
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Definition mlBase.h:63
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 that is a signed 32-bit size_t on 32-bit platforms and 64-bit one on 64-bit p...
Definition mlTypeDefs.h:563