# HG changeset patch # User Benjamin Golinvaux # Date 1586155360 -7200 # Node ID 13573ff63eb65b96ccfa55d63f028036f9e4e449 # Parent d80a3e3cc800e4a009e540c4cb01e59d076269f4 New StructuresUpdated message that is sent during individual structure set addition. diff -r d80a3e3cc800 -r 13573ff63eb6 Framework/Loaders/DicomStructureSetLoader.cpp --- a/Framework/Loaders/DicomStructureSetLoader.cpp Fri Apr 03 18:18:37 2020 +0200 +++ b/Framework/Loaders/DicomStructureSetLoader.cpp Mon Apr 06 08:42:40 2020 +0200 @@ -29,11 +29,6 @@ #include -#if 0 -bool logbgo233 = false; -bool logbgo115 = false; -#endif - namespace OrthancStone { @@ -78,10 +73,11 @@ DicomStructureSetLoader& loader = GetLoader(); loader.content_->AddReferencedSlice(dicom); - loader.countProcessedInstances_ ++; assert(loader.countProcessedInstances_ <= loader.countReferencedInstances_); + loader.SetStructuresUpdated(); + if (loader.countProcessedInstances_ == loader.countReferencedInstances_) { // All the referenced instances have been loaded, finalize the RT-STRUCT @@ -161,10 +157,6 @@ virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) { -#if 0 - if (logbgo115) - LOG(TRACE) << "DicomStructureSetLoader::LoadStructure::Handle() (SUCCESS)"; -#endif DicomStructureSetLoader& loader = GetLoader(); { @@ -413,6 +405,11 @@ } } + void DicomStructureSetLoader::SetStructuresUpdated() + { + BroadcastMessage(DicomStructureSetLoader::StructuresUpdated(*this)); + } + void DicomStructureSetLoader::SetStructuresReady() { ORTHANC_ASSERT(!structuresReady_); diff -r d80a3e3cc800 -r 13573ff63eb6 Framework/Loaders/DicomStructureSetLoader.h --- a/Framework/Loaders/DicomStructureSetLoader.h Fri Apr 03 18:18:37 2020 +0200 +++ b/Framework/Loaders/DicomStructureSetLoader.h Mon Apr 06 08:42:40 2020 +0200 @@ -75,6 +75,7 @@ public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader); + ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresUpdated, DicomStructureSetLoader); static boost::shared_ptr Create( OrthancStone::ILoadersContext& loadersContext); @@ -99,6 +100,7 @@ virtual IExtractedSlice* ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; void SetStructuresReady(); + void SetStructuresUpdated(); bool AreStructuresReady() const; };