comparison Framework/Loaders/DicomStructureSetLoader.cpp @ 937:86ac61a040c9

Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 31 Jul 2019 10:24:09 +0200
parents 401808e7ff2e
children bd979d435e9d
comparison
equal deleted inserted replaced
936:775ebd43bd3b 937:86ac61a040c9
56 if (loader.countProcessedInstances_ == loader.countReferencedInstances_) 56 if (loader.countProcessedInstances_ == loader.countReferencedInstances_)
57 { 57 {
58 // All the referenced instances have been loaded, finalize the RT-STRUCT 58 // All the referenced instances have been loaded, finalize the RT-STRUCT
59 loader.content_->CheckReferencedSlices(); 59 loader.content_->CheckReferencedSlices();
60 loader.revision_++; 60 loader.revision_++;
61 loader.SetStructuresReady();
61 } 62 }
62 } 63 }
63 }; 64 };
64 65
65 66
223 }; 224 };
224 225
225 226
226 DicomStructureSetLoader::DicomStructureSetLoader(IOracle& oracle, 227 DicomStructureSetLoader::DicomStructureSetLoader(IOracle& oracle,
227 IObservable& oracleObservable) : 228 IObservable& oracleObservable) :
229 IObservable(oracleObservable.GetBroker()),
228 LoaderStateMachine(oracle, oracleObservable), 230 LoaderStateMachine(oracle, oracleObservable),
229 revision_(0), 231 revision_(0),
230 countProcessedInstances_(0), 232 countProcessedInstances_(0),
231 countReferencedInstances_(0) 233 countReferencedInstances_(0),
234 structuresReady_(false)
232 { 235 {
233 } 236 }
234 237
235 238
236 DicomStructureSetLoader::~DicomStructureSetLoader() 239 DicomStructureSetLoader::~DicomStructureSetLoader()
264 else 267 else
265 { 268 {
266 return new Slice(*content_, revision_, cuttingPlane); 269 return new Slice(*content_, revision_, cuttingPlane);
267 } 270 }
268 } 271 }
272
273 void DicomStructureSetLoader::SetStructuresReady()
274 {
275 ORTHANC_ASSERT(!structuresReady_);
276 structuresReady_ = true;
277 BroadcastMessage(DicomStructureSetLoader::StructuresReady(*this));
278 }
279
280 bool DicomStructureSetLoader::AreStructuresReady() const
281 {
282 return structuresReady_;
283 }
284
269 } 285 }