From 547be998e10b62d3b548146513607c227a9829cd Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 27 Jul 2018 16:29:46 +0200 Subject: [PATCH] #3207 creaMaracasVisu Feature New Normal branch vtk7itk4wx3-mingw --- .../widgets/pPlotter/HistogramDialog.cxx | 9 +++ .../widgets/pPlotter/HistogramDialog.h | 30 ++++----- .../widgets/pPlotter/MaximumsDialog.cxx | 5 ++ ...racasMultipleVolumeRendererManagerData.cxx | 61 +++++++++++++------ ...MaracasMultipleVolumeRendererManagerData.h | 31 +++++++--- .../widgets/wxVtkClipping3DViewCntrlPanel.cxx | 5 ++ 6 files changed, 102 insertions(+), 39 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx index 082c05b..4f621cb 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx @@ -133,7 +133,12 @@ void HistogramDialog::initializeHistogramDialog(bool extracontrols){ sizer->Add(bottomBox,0,wxCENTER); SetAutoLayout( TRUE ); SetSizer( sizer ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 SetBestSize(wxSize(600,600)); +#else + SetSize(wxSize(600,600)); +#endif } wxPanel* HistogramDialog::getPanExtraControls(){ wxBoxSizer* sizer0 = new wxBoxSizer(wxVERTICAL); @@ -732,7 +737,11 @@ void HistogramDialog::OnRefreshBtn(wxCommandEvent &event) return refreshed; } +#if (VTK_MAJOR_VERSION <= 7) void HistogramDialog::setVolumeMapper(vtkVolumeRayCastMapper* volMapper) +#else + void HistogramDialog::setVolumeMapper(vtkFixedPointVolumeRayCastMapper* volMapper) +#endif { volumeMapper=volMapper; } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.h index bb360a7..c3ba219 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.h @@ -148,7 +148,7 @@ public: #if (VTK_MAJOR_VERSION <= 7) void setVolumeMapper(vtkVolumeRayCastMapper* volMapper); #else - void setFixedPointVolumeMapper(vtkFixedPointVolumeRayCastMapper* volMapper); + void setVolumeMapper(vtkFixedPointVolumeRayCastMapper* volMapper); #endif void setVolume(vtkVolume* vol); //void setMPR3Dview(wxVtkMPR3DView *wxvtkmpr3Dview1); @@ -219,35 +219,37 @@ private: /* cancel Button */ - //wxButton *cancelBtn; - wxBitmapButton *cancelBtn; + //wxButton *cancelBtn; + wxBitmapButton *cancelBtn; /* save Button */ - wxButton *saveDataBtn; + wxButton *saveDataBtn; /* Load Button */ - wxButton *loadDataBtn; + wxButton *loadDataBtn; /* Refresh Button */ - wxButton *refreshBtn; - - wxPanel *_panextracontrols; - + wxButton *refreshBtn; + wxPanel *_panextracontrols; // the user had pressed refresh bool refreshed; - vtkColorTransferFunction *_ctfun; - vtkPiecewiseFunction *_tfun; - vtkVolumeRayCastMapper *volumeMapper; - vtkVolume *newvol; + vtkColorTransferFunction *_ctfun; + vtkPiecewiseFunction *_tfun; +#if (VTK_MAJOR_VERSION <= 7) + vtkVolumeRayCastMapper *volumeMapper; +#else + vtkFixedPointVolumeRayCastMapper *volumeMapper; +#endif + vtkVolume *newvol; //things to refresh //wxVtkMPR3DView *wxvtkmpr3Dview; - //wxVtkClipping3DView *wxvtkclipping3Dview; + //wxVtkClipping3DView *wxvtkclipping3Dview; wxSizer* getControls(bool extracontrols = false); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/MaximumsDialog.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/MaximumsDialog.cxx index edcc939..1140df5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/MaximumsDialog.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/MaximumsDialog.cxx @@ -72,7 +72,12 @@ MaximumsDialog::MaximumsDialog(wxWindow *parent,wxString title) SetAutoLayout( TRUE ); SetSizer( sizer ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 SetBestSize(wxSize(325,100)); +#else + SetSize(wxSize(325,100)); +#endif } //----------------------------------------------------------------- float MaximumsDialog::getXValue() diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx index a7680bb..d71d3e9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx @@ -32,18 +32,22 @@ wxMaracasMultipleVolumeRendererManagerData::wxMaracasMultipleVolumeRendererManagerData(vtkImageData* vol, std::string dataname){ - _vol = vol; - _dataname = dataname; - - _tfun = vtkPiecewiseFunction::New(); - _ctfun = vtkColorTransferFunction::New(); + _vol = vol; + _dataname = dataname; + _tfun = vtkPiecewiseFunction::New(); + _ctfun = vtkColorTransferFunction::New(); + _volumePlanes = vtkPlanes::New(); - _volumePlanes = vtkPlanes::New(); - _compositeFunction = vtkVolumeRayCastCompositeFunction::New(); - _MIPFunction = vtkVolumeRayCastMIPFunction::New(); - _volumeMapper = vtkVolumeRayCastMapper::New(); +#if (VTK_MAJOR_VERSION <= 7) + _compositeFunction = vtkVolumeRayCastCompositeFunction::New(); + _MIPFunction = vtkVolumeRayCastMIPFunction::New(); + _volumeMapper = vtkVolumeRayCastMapper::New(); _volumeMapper->SetVolumeRayCastFunction(_compositeFunction); +#else + _volumeMapper = vtkFixedPointVolumeRayCastMapper::New(); +#endif + _volumeMapper->SetClippingPlanes( _volumePlanes ); _volumeMapper->AutoAdjustSampleDistancesOn(); _volumeProperty = vtkVolumeProperty::New(); @@ -74,8 +78,16 @@ wxMaracasMultipleVolumeRendererManagerData::~wxMaracasMultipleVolumeRendererMana _tfun->Delete(); _ctfun->Delete(); _volumePlanes->Delete(); + + +#if (VTK_MAJOR_VERSION <= 7) _compositeFunction->Delete(); +#else + // .. +#endif + _volumeMapper->Delete(); + _volumeProperty->Delete(); _newvol->Delete(); @@ -113,14 +125,24 @@ void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vectorSetVolumeRayCastFunction(_compositeFunction); }else{ _volumeMapper->SetVolumeRayCastFunction(_MIPFunction); } - +#else + printf("EED wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction Composite MIP ..... ??"); +#endif } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h index 147704a..3f43407 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h @@ -26,9 +26,7 @@ #ifndef wxMaracasMultipleVolumeRendererManagerData_H_ #define wxMaracasMultipleVolumeRendererManagerData_H_ -#include #include -#include #include #include #include @@ -36,7 +34,16 @@ #include #include #include -#include + + +#if (VTK_MAJOR_VERSION <= 7) + #include + #include + #include +#else + #include +#endif + #include @@ -123,14 +130,22 @@ private: */ int _id; - vtkVolumeRayCastCompositeFunction *_compositeFunction; + + vtkPlanes *_volumePlanes; - vtkVolumeRayCastMapper *_volumeMapper; vtkVolumeProperty *_volumeProperty; vtkVolume *_newvol; - vtkPiecewiseFunction* _tfun; - vtkColorTransferFunction* _ctfun; - vtkVolumeRayCastMIPFunction* _MIPFunction; + vtkPiecewiseFunction *_tfun; + vtkColorTransferFunction *_ctfun; + +#if (VTK_MAJOR_VERSION <= 7) + vtkVolumeRayCastMIPFunction *_MIPFunction; + vtkVolumeRayCastCompositeFunction *_compositeFunction; + vtkVolumeRayCastMapper *_volumeMapper; +#else + vtkFixedPointVolumeRayCastMapper *_volumeMapper; +#endif + }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx index 9dc0af6..2680230 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx @@ -71,7 +71,12 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w _isoValue->SetRange( (int)(range[1]*0.1) , (int)(range[1]) ); _isoValue->SetValue( (int)(wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetIsovalue(0)) ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _isoValue->SetTickFreq(25,0); +#else + // .. +#endif _isoValueSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT ); _isoValueSpin->SetRange(1,8); -- 2.45.1