Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyLayer.cpp @ 658:63982c8c294a
merge am-dev -> default
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 14 May 2019 18:39:50 +0200 |
parents | 42dadae61fa9 8d66efecd91c |
children | 68b5688241d5 |
comparison
equal
deleted
inserted
replaced
656:002d9562c8f5 | 658:63982c8c294a |
---|---|
32 } | 32 } |
33 | 33 |
34 | 34 |
35 RadiographyLayer::Geometry::Geometry() : | 35 RadiographyLayer::Geometry::Geometry() : |
36 hasCrop_(false), | 36 hasCrop_(false), |
37 flipVertical_(false), | |
38 flipHorizontal_(false), | |
37 panX_(0), | 39 panX_(0), |
38 panY_(0), | 40 panY_(0), |
39 angle_(0), | 41 angle_(0), |
40 resizeable_(false), | 42 resizeable_(false), |
41 pixelSpacingX_(1), | 43 pixelSpacingX_(1), |
55 height = cropHeight_; | 57 height = cropHeight_; |
56 } | 58 } |
57 | 59 |
58 void RadiographyLayer::UpdateTransform() | 60 void RadiographyLayer::UpdateTransform() |
59 { | 61 { |
60 transform_ = AffineTransform2D::CreateScaling(geometry_.GetPixelSpacingX(), geometry_.GetPixelSpacingY()); | 62 transform_ = AffineTransform2D::CreateScaling(geometry_.GetScalingX(), geometry_.GetScalingY()); |
61 | 63 |
62 double centerX, centerY; | 64 double centerX, centerY; |
63 GetCenter(centerX, centerY); | 65 GetCenter(centerX, centerY); |
64 | 66 |
65 transform_ = AffineTransform2D::Combine( | 67 transform_ = AffineTransform2D::Combine( |
202 UpdateTransform(); | 204 UpdateTransform(); |
203 | 205 |
204 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); | 206 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); |
205 } | 207 } |
206 | 208 |
209 void RadiographyLayer::SetFlipVertical(bool flip) | |
210 { | |
211 geometry_.SetFlipVertical(flip); | |
212 UpdateTransform(); | |
213 | |
214 EmitMessage(RadiographyLayer::LayerEditedMessage(*this)); | |
215 } | |
216 | |
217 void RadiographyLayer::SetFlipHorizontal(bool flip) | |
218 { | |
219 geometry_.SetFlipHorizontal(flip); | |
220 UpdateTransform(); | |
221 | |
222 EmitMessage(RadiographyLayer::LayerEditedMessage(*this)); | |
223 } | |
207 | 224 |
208 void RadiographyLayer::SetSize(unsigned int width, | 225 void RadiographyLayer::SetSize(unsigned int width, |
209 unsigned int height) | 226 unsigned int height) |
210 { | 227 { |
211 if (hasSize_ && | 228 if (hasSize_ && |