]> Creatis software - creaContours.git/blob - lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.h
*** empty log message ***
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourViewPanel.h
1 #ifndef __wxContourViewPanel_h_INCLUDED_H__
2 #define __wxContourViewPanel_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 #include <wx/scrolwin.h>
19
20 //------------------------------------------------------------------------------------------------------------
21 // Includes
22 //------------------------------------------------------------------------------------------------------------
23
24 #include "mBarRange.h"
25 #include "wxMaracas_N_ViewersWidget.h"
26 #include "vtkImageData.h"
27 #include <manualContour.h>
28 #include "wxVtkBaseView.h"
29 #include <iostream>
30 #include <wx/event.h>
31 //------------------------------------------------------------------------------------------------------------
32 // Events declaration
33 //------------------------------------------------------------------------------------------------------------
34
35 BEGIN_DECLARE_EVENT_TYPES()
36         DECLARE_EVENT_TYPE(wxINSTANT_CHANGE,400)
37 END_DECLARE_EVENT_TYPES()
38
39
40 /** file wxContourViewPanel.h */
41
42 //------------------------------------------------------------------------------------------------------------
43 // Class definition
44 //------------------------------------------------------------------------------------------------------------
45
46 class wxContourViewPanel : public wxPanel {// public wxScrolledWindow {
47
48         public:
49
50         //------------------------------------------------------------------------------------------------------------
51         // Constructors & Destructors
52         //------------------------------------------------------------------------------------------------------------
53         
54         wxContourViewPanel( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos=wxDefaultPosition, const wxSize& size = wxDefaultSize,long style= wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, int vertStart=1, int vertEnd=1, int horzStart=1, int horzEnd=1 );
55
56         ~wxContourViewPanel();
57
58         //------------------------------------------------------------------------------------------------------------
59         // Creational and initialization methods
60         //------------------------------------------------------------------------------------------------------------
61         
62         void setWxEventHandler( wxEvtHandler * theEventHandler );
63
64         void createHorizontalBar(int horzStart, int horzEnd);
65
66         void createVerticalBar(int vertStart, int vertEnd);
67
68         void createViewPanel();
69
70         //------------------------------------------------------------------------------------------------------------
71         // Methods for capturing events from the horizontal bar
72         //------------------------------------------------------------------------------------------------------------
73         
74         /**
75         * Handles the event wxEVT_TSBAR from the horizontal bar 
76         */
77         void onBarrange_Horizontal(wxCommandEvent& event);
78         /**
79         * Handles the event wxEVT_TSBAR_ACTUAL from the horizontal bar  
80         */
81         void onActualChange_Bar_Horizontal(wxCommandEvent& event);
82         /**
83         * Handles the event wxEVT_TSBAR_START from the horizontal bar   
84         */
85         void onStartChange_Bar_Horizontal(wxCommandEvent& event);
86         /**
87         * Handles the event wxEVT_TSBAR_END from the horizontal bar     
88         */
89         void onEndChange_Bar_Horizontal(wxCommandEvent& event);
90         /**
91         * Handles the event wxEVT_SELECTION_END from the horizontal bar 
92         */
93         void onSelectionEnd_Horizontal(wxCommandEvent& event);
94         /**
95         * Handles the event wxEVT_TSBAR_MOVED from the horizontal bar   
96         */
97         void onMovedBar_Horizontal(wxCommandEvent& event);
98
99
100         //------------------------------------------------------------------------------------------------------------
101         // Methods for capturing events from the vertical bar
102         //------------------------------------------------------------------------------------------------------------
103
104         /**
105         * Handles the event wxEVT_TSBAR from the vertical bar   
106         */
107         void onBarrange_Vertical(wxCommandEvent& event);
108         /**
109         * Handles the event wxEVT_TSBAR_ACTUAL from the vertical bar    
110         */
111         void onActualChange_Bar_Vertical(wxCommandEvent& event);
112         /**
113         * Handles the event wxEVT_TSBAR_START from the vertical bar     
114         */
115         void onStartChange_Bar_Vertical(wxCommandEvent& event);
116         /**
117         * Handles the event wxEVT_TSBAR_END from the vertical bar       
118         */
119         void onEndChange_Bar_Vertical(wxCommandEvent& event);
120         /**
121         * Handles the event wxEVT_SELECTION_END from the vertical bar   
122         */
123         void onSelectionEnd_Vertical(wxCommandEvent& event);
124         /**
125         * Handles the event wxEVT_TSBAR_MOVED from the vertical bar     
126         */
127         void onMovedBar_Vertical(wxCommandEvent& event);
128
129
130         //------------------------------------------------------------------------------------------------------------
131         //  Methods for sending events
132         //------------------------------------------------------------------------------------------------------------
133
134         //------------------------------------------------------------------------------------------------------------
135         //  Attributes getters and setters
136         //------------------------------------------------------------------------------------------------------------
137         
138         /**
139         * Sets the represented values of the vertical bar
140         * @param minRepresented In the minimum represented value of the bar
141         * @param maxRepresented In the maximum represented value of the bar
142         */
143         void setVerticalRepresentedValues( int minRepresented, int maxRepresented );
144
145         /**
146         * Sets the represented values of the horizontal bar
147         * @param minRepresented In the minimum represented value of the bar
148         * @param maxRepresented In the maximum represented value of the bar
149         */
150         void setHorizontalRepresentedValues( int minRepresented, int maxRepresented );
151
152         /**
153         * Gets the StartVertical value
154         * @return The StartVertical
155         */
156         int getStartVertical();
157         /**
158         * Gets the EndVertical value
159         * @return The EndVertical
160         */
161         int getEndVertical();
162         /**
163         * Gets the ActualVertical value
164         * @return The ActualVertical
165         */
166         int getActualVertical();
167
168         /**
169         * Sets the StartVertical value
170         * @param nwValue The new value for the StartVertical
171         */
172         void setStartVertical( int nwValue);
173         /**
174         * Sets the EndVertical value
175         * @param nwValue The new value for the EndVertical
176         */
177         void setEndVertical( int nwValue);
178         /**
179         * Sets the ActualVertical value
180         * @param nwValue The new value for the ActualVertical
181         */
182         void setActualVertical( int nwValue);
183
184         /**
185         * Gets the StartHorizontal value
186         * @return The StartHorizontal
187         */
188         int getStartHorizontal();
189         /**
190         * Gets the EndHorizontal value
191         * @return The EndHorizontal
192         */
193         int getEndHorizontal();
194         /**
195         * Gets the ActualHorizontal value
196         * @return The ActualHorizontal
197         */
198         int getActualHorizontal();
199
200         /**
201         * Sets the StartHorizontal value
202         * @param nwValue The new value for the StartHorizontal
203         */
204         void setStartHorizontal( int nwValue);
205         /**
206         * Sets the EndHorizontal value
207         * @param nwValue The new value for the EndHorizontal
208         */
209         void setEndHorizontal( int nwValue);
210         /**
211         * Sets the ActualHorizontal value
212         * @param nwValue The new value for the ActualHorizontal
213         */
214         void setActualHorizontal( int nwValue);
215
216         /**
217         * Sets the horizontal concept values and name
218         * @param theHorizontalConcept The name of the concept for setting at the horizontal bar
219         * @param minRepresent The minRepresent value of the concept for setting at the horizontal bar
220         * @param maxRepresent The maxRepresent value of the concept for setting at the horizontal bar
221         * @param minShowed The minShowed value of the concept for setting at the horizontal bar
222         * @param maxShowed The maxShowed value of the concept for setting at the horizontal bar
223         * @param actualShow The actualShow value of the concept for setting at the horizontal bar
224         */
225         void setHorizontalConcept( std::string theHorizontalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow ); 
226
227         /**
228         * Sets the vertical concept values and name
229         * @param theVerticalConcept The name of the concept for setting at the vertical bar
230         * @param minRepresent The minRepresent value of the concept for setting at the vertical bar
231         * @param maxRepresent The maxRepresent value of the concept for setting at the vertical bar
232         * @param minShowed The minShowed value of the concept for setting at the vertical bar
233         * @param maxShowed The maxShowed value of the concept for setting at the vertical bar
234         * @param actualShow The actualShow value of the concept for setting at the vertical bar
235         */
236         void setVerticalConcept( std::string theVerticalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow );
237         
238         /**
239         * Sets the horizontal concept name
240         * @param theHorizontalConcept The name of the concept for setting at the horizontal bar
241         */
242         void setHorizontalConceptName( std::string theHorizontalConcept );
243
244         /**
245         * Gets the horizontal concept name
246         * @return _horizontalConcept The name of the concept for setting at the horizontal bar
247         */
248         std::string  getHorizontalConceptName(  );
249
250         /**
251         * Sets the vertical concept name
252         * @param theVerticalConcept The name of the concept for setting at the vertical bar
253         */
254         void setVerticalConceptName( std::string theVerticalConcept );
255
256         /**
257         * Gets the vertical concept name
258         * @return _verticalConcept The name of the concept for setting at the vertical bar
259         */
260         std::string  getVerticalConceptName(  );
261
262         //------------------------------------------------------------------------------------------------------------
263         //  Other functional methods
264         //------------------------------------------------------------------------------------------------------------
265
266         void getSpacing( double * spacing );
267
268         wxVtkBaseView* getWxVtkBaseView();
269
270         double getCurrentDeep();
271         
272         void    SetVisibleAxis(bool ok);
273         int             GetX();
274         int             GetY();
275         int             GetZ();
276         void    Refresh();
277
278
279 private:
280         //------------------------------------------------------------------------------------------------------------
281         //  Private methods
282         //------------------------------------------------------------------------------------------------------------
283
284         //------------------------------------------------------------------------------------------------------------
285         // Attributtes
286         //------------------------------------------------------------------------------------------------------------
287         /*
288         * Represents the outer sizer of the ContourViewPanel
289         */
290         wxFlexGridSizer* outSizer;
291
292         /*
293         * Represents the panel for viewing
294         */
295         wxMaracas_N_ViewersWidget * theViewPanel;
296         /*
297         * Represents the vertical barrange
298         */
299         mBarRange * _verticalBar;
300
301         /*
302         * Represents the horizontal barrange
303         */
304         mBarRange * _horizontalBar;
305
306         vtkImageData * showingVID;      
307
308         std::string _verticalConceptName;
309
310         std::string _horizontalConceptName;
311
312         double last_spacing[3];
313
314         bool _useVerticalBar;
315
316         bool _useHorizontalBar;
317         
318         wxEvtHandler * _eventHandler;
319         
320 //EED
321         wxVtkMPR2DView * GetwxVtkMPR2DView();
322
323
324 //      DECLARE_CLASS(wxContourViewPanel)
325         // any class wishing to process wxWindows events must use this macro
326         //DECLARE_EVENT_TABLE()
327
328 };
329 #endif // __wxContour_ViewPanel__
330