changeset 1042:08cdcadfab14

allow using nearest neighbour interpolation while windowing
author Alain Mazy <alain@mazy.be>
date Wed, 09 Oct 2019 15:34:45 +0200
parents 3a35d8397559
children b26fb3a99f01
files Framework/Radiography/RadiographyWindowingTracker.cpp Framework/Radiography/RadiographyWindowingTracker.h
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyWindowingTracker.cpp	Mon Oct 07 22:37:24 2019 +0200
+++ b/Framework/Radiography/RadiographyWindowingTracker.cpp	Wed Oct 09 15:34:45 2019 +0200
@@ -20,6 +20,7 @@
 
 
 #include "RadiographyWindowingTracker.h"
+#include "RadiographyWidget.h"
 
 #include <Core/OrthancException.h>
 
@@ -115,6 +116,8 @@
     
   RadiographyWindowingTracker::RadiographyWindowingTracker(UndoRedoStack& undoRedoStack,
                                                            RadiographyScene& scene,
+                                                           RadiographyWidget& widget,
+                                                           ImageInterpolation interpolationDuringTracking,
                                                            int x,
                                                            int y,
                                                            Action leftAction,
@@ -123,6 +126,8 @@
                                                            Action downAction) :
     undoRedoStack_(undoRedoStack),
     scene_(scene),
+    widget_(widget),
+    initialWidgetInterpolation_(widget.GetInterpolation()),
     clickX_(x),
     clickY_(y),
     leftAction_(leftAction),
@@ -131,6 +136,7 @@
     downAction_(downAction)
   {
     scene_.GetWindowingWithDefault(sourceCenter_, sourceWidth_);
+    widget_.SetInterpolation(interpolationDuringTracking);
 
     float minValue, maxValue;
     scene.GetRange(minValue, maxValue);
@@ -156,6 +162,7 @@
 
   void RadiographyWindowingTracker::MouseUp()
   {
+    widget_.SetInterpolation(initialWidgetInterpolation_);
     undoRedoStack_.Add(new UndoRedoCommand(*this));
   }
 
--- a/Framework/Radiography/RadiographyWindowingTracker.h	Mon Oct 07 22:37:24 2019 +0200
+++ b/Framework/Radiography/RadiographyWindowingTracker.h	Wed Oct 09 15:34:45 2019 +0200
@@ -27,6 +27,9 @@
 
 namespace OrthancStone
 {
+
+  class RadiographyWidget;
+
   class RadiographyWindowingTracker : public Deprecated::IWorldSceneMouseTracker
   {   
   public:
@@ -43,6 +46,8 @@
 
     UndoRedoStack&      undoRedoStack_;
     RadiographyScene&   scene_;
+    RadiographyWidget&  widget_;
+    ImageInterpolation  initialWidgetInterpolation_;
     int                 clickX_;
     int                 clickY_;
     Action              leftAction_;
@@ -62,6 +67,8 @@
   public:
     RadiographyWindowingTracker(UndoRedoStack& undoRedoStack,
                                 RadiographyScene& scene,
+                                RadiographyWidget& widget,
+                                ImageInterpolation interpolationDuringTracking,
                                 int x,
                                 int y,
                                 Action leftAction,