# HG changeset patch # User Sebastien Jodogne # Date 1575474864 -3600 # Node ID ab06dfdf3b751781538e750dd811e91b3118ce7e # Parent d10d2acb8a02bbc9b9a7ee8a6513026ad2499270# Parent b5dec783ba0864c481cfe8dde98076f26ce9afd0 integration mainline->broker diff -r d10d2acb8a02 -r ab06dfdf3b75 Framework/Scene2D/GrayscaleStyleConfigurator.cpp --- 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_); } } diff -r d10d2acb8a02 -r ab06dfdf3b75 Framework/Scene2D/GrayscaleStyleConfigurator.h --- 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_; diff -r d10d2acb8a02 -r ab06dfdf3b75 Framework/Scene2DViewport/MeasureToolsToolbox.cpp --- 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 diff -r d10d2acb8a02 -r ab06dfdf3b75 Framework/Scene2DViewport/MeasureToolsToolbox.h --- 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 diff -r d10d2acb8a02 -r ab06dfdf3b75 Framework/Toolbox/AffineTransform2D.h --- 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,