# HG changeset patch # User Benjamin Golinvaux # Date 1563787269 -7200 # Node ID 81d30cd93b6586c2d190283eb23622822db0666d # Parent d6c029d15aaa88036a5a800760a64c0d374c0b92 Ability to ask the loader for the geometry in PULL mode (when subscribing to the messages is not possible) + small changes (removed const/ref qualifiers for boost::shared_ptr param, added traces, doc change) diff -r d6c029d15aaa -r 81d30cd93b65 Framework/Loaders/OrthancMultiframeVolumeLoader.cpp --- a/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Fri Jul 19 15:15:13 2019 +0200 +++ b/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Mon Jul 22 11:21:09 2019 +0200 @@ -196,7 +196,6 @@ transferSyntaxUid_ = Orthanc::Toolbox::StripSpaces(transferSyntax); ScheduleFrameDownloads(); } - void OrthancMultiframeVolumeLoader::SetGeometry(const Orthanc::DicomMap& dicom) { @@ -298,7 +297,6 @@ } } } - void OrthancMultiframeVolumeLoader::SetUncompressedPixelData(const std::string& pixelData) { @@ -318,7 +316,7 @@ } - OrthancMultiframeVolumeLoader::OrthancMultiframeVolumeLoader(const boost::shared_ptr& volume, + OrthancMultiframeVolumeLoader::OrthancMultiframeVolumeLoader(boost::shared_ptr volume, IOracle& oracle, IObservable& oracleObservable) : LoaderStateMachine(oracle, oracleObservable), diff -r d6c029d15aaa -r 81d30cd93b65 Framework/Loaders/OrthancMultiframeVolumeLoader.h --- a/Framework/Loaders/OrthancMultiframeVolumeLoader.h Fri Jul 19 15:15:13 2019 +0200 +++ b/Framework/Loaders/OrthancMultiframeVolumeLoader.h Mon Jul 22 11:21:09 2019 +0200 @@ -42,7 +42,6 @@ std::string instanceId_; std::string transferSyntaxUid_; - const std::string& GetInstanceId() const; void ScheduleFrameDownloads(); @@ -57,7 +56,7 @@ void SetUncompressedPixelData(const std::string& pixelData); public: - OrthancMultiframeVolumeLoader(const boost::shared_ptr& volume, + OrthancMultiframeVolumeLoader(boost::shared_ptr volume, IOracle& oracle, IObservable& oracleObservable); diff -r d6c029d15aaa -r 81d30cd93b65 Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h --- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h Fri Jul 19 15:15:13 2019 +0200 +++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h Mon Jul 22 11:21:09 2019 +0200 @@ -92,7 +92,6 @@ void IncrementSliceRevision(size_t index); }; - void ScheduleNextSliceDownload(); void LoadGeometry(const OrthancRestApiCommand::SuccessMessage& message); @@ -125,6 +124,24 @@ void LoadSeries(const std::string& seriesId); /** + This getter is used by clients that do not receive the geometry through + subscribing, for instance if they are created or listening only AFTER the + "geometry loaded" message is broadcast + */ + bool HasGeometry() const + { + return seriesGeometry_.HasGeometry(); + } + + /** + Same remark as HasGeometry + */ + const VolumeImageGeometry& GetImageGeometry() const + { + return seriesGeometry_.GetImageGeometry(); + } + + /** When a slice is requested, the strategy algorithm (that defines the sequence of resources to be loaded from the server) is modified to take into account this request (this is done in the ExtractedSlice ctor) diff -r d6c029d15aaa -r 81d30cd93b65 Framework/Volumes/VolumeSceneLayerSource.cpp --- a/Framework/Volumes/VolumeSceneLayerSource.cpp Fri Jul 19 15:15:13 2019 +0200 +++ b/Framework/Volumes/VolumeSceneLayerSource.cpp Mon Jul 22 11:21:09 2019 +0200 @@ -119,6 +119,7 @@ } else { + LOG(TRACE) << "VolumeSceneLayerSource::Update -- Content has changed: An update is needed"; // Content has changed: An update is needed lastPlane_.reset(new CoordinateSystem3D(plane)); lastRevision_ = slice->GetRevision(); @@ -126,10 +127,12 @@ std::auto_ptr layer(slice->CreateSceneLayer(configurator_.get(), plane)); if (layer.get() == NULL) { + LOG(TRACE) << "VolumeSceneLayerSource::Update -- (layer.get() == NULL)"; ClearLayer(); } else { + LOG(TRACE) << "VolumeSceneLayerSource::Update -- (layer.get() != NULL)"; if (configurator_.get() != NULL) { lastConfiguratorRevision_ = configurator_->GetRevision(); diff -r d6c029d15aaa -r 81d30cd93b65 Framework/Volumes/VolumeSceneLayerSource.h --- a/Framework/Volumes/VolumeSceneLayerSource.h Fri Jul 19 15:15:13 2019 +0200 +++ b/Framework/Volumes/VolumeSceneLayerSource.h Mon Jul 22 11:21:09 2019 +0200 @@ -34,7 +34,7 @@ scene". The style of the layer can be fine-tuned using a "layer style configurator". The class only changes the layer if the cutting plane has been modified since the last call to "Update()". - **/ + */ class VolumeSceneLayerSource : public boost::noncopyable { private: