annotate OrthancStone/Sources/Scene2D/TextureBaseSceneLayer.cpp @ 2032:d10bab7cc396 deep-learning

added OpenGLTexture::Download()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 21 Jan 2023 16:48:56 +0100
parents 7053b8a0aaec
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
20 * <http://www.gnu.org/licenses/>.
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "TextureBaseSceneLayer.h"
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
1624
59f95b9ea858 fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
26 #include <Logging.h>
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
27 #include <OrthancException.h>
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 namespace OrthancStone
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
31 void TextureBaseSceneLayer::CheckNoManualTransform() const
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
32 {
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
33 if (transform_.get() != NULL)
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
34 {
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
35 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls,
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
36 "A transform has been manually set, first call ClearTransform()");
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
37 }
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
38 }
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
39
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
40
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 void TextureBaseSceneLayer::SetTexture(Orthanc::ImageAccessor* texture)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 if (texture == NULL)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 texture_.reset(texture);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 void TextureBaseSceneLayer::CopyParameters(const TextureBaseSceneLayer& other)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 originX_ = other.originX_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 originY_ = other.originY_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 pixelSpacingX_ = other.pixelSpacingX_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 pixelSpacingY_ = other.pixelSpacingY_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 angle_ = other.angle_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 isLinearInterpolation_ = other.isLinearInterpolation_;
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
63 flipX_ = other.flipX_;
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
64 flipY_ = other.flipY_;
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
65
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
66 if (other.transform_.get() != NULL)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
67 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
68 transform_.reset(new AffineTransform2D(*other.transform_));
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
69 }
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 TextureBaseSceneLayer::TextureBaseSceneLayer() :
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 originX_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 originY_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 pixelSpacingX_(1),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 pixelSpacingY_(1),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 angle_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 isLinearInterpolation_(false),
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
80 flipX_(false),
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
81 flipY_(false),
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 revision_(0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 if (pixelSpacingX_ <= 0 ||
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 pixelSpacingY_ <= 0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 void TextureBaseSceneLayer::SetOrigin(double x,
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 double y)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
95 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
96
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 originX_ = x;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 originY_ = y;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 void TextureBaseSceneLayer::SetPixelSpacing(double sx,
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 double sy)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
106 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
107
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 if (sx <= 0 ||
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 sy <= 0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 pixelSpacingX_ = sx;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 pixelSpacingY_ = sy;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 void TextureBaseSceneLayer::SetAngle(double angle)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
124 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
125
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 angle_ = angle;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 void TextureBaseSceneLayer::SetLinearInterpolation(bool isLinearInterpolation)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 isLinearInterpolation_ = isLinearInterpolation;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
138 void TextureBaseSceneLayer::SetFlipX(bool flip)
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
139 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
140 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
141
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
142 flipX_ = flip;
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
143 IncrementRevision();
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
144 }
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
145
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
146
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
147 void TextureBaseSceneLayer::SetFlipY(bool flip)
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
148 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
149 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
150
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
151 flipY_ = flip;
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
152 IncrementRevision();
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
153 }
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
154
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
155
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 const Orthanc::ImageAccessor& TextureBaseSceneLayer::GetTexture() const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 if (!HasTexture())
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 {
956
a7351ad54960 Made IsContextLost automatically set the flag by checking with the emscripten
Benjamin Golinvaux <bgo@osimis.io>
parents: 590
diff changeset
160 LOG(ERROR) << "TextureBaseSceneLayer::GetTexture(): (!HasTexture())";
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 return *texture_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
170 void TextureBaseSceneLayer::SetTransform(const AffineTransform2D& transform)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
171 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
172 transform_.reset(new AffineTransform2D(transform));
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
173 IncrementRevision();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
174 }
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
175
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
176
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
177 void TextureBaseSceneLayer::ClearTransform()
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
178 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
179 transform_.reset(NULL);
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
180 IncrementRevision();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
181 }
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
182
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
183
1769
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
184 void TextureBaseSceneLayer::SetCuttingPlaneTransform(const CoordinateSystem3D& cuttingPlane,
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
185 const Vector& origin,
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
186 const Vector& pixelOffsetX,
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
187 const Vector& pixelOffsetY)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
188 {
1775
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
189 /**
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
190 * Shift from the center of the voxel (DICOM convention for 3D
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
191 * slices) to the corner of the voxel, because 2D textures are
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
192 * expressed relatively to their borders. (*)
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
193 **/
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
194 Vector p = origin + cuttingPlane.GetOrigin() - 0.5 * pixelOffsetX - 0.5 * pixelOffsetY;
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
195
1769
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
196 double x0, y0, x1, y1, x2, y2;
1775
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
197 cuttingPlane.ProjectPoint(x0, y0, p);
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
198 cuttingPlane.ProjectPoint(x1, y1, p + pixelOffsetX);
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
199 cuttingPlane.ProjectPoint(x2, y2, p + pixelOffsetY);
1769
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
200
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
201 /**
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
202
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
203 A = [ a11 a12 ; a21 a22 ]
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
204
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
205 (1) A * (0 ; 0) + (b1 ; b2) = (x0 ; y0)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
206 (2) A * (1 ; 0) + (b1 ; b2) = (x1 ; y1)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
207 (3) A * (0 ; 1) + (b1 ; b2) = (x2 ; y2)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
208
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
209 (2-1) A * (1 ; 0) = (x1 - x0 ; y1 - y0) <=> (a11 ; a21) = (x1 - x0 ; y1 - y0)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
210 (3-1) A * (0 ; 1) = (x2 - x0 ; y2 - y0) <=> (a12 ; a22) = (x2 - x0 ; y2 - y0)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
211
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
212 **/
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
213
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
214 Matrix m(3, 3);
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
215 m(0, 0) = x1 - x0; // a11
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
216 m(0, 1) = x2 - x0; // a12
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
217 m(0, 2) = x0; // b1
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
218 m(1, 0) = y1 - y0; // a21
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
219 m(1, 1) = y2 - y0; // a22
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
220 m(1, 2) = y0; // b2
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
221 m(2, 0) = 0;
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
222 m(2, 1) = 0;
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
223 m(2, 2) = 1;
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
224
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
225 SetTransform(AffineTransform2D(m));
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
226 }
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
227
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
228
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 AffineTransform2D TextureBaseSceneLayer::GetTransform() const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 {
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
231 if (transform_.get() == NULL)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
232 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
233 unsigned int width = 0;
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
234 unsigned int height = 0;
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
235
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
236 if (texture_.get() != NULL)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
237 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
238 width = texture_->GetWidth();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
239 height = texture_->GetHeight();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
240 }
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
241
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
242 return AffineTransform2D::Combine(
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
243 AffineTransform2D::CreateOffset(originX_, originY_),
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
244 AffineTransform2D::CreateRotation(angle_),
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
245 AffineTransform2D::CreateScaling(pixelSpacingX_, pixelSpacingY_),
1775
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
246 AffineTransform2D::CreateOffset(-0.5, -0.5), // (*)
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
247 AffineTransform2D::CreateFlip(flipX_, flipY_, width, height));
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
248 }
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
249 else
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
250 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
251 return *transform_;
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
252 }
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255
1610
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
256 void TextureBaseSceneLayer::GetBoundingBox(Extent2D& target) const
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 {
1610
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
258 target.Clear();
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
259
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
260 if (texture_.get() != NULL)
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 const AffineTransform2D t = GetTransform();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 double x, y;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 }