changeset 401:f1c769b3a5c2

start getting rid of VolumeSlicerBase
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 10 Nov 2018 10:11:29 +0100
parents 518f680dbf2e
children 72355b637945
files Framework/Layers/DicomSeriesVolumeSlicer.cpp Framework/Layers/DicomStructureSetSlicer.cpp Framework/Layers/DicomStructureSetSlicer.h Framework/Layers/VolumeSlicerBase.cpp Framework/Layers/VolumeSlicerBase.h Framework/SmartLoader.cpp Framework/dev.h
diffstat 7 files changed, 19 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Layers/DicomSeriesVolumeSlicer.cpp	Sat Nov 10 09:58:45 2018 +0100
+++ b/Framework/Layers/DicomSeriesVolumeSlicer.cpp	Sat Nov 10 10:11:29 2018 +0100
@@ -36,7 +36,7 @@
   {
     if (message.GetOrigin().GetSliceCount() > 0)
     {
-      VolumeSlicerBase::NotifyGeometryReady();
+      EmitMessage(IVolumeSlicer::GeometryReadyMessage(*this));
     }
     else
     {
@@ -78,7 +78,8 @@
 
     // then notify that the layer is ready for render
     RendererFactory factory(message);
-    VolumeSlicerBase::NotifyLayerReady(factory, message.GetSlice().GetGeometry());
+
+    EmitMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, message.GetSlice().GetGeometry()));
   }
 
   void DicomSeriesVolumeSlicer::OnSliceImageError(const OrthancSlicesLoader::SliceImageErrorMessage& message)
--- a/Framework/Layers/DicomStructureSetSlicer.cpp	Sat Nov 10 09:58:45 2018 +0100
+++ b/Framework/Layers/DicomStructureSetSlicer.cpp	Sat Nov 10 10:11:29 2018 +0100
@@ -152,7 +152,7 @@
     if (loader_.HasStructureSet())
     {
       RendererFactory factory(loader_.GetStructureSet(), viewportPlane);
-      NotifyLayerReady(factory, viewportPlane);
+      EmitMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, viewportPlane));
     }
   }
 }
--- a/Framework/Layers/DicomStructureSetSlicer.h	Sat Nov 10 09:58:45 2018 +0100
+++ b/Framework/Layers/DicomStructureSetSlicer.h	Sat Nov 10 10:11:29 2018 +0100
@@ -34,11 +34,6 @@
     class Renderer;
     class RendererFactory;
 
-    virtual void NotifyGeometryReady(const IVolumeLoader& loader)
-    {
-      VolumeSlicerBase::NotifyGeometryReady();
-    }
-
     virtual void NotifyGeometryError(const IVolumeLoader& loader)
     {
       VolumeSlicerBase::NotifyGeometryError();
--- a/Framework/Layers/VolumeSlicerBase.cpp	Sat Nov 10 09:58:45 2018 +0100
+++ b/Framework/Layers/VolumeSlicerBase.cpp	Sat Nov 10 10:11:29 2018 +0100
@@ -25,11 +25,6 @@
 
 namespace OrthancStone
 {
-  void VolumeSlicerBase::NotifyGeometryReady()
-  {
-    EmitMessage(IVolumeSlicer::GeometryReadyMessage(*this));
-  }
-    
   void VolumeSlicerBase::NotifyGeometryError()
   {
     EmitMessage(IVolumeSlicer::GeometryErrorMessage(*this));
@@ -45,12 +40,6 @@
     EmitMessage(IVolumeSlicer::SliceContentChangedMessage(*this, slice));
   }
 
-  void VolumeSlicerBase::NotifyLayerReady(const LayerReadyMessage::IRendererFactory& factory,
-                                          const CoordinateSystem3D& slice)
-  {
-    EmitMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, slice));
-  }
-
   void VolumeSlicerBase::NotifyLayerError(const CoordinateSystem3D& slice)
   {
     EmitMessage(IVolumeSlicer::LayerErrorMessage(*this, slice));
--- a/Framework/Layers/VolumeSlicerBase.h	Sat Nov 10 09:58:45 2018 +0100
+++ b/Framework/Layers/VolumeSlicerBase.h	Sat Nov 10 10:11:29 2018 +0100
@@ -26,29 +26,20 @@
 
 namespace OrthancStone
 {
-  class SmartLoader;
-
   class VolumeSlicerBase : public IVolumeSlicer
   {
   protected:
-    void NotifyGeometryReady();
-    
+    VolumeSlicerBase(MessageBroker& broker) :
+      IVolumeSlicer(broker)
+    {
+    }
+
     void NotifyGeometryError();
 
     void NotifyContentChange();
 
     void NotifySliceContentChange(const Slice& slice);
 
-    void NotifyLayerReady(const LayerReadyMessage::IRendererFactory& factory,
-                          const CoordinateSystem3D& slice);
-
     void NotifyLayerError(const CoordinateSystem3D& slice);
-
-    VolumeSlicerBase(MessageBroker& broker) :
-      IVolumeSlicer(broker)
-    {
-    }
-
-    friend class SmartLoader;
   };
 }
--- a/Framework/SmartLoader.cpp	Sat Nov 10 09:58:45 2018 +0100
+++ b/Framework/SmartLoader.cpp	Sat Nov 10 10:11:29 2018 +0100
@@ -37,7 +37,7 @@
     CachedSliceStatus_ImageLoaded
   };
 
-  class SmartLoader::CachedSlice : public VolumeSlicerBase
+  class SmartLoader::CachedSlice : public IVolumeSlicer
   {
   public:
     class RendererFactory : public LayerReadyMessage::IRendererFactory
@@ -68,7 +68,7 @@
 
   public:
     CachedSlice(MessageBroker& broker) :
-    VolumeSlicerBase(broker)
+    IVolumeSlicer(broker)
     {
     }
 
@@ -94,8 +94,8 @@
       {
         LOG(WARNING) << "ScheduleLayerCreation for CachedSlice (image is loaded): " << slice_->GetOrthancInstanceId();
 
-        RendererFactory factory(*this);
-        VolumeSlicerBase::NotifyLayerReady(factory, slice_->GetGeometry());
+        RendererFactory factory(*this);   
+        EmitMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, slice_->GetGeometry()));
       }
       else
       {
@@ -174,7 +174,7 @@
 
     if (cachedSlice != NULL)
     {
-      cachedSlice->NotifyGeometryReady();
+      EmitMessage(IVolumeSlicer::GeometryReadyMessage(*cachedSlice));
     }
 
   }
--- a/Framework/dev.h	Sat Nov 10 09:58:45 2018 +0100
+++ b/Framework/dev.h	Sat Nov 10 10:11:29 2018 +0100
@@ -542,7 +542,7 @@
       coronalGeometry_.reset(new VolumeImageGeometry(volume_, VolumeProjection_Coronal));
       sagittalGeometry_.reset(new VolumeImageGeometry(volume_, VolumeProjection_Sagittal));
       
-      VolumeSlicerBase::NotifyGeometryReady();
+      EmitMessage(IVolumeSlicer::GeometryReadyMessage(*this));
     }
 
     virtual void NotifyGeometryError(const ISlicedVolume& volume)
@@ -684,9 +684,8 @@
           std::auto_ptr<Slice> slice(geometry.GetSlice(closest));
 
           RendererFactory factory(*frame, *slice, isFullQuality);
-          VolumeSlicerBase::NotifyLayerReady(factory,
-            //new SliceOutlineRenderer(slice),
-            slice->GetGeometry());
+
+          EmitMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, slice->GetGeometry()));
           return;
         }
       }
@@ -903,7 +902,7 @@
       VolumeSlicerBase(broker),
       otherPlane_(otherPlane)
     {
-      NotifyGeometryReady();
+      EmitMessage(IVolumeSlicer::GeometryReadyMessage(*this));
     }
 
     virtual bool GetExtent(std::vector<Vector>& points,
@@ -942,7 +941,7 @@
                                                  extent.GetX2(), extent.GetY2()))
         {
           RendererFactory factory(x1, y1, x2, y2, slice);
-          NotifyLayerReady(factory, reference.GetGeometry());
+          EmitMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, reference.GetGeometry()));
         }
         else
         {