]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h
2876a876a9a80bef15e16929c80c193ca7bc2262
[creaContours.git] / lib / kernel_ManagerContour_NDimensions / KernelManagerContour.h
1 #ifndef __KERNELMANAGERCONTOUR__
2 #define __KERNELMANAGERCONTOUR__
3
4
5
6 //------------------------------------------------------------------------------------------------------------
7 // Includes
8 //------------------------------------------------------------------------------------------------------------
9 #include "ImageSourceThing.h"
10 #include "ImageSectionThing.h"
11 #include "AxeThing.h"
12 #include "ContourThing.h"
13 #include "OutlineModelManager.h"
14 #include "OutlineModelBuilder.h"
15
16 #include "Contour/ContourPropagation.h"
17
18
19 class KernelManagerContour{
20
21 //------------------------------------------------------------------------------------------------------------
22 // Constructors & Destructors
23 //------------------------------------------------------------------------------------------------------------
24 public:
25
26         /**
27         ** With this constructor the setVectImages and initialize environment must be called
28         **/
29         KernelManagerContour();
30         /**
31         **      If images are available before the construction of the kernelManager this method should be used
32         **      it sets the vector images and initializes the environment
33         **/
34         KernelManagerContour(std::vector<vtkImageData*> images);
35         ~KernelManagerContour();
36
37         std::vector<vtkImageData*> getVectImages();
38         void setVectImages(std::vector<vtkImageData*> vectimg);
39
40         /**
41         **      This method returns the source of the image data selected by the user.
42         */
43         vtkImageData* getSourceImage();
44
45         
46
47         void initializeEnvironment();
48
49
50         /**
51         **      This methods connect the event in the class interfNewContourMenu with the world of the appli
52         **/     
53
54         std::string createOutline(manualContourModel * manModelContour,std::vector<int> instantVector);
55         /////////////////////////////////
56
57         std::string intToString(int num);
58
59         std::vector<std::string> GetLstNameThingsStatic();
60
61         void SaveThingName(FILE* pFile, std::string name );
62
63         std::vector<std::string> GetLstNameThings();
64
65         bool IsPartOfStaticList(std::string keyName );
66
67         void deleteCModel(std::string theKeyName);
68
69         void removeAllOutlines();
70
71         //void setInstance(theInstant);
72
73         std::vector<NameWrapper *> getActualInstantOutlines();
74
75         int getNamesWrappingSize();
76
77         std::string getNameWrapping(int i);
78
79         void setInstant(Instant* theInstant);
80         void setInstant(std::vector<int> vectInstant);
81         std::string createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData);
82         
83         Instant * getCurrentInstant();
84
85         manualContourModel* getOutlineByKeyName(std::string cloneName);
86
87         bool onRedo(std::string& filename);
88
89         bool onUndo(std::string& filename);
90
91         bool onUndoSaveFile(std::string& filename);
92
93         std::string saveState();
94
95         void changeContourOfManager(std::string keyName, Instant *instant);
96
97         void resetAppend();
98
99         std::string onSpreadAdd( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ, std::vector<int> instants);
100
101         void getMaxMinZ(double *minZ,double *maxZ);
102
103         manualContourModel* GetPoints(int z,int type, std::vector<double>* vecCtrlPointX,std::vector<double>* vecCtrlPointY,std::vector<double>* vecCtrlPointZ, std::string& theName,int typeofcontour, std::vector<int> tempVector);
104
105         manualContourModel* factoryManualContourModel(int typeContour);
106
107         void CalculeSplinePropagation();
108
109         std::vector<std::string> getOutlinesNameAtInstant(std::vector<int> tempvector);
110
111         std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
112
113         std::vector<manualContourModel*> ExploseEachModel( std::vector<manualContourModel*> lstManConMod );
114
115         
116         void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
117
118         vtkImageData* getImageAtInstant(std::vector<int> inst);
119         
120 //------------------------------------------------------------------------------------------------------------
121 // Constants
122 //------------------------------------------------------------------------------------------------------------
123
124 private:        
125 //------------------------------------------------------------------------------------------------------------
126 // Attributes
127 //------------------------------------------------------------------------------------------------------------
128         std::vector<vtkImageData*> vectimages;
129
130         ImageSourceThing                * imageSource;
131
132         //Instant * _actualInstant;
133 //Temporary attribute should be removed
134         OutlineModelManager             * modelManager;
135
136         int inredo;
137         int inundo;
138         int _currentIndex;
139         std::string     stundoredo;
140
141         ContourPropagation* _contourPropagation;
142
143         bool isInitContourPropagation();
144
145         OutlineModelManager* getOutlineModelManager();
146 };
147 #endif