OTB  9.0.0
Orfeo Toolbox
otbGenericMapProjection.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 
69  itkTypeMacro(GenericMapProjection, Transform);
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
otb::TransformDirection
TransformDirection
Definition: otbTransform.h:30
otb::GenericMapProjection::m_MapProjection
std::unique_ptr< CoordinateTransformation > m_MapProjection
Definition: otbGenericMapProjection.h:94
otb::GenericMapProjection::Self
GenericMapProjection Self
Definition: otbGenericMapProjection.h:57
otbTransform.h
otb::Transform::ScalarType
TScalarType ScalarType
Definition: otbTransform.h:71
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::GenericMapProjection::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbGenericMapProjection.h:59
otb::GenericMapProjection
This is the base class for generic map projection transformation.
Definition: otbGenericMapProjection.h:50
otbGenericMapProjection.hxx
otbCoordinateTransformation.h
otb::GenericMapProjection::OutputPointType
itk::Point< ScalarType, NOutputDimensions > OutputPointType
Definition: otbGenericMapProjection.h:63
otb::GenericMapProjection::ScalarType
Superclass::ScalarType ScalarType
Definition: otbGenericMapProjection.h:61
otb::Transform
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:39
otb::GenericMapProjection::InputPointType
itk::Point< ScalarType, NInputDimensions > InputPointType
Definition: otbGenericMapProjection.h:62
otb::GenericMapProjection::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGenericMapProjection.h:58
otb::GenericMapProjection::Superclass
Transform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
Definition: otbGenericMapProjection.h:56