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