annotate Framework/Scene2D/TextureBaseSceneLayer.cpp @ 1455:30deba7bc8e2

simplifying include_directories
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Jun 2020 20:54:01 +0200
parents 2d8ab34c8c91
children
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
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 956
diff changeset
5 * Copyright (C) 2017-2020 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
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
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
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
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 #include "TextureBaseSceneLayer.h"
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
24 #include <OrthancException.h>
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 namespace OrthancStone
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 void TextureBaseSceneLayer::SetTexture(Orthanc::ImageAccessor* texture)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 if (texture == NULL)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 texture_.reset(texture);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 void TextureBaseSceneLayer::CopyParameters(const TextureBaseSceneLayer& other)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 originX_ = other.originX_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 originY_ = other.originY_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 pixelSpacingX_ = other.pixelSpacingX_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 pixelSpacingY_ = other.pixelSpacingY_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 angle_ = other.angle_;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 isLinearInterpolation_ = other.isLinearInterpolation_;
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 TextureBaseSceneLayer::TextureBaseSceneLayer() :
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 originX_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 originY_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 pixelSpacingX_(1),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 pixelSpacingY_(1),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 angle_(0),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 isLinearInterpolation_(false),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 revision_(0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 if (pixelSpacingX_ <= 0 ||
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 pixelSpacingY_ <= 0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 void TextureBaseSceneLayer::SetOrigin(double x,
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 double y)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 originX_ = x;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 originY_ = y;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 void TextureBaseSceneLayer::SetPixelSpacing(double sx,
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 double sy)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 if (sx <= 0 ||
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 sy <= 0)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 pixelSpacingX_ = sx;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 pixelSpacingY_ = sy;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 void TextureBaseSceneLayer::SetAngle(double angle)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 angle_ = angle;
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::SetLinearInterpolation(bool isLinearInterpolation)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 isLinearInterpolation_ = isLinearInterpolation;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 IncrementRevision();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 const Orthanc::ImageAccessor& TextureBaseSceneLayer::GetTexture() const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 if (!HasTexture())
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 {
956
a7351ad54960 Made IsContextLost automatically set the flag by checking with the emscripten
Benjamin Golinvaux <bgo@osimis.io>
parents: 590
diff changeset
114 LOG(ERROR) << "TextureBaseSceneLayer::GetTexture(): (!HasTexture())";
590
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 return *texture_;
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
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 AffineTransform2D TextureBaseSceneLayer::GetTransform() const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 return AffineTransform2D::Combine(
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 AffineTransform2D::CreateOffset(originX_, originY_),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 AffineTransform2D::CreateRotation(angle_),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 AffineTransform2D::CreateScaling(pixelSpacingX_, pixelSpacingY_),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 AffineTransform2D::CreateOffset(-0.5, -0.5));
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 bool TextureBaseSceneLayer::GetBoundingBox(Extent2D& target) const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 if (texture_.get() == NULL)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 return false;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 const AffineTransform2D t = GetTransform();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 target.Reset();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 double x, y;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 return true;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 }