1 #ifndef __wxContourViewPanel_h_INCLUDED_H__
2 #define __wxContourViewPanel_h_INCLUDED_H__
5 // -----------------------------------------------------------------------------------------------------------
6 // WX headers inclusion.
7 // For compilers that support precompilation, includes <wx/wx.h>.
8 // -----------------------------------------------------------------------------------------------------------
10 #include <wx/wxprec.h>
18 #include <wx/scrolwin.h>
20 //------------------------------------------------------------------------------------------------------------
22 //------------------------------------------------------------------------------------------------------------
24 #include "mBarRange.h"
25 #include "wxMaracas_N_ViewersWidget.h"
26 #include "vtkImageData.h"
27 #include <manualContour.h>
28 #include "wxVtkBaseView.h"
31 //------------------------------------------------------------------------------------------------------------
33 //------------------------------------------------------------------------------------------------------------
35 BEGIN_DECLARE_EVENT_TYPES()
36 DECLARE_EVENT_TYPE(wxINSTANT_CHANGE,400)
37 END_DECLARE_EVENT_TYPES()
40 /** file wxContourViewPanel.h */
42 //------------------------------------------------------------------------------------------------------------
44 //------------------------------------------------------------------------------------------------------------
46 class wxContourViewPanel : public wxPanel {// public wxScrolledWindow {
50 //------------------------------------------------------------------------------------------------------------
51 // Constructors & Destructors
52 //------------------------------------------------------------------------------------------------------------
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 );
56 ~wxContourViewPanel();
58 //------------------------------------------------------------------------------------------------------------
59 // Creational and initialization methods
60 //------------------------------------------------------------------------------------------------------------
62 void setWxEventHandler( wxEvtHandler * theEventHandler );
64 void createHorizontalBar(int horzStart, int horzEnd);
66 void createVerticalBar(int vertStart, int vertEnd);
68 void createViewPanel();
70 //------------------------------------------------------------------------------------------------------------
71 // Methods for capturing events from the horizontal bar
72 //------------------------------------------------------------------------------------------------------------
75 * Handles the event wxEVT_TSBAR from the horizontal bar
77 void onBarrange_Horizontal(wxCommandEvent& event);
79 * Handles the event wxEVT_TSBAR_ACTUAL from the horizontal bar
81 void onActualChange_Bar_Horizontal(wxCommandEvent& event);
83 * Handles the event wxEVT_TSBAR_START from the horizontal bar
85 void onStartChange_Bar_Horizontal(wxCommandEvent& event);
87 * Handles the event wxEVT_TSBAR_END from the horizontal bar
89 void onEndChange_Bar_Horizontal(wxCommandEvent& event);
91 * Handles the event wxEVT_SELECTION_END from the horizontal bar
93 void onSelectionEnd_Horizontal(wxCommandEvent& event);
95 * Handles the event wxEVT_TSBAR_MOVED from the horizontal bar
97 void onMovedBar_Horizontal(wxCommandEvent& event);
100 //------------------------------------------------------------------------------------------------------------
101 // Methods for capturing events from the vertical bar
102 //------------------------------------------------------------------------------------------------------------
105 * Handles the event wxEVT_TSBAR from the vertical bar
107 void onBarrange_Vertical(wxCommandEvent& event);
109 * Handles the event wxEVT_TSBAR_ACTUAL from the vertical bar
111 void onActualChange_Bar_Vertical(wxCommandEvent& event);
113 * Handles the event wxEVT_TSBAR_START from the vertical bar
115 void onStartChange_Bar_Vertical(wxCommandEvent& event);
117 * Handles the event wxEVT_TSBAR_END from the vertical bar
119 void onEndChange_Bar_Vertical(wxCommandEvent& event);
121 * Handles the event wxEVT_SELECTION_END from the vertical bar
123 void onSelectionEnd_Vertical(wxCommandEvent& event);
125 * Handles the event wxEVT_TSBAR_MOVED from the vertical bar
127 void onMovedBar_Vertical(wxCommandEvent& event);
130 //------------------------------------------------------------------------------------------------------------
131 // Methods for sending events
132 //------------------------------------------------------------------------------------------------------------
134 //------------------------------------------------------------------------------------------------------------
135 // Attributes getters and setters
136 //------------------------------------------------------------------------------------------------------------
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
143 void setVerticalRepresentedValues( int minRepresented, int maxRepresented );
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
150 void setHorizontalRepresentedValues( int minRepresented, int maxRepresented );
153 * Gets the StartVertical value
154 * @return The StartVertical
156 int getStartVertical();
158 * Gets the EndVertical value
159 * @return The EndVertical
161 int getEndVertical();
163 * Gets the ActualVertical value
164 * @return The ActualVertical
166 int getActualVertical();
169 * Sets the StartVertical value
170 * @param nwValue The new value for the StartVertical
172 void setStartVertical( int nwValue);
174 * Sets the EndVertical value
175 * @param nwValue The new value for the EndVertical
177 void setEndVertical( int nwValue);
179 * Sets the ActualVertical value
180 * @param nwValue The new value for the ActualVertical
182 void setActualVertical( int nwValue);
185 * Gets the StartHorizontal value
186 * @return The StartHorizontal
188 int getStartHorizontal();
190 * Gets the EndHorizontal value
191 * @return The EndHorizontal
193 int getEndHorizontal();
195 * Gets the ActualHorizontal value
196 * @return The ActualHorizontal
198 int getActualHorizontal();
201 * Sets the StartHorizontal value
202 * @param nwValue The new value for the StartHorizontal
204 void setStartHorizontal( int nwValue);
206 * Sets the EndHorizontal value
207 * @param nwValue The new value for the EndHorizontal
209 void setEndHorizontal( int nwValue);
211 * Sets the ActualHorizontal value
212 * @param nwValue The new value for the ActualHorizontal
214 void setActualHorizontal( int nwValue);
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
225 void setHorizontalConcept( std::string theHorizontalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow );
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
236 void setVerticalConcept( std::string theVerticalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow );
239 * Sets the horizontal concept name
240 * @param theHorizontalConcept The name of the concept for setting at the horizontal bar
242 void setHorizontalConceptName( std::string theHorizontalConcept );
245 * Gets the horizontal concept name
246 * @return _horizontalConcept The name of the concept for setting at the horizontal bar
248 std::string getHorizontalConceptName( );
251 * Sets the vertical concept name
252 * @param theVerticalConcept The name of the concept for setting at the vertical bar
254 void setVerticalConceptName( std::string theVerticalConcept );
257 * Gets the vertical concept name
258 * @return _verticalConcept The name of the concept for setting at the vertical bar
260 std::string getVerticalConceptName( );
262 //------------------------------------------------------------------------------------------------------------
263 // Other functional methods
264 //------------------------------------------------------------------------------------------------------------
266 void getSpacing( double * spacing );
268 wxVtkBaseView* getWxVtkBaseView();
270 double getCurrentDeep();
272 void SetVisibleAxis(bool ok);
280 //------------------------------------------------------------------------------------------------------------
282 //------------------------------------------------------------------------------------------------------------
284 //------------------------------------------------------------------------------------------------------------
286 //------------------------------------------------------------------------------------------------------------
288 * Represents the outer sizer of the ContourViewPanel
290 wxFlexGridSizer* outSizer;
293 * Represents the panel for viewing
295 wxMaracas_N_ViewersWidget * theViewPanel;
297 * Represents the vertical barrange
299 mBarRange * _verticalBar;
302 * Represents the horizontal barrange
304 mBarRange * _horizontalBar;
306 vtkImageData * showingVID;
308 std::string _verticalConceptName;
310 std::string _horizontalConceptName;
312 double last_spacing[3];
314 bool _useVerticalBar;
316 bool _useHorizontalBar;
318 wxEvtHandler * _eventHandler;
321 wxVtkMPR2DView * GetwxVtkMPR2DView();
324 // DECLARE_CLASS(wxContourViewPanel)
325 // any class wishing to process wxWindows events must use this macro
326 //DECLARE_EVENT_TABLE()
329 #endif // __wxContour_ViewPanel__