changeset 2355:0f8d09f1c245 refactoring

fix rendering of deleted annotations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 Oct 2026 09:02:26 +0200
parents 2a9d30482584
children 2ffbba6497f0
files Applications/Samples/Common/SimpleViewerCore.cpp Applications/Samples/Common/SimpleViewerCore.h
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/Common/SimpleViewerCore.cpp	Tue Oct 06 22:04:34 2026 +0200
+++ b/Applications/Samples/Common/SimpleViewerCore.cpp	Wed Oct 07 09:02:26 2026 +0200
@@ -143,6 +143,8 @@
     annotations_->SetActiveTool(AnnotationsSceneLayer::Tool_Edit);
     annotations_->SetProbedLayer(0);
 
+    Register<AnnotationsSceneLayer::AnnotationRemovedMessage>(*annotations_, &SimpleViewerCore::Handle);
+
     {
       std::unique_ptr<IViewport::ILock> viewportLock(viewport->Lock());
       viewportLock->GetController().SetUndoStack(boost::make_shared<UndoStack>());
--- a/Applications/Samples/Common/SimpleViewerCore.h	Tue Oct 06 22:04:34 2026 +0200
+++ b/Applications/Samples/Common/SimpleViewerCore.h	Wed Oct 07 09:02:26 2026 +0200
@@ -56,6 +56,11 @@
     virtual void Handle(const New::IObservable& observable,
                         const DicomResourcesLoadedMessage& message) ORTHANC_OVERRIDE;
 
+    void Handle(const AnnotationsSceneLayer::AnnotationRemovedMessage& message)
+    {
+      RenderAnnotations();
+    }
+
     void RenderAnnotations();
 
   protected: