OTB  6.7.0
Orfeo Toolbox
otbForwardSensorModel.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbForwardSensorModel_hxx
22 #define otbForwardSensorModel_hxx
23 
24 #include "otbForwardSensorModel.h"
25 #include "otbMacro.h"
26 
27 namespace otb
28 {
29 
30 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
33 {}
34 
35 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
38 {}
39 
40 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
43 ::TransformPoint(const InputPointType& point) const
44 {
45  double x = point[0];
46  double y = point[1];
47 
48  double lon, lat, h;
49 
50  if (InputPointType::PointDimension == 3)
51  {
52  double z = point[2];
53 
54  this->m_Model->ForwardTransformPoint(x, y, z, lon, lat, h);
55  }
56  else
57  {
58  this->m_Model->ForwardTransformPoint(x, y, lon, lat, h);
59  }
60 
61  OutputPointType outputPoint;
62  outputPoint[0] = lon;
63  outputPoint[1] = lat;
64 
65  if (OutputPointType::PointDimension == 3)
66  {
67  outputPoint[2] = h;
68  }
69  return outputPoint;
70 }
71 
72 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
73 void
75 ::PrintSelf(std::ostream& os, itk::Indent indent) const
76 {
77  Superclass::PrintSelf(os, indent);
78 }
79 
80 } // namespace otb
81 
82 #endif
Superclass::OutputPointType OutputPointType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Superclass::InputPointType InputPointType
OutputPointType TransformPoint(const InputPointType &point) const override