]> Creatis software - creaContours.git/blob - lib/Interface_Icons_NDimensions/interfMainPanel.h
*** empty log message ***
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMainPanel.h
1 #pragma once
2
3 #include <wx/wx.h>
4 //#include "wxContourEventHandler.h"
5
6 #include "interfNewContourMenu.h"
7 #include "interfIOMenu.h"
8 #include "interfEditMenu.h"
9 #include "interfDeleteMenu.h"
10 #include "interfToolsMenu.h"
11 #include "interfToolsSpreadPanel.h"
12 #include "interfSegmentationMenu.h"
13 #include "interfMenuBar.h"
14 #include "interfSegmentationPanels.h"
15 #include "interfToolsPanels.h"
16
17 #include <wx/treebook.h>
18 #include <wx/sizer.h>
19 #include <wx/button.h>
20 #include <wx/stattext.h>
21 #include <wx/splitter.h>
22 #include <wx/statline.h>
23
24 #include "vtkImageData.h"
25
26 class interfMainPanel : public wxPanel {
27
28 public:
29         
30         interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir = "data/Icons");
31         ~interfMainPanel(void);
32
33         /**     This method should be called the first time by the parent class
34         **      in creates all the panels the first time
35         **/
36         static interfMainPanel* getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler=NULL );
37         /**     This method should be called the first time by the parent class
38         **      in creates all the panels the first time
39         **/
40         static interfMainPanel* getInstance(wxWindow* parent, wxEvtHandler * evtHandler=NULL);
41         /**
42         **      Gets the instance of the class
43         **/
44         static interfMainPanel* getInstance();
45
46
47         /**
48         **      Adds a new checkbox to the scrolledwindow using the checkboxsizer
49         **      @Params id of contour
50         **      
51         **/
52         void addContourCheckBox(std::string id);
53
54         /**
55         **      Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer)
56         **      @Params id of contour
57         **      
58         **/
59         void removeContourCheckBox(std::string id);
60
61
62         /**
63         **      Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
64         **      of the button corresponding to the method that has to be executed,
65         **      it uses attribute eventHandler to call the methods define by the application.
66         **      see setEventHandler(wxEventHandler*)
67         **/
68         void onActionButtonPressed1( wxCommandEvent& event );
69
70         /**
71         **      Shows the panel in the 
72         **/
73         void showPanel(wxWindow* panel);
74         /**
75         **      Gets the Information panel
76         **/
77         wxPanel* getInfoPanel();
78         
79         /**
80         **      This methods connect the event in the class interfNewContourMenu with the world of the appli
81         **/
82         void onCreateContourSpline( );
83         void onCreateContourRectangle( );
84         void onCreateContourCircle( );
85         void onCreateContourLine( );
86         void onCreateContoursBullEye(wxPanel* panBull);
87         /////////////////////////////////
88         void onDeleteContour();
89         void onDeleteContoursActSlice();
90         void onDeleteAllContours();
91         /////////////////////////
92         void onCopy();
93         void onPaste();
94         void onUndo();
95         void onRedo();
96
97         //////////////////////////
98         void onLoad();
99         void onSave();
100 /////////////////////////////7
101         void RefreshInterface();
102
103         vtkImageData* getImageData();
104
105         void onSegmentationOneSlice(int isovalue,int sampling,int method);
106
107         int GetImageDataSizeZ();
108
109         void GetImageDataRange(double *range);
110
111         void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
112
113         void onMirror();
114
115         void setLabelSegmentationPanelVTK(wxString tmpString);
116
117         void onSegmentationPressed();
118
119         void onSegmentationPressedITK();
120
121         void onRigidPressed();
122
123         void onWidthOfContour(double width);
124
125         int getColorWindow();
126         int getWindowLevel();
127
128         void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
129
130         void onInterpolation(bool interpolate);
131
132         void onSpreadPressed();
133
134         void onConfigurationPressed();
135
136         void resetAppend();
137
138         void onSpreadAdd();
139
140         void appendStringSpread(std::string val);
141
142         void onSpreadGo(int type);
143
144         void setStringSpread(std::string stringtemp);
145
146         void onInformationPressed();
147
148         
149         void getInstantVector(std::vector<int>& tempVector);
150
151         std::vector<std::string> getOutlinesName(int slide);
152
153         void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ);
154
155         void setStringInfoPanel(wxString tmpString);    
156
157         void setRowLabelInfoPanel(int z, wxString tempString);
158
159         int getNumberColsInformationPanel();
160         
161         void appendColsInformationPanel(int _numberOfVariablesStatistics);
162
163         void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
164
165         void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
166
167         void onSaveResults(std::string directory,std::string namefile, std::string filename,int typeContourGroup);
168
169         wxString getCellValue(int j,int i);
170
171         void onSnakePressed();
172
173         void onMirrorPressed();
174
175 private:
176         
177
178         static interfMainPanel* interfmainpanel;
179
180
181         wxPanel* menubar;
182         wxPanel* menubar1;
183         wxPanel* menubar2;
184         wxPanel* menubar3;
185         wxPanel* menubar4;
186         wxPanel* menubar5;
187
188         wxWindow* currentWindow;
189         wxSplitterWindow* splitterwindow;
190
191         wxPanel* infoPanel;
192
193         wxStaticText* statictext;
194         wxStaticText* statictext1;
195         wxStaticText* statictext2;
196         wxStaticText* statictext3;
197         wxStaticText* statictext4;
198         wxStaticText* statictext5;
199
200         std::string PANEL;
201         std::string PANEL1;
202         std::string PANEL2;
203         std::string PANEL3;
204         std::string PANEL4;
205         std::string PANEL5;
206
207         wxPanel* segmentPanel;
208         wxPanel* segmentationPanel;
209         wxPanel* segmentPanelITK;
210         wxPanel* configPanel;
211         wxPanel* spreadPanel;
212         interfSpreadPanel* panelSpread;
213         wxPanel* mirrorPanel;
214         interfMirrorPanel* panelMirror; 
215         wxWindow* infoWin;
216         wxPanel* informationPanel;
217
218         bool axisshown;
219
220         
221         //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
222         //list of contours
223         interfToolsSpreadPanel* toolspread;
224
225         /**
226         **      This method initializes the tools panel, with the bar and the panel where the contours can be added
227         **      and removed.
228         **      @params size of the buttons panel
229         **      @params sizey of the buttons panel
230         **      @params evtHandler this is the class in charge of responding to the events of the buttons
231         **/
232         wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
233
234         /**
235         **      initialize a statictext component of the interface
236         **/
237         wxStaticText* getText(wxWindow* parent, std::string nom);
238         /**
239         ** initializes a button with data
240         **/
241         wxButton* getButton(wxWindow* parent);
242         /**
243         ** Puts the panel button and the text int the sizer
244         **/
245         wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);
246
247         
248 };