X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvStructureSetActor.cxx;h=82ef95b43948723d9e7edbbbf3fad2ef5c47b8eb;hb=573d80d0f7a17607d2ee883c21c940c0ba020282;hp=09fc245758ae8d26de3e84140c424f5df31feb73;hpb=1f2d49aa5d3d0e8d5913967e5464505e6f7a61c5;p=clitk.git diff --git a/vv/vvStructureSetActor.cxx b/vv/vvStructureSetActor.cxx index 09fc245..82ef95b 100644 --- a/vv/vvStructureSetActor.cxx +++ b/vv/vvStructureSetActor.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #include "vvStructureSetActor.h" #include "vvROIActor.h" @@ -30,6 +30,7 @@ vvStructureSetActor::vvStructureSetActor() //------------------------------------------------------------------------------ vvStructureSetActor::~vvStructureSetActor() { + } //------------------------------------------------------------------------------ @@ -43,7 +44,7 @@ int vvStructureSetActor::GetNumberOfROIs() //------------------------------------------------------------------------------ -std::vector & vvStructureSetActor::GetROIList() +std::vector< QSharedPointer > & vvStructureSetActor::GetROIList() { return mROIActors; } @@ -73,13 +74,13 @@ vvROIActor * vvStructureSetActor::GetROIActor(int n) std::cerr << "No ROI number " << n << std::endl; return NULL; } - return mROIActors[mMapROIIndex[n]]; + return mROIActors[mMapROIIndex[n]].data(); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -void vvStructureSetActor::CreateNewROIActor(int n) +void vvStructureSetActor::CreateNewROIActor(int n, bool modeBG) { // Check clitk::DicomRT_ROI * roi = mStructureSet->GetROI(n); @@ -90,15 +91,16 @@ void vvStructureSetActor::CreateNewROIActor(int n) // If already exist : delete it int old = -1; - if (mMapROIIndex.find(n) != mMapROIIndex.end()) { - delete mROIActors[mMapROIIndex[n]]; + if (mMapROIIndex.find(n) != mMapROIIndex.end()) old = mMapROIIndex[n]; - } // Add ROI Actors - vvROIActor * actor = new vvROIActor; - if (old == -1) mROIActors.push_back(actor); - else mROIActors[old] = actor; + QSharedPointer actor = QSharedPointer(new vvROIActor); + if (old == -1) + mROIActors.push_back(actor); + else + mROIActors[old] = actor; + actor->SetBGMode(modeBG); actor->SetROI(roi); actor->SetSlicerManager(mSlicerManager); actor->Initialize();