X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxVtkMPR3DView.cxx;h=8776906760f76410b6d6a8cff3b1f8af020fa988;hb=cf42d2bd2f87434922bf9f6f3f520b3f8ad2ba64;hp=e67cc22c0b5b7b4898c38685eaf9de4657c8f699;hpb=a25a3df9a4e94c5309055cff2f05142126afe968;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index e67cc22..8776906 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -195,7 +195,10 @@ void wxVtkMPR3DView::Configure() // 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 @@ -557,7 +560,8 @@ vtkMPR3DDataViewer* wxVtkMPR3DView::GetVtkMPR3DDataViewer() //------------------------------------------------------------------- wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() throw (char*) { - if(_wxvtk3Dbaseview==NULL){ + if(_wxvtk3Dbaseview==NULL) + { throw "wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() _wxvtk3Dbaseview=NULL"; } return _wxvtk3Dbaseview; @@ -585,12 +589,18 @@ void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){ // 4. Putting again the originals actors // 5. Refresh +//EED 4 nov 2015 (For Estelle) +// This works in ViewerNV with nTymeView=6 +// Because the others modules (5) generate also more actors with an OutLineFilter -> Actor +//showOutlineActor(false); + // step 1, step 2 vtkActorCollection *tmpCollection = vtkActorCollection::New(); vtkActorCollection *collectionActors = _wxvtk3Dbaseview->GetRenderer()->GetActors(); int i,size=collectionActors->GetNumberOfItems(); for (i=0; iAddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) ); _wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) ); } // for @@ -646,6 +656,7 @@ void wxVtkMPR3DView::VisiblePlaneWidget( bool visible ) //CPR: Method added 30 Nov 2009 void wxVtkMPR3DView::showOutlineActor(bool value) { + vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor(); if(value == true) { @@ -655,6 +666,7 @@ void wxVtkMPR3DView::showOutlineActor(bool value) { _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor ); } + } //------------------------------------------------------------------- @@ -812,7 +824,6 @@ void wxVtkMPR3DView::TestLoic2() vtkPlane *slicePlane = vtkPlane::New(); this->_planeWidget->GetPlane( slicePlane ); - vtkCutter* sliceCutter = vtkCutter::New(); vtkImageData *vtkimagedata = this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData(); sliceCutter->SetInput( vtkimagedata ); @@ -821,7 +832,6 @@ void wxVtkMPR3DView::TestLoic2() //EED // vtkLookupTable *lut = BuildHueWeightBaseMap(); - vtkPolyDataMapper *slice = vtkPolyDataMapper::New(); slice->SetInput( sliceCutter->GetOutput() ); double range[2]; @@ -841,12 +851,9 @@ void wxVtkMPR3DView::TestLoic2() contourMapper->SetScalarRange( range ); // contourMapper->SetLookupTable( lut ); - vtkActor *contourActor = vtkActor::New(); contourActor->SetMapper( contourMapper ); - - // The usual rendering stuff. vtkCamera *camera = vtkCamera::New(); camera->SetPosition(1,1,1); @@ -872,5 +879,25 @@ void wxVtkMPR3DView::TestLoic2() iren->Start(); } +//------------------------------------------------------------------- +void wxVtkMPR3DView::SetBackGroundType(int type) +{ + if (_wxvtk3Dbaseview!=NULL) + { + if (type==0) + { + _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOff(); + _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0 , 0 , 0 ); + } // if type + if (type==1) + { + _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOn(); + _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.33 , 0.33 , 0.33 ); + _wxvtk3Dbaseview->GetRenderer()->SetBackground2( 0.66 , 0.66 , 0.66 ); + } // if type + _wxvtk3Dbaseview->Refresh(); + }// if _wxvtk3Dbaseview + +}