# HG changeset patch # User am@osimis.io # Date 1542883518 -3600 # Node ID 087237703d63d1a43b32b2a2b6ceb974127fbdb1 # Parent bb573a52fc631c26c544f6c6c35bee20bd2a0a5c added layer accessors diff -r bb573a52fc63 -r 087237703d63 Framework/Radiography/RadiographyScene.cpp --- 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 diff -r bb573a52fc63 -r 087237703d63 Framework/Radiography/RadiographyScene.h --- a/Framework/Radiography/RadiographyScene.h Wed Nov 21 17:08:03 2018 +0100 +++ b/Framework/Radiography/RadiographyScene.h Thu Nov 22 11:45:18 2018 +0100 @@ -117,6 +117,15 @@ RadiographyLayer& LoadDicomWebFrame(IWebService& web); + void RemoveLayer(size_t layerIndex); + + size_t GetLayerCount() + { + return countLayers_; + } + + RadiographyLayer& GetLayer(size_t layerIndex); + Extent2D GetSceneExtent() const; void Render(Orthanc::ImageAccessor& buffer,