# HG changeset patch # User Alain Mazy # Date 1570106286 -7200 # Node ID 701f36c28193eacda8893096cce21e828595eb38 # Parent 1e80a925323a6f94f642ea3e2e854055e23cf136# Parent 2f22e3086a5b7d9fb9eecc33ce1dbbe11280d62b merge diff -r 2f22e3086a5b -r 701f36c28193 Framework/Radiography/RadiographySceneReader.cpp --- 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 diff -r 2f22e3086a5b -r 701f36c28193 Framework/Radiography/RadiographySceneReader.h --- 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); + };