comparison Framework/Radiography/RadiographyLayer.cpp @ 1321:d4e6cd35107b

Clarified GetExtent/GetSceneExtent
author Alain Mazy <alain@mazy.be>
date Fri, 20 Mar 2020 12:52:13 +0100
parents 398ea4259e65
children a72c2c9af49a
comparison
equal deleted inserted replaced
1301:d3c4f5e2b287 1321:d4e6cd35107b
236 { 236 {
237 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); 237 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
238 } 238 }
239 } 239 }
240 240
241 241 Extent2D RadiographyLayer::GetSceneExtent() const
242 Extent2D RadiographyLayer::GetExtent() const
243 { 242 {
244 Extent2D extent; 243 Extent2D extent;
245 244
246 unsigned int x, y, width, height; 245 unsigned int x, y, width, height;
247 GetCrop(x, y, width, height); 246 GetCrop(x, y, width, height);
249 double dx = static_cast<double>(x); 248 double dx = static_cast<double>(x);
250 double dy = static_cast<double>(y); 249 double dy = static_cast<double>(y);
251 double dwidth = static_cast<double>(width); 250 double dwidth = static_cast<double>(width);
252 double dheight = static_cast<double>(height); 251 double dheight = static_cast<double>(height);
253 252
253 // AddToExtent transforms the coordinates from image to scene
254 AddToExtent(extent, dx, dy); 254 AddToExtent(extent, dx, dy);
255 AddToExtent(extent, dx + dwidth, dy); 255 AddToExtent(extent, dx + dwidth, dy);
256 AddToExtent(extent, dx, dy + dheight); 256 AddToExtent(extent, dx, dy + dheight);
257 AddToExtent(extent, dx + dwidth, dy + dheight); 257 AddToExtent(extent, dx + dwidth, dy + dheight);
258 258