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 #include "wxVtkBaseView_SceneManager.h"
32 #include "manualContour.h"
34 #include <vtkImageMapToWindowLevelColors.h>
37 //------------------------------------------------------------------------------------------------------------
39 //------------------------------------------------------------------------------------------------------------
41 BEGIN_DECLARE_EVENT_TYPES()
42 DECLARE_EVENT_TYPE(wxINSTANT_CHANGE,400)
43 END_DECLARE_EVENT_TYPES()
46 /** file wxContourViewPanel.h */
48 //------------------------------------------------------------------------------------------------------------
50 //------------------------------------------------------------------------------------------------------------
52 class wxContourViewPanel : public wxPanel {// public wxScrolledWindow {
56 //------------------------------------------------------------------------------------------------------------
57 // Constructors & Destructors
58 //------------------------------------------------------------------------------------------------------------
60 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 );
62 ~wxContourViewPanel();
64 //------------------------------------------------------------------------------------------------------------
65 // Creational and initialization methods
66 //------------------------------------------------------------------------------------------------------------
68 void setWxEventHandler( wxEvtHandler * theEventHandler );
70 void createHorizontalBar(int horzStart, int horzEnd);
72 void createVerticalBar(int vertStart, int vertEnd);
74 void createViewPanel();
76 //------------------------------------------------------------------------------------------------------------
77 // Methods for capturing events from the horizontal bar
78 //------------------------------------------------------------------------------------------------------------
81 * Handles the event wxEVT_TSBAR from the horizontal bar
83 void onBarrange_Horizontal(wxCommandEvent& event);
85 * Handles the event wxEVT_TSBAR_ACTUAL from the horizontal bar
87 void onActualChange_Bar_Horizontal(wxCommandEvent& event);
89 * Handles the event wxEVT_TSBAR_START from the horizontal bar
91 void onStartChange_Bar_Horizontal(wxCommandEvent& event);
93 * Handles the event wxEVT_TSBAR_END from the horizontal bar
95 void onEndChange_Bar_Horizontal(wxCommandEvent& event);
97 * Handles the event wxEVT_SELECTION_END from the horizontal bar
99 void onSelectionEnd_Horizontal(wxCommandEvent& event);
101 * Handles the event wxEVT_TSBAR_MOVED from the horizontal bar
103 void onMovedBar_Horizontal(wxCommandEvent& event);
106 //------------------------------------------------------------------------------------------------------------
107 // Methods for capturing events from the vertical bar
108 //------------------------------------------------------------------------------------------------------------
111 * Handles the event wxEVT_TSBAR from the vertical bar
113 void onBarrange_Vertical(wxCommandEvent& event);
115 * Handles the event wxEVT_TSBAR_ACTUAL from the vertical bar
117 void onActualChange_Bar_Vertical(wxCommandEvent& event);
119 * Handles the event wxEVT_TSBAR_START from the vertical bar
121 void onStartChange_Bar_Vertical(wxCommandEvent& event);
123 * Handles the event wxEVT_TSBAR_END from the vertical bar
125 void onEndChange_Bar_Vertical(wxCommandEvent& event);
127 * Handles the event wxEVT_SELECTION_END from the vertical bar
129 void onSelectionEnd_Vertical(wxCommandEvent& event);
131 * Handles the event wxEVT_TSBAR_MOVED from the vertical bar
133 void onMovedBar_Vertical(wxCommandEvent& event);
136 //------------------------------------------------------------------------------------------------------------
137 // Methods for sending events
138 //------------------------------------------------------------------------------------------------------------
140 //------------------------------------------------------------------------------------------------------------
141 // Attributes getters and setters
142 //------------------------------------------------------------------------------------------------------------
145 * Sets the represented values of the vertical bar
146 * @param minRepresented In the minimum represented value of the bar
147 * @param maxRepresented In the maximum represented value of the bar
149 void setVerticalRepresentedValues( int minRepresented, int maxRepresented );
152 * Sets the represented values of the horizontal bar
153 * @param minRepresented In the minimum represented value of the bar
154 * @param maxRepresented In the maximum represented value of the bar
156 void setHorizontalRepresentedValues( int minRepresented, int maxRepresented );
159 * Gets the StartVertical value
160 * @return The StartVertical
162 int getStartVertical();
164 * Gets the EndVertical value
165 * @return The EndVertical
167 int getEndVertical();
169 * Gets the ActualVertical value
170 * @return The ActualVertical
172 int getActualVertical();
175 * Sets the StartVertical value
176 * @param nwValue The new value for the StartVertical
178 void setStartVertical( int nwValue);
180 * Sets the EndVertical value
181 * @param nwValue The new value for the EndVertical
183 void setEndVertical( int nwValue);
185 * Sets the ActualVertical value
186 * @param nwValue The new value for the ActualVertical
188 void setActualVertical( int nwValue);
191 * Gets the StartHorizontal value
192 * @return The StartHorizontal
194 int getStartHorizontal();
196 * Gets the EndHorizontal value
197 * @return The EndHorizontal
199 int getEndHorizontal();
201 * Gets the ActualHorizontal value
202 * @return The ActualHorizontal
204 int getActualHorizontal();
207 * Sets the StartHorizontal value
208 * @param nwValue The new value for the StartHorizontal
210 void setStartHorizontal( int nwValue);
212 * Sets the EndHorizontal value
213 * @param nwValue The new value for the EndHorizontal
215 void setEndHorizontal( int nwValue);
217 * Sets the ActualHorizontal value
218 * @param nwValue The new value for the ActualHorizontal
220 void setActualHorizontal( int nwValue);
223 * Sets the horizontal concept values and name
224 * @param theHorizontalConcept The name of the concept for setting at the horizontal bar
225 * @param minRepresent The minRepresent value of the concept for setting at the horizontal bar
226 * @param maxRepresent The maxRepresent value of the concept for setting at the horizontal bar
227 * @param minShowed The minShowed value of the concept for setting at the horizontal bar
228 * @param maxShowed The maxShowed value of the concept for setting at the horizontal bar
229 * @param actualShow The actualShow value of the concept for setting at the horizontal bar
231 void setHorizontalConcept( std::string theHorizontalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow );
234 * Sets the vertical concept values and name
235 * @param theVerticalConcept The name of the concept for setting at the vertical bar
236 * @param minRepresent The minRepresent value of the concept for setting at the vertical bar
237 * @param maxRepresent The maxRepresent value of the concept for setting at the vertical bar
238 * @param minShowed The minShowed value of the concept for setting at the vertical bar
239 * @param maxShowed The maxShowed value of the concept for setting at the vertical bar
240 * @param actualShow The actualShow value of the concept for setting at the vertical bar
242 void setVerticalConcept( std::string theVerticalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow );
245 * Sets the horizontal concept name
246 * @param theHorizontalConcept The name of the concept for setting at the horizontal bar
248 void setHorizontalConceptName( std::string theHorizontalConcept );
251 * Gets the horizontal concept name
252 * @return _horizontalConcept The name of the concept for setting at the horizontal bar
254 std::string getHorizontalConceptName( );
257 * Sets the vertical concept name
258 * @param theVerticalConcept The name of the concept for setting at the vertical bar
260 void setVerticalConceptName( std::string theVerticalConcept );
263 * Gets the vertical concept name
264 * @return _verticalConcept The name of the concept for setting at the vertical bar
266 std::string getVerticalConceptName( );
268 //------------------------------------------------------------------------------------------------------------
269 // Other functional methods
270 //------------------------------------------------------------------------------------------------------------
272 void getSpacing( double * spacing );
274 wxVtkBaseView* getWxVtkBaseView();
276 double getCurrentDeep();
278 void SetVisibleAxis(bool ok);
285 //this method should be deleted
286 wxVtkBaseView_SceneManager* getSceneManager();
288 void initializeScenceManager();
289 bool isEditableCControler(std::string theKeyName);
290 void removeFromScene(std::string theKeyName);
292 /////////////////////////////////////////////////////
293 void onChangeInstant(wxCommandEvent& event);
294 void onCreateMultipleROI (wxCommandEvent& event);
295 void onCreateROI (wxCommandEvent& event);
296 void onStopCreateROI (wxCommandEvent& event);
297 void onChangedDeep (wxCommandEvent& event);
298 void onActionButtonPressed(wxCommandEvent& event);
300 void removeSceneContours();
301 void addNameWrapperToScene();
303 std::vector<std::string> getSelectedObjects();
305 void RefreshInterface();
307 vtkImageData* getImageData();
309 void configureViewControlTo(std::string theName,manualContourModel* manModelContour,double* spc,int typeofcontour);
311 int GetImageDataSizeZ();
313 void GetImageDataRange(double *range);
315 void SetWidthContour(double width );
317 int getColorWindow();
319 int getWindowLevel();
321 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
323 void onInterpolation(bool interpolate);
325 void GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ );
327 void changeImage(vtkImageData* img);
330 //------------------------------------------------------------------------------------------------------------
332 //------------------------------------------------------------------------------------------------------------
333 wxVtkBaseView_SceneManager* _sceneManager;
335 * Represents the outer sizer of the ContourViewPanel
337 wxFlexGridSizer* outSizer;
340 * Represents the panel for viewing
342 wxMaracas_N_ViewersWidget * theViewPanel;
344 * Represents the vertical barrange
346 mBarRange * _verticalBar;
349 * Represents the horizontal barrange
351 mBarRange * _horizontalBar;
353 vtkImageData * showingVID;
355 std::string _verticalConceptName;
357 std::string _horizontalConceptName;
359 double last_spacing[3];
361 bool _useVerticalBar;
363 bool _useHorizontalBar;
365 wxEvtHandler * _eventHandler;
369 //------------------------------------------------------------------------------------------------------------
371 //------------------------------------------------------------------------------------------------------------
375 wxVtkMPR2DView * GetwxVtkMPR2DView();
378 // DECLARE_CLASS(wxContourViewPanel)
379 // any class wishing to process wxWindows events must use this macro
380 //DECLARE_EVENT_TABLE()
383 #endif // __wxContour_ViewPanel__