]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h
Changes with manualBaseModel. It improves the functionality with the new
[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 #include "time.h"
16
17 #include "ContourPropagation.h"
18
19 #include "manualContourModel.h"
20 #include "manualContourModelCircle.h"
21 #include "manualContourModelLine.h"
22 #include "manualContourModelRoi.h"
23
24 #include <vtkImageChangeInformation.h>
25
26 class KernelManagerContour{
27
28 //------------------------------------------------------------------------------------------------------------
29 // Constructors & Destructors
30 //------------------------------------------------------------------------------------------------------------
31 public:
32
33         /**
34         ** With this constructor the setVectImages and initialize environment must be called
35         **/
36         KernelManagerContour();
37         /**
38         **      If images are available before the construction of the kernelManager this method should be used
39         **      it sets the vector images and initializes the environment
40         **/
41         KernelManagerContour(std::vector<vtkImageData*> images,std::string datadir,std::string tmpdir);
42         ~KernelManagerContour();
43
44         std::vector<vtkImageData*> getVectImages();
45         void setVectImages(std::vector<vtkImageData*> vectimg);
46
47         /**
48         **      This method returns the source of the image data selected by the user.
49         */
50         vtkImageData* getSourceImage();
51
52         
53
54         void initializeEnvironment(std::string datadir);
55
56
57         /**
58         **      This methods connect the event in the class interfNewContourMenu with the world of the appli
59         **/     
60
61         std::string createOutline(manualBaseModel * manModelContour,std::vector<int> instantVector);
62         /////////////////////////////////
63
64         std::string intToString(int num);
65
66         std::vector<std::string> GetLstNameThingsStatic();
67
68         void SaveThingName(FILE* pFile, FILE *pFileData, std::string name );
69
70         std::vector<std::string> GetLstNameThings();
71
72         bool IsPartOfStaticList(std::string keyName );
73
74         void deleteCModel(std::string theKeyName);
75
76         void removeAllOutlines();
77
78         //void setInstance(theInstant);
79
80         std::vector<NameWrapper *> getActualInstantOutlines();
81
82         int getNamesWrappingSize();
83
84         std::string getNameWrapping(int i);
85
86         void setInstant(Instant* theInstant);
87         void setInstant(std::vector<int> vectInstant);
88         std::string createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData);
89         
90         Instant * getCurrentInstant();
91
92         manualBaseModel* getOutlineByKeyName(std::string cloneName);
93
94         bool onRedo(std::string& filename);
95
96         bool onUndo(std::string& filename);
97
98         bool onUndoSaveFile(std::string& filename);
99
100         std::string saveState();
101
102         void changeContourOfManager(std::string keyName, Instant *instant);
103
104         void resetAppend();
105
106         std::string onSpreadAdd( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ, std::vector<int> instants);
107
108         void getMaxMinZ(double *minZ,double *maxZ);
109
110         manualBaseModel* 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);
111
112         //
113         // Method which creates the model associated with the type in parameter. The possible contour types are:
114         // 0-spline
115         // 1-spline
116         // 2-rectangle
117         // 3-circle
118         // 4-BullEye
119         // 5-BullEyeSector
120         // 6-Line
121         // 7-Points
122         // NOTE: The view and the controler are created in the wxVtkBaseView_SceneManager class, configureViewControlTo method
123         // @param typeContour - int
124         // @return manualBaseModel - Model created based on the type
125         manualBaseModel* factoryManualContourModel(int typeContour);
126
127         void CalculeSplinePropagation();
128
129         std::vector<std::string> getOutlinesNameAtInstant(std::vector<int> tempvector);
130
131         std::vector<ContourThing**> getOutlinesAtInstant(Instant* instant );
132
133         std::vector<manualBaseModel*> ExploseEachModel( std::vector<manualBaseModel*> lstManConMod );
134
135         
136         void getConceptsInformation(std::vector<std::string>& conceptNameVect, std::vector<int>& conceptSizeVect);
137
138         vtkImageData* getImageAtInstant(std::vector<int> inst);
139         
140 //------------------------------------------------------------------------------------------------------------
141 // Constants
142 //------------------------------------------------------------------------------------------------------------
143
144         void setCurrentFileName(std::string filenam);
145         std::string getCurrentFileName();
146 private:        
147 //------------------------------------------------------------------------------------------------------------
148 // Attributes
149 //------------------------------------------------------------------------------------------------------------
150         std::vector<vtkImageData*> vectimages;
151
152         ImageSourceThing                * imageSource;
153
154         //Instant * _actualInstant;
155 //Temporary attribute should be removed
156         OutlineModelManager             * modelManager;
157
158         std::string filename;
159
160         int inredo;
161         int inundo;
162         int _currentIndex;
163         std::string     stundoredo;
164
165         ContourPropagation* _contourPropagation;
166
167         bool isInitContourPropagation();
168
169         OutlineModelManager* getOutlineModelManager();
170 };
171 #endif