diff Framework/Layers/DicomStructureSetRendererFactory.cpp @ 121:e66b2c757790 wasm

displaying rt-struct
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Oct 2017 17:53:47 +0200
parents 2eca030792aa
children e3433dabfb8d
line wrap: on
line diff
--- a/Framework/Layers/DicomStructureSetRendererFactory.cpp	Wed Oct 04 15:51:34 2017 +0200
+++ b/Framework/Layers/DicomStructureSetRendererFactory.cpp	Wed Oct 04 17:53:47 2017 +0200
@@ -29,12 +29,12 @@
   {
   private:
     const DicomStructureSet&  structureSet_;
-    SliceGeometry             slice_;
+    CoordinateSystem3D        slice_;
     bool                      visible_;
 
   public:
     Renderer(const DicomStructureSet& structureSet,
-             const SliceGeometry& slice) :
+             const CoordinateSystem3D& slice) :
       structureSet_(structureSet),
       slice_(slice),
       visible_(true)
@@ -42,8 +42,7 @@
     }
 
     virtual bool RenderLayer(CairoContext& context,
-                             const ViewportGeometry& view,
-                             const SliceGeometry& viewportSlice)
+                             const ViewportGeometry& view)
     {
       if (visible_)
       {
@@ -54,6 +53,11 @@
       return true;
     }
 
+    virtual const CoordinateSystem3D& GetLayerSlice()
+    {
+      return slice_;
+    }
+
     virtual void SetLayerStyle(const RenderStyle& style)
     {
       visible_ = style.visible_;
@@ -66,22 +70,12 @@
   };
 
 
-  ILayerRenderer* DicomStructureSetRendererFactory::CreateLayerRenderer(const SliceGeometry& displaySlice)
+  void DicomStructureSetRendererFactory::ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice)
   {
     bool isOpposite;
-    if (GeometryToolbox::IsParallelOrOpposite(isOpposite, displaySlice.GetNormal(), structureSet_.GetNormal()))
+    if (GeometryToolbox::IsParallelOrOpposite(isOpposite, viewportSlice.GetNormal(), structureSet_.GetNormal()))
     {
-      return new Renderer(structureSet_, displaySlice);
-    }
-    else
-    {
-      return NULL;
+      NotifyLayerReady(new Renderer(structureSet_, viewportSlice), viewportSlice, false);
     }
   }
-
-
-  ISliceableVolume& DicomStructureSetRendererFactory::GetSourceVolume() const
-  {
-    throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
-  }
 }