comparison OrthancStone/Sources/Scene2D/TextureBaseSceneLayer.h @ 1512:244ad1e4e76a

reorganization of folders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 16:21:02 +0200
parents Framework/Scene2D/TextureBaseSceneLayer.h@30deba7bc8e2
children 6d14ed6163b1
comparison
equal deleted inserted replaced
1511:9dfeee74c1e6 1512:244ad1e4e76a
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Affero General Public License
9 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/
20
21
22 #pragma once
23
24 #include "ISceneLayer.h"
25 #include "../Toolbox/AffineTransform2D.h"
26
27 #include <Compatibility.h>
28 #include <Images/ImageAccessor.h>
29
30 namespace OrthancStone
31 {
32 class TextureBaseSceneLayer : public ISceneLayer
33 {
34 private:
35 std::unique_ptr<Orthanc::ImageAccessor> texture_;
36 double originX_;
37 double originY_;
38 double pixelSpacingX_;
39 double pixelSpacingY_;
40 double angle_;
41 bool isLinearInterpolation_;
42 uint64_t revision_;
43
44 protected:
45 void SetTexture(Orthanc::ImageAccessor* texture);
46
47 void IncrementRevision()
48 {
49 revision_++;
50 }
51
52 void CopyParameters(const TextureBaseSceneLayer& other);
53
54 public:
55 TextureBaseSceneLayer();
56
57 // Center of the top-left pixel
58 void SetOrigin(double x,
59 double y);
60
61 void SetPixelSpacing(double sx,
62 double sy);
63
64 // In radians
65 void SetAngle(double angle);
66
67 void SetLinearInterpolation(bool isLinearInterpolation);
68
69 double GetOriginX() const
70 {
71 return originX_;
72 }
73
74 double GetOriginY() const
75 {
76 return originY_;
77 }
78
79 double GetPixelSpacingX() const
80 {
81 return pixelSpacingX_;
82 }
83
84 double GetPixelSpacingY() const
85 {
86 return pixelSpacingY_;
87 }
88
89 double GetAngle() const
90 {
91 return angle_;
92 }
93
94 bool IsLinearInterpolation() const
95 {
96 return isLinearInterpolation_;
97 }
98
99 bool HasTexture() const
100 {
101 return (texture_.get() != NULL);
102 }
103
104 const Orthanc::ImageAccessor& GetTexture() const;
105
106 AffineTransform2D GetTransform() const;
107
108 virtual bool GetBoundingBox(Extent2D& target) const;
109
110 virtual uint64_t GetRevision() const
111 {
112 return revision_;
113 }
114 };
115 }