From be48b90c46013412d0f94bb4b6b9a8f5de0e2920 Mon Sep 17 00:00:00 2001 From: Laurent Chauvin Date: Wed, 10 Jul 2013 16:01:05 -0400 Subject: [PATCH] BUG: Turn off projections when annotations deleted Fixes #3214 Projections of annotations were not deleted with annotation. This fix ensure widget representing annotation's projection is deleted when annotation is deleted. --- ...MRMLAnnotationDisplayableManagerHelper.cxx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Modules/Loadable/Annotations/MRMLDM/vtkMRMLAnnotationDisplayableManagerHelper.cxx b/Modules/Loadable/Annotations/MRMLDM/vtkMRMLAnnotationDisplayableManagerHelper.cxx index 1fd219405..4fc166d8e 100644 --- a/Modules/Loadable/Annotations/MRMLDM/vtkMRMLAnnotationDisplayableManagerHelper.cxx +++ b/Modules/Loadable/Annotations/MRMLDM/vtkMRMLAnnotationDisplayableManagerHelper.cxx @@ -395,6 +395,38 @@ void vtkMRMLAnnotationDisplayableManagerHelper::RemoveWidgetAndNode( this->WidgetIntersections.erase(node); } + WidgetOverLineProjectionsIt widgetOverLineProjectionIterator = this->WidgetOverLineProjections.find(node); + if (widgetOverLineProjectionIterator != this->WidgetOverLineProjections.end()) { + + if (this->WidgetOverLineProjections[node]) + { + this->WidgetOverLineProjections[node]->Off(); + this->WidgetOverLineProjections[node]->Delete(); + } + this->WidgetOverLineProjections.erase(node); + } + + WidgetUnderLineProjectionsIt widgetUnderLineProjectionIterator = this->WidgetUnderLineProjections.find(node); + if (widgetUnderLineProjectionIterator != this->WidgetUnderLineProjections.end()) { + + if (this->WidgetUnderLineProjections[node]) + { + this->WidgetUnderLineProjections[node]->Off(); + this->WidgetUnderLineProjections[node]->Delete(); + } + this->WidgetUnderLineProjections.erase(node); + } + + WidgetPointProjectionsIt widgetPointProjectionIterator = this->WidgetPointProjections.find(node); + if (widgetPointProjectionIterator != this->WidgetPointProjections.end()) { + + if (this->WidgetPointProjections[node]) + { + this->WidgetPointProjections[node]->Off(); + this->WidgetPointProjections[node]->Delete(); + } + this->WidgetPointProjections.erase(node); + } vtkMRMLAnnotationDisplayableManagerHelper::AnnotationNodeListIt nodeIterator = std::find( this->AnnotationNodeList.begin(), -- GitLab