changeset 1023:701f36c28193

merge
author Alain Mazy <alain@mazy.be>
date Thu, 03 Oct 2019 14:38:06 +0200
parents 1e80a925323a (diff) 2f22e3086a5b (current diff)
children 9889c819db01
files
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Radiography/RadiographySceneReader.cpp	Mon Sep 30 10:41:37 2019 +0200
+++ b/Framework/Radiography/RadiographySceneReader.cpp	Thu Oct 03 14:38:06 2019 +0200
@@ -140,7 +140,6 @@
     }
   }
 
-
   void RadiographySceneReader::Read(const Json::Value& input)
   {
     unsigned int version = input["version"].asUInt();
@@ -228,6 +227,20 @@
     }
   }
 
+  void RadiographySceneBuilder::ReadDicomLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input)
+  {
+    for(size_t layerIndex = 0; layerIndex < input["layers"].size(); layerIndex++)
+    {
+      const Json::Value& jsonLayer = input["layers"][(int)layerIndex];
+      RadiographyLayer::Geometry geometry;
+      if (jsonLayer["type"].asString() == "dicom")
+      {
+        ReadLayerGeometry(geometry, jsonLayer);
+        return;
+      }
+    }
+  }
+
   void RadiographySceneBuilder::ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& jsonLayer)
   {
     {// crop
--- a/Framework/Radiography/RadiographySceneReader.h	Mon Sep 30 10:41:37 2019 +0200
+++ b/Framework/Radiography/RadiographySceneReader.h	Thu Oct 03 14:38:06 2019 +0200
@@ -64,9 +64,12 @@
       fontRegistry_ = &fontRegistry;
     }
 
+    static void ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input);
+    static void ReadDicomLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input);
+
   protected:
-    void ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input);
     virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry);
+
   };