]> 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 onCreateContourBullEye(wxPanel* pan);
173         /////////////////////////////////
174         void onDeleteContour();
175         void deleteContours( std::vector<std::string>  keyNamesVector );
176         void deleteContour( std::string theKeyName );
177         void onDeleteContoursActSlice();
178         void onDeleteAllContours();
179         void deleteAllContours();
180         void setConceptValue( std::string name, int value );
181         ConceptDataWrap* getLastConceptData();
182         bool getIfConceptCheckedAt( std::string name, int pos );
183
184         void changeInstant();
185
186         int getNamesWrappingSize();
187
188         std::string getNameWrapping(int i);
189
190
191         void updateInstantOutlines();
192         void updateInstantImageData();
193         void updateInstantAxes();
194
195         void onChangeDeep(int val);
196
197 ///////////////////////////
198         void onCopy();
199         void onPaste();
200         void onUndo();
201         void onRedo();
202         void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
203 ///////////////////////7
204         void onLoad();
205         void onSave();
206         
207         void openContours( FILE *pFile, bool staticContour );
208
209         void RefreshInterface();
210
211         vtkImageData* getImageData();
212
213         void onSegmentationOneSlice(int isovalue,int sampling,int method);
214
215         void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
216
217         int GetImageDataSizeZ();
218
219         void GetImageDataRange(double *range);
220
221         void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
222
223         void showAxis(bool show);
224
225         void onRigidPressed();
226
227         void onWidthOfContour(double width);
228
229         int getColorWindow();
230         int getWindowLevel();
231
232         void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
233
234         void onInterpolation(bool interpolate);
235
236         void onChangeInstant(std::string name,int actual);
237
238         void resetAppend();
239
240         void onSpreadAdd();
241
242         void onSpreadGo(int type);
243
244         void getInstantVector(std::vector<int>& tempVector);
245
246         std::vector<std::string> getOutlinesName(int slide);
247
248         void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
249
250         void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
251
252         void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
253
254         void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
255
256         void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
257
258         void onSnakePressed();
259
260         void saveFileWithContoursAutomatique();
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         wxInstantChooserPanel * _instantPanel;
277
278
279         wxAuiManager m_mgr;
280     /*
281         wxArrayString m_perspectives;
282     wxMenu* m_perspectives_menu;
283         */
284     long m_notebook_style;
285     long m_notebook_theme;
286         int _numberOfVariablesStatistics;
287
288         //OutlineModelManager * _modelManager;
289
290         
291
292         //wxContour_ButtonsBar * _buttonsBar;
293
294         //wxContour_Grid *  _gridPanel;
295
296         //wxContour_DrawToolsPanel * _drawToolsPanel;
297
298         //wxContour_OperationsToolsPanel * _operationsToolsPanel;
299
300         //wxContour_AutomaticFormsToolsPanel * _autoFormsPanel; 
301
302         //wxContour_StandardToolsPanel *_standardToolsPanel;
303
304         //wxContour_EdtionToolsPanel * _editionToolsPanel;
305
306         //wxContour_ListViewPanel * _listViewPanel;
307
308         //wxVtkBaseView_SceneManager * _sceneManager;
309
310         //Instant * _actualInstant;
311
312         
313
314         /*DECLARE_CLASS(wxContourMainFrame)
315         // any class wishing to process wxWindows events must use this macro
316         DECLARE_EVENT_TABLE()*/
317         bool _creatingContoursActive;
318 ////////JCP 21 - 11 - 08
319         void createContour( int typeContour );
320
321         //manualContourModel * factoryManualContourModel(int typeContour);
322
323         manualContourModel * factoryManualContourModel(wxPanel* panel);
324
325
326
327         void saveState();
328         void loadState(std::string filename);
329
330         void saveFileWithContours( std::string filename );
331
332         int inredo;
333         int inundo;
334         std::string     stundoredo;
335
336         
337
338         //wxContourViewPanel* _viewPan;
339         PerformingOperation* _performingOperation;
340
341         static char COPY;
342
343 };
344
345 #endif