diff Framework/Radiography/RadiographyScene.cpp @ 1257:6af941a68472

RadiographyScene: virtual methods to use in derived class
author Alain Mazy <alain@mazy.be>
date Tue, 14 Jan 2020 12:05:01 +0100
parents 9ee6b28f53e8
children 9c20ae049669
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyScene.cpp	Thu Jan 09 15:24:43 2020 +0100
+++ b/Framework/Radiography/RadiographyScene.cpp	Tue Jan 14 12:05:01 2020 +0100
@@ -125,6 +125,17 @@
     }
   }
 
+  void RadiographyScene::_RegisterLayer(RadiographyLayer* layer)
+  {
+    std::auto_ptr<RadiographyLayer> raii(layer);
+
+    // LOG(INFO) << "Registering layer: " << countLayers_;
+
+    size_t index = nextLayerIndex_++;
+    raii->SetIndex(index);
+    layers_[index] = raii.release();
+  }
+
   RadiographyLayer& RadiographyScene::RegisterLayer(RadiographyLayer* layer)
   {
     if (layer == NULL)
@@ -132,13 +143,7 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
     }
 
-    std::auto_ptr<RadiographyLayer> raii(layer);
-
-    // LOG(INFO) << "Registering layer: " << countLayers_;
-
-    size_t index = nextLayerIndex_++;
-    raii->SetIndex(index);
-    layers_[index] = raii.release();
+    _RegisterLayer(layer);
 
     BroadcastMessage(GeometryChangedMessage(*this, *layer));
     BroadcastMessage(ContentChangedMessage(*this, *layer));