wxContourViewPanel.h
Go to the documentation of this file.00001 #ifndef __wxContourViewPaneL_h_INCLUDED_H__
00002 #define __wxContourViewPaneL_h_INCLUDED_H__
00003
00004
00005
00006
00007
00008
00009
00010 #include <wx/wxprec.h>
00011 #ifdef __BORLANDC__
00012 #pragma hdrstop
00013 #endif
00014 #ifndef WX_PRECOMP
00015 #include <wx/wx.h>
00016 #endif
00017
00018 #include <wx/scrolwin.h>
00019
00020
00021
00022
00023
00024 #include "mBarRange.h"
00025 #include "wxMaracas_N_ViewersWidget.h"
00026 #include "vtkImageData.h"
00027 #include "wxVtkBaseView.h"
00028 #include <iostream>
00029 #include <wx/event.h>
00030 #include "wxVtkBaseView_SceneManager.h"
00031 #include "manualContourModel.h"
00032
00033 #include <vtkImageMapToWindowLevelColors.h>
00034
00035
00036
00037
00038
00039
00040 BEGIN_DECLARE_EVENT_TYPES()
00041 DECLARE_EVENT_TYPE(wxINSTANT_CHANGE,400)
00042 END_DECLARE_EVENT_TYPES()
00043
00044
00049
00050
00051
00052
00053 class wxContourViewPanel : public wxPanel {
00054
00055 public:
00056
00057
00058
00059
00060
00061 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 );
00062
00063 ~wxContourViewPanel();
00064
00065
00066
00067
00068
00069 void setWxEventHandler( wxEvtHandler * theEventHandler );
00070
00071 void createHorizontalBar(int horzStart, int horzEnd);
00072
00073 void createVerticalBar(int vertStart, int vertEnd);
00074
00075 void createViewPanel();
00076
00077
00078
00079
00080
00084 void onBarrange_Horizontal(wxCommandEvent& event);
00088 void onActualChange_Bar_Horizontal(wxCommandEvent& event);
00092 void onStartChange_Bar_Horizontal(wxCommandEvent& event);
00096 void onEndChange_Bar_Horizontal(wxCommandEvent& event);
00100 void onSelectionEnd_Horizontal(wxCommandEvent& event);
00104 void onMovedBar_Horizontal(wxCommandEvent& event);
00105
00106
00107
00108
00109
00110
00114 void onBarrange_Vertical(wxCommandEvent& event);
00118 void onActualChange_Bar_Vertical(wxCommandEvent& event);
00122 void onStartChange_Bar_Vertical(wxCommandEvent& event);
00126 void onEndChange_Bar_Vertical(wxCommandEvent& event);
00130 void onSelectionEnd_Vertical(wxCommandEvent& event);
00134 void onMovedBar_Vertical(wxCommandEvent& event);
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00150 void setVerticalRepresentedValues( int minRepresented, int maxRepresented );
00151
00157 void setHorizontalRepresentedValues( int minRepresented, int maxRepresented );
00158
00163 int getStartVertical();
00168 int getEndVertical();
00173 int getActualVertical();
00174
00179 void setStartVertical( int nwValue);
00184 void setEndVertical( int nwValue);
00189 void setActualVertical( int nwValue);
00190
00195 int getStartHorizontal();
00200 int getEndHorizontal();
00205 int getActualHorizontal();
00206
00211 void setStartHorizontal( int nwValue);
00216 void setEndHorizontal( int nwValue);
00221 void setActualHorizontal( int nwValue);
00222
00232 void setHorizontalConcept( std::string theHorizontalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow );
00233
00243 void setVerticalConcept( std::string theVerticalConcept, int minRepresent, int maxRepresent, int minShowed, int maxShowed, int actualShow );
00244
00249 void setHorizontalConceptName( std::string theHorizontalConcept );
00250
00255 std::string getHorizontalConceptName( );
00256
00261 void setVerticalConceptName( std::string theVerticalConcept );
00262
00267 std::string getVerticalConceptName( );
00268
00269
00270
00271
00272
00273 void getSpacing( double * spacing );
00274
00275 wxVtkBaseView* getWxVtkBaseView();
00276
00277 double getCurrentDeep();
00278
00279 void SetVisibleAxis(bool ok);
00280 int GetX();
00281 int GetY();
00282 int GetZ();
00283 void Refresh();
00284
00285
00286
00287 wxVtkBaseView_SceneManager* getSceneManager();
00289 void initializeScenceManager();
00290 bool isEditableCControler(std::string theKeyName);
00291 void removeFromScene(std::string theKeyName);
00292
00294 void onChangeInstant(wxCommandEvent& event);
00295 void onCreateMultipleROI (wxCommandEvent& event);
00296 void onCreateROI (wxCommandEvent& event);
00297 void onStopCreateROI (wxCommandEvent& event);
00298 void onChangedDeep (wxCommandEvent& event);
00299 void onActionButtonPressed(wxCommandEvent& event);
00300
00301 void removeSceneContours();
00302 void addNameWrapperToScene();
00303
00304 std::vector<std::string> getSelectedObjects();
00305
00306 void RefreshInterface();
00307
00308 vtkImageData* getImageData();
00309
00310 void configureViewControlTo(std::string theName,manualBaseModel* manModelContour,double* spc,int typeofcontour);
00311
00312 int GetImageDataSizeZ();
00313
00314 void GetImageDataRange(double *range);
00315
00316 void SetWidthContour(double width );
00317
00318 int getColorWindow();
00319
00320 int getWindowLevel();
00321
00322 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
00323
00324 void onInterpolation(bool interpolate);
00325
00326 void GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ );
00327
00328 void changeImage(vtkImageData* img);
00329
00330 void changeDeep();
00331
00332 void setImageSlice(int z);
00333 private:
00334
00335
00336
00337
00338 wxVtkBaseView_SceneManager* _sceneManager;
00339
00340
00341
00342 wxFlexGridSizer* outSizer;
00343
00344
00345
00346
00347 wxMaracas_N_ViewersWidget * theViewPanel;
00348
00349
00350
00351 mBarRange * _verticalBar;
00352
00353
00354
00355
00356 mBarRange * _horizontalBar;
00357
00358 vtkImageData * showingVID;
00359
00360 std::string _verticalConceptName;
00361
00362 std::string _horizontalConceptName;
00363
00364 double last_spacing[3];
00365
00366 bool _useVerticalBar;
00367
00368 bool _useHorizontalBar;
00369
00370 wxEvtHandler * _eventHandler;
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380 wxVtkMPR2DView * GetwxVtkMPR2DView();
00381
00382
00383
00384
00385
00386
00387 };
00388 #endif // __wxContour_ViewPanel__
00389