OTB  7.4.0
Orfeo Toolbox
otbCompositeTransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2020 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 otbCompositeTransform_h
22 #define otbCompositeTransform_h
23 
24 #include <sstream>
25 #include <stdio.h>
26 #include "otbTransform.h"
27 #include "itkMacro.h"
28 
29 namespace otb
30 {
31 
44 // typedef enum
45 //{
46 // PROJDEFAULT=0,
47 // PROJIDENTITY=1,
48 // PROJMAPFORWARD=2,
49 // PROJMAPINVERSE=3,
50 // PROJSENSORFORWARD=4,
51 // PROJSENSORINVERSE=5
52 //} ProjectionTypeEnum;
53 
54 template <class TFirstTransform, class TSecondTransform, class TScalarType = typename TFirstTransform::ScalarType,
55  unsigned int NInputDimensions = TFirstTransform::InputSpaceDimension,
56  unsigned int NOutputDimensions = TSecondTransform::OutputSpaceDimension>
57 class ITK_EXPORT CompositeTransform : public Transform<TScalarType, // Data type for scalars
58  NInputDimensions, // Number of dimensions in the input space
59  NOutputDimensions> // Number of dimensions in the output space
60 {
61 public:
65  typedef itk::SmartPointer<Self> Pointer;
66  typedef itk::SmartPointer<const Self> ConstPointer;
67 
68  typedef TFirstTransform FirstTransformType;
69  typedef typename TFirstTransform::Pointer FirstTransformPointerType;
70  typedef TSecondTransform SecondTransformType;
71  typedef typename TSecondTransform::Pointer SecondTransformPointerType;
72 
74  // typedef typename TFirstTransform::InputVectorType FirstTransformInputVectorType;
75  // typedef typename TFirstTransform::OutputVectorType FirstTransformOutputVectorType;
76 
78  // typedef typename TFirstTransform::InputCovariantVectorType FirstTransformInputCovariantVectorType;
79  // typedef typename TFirstTransform::OutputCovariantVectorType FirstTransformOutputCovariantVectorType;
80 
82  // typedef typename TFirstTransform::InputVnlVectorType FirstTransformInputVnlVectorType;
83  // typedef typename TFirstTransform::OutputVnlVectorType FirstTransformOutputVnlVectorType;
84 
87  typedef typename TFirstTransform::OutputPointType FirstTransformOutputPointType;
88 
93 
95  itkNewMacro(Self);
96 
98  itkTypeMacro(CompositeTransform, Transform);
99 
100  itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
101  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
102  itkStaticConstMacro(SpaceDimension, unsigned int, NInputDimensions);
103  itkStaticConstMacro(ParametersDimension, unsigned int, NInputDimensions*(NInputDimensions + 1));
104 
106  itkSetObjectMacro(FirstTransform, FirstTransformType);
107 
109  itkSetObjectMacro(SecondTransform, SecondTransformType);
110 
112  itkGetConstReferenceMacro(FirstTransform, FirstTransformPointerType);
113  itkGetConstReferenceMacro(SecondTransform, SecondTransformPointerType);
115 
117  SecondTransformOutputPointType TransformPoint(const FirstTransformInputPointType&) const override;
118 
120  // virtual OutputVectorType TransformVector(const InputVectorType &) const;
121 
123  // virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const;
124 
126  // virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const;
127 
128 protected:
130  ~CompositeTransform() override;
131 
132  FirstTransformPointerType m_FirstTransform;
133  SecondTransformPointerType m_SecondTransform;
134 
135 private:
136  CompositeTransform(const Self&) = delete;
137  void operator=(const Self&) = delete;
138 };
139 
140 } // namespace otb
141 
142 #ifndef OTB_MANUAL_INSTANTIATION
143 #include "otbCompositeTransform.hxx"
144 #endif
145 
146 #endif
itk::Point< TScalarType, NOutputDimensions > OutputPointType
Definition: otbTransform.h:95
Superclass::InputPointType FirstTransformInputPointType
SecondTransformPointerType m_SecondTransform
TFirstTransform::OutputPointType FirstTransformOutputPointType
itk::Point< TScalarType, NInputDimensions > InputPointType
Definition: otbTransform.h:94
itk::SmartPointer< Self > Pointer
TSecondTransform SecondTransformType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
TSecondTransform::Pointer SecondTransformPointerType
TFirstTransform FirstTransformType
Superclass::OutputPointType SecondTransformOutputPointType
FirstTransformPointerType m_FirstTransform
TFirstTransform::Pointer FirstTransformPointerType
Transform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
itk::SmartPointer< const Self > ConstPointer
Class which compose two itk::Transform to obtain one itk::Transform T1 T2 T3 (x, y) -> (x&#39;...
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:39