# HG changeset patch # User Benjamin Golinvaux # Date 1586155383 -7200 # Node ID e92c516adcbda46808fa536ccd8a533ce5a0e8eb # Parent 13573ff63eb65b96ccfa55d63f028036f9e4e449 Dead code removal diff -r 13573ff63eb6 -r e92c516adcbd Framework/Loaders/LoaderCache.cpp --- a/Framework/Loaders/LoaderCache.cpp Mon Apr 06 08:42:40 2020 +0200 +++ b/Framework/Loaders/LoaderCache.cpp Mon Apr 06 08:43:03 2020 +0200 @@ -27,13 +27,6 @@ #include "../Loaders/ILoadersContext.h" - -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 -#include "DicomStructureSetLoader2.h" -#endif - //BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - - #if ORTHANC_ENABLE_WASM == 1 # include # include "../Oracle/WebAssemblyOracle.h" @@ -41,19 +34,9 @@ # include "../Oracle/ThreadedOracle.h" #endif -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 -#include "../../Toolbox/DicomStructureSet2.h" -#endif -//BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - #include "../Volumes/DicomVolumeImage.h" #include "../Volumes/DicomVolumeImageMPRSlicer.h" -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 -#include "../../Volumes/DicomStructureSetSlicer2.h" -#endif -//BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - #include #include @@ -179,23 +162,6 @@ } } -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - - boost::shared_ptr LoaderCache::GetDicomStructureSetSlicer2(std::string instanceUuid) - { - // if the loader is not available, let's trigger its creation - if (dicomStructureSetSlicers2_.find(instanceUuid) == dicomStructureSetSlicers2_.end()) - { - GetDicomStructureSetLoader2(instanceUuid); - } - ORTHANC_ASSERT(dicomStructureSetSlicers2_.find(instanceUuid) != dicomStructureSetSlicers2_.end()); - - return dicomStructureSetSlicers2_[instanceUuid]; - } -#endif -//BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - - /** This method allows to convert a list of string into a string by sorting the strings then joining them @@ -274,66 +240,6 @@ } } -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - - boost::shared_ptr LoaderCache::GetDicomStructureSetLoader2(std::string instanceUuid) - { - try - { - // normalize keys a little - instanceUuid = Orthanc::Toolbox::StripSpaces(instanceUuid); - Orthanc::Toolbox::ToLowerCase(instanceUuid); - - // find in cache - if (dicomStructureSetLoaders2_.find(instanceUuid) == dicomStructureSetLoaders2_.end()) - { - boost::shared_ptr loader; - boost::shared_ptr structureSet(new DicomStructureSet2()); - boost::shared_ptr rtSlicer(new DicomStructureSetSlicer2(structureSet)); - dicomStructureSetSlicers2_[instanceUuid] = rtSlicer; - dicomStructureSets2_[instanceUuid] = structureSet; // to prevent it from being deleted - { -#if ORTHANC_ENABLE_WASM == 1 - loader.reset(new DicomStructureSetLoader2(*(structureSet.get()), oracle_, oracle_)); -#else - LockingEmitter::WriterLock lock(lockingEmitter_); - // TODO: clarify lifetimes... this is DANGEROUS! - loader.reset(new DicomStructureSetLoader2(*(structureSet.get()), oracle_, lock.GetOracleObservable())); -#endif - loader->LoadInstance(instanceUuid); - } - dicomStructureSetLoaders2_[instanceUuid] = loader; - } - return dicomStructureSetLoaders2_[instanceUuid]; - } - catch (const Orthanc::OrthancException& e) - { - if (e.HasDetails()) - { - LOG(ERROR) << "OrthancException in GetDicomStructureSetLoader2: " << e.What() << " Details: " << e.GetDetails(); - } - else - { - LOG(ERROR) << "OrthancException in GetDicomStructureSetLoader2: " << e.What(); - } - throw; - } - catch (const std::exception& e) - { - LOG(ERROR) << "std::exception in GetDicomStructureSetLoader2: " << e.what(); - throw; - } - catch (...) - { - LOG(ERROR) << "Unknown exception in GetDicomStructureSetLoader2"; - throw; - } - } - -#endif -// BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - - void LoaderCache::ClearCache() { std::unique_ptr lock(loadersContext_.Lock()); @@ -347,13 +253,6 @@ dicomVolumeImageMPRSlicers_.clear(); dicomStructureSetLoaders_.clear(); -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - // order is important! - dicomStructureSetLoaders2_.clear(); - dicomStructureSetSlicers2_.clear(); - dicomStructureSets2_.clear(); -#endif -// BGO_ENABLE_DICOMSTRUCTURESETLOADER2 } template void DebugDisplayObjRefCountsInMap( @@ -375,10 +274,5 @@ DebugDisplayObjRefCountsInMap("multiframeVolumeLoaders_", multiframeVolumeLoaders_); DebugDisplayObjRefCountsInMap("dicomVolumeImageMPRSlicers_", dicomVolumeImageMPRSlicers_); DebugDisplayObjRefCountsInMap("dicomStructureSetLoaders_", dicomStructureSetLoaders_); -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - DebugDisplayObjRefCountsInMap("dicomStructureSetLoaders2_", dicomStructureSetLoaders2_); - DebugDisplayObjRefCountsInMap("dicomStructureSetSlicers2_", dicomStructureSetSlicers2_); -#endif -//BGO_ENABLE_DICOMSTRUCTURESETLOADER2 } } diff -r 13573ff63eb6 -r e92c516adcbd Framework/Loaders/LoaderCache.h --- a/Framework/Loaders/LoaderCache.h Mon Apr 06 08:42:40 2020 +0200 +++ b/Framework/Loaders/LoaderCache.h Mon Apr 06 08:43:03 2020 +0200 @@ -57,15 +57,6 @@ std::string instanceUuid, const std::vector& initiallyVisibleStructures); -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - boost::shared_ptr - GetDicomStructureSetLoader2(std::string instanceUuid); - - boost::shared_ptr - GetDicomStructureSetSlicer2(std::string instanceUuid); -#endif - //BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - void ClearCache(); private: @@ -82,15 +73,6 @@ dicomVolumeImageMPRSlicers_; std::map > dicomStructureSetLoaders_; -#ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 - std::map > - dicomStructureSetLoaders2_; - std::map > - dicomStructureSets2_; - std::map > - dicomStructureSetSlicers2_; -#endif - //BGO_ENABLE_DICOMSTRUCTURESETLOADER2 }; }