X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxVtkMPR3DView.cxx;h=d6fb6a53eebbe33672756b43486172ed03026a83;hb=410e06c32fc330d53bc93f81afeca8b72a6ddb26;hp=a55a101ec4311dce7ce0ebf69a6ae8d80efe0425;hpb=2ee213ddb39ae803798099822478e210a6bf0d57;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index a55a101..d6fb6a5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -186,36 +186,16 @@ void wxVtkMPR3DView::RemoveActor(vtkActor* actor) void wxVtkMPR3DView::Configure() { vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData(); - _wxvtk3Dbaseview->Configure(); _wxvtkmpr3DviewCntrlPanel->UpdateControlPanel(); - -//EED 27 Mai 2009 -// _wxvtk3Dbaseview->GetRenderer()->Clear(); - // Actors are added to the renderer. vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor(); - - _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor ); - -// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0) ); // _saggital -// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1) ); // _axial -// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2) ); // _coronal - - - - // vtkPointWidget - //if(_myCallback!=NULL){ - //_myCallback->Delete(); - - //} vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New(); _myCallback->SetWxVtkMPR3DView(this); - - if(imageData){ - if(_pointWidget==NULL){ + if(_pointWidget==NULL) + { _pointWidget = vtkPointWidget::New(); } //EED 2017-01-01 Migration VTK7 @@ -258,18 +238,21 @@ void wxVtkMPR3DView::Configure() _planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd ); if(_vtkplane==NULL){ - _vtkplane = vtkPolyData::New(); - - _probe = vtkProbeFilter::New(); - _contourMapper = vtkPolyDataMapper::New(); - + _vtkplane = vtkPolyData::New(); + _probe = vtkProbeFilter::New(); + _contourMapper = vtkPolyDataMapper::New(); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _probe->SetInput(_vtkplane); _contourMapper->SetInput( _probe->GetPolyDataOutput() ); #else + _myCallback->SetVtkPolyData(_vtkplane); + _myCallback->SetVtkProbeFilter(_probe); + _planeWidget->GetPolyData(_vtkplane); _probe->SetInputData(_vtkplane); + _probe->SetSourceData(imageData); +// _probe->Update(); _contourMapper->SetInputData( _probe->GetPolyDataOutput() ); #endif @@ -611,6 +594,12 @@ void wxVtkMPR3DView::RefreshView() // virtual _planeWidget->SetCenter( x,y,z ); _planeWidget->UpdatePlacement(); _planeWidget->GetPolyData(_vtkplane); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + // .. +#else + _probe->Update(); +#endif } if (_wxvtkmpr3DviewCntrlPanel!=NULL) @@ -690,9 +679,9 @@ void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){ // step 5 Refresh _wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render(); - } + } // if visible _vtkmpr3Ddataviewer->SetVisiblePosition(idPosition,visible); - } + } // if visible } @@ -705,8 +694,8 @@ void wxVtkMPR3DView::VisiblePointWidget( bool visible ) _pointWidget->On(); } else { _pointWidget->Off(); - } - } + } // visible + } // _pointWidget } //------------------------------------------------------------------- @@ -720,9 +709,10 @@ void wxVtkMPR3DView::VisiblePlaneWidget( bool visible ) } else { _planeWidget->Off(); - _contourPlaneActor->VisibilityOff(); - } - } + _contourPlaneActor->VisibilityOff(); + } // if visible + _wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render(); + } // _planeWidget } //CPR: Method added 30 Nov 2009 @@ -733,11 +723,9 @@ void wxVtkMPR3DView::showOutlineActor(bool value) if(value == true) { _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor ); - } - else - { + } else { _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor ); - } + } // value }