]> Creatis software - creaContours.git/blob - lib/Interface_Icons_NDimensions/interfMainPanel.h
Version with out wxEventHandler
[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 onCreateContoursBullEye(wxPanel* panBull);
86         /////////////////////////////////
87         void onDeleteContour();
88         void onDeleteContoursActSlice();
89         void onDeleteAllContours();
90         /////////////////////////
91         void onCopy();
92         void onPaste();
93         void onUndo();
94         void onRedo();
95
96         //////////////////////////
97         void onLoad();
98         void onSave();
99 /////////////////////////////7
100         void RefreshInterface();
101
102         vtkImageData* getImageData();
103
104         void onSegmentationOneSlice(int isovalue,int sampling,int method);
105
106         int GetImageDataSizeZ();
107
108         void GetImageDataRange(double *range);
109
110         void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
111
112         void setLabelSegmentationPanelVTK(wxString tmpString);
113
114         void onSegmentationPressed();
115
116         void onSegmentationPressedITK();
117
118         void onRigidPressed();
119
120         void onWidthOfContour(double width);
121
122         int getColorWindow();
123         int getWindowLevel();
124
125         void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
126
127         void onInterpolation(bool interpolate);
128
129         void onSpreadPressed();
130
131         void onConfigurationPressed();
132
133         void resetAppend();
134
135         void onSpreadAdd();
136
137         void appendStringSpread(std::string val);
138
139         void onSpreadGo(int type);
140
141         void setStringSpread(std::string stringtemp);
142
143         void onInformationPressed();
144
145         
146         void getInstantVector(std::vector<int>& tempVector);
147
148         std::vector<std::string> getOutlinesName(int slide);
149
150         void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ);
151
152         void setStringInfoPanel(wxString tmpString);    
153
154         void setRowLabelInfoPanel(int z, wxString tempString);
155
156         int getNumberColsInformationPanel();
157         
158         void appendColsInformationPanel(int _numberOfVariablesStatistics);
159
160         void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
161
162         void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
163
164         void onSaveResults(std::string directory,std::string namefile, std::string filename,int typeContourGroup);
165
166         wxString getCellValue(int j,int i);
167 private:
168         
169
170         static interfMainPanel* interfmainpanel;
171
172
173         wxPanel* menubar;
174         wxPanel* menubar1;
175         wxPanel* menubar2;
176         wxPanel* menubar3;
177         wxPanel* menubar4;
178         wxPanel* menubar5;
179
180         wxWindow* currentWindow;
181         wxSplitterWindow* splitterwindow;
182
183         wxPanel* infoPanel;
184
185         wxStaticText* statictext;
186         wxStaticText* statictext1;
187         wxStaticText* statictext2;
188         wxStaticText* statictext3;
189         wxStaticText* statictext4;
190         wxStaticText* statictext5;
191
192         std::string PANEL;
193         std::string PANEL1;
194         std::string PANEL2;
195         std::string PANEL3;
196         std::string PANEL4;
197         std::string PANEL5;
198
199         wxPanel* segmentPanel;
200         wxPanel* segmentationPanel;
201         wxPanel* segmentPanelITK;
202         wxPanel* configPanel;
203         wxPanel* spreadPanel;
204         interfSpreadPanel* panelSpread;
205         wxWindow* infoWin;
206         wxPanel* informationPanel;
207
208         bool axisshown;
209
210         
211         //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
212         //list of contours
213         interfToolsSpreadPanel* toolspread;
214
215         /**
216         **      This method initializes the tools panel, with the bar and the panel where the contours can be added
217         **      and removed.
218         **      @params size of the buttons panel
219         **      @params sizey of the buttons panel
220         **      @params evtHandler this is the class in charge of responding to the events of the buttons
221         **/
222         wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
223
224         /**
225         **      initialize a statictext component of the interface
226         **/
227         wxStaticText* getText(wxWindow* parent, std::string nom);
228         /**
229         ** initializes a button with data
230         **/
231         wxButton* getButton(wxWindow* parent);
232         /**
233         ** Puts the panel button and the text int the sizer
234         **/
235         wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);
236
237         
238 };