annotate OrthancStone/Sources/Scene2D/TextureBaseSceneLayer.cpp @ 1800:2c0497d61a5d

unserialization of annotations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 May 2021 12:05:15 +0200
parents 6e8105942146
children 3889ae96d2e9
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
1739
9ac2a65d4172 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1624
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * 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
8 * modify it under the terms of the GNU Lesser General Public License
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * 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
14 * 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
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
16 *
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
17 * 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
18 * 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
19 * <http://www.gnu.org/licenses/>.
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
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 #include "TextureBaseSceneLayer.h"
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
1624
59f95b9ea858 fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
25 #include <Logging.h>
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
26 #include <OrthancException.h>
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace OrthancStone
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
30 void TextureBaseSceneLayer::CheckNoManualTransform() const
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
31 {
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
32 if (transform_.get() != NULL)
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
33 {
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
34 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls,
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
35 "A transform has been manually set, first call ClearTransform()");
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
36 }
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
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 void TextureBaseSceneLayer::SetTexture(Orthanc::ImageAccessor* texture)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 if (texture == NULL)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 texture_.reset(texture);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 }
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 void TextureBaseSceneLayer::CopyParameters(const TextureBaseSceneLayer& other)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 originX_ = other.originX_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 originY_ = other.originY_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 pixelSpacingX_ = other.pixelSpacingX_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 pixelSpacingY_ = other.pixelSpacingY_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 angle_ = other.angle_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 isLinearInterpolation_ = other.isLinearInterpolation_;
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
62 flipX_ = other.flipX_;
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
63 flipY_ = other.flipY_;
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
64
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
65 if (other.transform_.get() != NULL)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
66 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
67 transform_.reset(new AffineTransform2D(*other.transform_));
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
68 }
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 }
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 TextureBaseSceneLayer::TextureBaseSceneLayer() :
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 originX_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 originY_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 pixelSpacingX_(1),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 pixelSpacingY_(1),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 angle_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 isLinearInterpolation_(false),
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
79 flipX_(false),
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
80 flipY_(false),
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 revision_(0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 if (pixelSpacingX_ <= 0 ||
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 pixelSpacingY_ <= 0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 }
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 void TextureBaseSceneLayer::SetOrigin(double x,
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 double y)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
94 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
95
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 originX_ = x;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 originY_ = y;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
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 void TextureBaseSceneLayer::SetPixelSpacing(double sx,
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 double sy)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
105 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
106
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 if (sx <= 0 ||
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 sy <= 0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 pixelSpacingX_ = sx;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 pixelSpacingY_ = sy;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 }
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 void TextureBaseSceneLayer::SetAngle(double angle)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
123 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
124
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 angle_ = angle;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 }
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 void TextureBaseSceneLayer::SetLinearInterpolation(bool isLinearInterpolation)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 isLinearInterpolation_ = isLinearInterpolation;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
137 void TextureBaseSceneLayer::SetFlipX(bool flip)
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
138 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
139 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
140
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
141 flipX_ = flip;
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
142 IncrementRevision();
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
143 }
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 void TextureBaseSceneLayer::SetFlipY(bool flip)
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
147 {
1787
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
148 CheckNoManualTransform();
6e8105942146 safeguard in TextureBaseSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1775
diff changeset
149
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
150 flipY_ = flip;
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
151 IncrementRevision();
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
152 }
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
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 const Orthanc::ImageAccessor& TextureBaseSceneLayer::GetTexture() const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 if (!HasTexture())
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 {
956
a7351ad54960 Made IsContextLost automatically set the flag by checking with the emscripten
Benjamin Golinvaux <bgo@osimis.io>
parents: 590
diff changeset
159 LOG(ERROR) << "TextureBaseSceneLayer::GetTexture(): (!HasTexture())";
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 return *texture_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 }
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
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
169 void TextureBaseSceneLayer::SetTransform(const AffineTransform2D& transform)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
170 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
171 transform_.reset(new AffineTransform2D(transform));
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
172 IncrementRevision();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
173 }
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 void TextureBaseSceneLayer::ClearTransform()
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
177 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
178 transform_.reset(NULL);
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
179 IncrementRevision();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
180 }
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
1769
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
183 void TextureBaseSceneLayer::SetCuttingPlaneTransform(const CoordinateSystem3D& cuttingPlane,
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
184 const Vector& origin,
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
185 const Vector& pixelOffsetX,
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
186 const Vector& pixelOffsetY)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
187 {
1775
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
188 /**
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
189 * 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
190 * 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
191 * expressed relatively to their borders. (*)
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
192 **/
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
193 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
194
1769
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
195 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
196 cuttingPlane.ProjectPoint(x0, y0, p);
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
197 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
198 cuttingPlane.ProjectPoint(x2, y2, p + pixelOffsetY);
1769
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
199
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 A = [ a11 a12 ; a21 a22 ]
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
203
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
204 (1) A * (0 ; 0) + (b1 ; b2) = (x0 ; y0)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
205 (2) A * (1 ; 0) + (b1 ; b2) = (x1 ; y1)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
206 (3) A * (0 ; 1) + (b1 ; b2) = (x2 ; y2)
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
207
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
208 (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
209 (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
210
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 Matrix m(3, 3);
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
214 m(0, 0) = x1 - x0; // a11
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
215 m(0, 1) = x2 - x0; // a12
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
216 m(0, 2) = x0; // b1
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
217 m(1, 0) = y1 - y0; // a21
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
218 m(1, 1) = y2 - y0; // a22
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
219 m(1, 2) = y0; // b2
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
220 m(2, 0) = 0;
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
221 m(2, 1) = 0;
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
222 m(2, 2) = 1;
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
223
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
224 SetTransform(AffineTransform2D(m));
a217140dd41a refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1768
diff changeset
225 }
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
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 AffineTransform2D TextureBaseSceneLayer::GetTransform() const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 {
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
230 if (transform_.get() == NULL)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
231 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
232 unsigned int width = 0;
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
233 unsigned int height = 0;
1554
6d14ed6163b1 flip x/y in Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
234
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
235 if (texture_.get() != NULL)
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
236 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
237 width = texture_->GetWidth();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
238 height = texture_->GetHeight();
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
239 }
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 return AffineTransform2D::Combine(
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
242 AffineTransform2D::CreateOffset(originX_, originY_),
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
243 AffineTransform2D::CreateRotation(angle_),
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
244 AffineTransform2D::CreateScaling(pixelSpacingX_, pixelSpacingY_),
1775
fca942f4b4a7 fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1770
diff changeset
245 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
246 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
247 }
1768
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
248 else
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
249 {
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
250 return *transform_;
226718777702 fix DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer() for opposite normals
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
251 }
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254
1610
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
255 void TextureBaseSceneLayer::GetBoundingBox(Extent2D& target) const
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 {
1610
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
257 target.Clear();
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
258
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
259 if (texture_.get() != NULL)
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 const AffineTransform2D t = GetTransform();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 double x, y;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 }