changeset 921:81d30cd93b65 toa2019072201

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)
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 22 Jul 2019 11:21:09 +0200
parents d6c029d15aaa
children 988fa647df21
files Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Framework/Loaders/OrthancMultiframeVolumeLoader.h Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h Framework/Volumes/VolumeSceneLayerSource.cpp Framework/Volumes/VolumeSceneLayerSource.h
diffstat 5 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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<DicomVolumeImage>& volume,
+  OrthancMultiframeVolumeLoader::OrthancMultiframeVolumeLoader(boost::shared_ptr<DicomVolumeImage> volume,
                                                                IOracle& oracle,
                                                                IObservable& oracleObservable) :
     LoaderStateMachine(oracle, oracleObservable),
--- 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<DicomVolumeImage>& volume,
+    OrthancMultiframeVolumeLoader(boost::shared_ptr<DicomVolumeImage> volume,
                                   IOracle& oracle,
                                   IObservable& oracleObservable);
 
--- 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)
--- 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<ISceneLayer> 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();
--- 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: