OTB  6.7.0
Orfeo Toolbox
otbCompositeTransform.h
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 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,
55  class TSecondTransform,
56  class TScalarType = typename TFirstTransform::ScalarType,
57  unsigned int NInputDimensions = TFirstTransform::InputSpaceDimension,
58  unsigned int NOutputDimensions = TSecondTransform::OutputSpaceDimension>
59 class ITK_EXPORT CompositeTransform : public Transform<TScalarType, // Data type for scalars
60  NInputDimensions, // Number of dimensions in the input space
61  NOutputDimensions> // Number of dimensions in the output space
62 {
63 public:
64 
66  typedef Transform<TScalarType,
67  NInputDimensions,
68  NOutputDimensions> Superclass;
72 
73  typedef TFirstTransform FirstTransformType;
74  typedef typename TFirstTransform::Pointer FirstTransformPointerType;
75  typedef TSecondTransform SecondTransformType;
76  typedef typename TSecondTransform::Pointer SecondTransformPointerType;
77 
79  // typedef typename TFirstTransform::InputVectorType FirstTransformInputVectorType;
80  // typedef typename TFirstTransform::OutputVectorType FirstTransformOutputVectorType;
81 
83  // typedef typename TFirstTransform::InputCovariantVectorType FirstTransformInputCovariantVectorType;
84  // typedef typename TFirstTransform::OutputCovariantVectorType FirstTransformOutputCovariantVectorType;
85 
87  // typedef typename TFirstTransform::InputVnlVectorType FirstTransformInputVnlVectorType;
88  // typedef typename TFirstTransform::OutputVnlVectorType FirstTransformOutputVnlVectorType;
89 
91  typedef typename Superclass::InputPointType FirstTransformInputPointType;
92  typedef typename TFirstTransform::OutputPointType FirstTransformOutputPointType;
93 
97  typedef typename Superclass::OutputPointType SecondTransformOutputPointType;
98 
100  itkNewMacro(Self);
101 
103  itkTypeMacro(CompositeTransform, Transform);
104 
105  itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
106  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
107  itkStaticConstMacro(SpaceDimension, unsigned int, NInputDimensions);
108  itkStaticConstMacro(ParametersDimension, unsigned int, NInputDimensions * (NInputDimensions + 1));
109 
111  itkSetObjectMacro(FirstTransform, FirstTransformType);
112 
114  itkSetObjectMacro(SecondTransform, SecondTransformType);
115 
117  itkGetConstReferenceMacro(FirstTransform, FirstTransformPointerType);
118  itkGetConstReferenceMacro(SecondTransform, SecondTransformPointerType);
120 
122  SecondTransformOutputPointType TransformPoint(const FirstTransformInputPointType&) const override;
123 
125  // virtual OutputVectorType TransformVector(const InputVectorType &) const;
126 
128  // virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const;
129 
131  // virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const;
132 
133 protected:
135  ~CompositeTransform() override;
136 
139 
140 private:
141  CompositeTransform(const Self &) = delete;
142  void operator =(const Self&) = delete;
143 
144 };
145 
146 } // namespace otb
147 
148 #ifndef OTB_MANUAL_INSTANTIATION
149 #include "otbCompositeTransform.hxx"
150 #endif
151 
152 #endif
Superclass::InputPointType FirstTransformInputPointType
SecondTransformPointerType m_SecondTransform
TFirstTransform::OutputPointType FirstTransformOutputPointType
itk::SmartPointer< Self > Pointer
TSecondTransform SecondTransformType
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'...
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:40