]> 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 "vtkTransform.h"
76 //#include "vtkMetaImageReader.h"
77
78 //------------------------------------------------------------------------------------------------------------
79 // Events declaration
80 //------------------------------------------------------------------------------------------------------------
81
82 //BEGIN_DECLARE_EVENT_TYPES()
83 //END_DECLARE_EVENT_TYPES()
84
85 /** file wxContourMainFrame.h */
86
87
88 //------------------------------------------------------------------------------------------------------------
89 // Class definition
90 //------------------------------------------------------------------------------------------------------------
91
92 class wxContourMainFrame : public wxPanel {
93
94         public:
95
96         //------------------------------------------------------------------------------------------------------------
97         // Constructors & Destructors
98         //------------------------------------------------------------------------------------------------------------
99         
100
101         wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
102         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>");
103
104         ~wxContourMainFrame();
105
106         //------------------------------------------------------------------------------------------------------------
107         // Creational and initialization methods
108         //------------------------------------------------------------------------------------------------------------
109         bool configurePanels(wxAuiNotebook * theNoteBook );
110
111         void setNotebook( wxAuiNotebook * theNoteBook );
112
113         wxAuiNotebook * createNotebook();
114
115         void createInstantChooserPanel(wxAuiNotebook * parent);
116
117         void createViewPanel(wxAuiNotebook * parent);
118         
119         void createInstantChooserPanel(wxWindow * parent);
120
121         void createViewPanel(wxWindow * parent);
122
123         void setInstantChooserPanel(  wxInstantChooserPanel * theInstantChooserPanel );
124
125 //      void setButtonsBar(  wxContour_ButtonsBar * theButtonsBar );
126
127 //      void setGrid(  wxContour_Grid * theGridPanel );
128
129 //      void setDrawToolsPanel(  wxContour_DrawToolsPanel * theDrawToolsPanel );
130
131 //      void setOperationsToolsPanel(  wxContour_OperationsToolsPanel * theDrawToolsPanel );
132
133 //      void setAutomaticFormsPanel(  wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel );
134
135 //      void setStandardToolsPanel(  wxContour_StandardToolsPanel * theStandardToolsPanel );
136
137 //      void setEditionToolsPanel(  wxContour_EdtionToolsPanel * theEditionToolsPanel );
138
139 //      void setListViewPanel(  wxContour_ListViewPanel * theListViewPanel );
140
141
142         ////------------------------------------------------------------------------------------------------------------
143         //// Methods for capturing events
144         ////------------------------------------------------------------------------------------------------------------
145         
146
147         ////------------------------------------------------------------------------------------------------------------
148         ////  Model management methods
149         ////------------------------------------------------------------------------------------------------------------
150
151         
152         //------------------------------------------------------------------------------------------------------------
153         //  Attributes getters and setters
154         //------------------------------------------------------------------------------------------------------------
155         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>");
156         static wxContourMainFrame* getInstance();
157         //------------------------------------------------------------------------------------------------------------
158         //  Other functional methods
159         //------------------------------------------------------------------------------------------------------------
160
161         /*
162         ** This method returns the vector of images selected by the user 
163         **      return value std::vector<vtkImageData*>
164         */
165         std::vector<vtkImageData*> getVectImages();
166
167         /**
168         **      This methods connect the event in the class interfMainPanel with the world of the appli
169         **/
170         void onCreateContourSpline( );
171         void onCreateContourRectangle( );
172         void onCreateContourCircle( );
173         void onCreateContourLine( );
174         void onCreateContourBullEye(wxPanel* pan);
175         /////////////////////////////////
176         void onDeleteContour();
177         void deleteContours( std::vector<std::string>  keyNamesVector );
178         void deleteContour( std::string theKeyName );
179         void onDeleteContoursActSlice();
180         void onDeleteAllContours();
181         void deleteAllContours();
182         void setConceptValue( std::string name, int value );
183         ConceptDataWrap* getLastConceptData();
184         bool getIfConceptCheckedAt( std::string name, int pos );
185
186         void changeInstant();
187
188         int getNamesWrappingSize();
189
190         std::string getNameWrapping(int i);
191
192
193         void updateInstantOutlines();
194         void updateInstantImageData();
195         void updateInstantAxes();
196
197         void onChangeDeep(int val);
198
199 ///////////////////////////
200         void onCopy();
201         void onPaste();
202         void onUndo();
203         void onRedo();
204         void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
205         void createMirrorContourOf ( 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         void Mirror( int x, int y, int z, int isovalue, int sampling, int method );
221
222         int GetImageDataSizeZ();
223
224         void GetImageDataRange(double *range);
225
226         void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
227
228         //AD
229         void referenceLine();
230         void refLineHide();
231         void refLineShow();
232
233         //AD
234         void onMirror();
235
236         void showAxis(bool show);
237
238         void onRigidPressed();
239
240         void onWidthOfContour(double width);
241
242         int getColorWindow();
243         int getWindowLevel();
244
245         void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
246
247         void onInterpolation(bool interpolate);
248
249         void onChangeInstant(std::string name,int actual);
250
251         void resetAppend();
252
253         void onSpreadAdd();
254
255         void onSpreadGo(int type);
256
257         void getInstantVector(std::vector<int>& tempVector);
258
259         std::vector<std::string> getOutlinesName(int slide);
260
261         void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
262
263         void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
264
265         void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
266
267         void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
268
269         void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
270
271         void onSnakePressed();
272
273         void saveFileWithContoursAutomatique();
274 private:
275         //------------------------------------------------------------------------------------------------------------
276         //  Private methods
277         //------------------------------------------------------------------------------------------------------------
278
279         
280         //------------------------------------------------------------------------------------------------------------
281         // Attributtes
282         //------------------------------------------------------------------------------------------------------------
283         static wxContourMainFrame* instance;
284
285         KernelManagerContour* kernelManager;
286
287         wxContourViewPanel* _theViewPanel;
288
289         wxInstantChooserPanel * _instantPanel;
290
291         //AD: 03-09: This attributes represents the reference line that is going to be used for the mirroring
292         manualLineControler             * _refLineControl;
293         manualContourModelLine  * _refLineModel;
294         manualViewLine                  * _refLineView;
295
296
297
298         wxAuiManager m_mgr;
299     /*
300         wxArrayString m_perspectives;
301     wxMenu* m_perspectives_menu;
302         */
303     long m_notebook_style;
304     long m_notebook_theme;
305         int _numberOfVariablesStatistics;
306
307         //OutlineModelManager * _modelManager;
308
309         
310
311         //wxContour_ButtonsBar * _buttonsBar;
312
313         //wxContour_Grid *  _gridPanel;
314
315         //wxContour_DrawToolsPanel * _drawToolsPanel;
316
317         //wxContour_OperationsToolsPanel * _operationsToolsPanel;
318
319         //wxContour_AutomaticFormsToolsPanel * _autoFormsPanel; 
320
321         //wxContour_StandardToolsPanel *_standardToolsPanel;
322
323         //wxContour_EdtionToolsPanel * _editionToolsPanel;
324
325         //wxContour_ListViewPanel * _listViewPanel;
326
327         //wxVtkBaseView_SceneManager * _sceneManager;
328
329         //Instant * _actualInstant;
330
331         
332
333         /*DECLARE_CLASS(wxContourMainFrame)
334         // any class wishing to process wxWindows events must use this macro
335         DECLARE_EVENT_TABLE()*/
336         bool _creatingContoursActive;
337 ////////JCP 21 - 11 - 08
338         void createContour( int typeContour );
339
340         //manualContourModel * factoryManualContourModel(int typeContour);
341
342         manualContourModel * factoryManualContourModel(wxPanel* panel);
343
344
345
346         void saveState();
347         void loadState(std::string filename);
348
349         void saveFileWithContours( std::string filename );
350
351         int inredo;
352         int inundo;
353         std::string     stundoredo;
354
355         
356
357         //wxContourViewPanel* _viewPan;
358         PerformingOperation* _performingOperation;
359
360         static char COPY;
361
362 };
363
364 #endif