X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxPanelCuttingImageData.cxx;h=af20535fb7f48826e81c29c70ae9c2ab110c9360;hb=410e06c32fc330d53bc93f81afeca8b72a6ddb26;hp=225204185181b37962493947f6b487c54961ace1;hpb=c5bb8b228d6fcd2a4ea1d6210bfa3a39d6bcac33;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx index 2252041..af20535 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx @@ -106,7 +106,12 @@ void wxPanelCuttingImageData::Create3DViewObjects() _vtksphere->SetThetaResolution (20); _vtksphere->SetPhiResolution (20); _sphereMapper = vtkPolyDataMapper::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _sphereMapper->SetInput( _vtksphere->GetOutput() ); +#else + _sphereMapper->SetInputData( _vtksphere->GetOutput() ); +#endif _sphereActor = vtkActor::New(); _sphereActor->SetMapper(_sphereMapper); _sphereActor->SetOrigin(0, 0, 0); @@ -120,7 +125,12 @@ void wxPanelCuttingImageData::Create3DViewObjects() _vtkcube->SetYLength (1); _vtkcube->SetZLength (1); _cubeMapper = vtkPolyDataMapper::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _cubeMapper->SetInput( _vtkcube->GetOutput() ); +#else + _cubeMapper->SetInputData( _vtkcube->GetOutput() ); +#endif _cubeActor = vtkActor::New(); _cubeActor->SetMapper(_cubeMapper); _cubeActor->SetOrigin(0, 0, 0); @@ -132,7 +142,14 @@ void wxPanelCuttingImageData::Create3DViewObjects() _vtkcylinder = vtkCylinderSource::New(); _vtkcylinder->SetResolution(20); _cylinderMapper = vtkPolyDataMapper::New(); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _cylinderMapper->SetInput( _vtkcylinder->GetOutput() ); +#else + _cylinderMapper->SetInputData( _vtkcylinder->GetOutput() ); +#endif + _cylinderActor = vtkActor::New(); _cylinderActor->SetMapper(_cylinderMapper); _cylinderActor->SetOrigin(0, 0, 0); @@ -166,7 +183,12 @@ void wxPanelCuttingImageData::InitHistogramme() } else { _imageData->GetScalarRange(rangeA); } +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _xyplot->RemoveAllInputs(); +#else + _xyplot->RemoveAllDataSetInputConnections(); +#endif /* if ( _histogrammeVector!=NULL ) { @@ -175,9 +197,14 @@ void wxPanelCuttingImageData::InitHistogramme() */ _histogrammeVector = vtkImageData::New(); _histogrammeVector -> SetDimensions ( (int)(rangeA[1]),1,1 ); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _histogrammeVector -> SetScalarTypeToUnsignedShort(); _histogrammeVector -> AllocateScalars(); _histogrammeVector -> Update(); +#else + _histogrammeVector -> AllocateScalars(VTK_UNSIGNED_SHORT,1); +#endif unsigned short *p_vol = (unsigned short*)_histogrammeVector->GetScalarPointer(0,0,0); int i,size = (int) (rangeA[1]); @@ -188,7 +215,15 @@ void wxPanelCuttingImageData::InitHistogramme() } _xyplot->SetXRange(0, rangeA[1]); _xyplot->SetYRange(0, 10); + + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _xyplot->AddInput( _histogrammeVector ); +#else + _xyplot->AddDataSetInput( _histogrammeVector ); +#endif + } //------------------------------------------------------------------- @@ -478,7 +513,14 @@ void wxPanelCuttingImageData::OnExtract(wxCommandEvent& event) } } double range[2]; + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _histogrammeVector->Update(); +#else + _histogrammeVector->Modified(); +#endif + _histogrammeVector->GetScalarRange(range); _xyplot->SetYRange( 0 , range[1] ); _xyplot->SetXRange( min , max );