OTB  10.0.0
Orfeo Toolbox
otbGenericMapProjection.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbGenericMapProjection_h
22 #define otbGenericMapProjection_h
23 
24 #include <sstream>
25 
26 #include "otbTransform.h"
27 #include "itkMacro.h"
29 #include <string>
30 
31 namespace otb
32 {
48 template <TransformDirection TDirectionOfMapping, class TScalarType = double, unsigned int NInputDimensions = 2,
49  unsigned int NOutputDimensions = 2>
50 class ITK_EXPORT GenericMapProjection : public Transform<TScalarType, // Data type for scalars
51  NInputDimensions, // Number of dimensions in the input space
52  NOutputDimensions> // Number of dimensions in the output space
53 {
54 public:
58  typedef itk::SmartPointer<Self> Pointer;
59  typedef itk::SmartPointer<const Self> ConstPointer;
60 
62  typedef itk::Point<ScalarType, NInputDimensions> InputPointType;
63  typedef itk::Point<ScalarType, NOutputDimensions> OutputPointType;
64 
66  itkNewMacro(Self);
67 
70 
71  static const TransformDirection DirectionOfMapping = TDirectionOfMapping;
72 
73  itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
74  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
75  itkStaticConstMacro(SpaceDimension, unsigned int, NInputDimensions);
76  itkStaticConstMacro(ParametersDimension, unsigned int, NInputDimensions*(NInputDimensions + 1));
77 
79  virtual std::string GetWkt();
80 
82  virtual void SetWkt(const std::string& projectionRefWkt);
83 
84  OutputPointType TransformPoint(const InputPointType& point) const override;
85 
86  bool IsProjectionDefined() const;
87 
88 protected:
90  ~GenericMapProjection() override;
91 
92  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
93 
94  std::unique_ptr<CoordinateTransformation> m_MapProjection;
95 
96 private:
97  GenericMapProjection(const Self&) = delete;
98  void operator=(const Self&) = delete;
99 };
100 
101 } // namespace otb
102 
103 #ifndef OTB_MANUAL_INSTANTIATION
105 #endif
106 
107 #endif
This is the base class for generic map projection transformation.
itk::SmartPointer< const Self > ConstPointer
Superclass::ScalarType ScalarType
itk::SmartPointer< Self > Pointer
Transform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
itk::Point< ScalarType, NOutputDimensions > OutputPointType
void operator=(const Self &)=delete
GenericMapProjection(const Self &)=delete
itk::Point< ScalarType, NInputDimensions > InputPointType
std::unique_ptr< CoordinateTransformation > m_MapProjection
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:42
TScalarType ScalarType
Definition: otbTransform.h:71
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
TransformDirection
Definition: otbTransform.h:30