annotate Framework/Scene2D/TextureBaseSceneLayer.cpp @ 670:5dd496343fad

Restored missing code + fixed key ordering when generating code
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 15 May 2019 18:29:42 +0200
parents 5430bcffba57
children a7351ad54960
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
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
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
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include <Core/OrthancException.h>
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 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 return *texture_;
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
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 AffineTransform2D TextureBaseSceneLayer::GetTransform() const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 return AffineTransform2D::Combine(
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 AffineTransform2D::CreateOffset(originX_, originY_),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 AffineTransform2D::CreateRotation(angle_),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 AffineTransform2D::CreateScaling(pixelSpacingX_, pixelSpacingY_),
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 AffineTransform2D::CreateOffset(-0.5, -0.5));
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 }
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 bool TextureBaseSceneLayer::GetBoundingBox(Extent2D& target) const
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 if (texture_.get() == NULL)
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 return false;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 else
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 {
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 const AffineTransform2D t = GetTransform();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 target.Reset();
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 double x, y;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 y = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 x = 0;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 x = static_cast<double>(texture_->GetWidth());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 y = static_cast<double>(texture_->GetHeight());
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 t.Apply(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 target.AddPoint(x, y);
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 return true;
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 }
5430bcffba57 FloatTextureSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 }