comparison Framework/Scene2D/GrayscaleStyleConfigurator.cpp @ 1209:b5dec783ba08

Fixed the style configurator to only set inversion on the image if it has been explicitely asked by the user + Fixed AddCircle in the measuring toolbox + dummy change (reindent)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Dec 2019 15:46:14 +0100
parents eb28dfe432f7
children ab06dfdf3b75 2d8ab34c8c91
comparison
equal deleted inserted replaced
1206:c93a6218f0cd 1209:b5dec783ba08
27 27
28 namespace OrthancStone 28 namespace OrthancStone
29 { 29 {
30 void GrayscaleStyleConfigurator::SetWindowing(ImageWindowing windowing) 30 void GrayscaleStyleConfigurator::SetWindowing(ImageWindowing windowing)
31 { 31 {
32 hasWindowing_ = true; 32 hasWindowingOverride_ = true;
33 windowing_ = windowing; 33 windowing_ = windowing;
34 revision_++; 34 revision_++;
35 } 35 }
36 36
37 void GrayscaleStyleConfigurator::SetCustomWindowing(float windowCenter, float windowWidth) 37 void GrayscaleStyleConfigurator::SetCustomWindowing(float windowCenter, float windowWidth)
47 windowWidth = customWindowWidth_; 47 windowWidth = customWindowWidth_;
48 } 48 }
49 49
50 void GrayscaleStyleConfigurator::SetInverted(bool inverted) 50 void GrayscaleStyleConfigurator::SetInverted(bool inverted)
51 { 51 {
52 hasInversionOverride_ = true;
52 inverted_ = inverted; 53 inverted_ = inverted;
53 revision_++; 54 revision_++;
54 } 55 }
55 56
56 void GrayscaleStyleConfigurator::SetLinearInterpolation(bool enabled) 57 void GrayscaleStyleConfigurator::SetLinearInterpolation(bool enabled)
86 { 87 {
87 FloatTextureSceneLayer& l = dynamic_cast<FloatTextureSceneLayer&>(layer); 88 FloatTextureSceneLayer& l = dynamic_cast<FloatTextureSceneLayer&>(layer);
88 89
89 l.SetLinearInterpolation(linearInterpolation_); 90 l.SetLinearInterpolation(linearInterpolation_);
90 91
91 if (hasWindowing_) 92 if (hasWindowingOverride_)
92 { 93 {
93 if (windowing_ != ImageWindowing_Custom) 94 if (windowing_ != ImageWindowing_Custom)
94 { 95 {
95 l.SetWindowing(windowing_); 96 l.SetWindowing(windowing_);
96 } 97 }
97 else 98 else
98 { 99 {
99 l.SetCustomWindowing(customWindowCenter_, customWindowWidth_); 100 l.SetCustomWindowing(customWindowCenter_, customWindowWidth_);
100 } 101 }
101 } 102 }
102 l.SetInverted(inverted_); 103 if (hasInversionOverride_)
104 {
105 l.SetInverted(inverted_);
106 }
103 } 107 }
104 } 108 }