]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h
706382b81dca7ee3cf3e3b899921e22161fec1f8
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.h
1 #ifndef __wxContourMainFrame_h_INCLUDED_H__
2 #define __wxContourMainFrame_h_INCLUDED_H__
3
4
5 // -----------------------------------------------------------------------------------------------------------
6 // WX headers inclusion.
7 // For compilers that support precompilation, includes <wx/wx.h>.
8 // -----------------------------------------------------------------------------------------------------------
9
10 #include <wx/wxprec.h>
11 #ifdef __BORLANDC__
12 #pragma hdrstop
13 #endif
14 #ifndef WX_PRECOMP
15 #include <wx/wx.h>
16 #endif
17
18
19 //------------------------------------------------------------------------------------------------------------
20 // Includes
21 //------------------------------------------------------------------------------------------------------------
22 #include "wx/aui/aui.h"
23
24 #include "interfMainPanel.h"
25
26 #include "wxVtkBaseView_SceneManager.h"
27 #include "wxInstantChooserPanel.h"
28 #include "wxContourViewPanel.h"
29
30 #include "KernelManagerContour.h"
31
32 #include "ContourWorkspace.h"
33 #include "ContourExtractData.h"
34
35
36
37
38 #include "PerformingOperation.h"
39
40
41
42 //#include "ContourThing.h"
43 //#include "AxeThing.h"
44 //#include "ImageSourceThing.h"
45 //#include "ImageSectionThing.h"
46 //#include "InstantMembersNameList.h"
47 //#include "OutlineGroup.h"
48 #include "SomeEnvironment.h"
49 #include "ContourWorkspace.h"
50 #include "ContourWrap_ViewControl.h"
51 #include "Instant.h"
52 #include "PerformingOperation.h"
53
54 #include "ContourThing.h"
55
56 //#include "OutlineModelManager.h"
57
58 #include "wxContour_ButtonsBar.h"
59 #include "wxContour_ControlPanel.h"
60
61 #include "wxContour_Grid.h"
62 #include "wxContour_DrawToolsPanel.h"
63 #include "wxContour_OperationsToolsPanel.h"
64 #include "wxContour_AutomaticFormsToolsPanel.h"
65 #include "wxContour_StandardToolsPanel.h"
66 #include "wxContour_EdtionToolsPanel.h"
67 #include "wxContour_ListViewPanel.h"
68
69
70
71
72 #include "vtkContourFilter.h"
73 #include "vtkPolyDataConnectivityFilter.h"
74 #include "vtkCleanPolyData.h"
75 #include "vtkImageReslice.h"
76 #include "vtkMetaImageWriter.h"
77 #include "vtkImageData.h"
78 #include "vtkMetaImageReader.h"
79
80 //------------------------------------------------------------------------------------------------------------
81 // Events declaration
82 //------------------------------------------------------------------------------------------------------------
83
84 //BEGIN_DECLARE_EVENT_TYPES()
85 //END_DECLARE_EVENT_TYPES()
86
87 /** file wxContourMainFrame.h */
88
89
90 //------------------------------------------------------------------------------------------------------------
91 // Class definition
92 //------------------------------------------------------------------------------------------------------------
93
94 class wxContourMainFrame : public wxPanel {
95
96         public:
97
98         //------------------------------------------------------------------------------------------------------------
99         // Constructors & Destructors
100         //------------------------------------------------------------------------------------------------------------
101         
102
103         wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
104         wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
105
106         ~wxContourMainFrame();
107
108         //------------------------------------------------------------------------------------------------------------
109         // Creational and initialization methods
110         //------------------------------------------------------------------------------------------------------------
111         bool configurePanels(wxAuiNotebook * theNoteBook );
112
113         void setNotebook( wxAuiNotebook * theNoteBook );
114
115         wxAuiNotebook * createNotebook();
116
117         void createInstantChooserPanel(wxAuiNotebook * parent);
118
119         void createViewPanel(wxAuiNotebook * parent);
120         
121         void createInstantChooserPanel(wxWindow * parent);
122
123         void createViewPanel(wxWindow * parent);
124
125         void setInstantChooserPanel(  wxInstantChooserPanel * theInstantChooserPanel );
126
127         void setButtonsBar(  wxContour_ButtonsBar * theButtonsBar );
128
129         void setGrid(  wxContour_Grid * theGridPanel );
130
131         void setDrawToolsPanel(  wxContour_DrawToolsPanel * theDrawToolsPanel );
132
133         void setOperationsToolsPanel(  wxContour_OperationsToolsPanel * theDrawToolsPanel );
134
135         void setAutomaticFormsPanel(  wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel );
136
137         void setStandardToolsPanel(  wxContour_StandardToolsPanel * theStandardToolsPanel );
138
139         void setEditionToolsPanel(  wxContour_EdtionToolsPanel * theEditionToolsPanel );
140
141         void setListViewPanel(  wxContour_ListViewPanel * theListViewPanel );
142
143
144         ////------------------------------------------------------------------------------------------------------------
145         //// Methods for capturing events
146         ////------------------------------------------------------------------------------------------------------------
147         
148
149         ////------------------------------------------------------------------------------------------------------------
150         ////  Model management methods
151         ////------------------------------------------------------------------------------------------------------------
152
153         
154         //------------------------------------------------------------------------------------------------------------
155         //  Attributes getters and setters
156         //------------------------------------------------------------------------------------------------------------
157         static wxContourMainFrame* getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
158         static wxContourMainFrame* getInstance();
159         //------------------------------------------------------------------------------------------------------------
160         //  Other functional methods
161         //------------------------------------------------------------------------------------------------------------
162
163         /*
164         ** This method returns the vector of images selected by the user 
165         **      return value std::vector<vtkImageData*>
166         */
167         std::vector<vtkImageData*> getVectImages();
168
169         /**
170         **      This methods connect the event in the class interfMainPanel with the world of the appli
171         **/
172         void onCreateContourSpline( );
173         void onCreateContourRectangle( );
174         void onCreateContourCircle( );
175         void onCreateContourBullEye(wxPanel* pan);
176         /////////////////////////////////
177         void onDeleteContour();
178         void deleteContours( std::vector<std::string>  keyNamesVector );
179         void deleteContour( std::string theKeyName );
180         void onDeleteContoursActSlice();
181         void onDeleteAllContours();
182         void deleteAllContours();
183         void setConceptValue( std::string name, int value );
184         ConceptDataWrap* getLastConceptData();
185         bool getIfConceptCheckedAt( std::string name, int pos );
186
187         void changeInstant();
188
189         int getNamesWrappingSize();
190
191         std::string getNameWrapping(int i);
192
193
194         void updateInstantOutlines();
195         void updateInstantImageData();
196         void updateInstantAxes();
197
198         void onChangeDeep(int val);
199
200 ///////////////////////////
201         void onCopy();
202         void onPaste();
203         void onUndo();
204         void onRedo();
205         void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
206 ///////////////////////7
207         void onLoad();
208         void onSave();
209         
210         void openContours( FILE *pFile, bool staticContour );
211
212         void RefreshInterface();
213
214         vtkImageData* getImageData();
215
216         void onSegmentationOneSlice(int isovalue,int sampling,int method);
217
218         void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
219
220         int GetImageDataSizeZ();
221
222         void GetImageDataRange(double *range);
223
224         void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
225
226         void showAxis(bool show);
227
228         void onRigidPressed();
229
230         void onWidthOfContour(double width);
231
232         int getColorWindow();
233         int getWindowLevel();
234
235         void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
236
237         void onInterpolation(bool interpolate);
238
239         void onChangeInstant(std::string name,int actual);
240
241         void resetAppend();
242
243         void onSpreadAdd();
244
245         void onSpreadGo(int type);
246
247         void getInstantVector(std::vector<int>& tempVector);
248
249         std::vector<std::string> getOutlinesName(int slide);
250
251         void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
252
253         void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
254
255         void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
256
257         void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
258
259         void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
260
261 private:
262         //------------------------------------------------------------------------------------------------------------
263         //  Private methods
264         //------------------------------------------------------------------------------------------------------------
265
266         
267         //------------------------------------------------------------------------------------------------------------
268         // Attributtes
269         //------------------------------------------------------------------------------------------------------------
270         static wxContourMainFrame* instance;
271
272         KernelManagerContour* kernelManager;
273
274         wxContourViewPanel* _theViewPanel;
275
276
277         wxAuiManager m_mgr;
278     /*
279         wxArrayString m_perspectives;
280     wxMenu* m_perspectives_menu;
281         */
282     long m_notebook_style;
283     long m_notebook_theme;
284         int _numberOfVariablesStatistics;
285
286         //OutlineModelManager * _modelManager;
287
288         wxInstantChooserPanel * _instantPanel;
289
290         wxContour_ButtonsBar * _buttonsBar;
291
292         wxContour_Grid *  _gridPanel;
293
294         wxContour_DrawToolsPanel * _drawToolsPanel;
295
296         wxContour_OperationsToolsPanel * _operationsToolsPanel;
297
298         wxContour_AutomaticFormsToolsPanel * _autoFormsPanel; 
299
300         wxContour_StandardToolsPanel *_standardToolsPanel;
301
302         wxContour_EdtionToolsPanel * _editionToolsPanel;
303
304         wxContour_ListViewPanel * _listViewPanel;
305
306         wxVtkBaseView_SceneManager * _sceneManager;
307
308         //Instant * _actualInstant;
309
310         
311
312         /*DECLARE_CLASS(wxContourMainFrame)
313         // any class wishing to process wxWindows events must use this macro
314         DECLARE_EVENT_TABLE()*/
315         bool _creatingContoursActive;
316 ////////JCP 21 - 11 - 08
317         void createContour( int typeContour );
318
319         //manualContourModel * factoryManualContourModel(int typeContour);
320
321         manualContourModel * factoryManualContourModel(wxPanel* panel);
322
323
324
325         void saveState();
326         void loadState(std::string filename);
327
328         void saveFileWithContours( std::string filename );
329
330         int inredo;
331         int inundo;
332         std::string     stundoredo;
333
334         
335
336         //wxContourViewPanel* _viewPan;
337         PerformingOperation* _performingOperation;
338
339         static char COPY;
340
341 };
342
343 #endif