X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxSTLWidget_03.cxx;h=59c33cd49750734b47fa007f243f615744e2b21a;hb=47d49bceea4f93ff4f57c40596960d042171abb4;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..59c33cd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx @@ -1,3 +1,28 @@ +/*# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ */ + #include "vtkObjectFactory.h" @@ -65,10 +90,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 +159,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 +632,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 +649,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;