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