]> Creatis software - creaMaracasVisu.git/commitdiff
#3207 creaMaracasVisu Feature New Normal branch vtk7itk4wx3-mingw
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 27 Jul 2018 14:29:46 +0000 (16:29 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 27 Jul 2018 14:29:46 +0000 (16:29 +0200)
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/MaximumsDialog.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx

index 082c05b6083fbe62639ec070485c30f6ba1293cf..4f621cb350216666a5482e5f4b4c137ff7cd2b7e 100644 (file)
@@ -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;
        }
index bb360a714fd89fbec3a8ca0dc942d68e88c92bbc..c3ba219648c39cef58f1e74017e7de8897724d79 100644 (file)
@@ -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);
index edcc939b3cb758764dd4f6a1640615c2f14b30de..1140df5e99294bc5edd147fad7f1b35c3516fda9 100644 (file)
@@ -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()
index a7680bb84171bd365bb03b189a5a1d18c1c4f411..d71d3e91bac1b45d89d1006f682f54a80932bf63 100644 (file)
 
 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::vector<do
 /**
 **     Check if the variables are setted correctly
 **/
-void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *){
-       if(!_compositeFunction){
+void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *)
+{
+
+       
+#if (VTK_MAJOR_VERSION <= 7) 
+       if(!_compositeFunction)
+       {
                throw "No composite function initialized";
        }
-       if(!_MIPFunction){
+       if(!_MIPFunction)
+       {
                throw "No MIP function initialized";
        }
-       if(!_volumeMapper){
+#else 
+       // ..
+#endif
+       if(!_volumeMapper)
+       {
                throw "No volume mapper initialized";
        }
 }
@@ -163,12 +185,17 @@ void wxMaracasMultipleVolumeRendererManagerData::setDataname(std::string datanam
        _dataname = dataname;
 }
 
-void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *){
-       checkInvariant();
-       if(function == 0){
+void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *)
+{
+       checkInvariant();       
+#if (VTK_MAJOR_VERSION <= 7) 
+       if(function == 0)
+       {
                _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
        }else{
                _volumeMapper->SetVolumeRayCastFunction(_MIPFunction);
        }
-       
+#else 
+       printf("EED   wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction   Composite MIP  ..... ??");
+#endif
 }
index 147704a4a66bfcffaac0aff76793ef95c121744b..3f43407ef8c38834e0c3412abf89eac72fa0135e 100644 (file)
@@ -26,9 +26,7 @@
 #ifndef wxMaracasMultipleVolumeRendererManagerData_H_
 #define wxMaracasMultipleVolumeRendererManagerData_H_
 
-#include <vtkVolumeRayCastCompositeFunction.h>
 #include <vtkPlanes.h>
-#include <vtkVolumeRayCastMapper.h>
 #include <vtkVolumeProperty.h>
 #include <vtkVolume.h>
 #include <vtkPiecewiseFunction.h>
 #include <vtkImageData.h>
 #include <vtkProp3D.h>
 #include <vtkRenderer.h>
-#include <vtkVolumeRayCastMIPFunction.h>
+
+
+#if (VTK_MAJOR_VERSION <= 7) 
+       #include <vtkVolumeRayCastCompositeFunction.h>
+       #include <vtkVolumeRayCastMIPFunction.h>
+       #include <vtkVolumeRayCastMapper.h>
+#else 
+       #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
+
 
 #include <vector>
 
@@ -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
+       
 
        
 };
index 9dc0af6bf65b99e876c751321aebb6b78a34cf13..268023043cfa9f585f96345b11f2396caceef1e2 100644 (file)
@@ -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);