changeset 1212:ab06dfdf3b75 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Dec 2019 16:54:24 +0100
parents d10d2acb8a02 (current diff) b5dec783ba08 (diff)
children 86a8266b8888
files Framework/Scene2D/GrayscaleStyleConfigurator.cpp Framework/Scene2D/GrayscaleStyleConfigurator.h Framework/Scene2DViewport/MeasureToolsToolbox.cpp
diffstat 5 files changed, 29 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Scene2D/GrayscaleStyleConfigurator.cpp	Wed Dec 04 16:47:21 2019 +0100
+++ b/Framework/Scene2D/GrayscaleStyleConfigurator.cpp	Wed Dec 04 16:54:24 2019 +0100
@@ -30,9 +30,10 @@
   GrayscaleStyleConfigurator::GrayscaleStyleConfigurator() :
     revision_(0),
     linearInterpolation_(false),
-    hasWindowing_(false),
+    hasWindowingOverride_(false),
     customWindowWidth_(0),
     customWindowCenter_(0),
+    hasInversionOverride_(false),
     inverted_(false),
     applyLog_(false)
   {
@@ -40,7 +41,7 @@
 
   void GrayscaleStyleConfigurator::SetWindowing(ImageWindowing windowing)
   {
-    hasWindowing_ = true;
+    hasWindowingOverride_ = true;
     windowing_ = windowing;
     revision_++;
   }
@@ -60,6 +61,7 @@
 
   void GrayscaleStyleConfigurator::SetInverted(bool inverted)
   {
+    hasInversionOverride_ = true;
     inverted_ = inverted;
     revision_++;
   }
@@ -105,7 +107,7 @@
     
     l.SetLinearInterpolation(linearInterpolation_);
 
-    if (hasWindowing_)
+    if (hasWindowingOverride_)
     {
       if (windowing_ != ImageWindowing_Custom)
       {
@@ -117,7 +119,11 @@
       }
     }
 
-    l.SetInverted(inverted_);
+    if (hasInversionOverride_)
+    {
+      l.SetInverted(inverted_);
+    }
+
     l.SetApplyLog(applyLog_);
   }
 }
--- a/Framework/Scene2D/GrayscaleStyleConfigurator.h	Wed Dec 04 16:47:21 2019 +0100
+++ b/Framework/Scene2D/GrayscaleStyleConfigurator.h	Wed Dec 04 16:54:24 2019 +0100
@@ -34,10 +34,11 @@
   private:
     uint64_t        revision_;
     bool            linearInterpolation_;
-    bool            hasWindowing_;
+    bool            hasWindowingOverride_;
     ImageWindowing  windowing_;
     float           customWindowWidth_;
     float           customWindowCenter_;
+    bool            hasInversionOverride_;
     bool            inverted_;
     bool            applyLog_;
     
--- a/Framework/Scene2DViewport/MeasureToolsToolbox.cpp	Wed Dec 04 16:47:21 2019 +0100
+++ b/Framework/Scene2DViewport/MeasureToolsToolbox.cpp	Wed Dec 04 16:54:24 2019 +0100
@@ -65,6 +65,11 @@
     const ScenePoint2D& centerS,
     const double& sideLengthS)
   {
+    /*
+    The scene is required here because we need to draw the square with its
+    sides parallel to the SCREEN axis, not the SCENE axis
+    */
+
     // get the scaling factor 
     const double sceneToCanvas =
       scene.GetSceneToCanvasTransform().ComputeZoom();
@@ -204,9 +209,9 @@
 #endif
 
   void AddCircle(PolylineSceneLayer::Chain& chain,
-    const ScenePoint2D& centerS,
-    const double& radiusS,
-    const int           numSubdivisions)
+                 const ScenePoint2D&        centerS,
+                 const double&              radiusS,
+                 const int                  numSubdivisions)
   {
     //ScenePoint2D centerC = centerS.Apply(scene.GetSceneToCanvasTransform());
     //TODO: take DPI into account
--- a/Framework/Scene2DViewport/MeasureToolsToolbox.h	Wed Dec 04 16:47:21 2019 +0100
+++ b/Framework/Scene2DViewport/MeasureToolsToolbox.h	Wed Dec 04 16:54:24 2019 +0100
@@ -31,9 +31,9 @@
   square sides are parallel to the canvas boundaries.
   */
   void AddSquare(PolylineSceneLayer::Chain& chain,
-                 const Scene2D&     scene,
-                 const ScenePoint2D& centerS,
-                 const double& sideLengthS);
+                 const Scene2D&             scene,
+                 const ScenePoint2D&        centerS,
+                 const double&              sideLengthS);
 
   /**
     Creates an arc centered on c that goes
@@ -123,10 +123,9 @@
     Warning: the existing chain content will be wiped out.
   */
   void AddCircle(PolylineSceneLayer::Chain& chain,
-    const Scene2D& scene,
-    const ScenePoint2D& centerS,
-    const double& radiusS,
-    const int           numSubdivisions = 63);
+                 const ScenePoint2D&        centerS,
+                 const double&              radiusS,
+                 const int                  numSubdivisions = 63);
 
   /**
     Adds or subtracts 2*pi as many times as need to shift the specified
@@ -146,9 +145,7 @@
 
   */
   double MeasureAngle(
-    const ScenePoint2D& p1
-    , const ScenePoint2D& c
-    , const ScenePoint2D& p2);
+    const ScenePoint2D& p1, const ScenePoint2D& c, const ScenePoint2D& p2);
 
   /**
   RadiansToDegrees
--- a/Framework/Toolbox/AffineTransform2D.h	Wed Dec 04 16:47:21 2019 +0100
+++ b/Framework/Toolbox/AffineTransform2D.h	Wed Dec 04 16:54:24 2019 +0100
@@ -77,7 +77,8 @@
                                      const AffineTransform2D& c,
                                      const AffineTransform2D& d);
 
-    // transformations are applied right to left: e is the first transfo applied, a is the last one
+    // transformations are applied right to left: 
+    // `e` is the first transformation applied and `a` is the last one
     static AffineTransform2D Combine(const AffineTransform2D& a,
                                      const AffineTransform2D& b,
                                      const AffineTransform2D& c,