X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxSTLWidget_03.cxx;h=0086b270c85615599405758faccd49caad32f3cf;hb=e60eea9083457889b9603a815db80af918f983da;hp=d8568557e8591bf595fbb34bbde01127d7b35a79;hpb=3948b92b07a8992a6d04081c9649ba63e3e7d613;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx index d856855..0086b27 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx @@ -65,10 +65,45 @@ wxSTLWidget_03::wxSTLWidget_03(wxWindow *parent)//, marInterface* mar) : wxPanel( parent, -1) { - _wxMaracasMPR = NULL; + _imagedata=NULL; + cast2=NULL; + cast3=NULL; + cast4=NULL; // binary segmentation result + _thresh=NULL; + _thresh2=NULL; + _cast=NULL; + _connect=NULL; + _connect2=NULL; + _2_mapfinal=NULL; + _2_stripfinal=NULL; + _2_isoMapperMC6=NULL; + _2_isoActorMC6=NULL; + _2_isoMC6=NULL; + _loadSTLMapper=NULL; + _loadActorSTL=NULL; + sl_barrange_segmentation=NULL; + _imageviewer3D=NULL; + _wxMaracasMPR=NULL; + stlInterna=NULL; + stlExterna=NULL; + stlSliderDeltaGauss=NULL; + stlSliderMarchingCubes=NULL; + dsm1=NULL; + actorInternal=NULL; + stlSliderOpacityInternal=NULL; + dsm2=NULL; + actorExternal=NULL; + stlSliderOpacityExternal=NULL; + stlExtractor=NULL; + _sl_opacity_STL_file=NULL; + arteryImageData=NULL; + joiner=NULL; + joinMarchingCubes=NULL; + joinMapper=NULL; + joinActor=NULL; _maxSize = 2000; _minSize = 300; - _imagedata = NULL; + _stlMarchingCubesLevel = 128; _stlDeltaGaussLevel = 100; @@ -99,42 +134,49 @@ wxSTLWidget_03::wxSTLWidget_03(wxWindow *parent)//, marInterface* mar) // pnlSplitter -> SplitVertically( viewPanel, new wxPanel(pnlSplitter,-1) , 600 ); this -> SetSizer(sizer); - - // Result 2: Volume + Axis -// _2_prgov = NULL; - _2_mapfinal = NULL; - _2_stripfinal = NULL; - _2_isoMapperMC6 = NULL; - _2_isoActorMC6 = NULL; - _2_isoMC6 = NULL; - - _loadSTLMapper = NULL; - _loadActorSTL = NULL; - - - //JOIN REGIONS - arteryImageData = NULL; - joinMarchingCubes = NULL; - joinMapper = NULL; - joinActor = NULL; - - //DHC STL SURFACES - stlExterna = NULL; - stlInterna = NULL; - dsm1=NULL; - actorInternal = NULL; - dsm2 = NULL; - actorExternal=NULL; - _thresh=NULL; - } //------------------------------------------------------------------- wxSTLWidget_03::~wxSTLWidget_03(){ - ResetTree2_JF(); - Reset_vtk_STLFile(); + //ResetTree2_JF(); + //Reset_vtk_STLFile(); + + if(_imagedata!=NULL){ + _imagedata->Delete(); + } + if(cast2){cast2->Delete();} + if(cast3){cast3->Delete();} + if(cast4){cast4->Delete();} + if(_thresh){_thresh->Delete();} + if(_thresh2){_thresh2->Delete();} + if(_cast){_cast->Delete();} + if(_connect){_connect->Delete();} + if(_connect2){_connect2->Delete();} + if(_2_mapfinal){_2_mapfinal->Delete();} + if(_2_stripfinal){_2_stripfinal->Delete();} + if(_2_isoMapperMC6){_2_isoMapperMC6->Delete();} + if(_2_isoActorMC6){_2_isoActorMC6->Delete();} + if(_2_isoMC6){_2_isoMC6->Delete();} + // Load STL file + if(_loadSTLMapper){_loadSTLMapper->Delete();} + if(_loadActorSTL){_loadActorSTL->Delete();} + if(sl_barrange_segmentation){delete sl_barrange_segmentation;} + if(_imageviewer3D){delete _imageviewer3D;} + if(_wxMaracasMPR){delete _wxMaracasMPR;} + if(stlInterna){stlInterna->Delete();} + if(stlExterna){stlExterna->Delete();} + if(dsm1){dsm1->Delete();} + if(actorInternal){actorInternal->Delete();} + if(dsm2){dsm2->Delete();} + if(actorExternal){actorExternal->Delete();} + //if(stlExtractor){stlExtractor->Delete();} + if(arteryImageData){arteryImageData->Delete();} + if(joiner){delete joiner;} + if(joinMarchingCubes){joinMarchingCubes->Delete();} + if(joinMapper){joinMapper->Delete(); } + if(joinActor){joinActor->Delete();} } //------------------------------------------------------------------- wxPanel* wxSTLWidget_03::CreateViewPanel(wxWindow *parent) @@ -565,14 +607,7 @@ void wxSTLWidget_03::ResetTree2_JF() try{ - vtkRenderer *ren = _wxMaracasMPR->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer(); - - if (_2_isoActorMC6){ - ren->RemoveActor(_2_isoActorMC6); - } - if (_2_stripfinal){ - ren->RemoveActor(_2_stripfinal); - } + // Delete // if (_2_prgov ) { _2_prgov -> Delete(); } @@ -589,6 +624,18 @@ void wxSTLWidget_03::ResetTree2_JF() _2_isoMapperMC6 = NULL; _2_isoActorMC6 = NULL; _2_isoMC6 = NULL; + + + //vtkRenderer *ren = _wxMaracasMPR->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer(); + + /*if (_2_isoActorMC6){ + ren->RemoveActor(_2_isoActorMC6); + } + if (_2_stripfinal){ + ren->RemoveActor(_2_stripfinal); + }*/ + + }catch(char* e){ std::cout<GetValue() ); + int delta = (int)pow((double) 4 , (double)sl_B->GetValue() ); int startResized = value - delta/2; int endResized = value + delta/2;