OTB  6.7.0
Orfeo Toolbox
otbInverseSensorModel.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 otbInverseSensorModel_hxx
22 #define otbInverseSensorModel_hxx
23 
24 #include "otbInverseSensorModel.h"
25 #include "otbMacro.h"
26 
27 namespace otb
28 {
29 
30 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
33 {
34 }
35 
36 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
39 {
40 }
41 
42 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
45 ::TransformPoint(const InputPointType& point) const
46 {
47  double lon = point[0];
48  double lat = point[1];
49  double x, y, z;
50 
51  if (InputPointType::PointDimension == 3)
52  {
53  double h = point[2];
54 
55  this->m_Model->InverseTransformPoint(lon, lat, h, x, y, z);
56  }
57  else
58  {
59  this->m_Model->InverseTransformPoint(lon, lat, x, y, z);
60  }
61 
62  OutputPointType outputPoint;
63 
64  outputPoint[0] = x;
65  outputPoint[1] = y;
66 
67  if (OutputPointType::PointDimension == 3)
68  {
69  outputPoint[2] = z;
70  }
71 
72  return outputPoint;
73 }
74 
75 
76 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
77 void
79 ::PrintSelf(std::ostream& os, itk::Indent indent) const
80 {
81  Superclass::PrintSelf(os, indent);
82 }
83 
84 } // namespace otb
85 
86 #endif
Superclass::InputPointType InputPointType
OutputPointType TransformPoint(const InputPointType &point) const override
void PrintSelf(std::ostream &os, itk::Indent indent) const override