Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/ViewportGeometry.h @ 109:53bd9277b025 wasm
using the Extent class
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 14 Jun 2017 15:34:08 +0200 |
parents | c2dc924f1a63 |
children | 7665ccbf33db |
comparison
equal
deleted
inserted
replaced
108:37d4ae7052a5 | 109:53bd9277b025 |
---|---|
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "../Viewport/CairoContext.h" | 24 #include "../Viewport/CairoContext.h" |
25 #include "../Toolbox/Extent.h" | |
25 | 26 |
26 namespace OrthancStone | 27 namespace OrthancStone |
27 { | 28 { |
28 class ViewportGeometry | 29 class ViewportGeometry |
29 { | 30 { |
30 private: | 31 private: |
31 // Extent of the scene (in world units) | 32 // Extent of the scene (in world units) |
32 double x1_; | 33 Extent sceneExtent_; |
33 double y1_; | |
34 double x2_; | |
35 double y2_; | |
36 | 34 |
37 // Size of the display (in pixels) | 35 // Size of the display (in pixels) |
38 unsigned int width_; | 36 unsigned int width_; |
39 unsigned int height_; | 37 unsigned int height_; |
40 | 38 |
51 ViewportGeometry(); | 49 ViewportGeometry(); |
52 | 50 |
53 void SetDisplaySize(unsigned int width, | 51 void SetDisplaySize(unsigned int width, |
54 unsigned int height); | 52 unsigned int height); |
55 | 53 |
56 void SetSceneExtent(double x1, | 54 void SetSceneExtent(const Extent& extent); |
57 double y1, | |
58 double x2, | |
59 double y2); | |
60 | 55 |
61 void GetSceneExtent(double& x1, | 56 const Extent& GetSceneExtent() const |
62 double& y1, | 57 { |
63 double& x2, | 58 return sceneExtent_; |
64 double& y2) const; | 59 } |
65 | 60 |
66 void MapDisplayToScene(double& sceneX /* out */, | 61 void MapDisplayToScene(double& sceneX /* out */, |
67 double& sceneY /* out */, | 62 double& sceneY /* out */, |
68 double x, | 63 double x, |
69 double y) const; | 64 double y) const; |