X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolProfile.cxx;h=e0ebdf1c14f283e7795a54e4adfbecaec5cf0ce8;hb=99b8973aa53da85bd951268f29495311a1e3471f;hp=4360fee91119781a9401032d189fafed7065cdf6;hpb=c45f077f35553cdc72396626ac601080093d273b;p=clitk.git diff --git a/vv/vvToolProfile.cxx b/vv/vvToolProfile.cxx index 4360fee..e0ebdf1 100644 --- a/vv/vvToolProfile.cxx +++ b/vv/vvToolProfile.cxx @@ -361,18 +361,21 @@ void vvToolProfile::cancelPoints() //------------------------------------------------------------------------------ void vvToolProfile::RemoveVTKObjects() { - for(int i=0;iGetNumberOfSlicers(); i++) { - mCurrentSlicerManager->GetSlicer(i)->GetRenderer()->RemoveActor(mLineActors[i]); - } + if (mCurrentSlicerManager) + { + connect(mCurrentSlicerManager, SIGNAL(callAddLandmark(float,float,float,float)), mCurrentSlicerManager, SLOT(AddLandmark(float,float,float,float))); - if (mPoint1Selected) - mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P1", mPoint1[3]); - if (mPoint2Selected) - mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P2", mPoint2[3]); + for(int i=0;iGetNumberOfSlicers(); i++) { + mCurrentSlicerManager->GetSlicer(i)->GetRenderer()->RemoveActor(mLineActors[i]); + } + + if (mPoint1Selected) + mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P1", mPoint1[3]); + if (mPoint2Selected) + mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P2", mPoint2[3]); - - if (mCurrentSlicerManager) mCurrentSlicerManager->Render(); + } } //------------------------------------------------------------------------------ @@ -381,8 +384,7 @@ void vvToolProfile::RemoveVTKObjects() bool vvToolProfile::close() { //RemoveVTKObjects(); - - connect(mCurrentSlicerManager, SIGNAL(callAddLandmark(float,float,float,float)), mCurrentSlicerManager, SLOT(AddLandmark(float,float,float,float))); + return vvToolWidgetBase::close(); } //------------------------------------------------------------------------------