Mercurial > hg > orthanc-stone
changeset 1030:7014c2397b45
Empty structureNames now means NOTHING will be (initially) displayed
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 07 Oct 2019 14:05:01 +0200 |
parents | 2f22e3086a5b |
children | 7b89e88bb66e |
files | Framework/Loaders/DicomStructureSetLoader.cpp Framework/Loaders/DicomStructureSetLoader.h |
diffstat | 2 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Loaders/DicomStructureSetLoader.cpp Mon Sep 30 10:41:37 2019 +0200 +++ b/Framework/Loaders/DicomStructureSetLoader.cpp Mon Oct 07 14:05:01 2019 +0200 @@ -169,10 +169,19 @@ loader.content_.reset(new DicomStructureSet(dicom)); size_t structureCount = loader.content_->GetStructuresCount(); loader.structureVisibility_.resize(structureCount); + bool everythingVisible = false; + if ((loader.initiallyVisibleStructures_.size() == 1) + && (loader.initiallyVisibleStructures_[0].size() == 1) + && (loader.initiallyVisibleStructures_[0][0] == '*')) + { + everythingVisible = true; + } + for (size_t i = 0; i < structureCount; ++i) { - // if nothing is specified in the ctor, this means we want everything visible - if (loader.initiallyVisibleStructures_.size() == 0) + // if a single "*" string is supplied, this means we want everything + // to be visible... + if(everythingVisible) { loader.structureVisibility_.at(i) = true; }
--- a/Framework/Loaders/DicomStructureSetLoader.h Mon Sep 30 10:41:37 2019 +0200 +++ b/Framework/Loaders/DicomStructureSetLoader.h Mon Oct 07 14:05:01 2019 +0200 @@ -52,11 +52,11 @@ bool structuresReady_; /** - At load time, these strings is used to initialize the - structureVisibility_ vector. + At load time, these strings are used to initialize the structureVisibility_ + vector. - As a special case, if initiallyVisibleStructures_ is empty, ALL structures - will be made visible. + As a special case, if initiallyVisibleStructures_ contains a single string + that is '*', ALL structures will be made visible. */ std::vector<std::string> initiallyVisibleStructures_;