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