changeset 78:93b917b02fee wasm

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 May 2017 21:20:06 +0200
parents f5f54ed8d307
children 4e21f6b3aa0d
files Applications/Samples/SingleFrameApplication.h Framework/Widgets/LayerWidget.cpp Framework/Widgets/LayerWidget.h
diffstat 3 files changed, 6 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/SingleFrameApplication.h	Wed May 24 21:13:29 2017 +0200
+++ b/Applications/Samples/SingleFrameApplication.h	Wed May 24 21:20:06 2017 +0200
@@ -56,7 +56,7 @@
         if (widget_ != NULL &&
             slices.GetSliceCount() > 0)
         {
-          widget_->SetSlice(slices.GetSlice(0), 1.0 /* TODO */);
+          widget_->SetSlice(slices.GetSlice(0));
         }
       }
       
--- a/Framework/Widgets/LayerWidget.cpp	Wed May 24 21:13:29 2017 +0200
+++ b/Framework/Widgets/LayerWidget.cpp	Wed May 24 21:20:06 2017 +0200
@@ -91,12 +91,6 @@
       return countMissing_ == 0;
     }
 
-    bool IsSamePlane(const SliceGeometry& slice,
-                     double sliceThickness)
-    {
-      return slice_.IsSamePlane(slice, sliceThickness);
-    }
-
     bool RenderScene(CairoContext& context,
                      const ViewportGeometry& view)
     {
@@ -277,13 +271,13 @@
     renderer->SetLayerStyle(styles_[index]);
 
     if (currentScene_.get() != NULL &&
-        currentScene_->IsSamePlane(slice.GetGeometry(), sliceThickness_))
+        slice.ContainsPlane(currentScene_->GetSlice()))
     {
       currentScene_->SetLayer(index, tmp.release());
       NotifyChange();
     }
     else if (pendingScene_.get() != NULL &&
-             pendingScene_->IsSamePlane(slice.GetGeometry(), sliceThickness_))
+             slice.ContainsPlane(pendingScene_->GetSlice()))
     {
       pendingScene_->SetLayer(index, tmp.release());
 
@@ -298,8 +292,7 @@
 
   
   LayerWidget::LayerWidget() :
-    started_(false),
-    sliceThickness_(1)
+    started_(false)
   {
     SetBackgroundCleared(true);
   }
@@ -358,8 +351,7 @@
   }
   
 
-  void LayerWidget::SetSlice(const SliceGeometry& slice,
-                             double sliceThickness)
+  void LayerWidget::SetSlice(const SliceGeometry& slice)
   {
     if (!slice_.IsSamePlane(slice, 100.0 * std::numeric_limits<double>::epsilon()))
     {
@@ -371,7 +363,6 @@
       }
         
       slice_ = slice;
-      sliceThickness_ = sliceThickness;
       ResetPendingScene();
 
       if (started_)
--- a/Framework/Widgets/LayerWidget.h	Wed May 24 21:13:29 2017 +0200
+++ b/Framework/Widgets/LayerWidget.h	Wed May 24 21:20:06 2017 +0200
@@ -42,7 +42,6 @@
     std::vector<ILayerSource*>  layers_;
     std::vector<RenderStyle>    styles_;
     SliceGeometry               slice_;
-    double                      sliceThickness_;
     std::auto_ptr<Scene>        currentScene_;
     std::auto_ptr<Scene>        pendingScene_;
 
@@ -93,8 +92,7 @@
     void SetLayerStyle(size_t layer,
                        const RenderStyle& style);
 
-    void SetSlice(const SliceGeometry& slice,
-                  double sliceThickness);
+    void SetSlice(const SliceGeometry& slice);
 
     virtual void Start();
   };