diff Framework/Radiography/RadiographyScene.cpp @ 425:087237703d63 am-vsol-upgrade

added layer accessors
author am@osimis.io
date Thu, 22 Nov 2018 11:45:18 +0100
parents c23df8b3433b
children 660fe6f6bf4a
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyScene.cpp	Wed Nov 21 17:08:03 2018 +0100
+++ b/Framework/Radiography/RadiographyScene.cpp	Thu Nov 22 11:45:18 2018 +0100
@@ -443,6 +443,25 @@
     }
   }
 
+  void RadiographyScene::RemoveLayer(size_t layerIndex)
+  {
+    if (layerIndex > countLayers_)
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
+    }
+    delete layers_[layerIndex];
+    layers_.erase(layerIndex);
+    countLayers_--;
+  }
+
+  RadiographyLayer& RadiographyScene::GetLayer(size_t layerIndex)
+  {
+    if (layerIndex > countLayers_)
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
+    }
+    return *(layers_[layerIndex]);
+  }
 
   bool RadiographyScene::GetWindowing(float& center,
                                       float& width) const