diff --git a/Code/Projections/otbGeocentricTransform.h b/Code/Projections/otbGeocentricTransform.h new file mode 100644 index 0000000000000000000000000000000000000000..381ada6175b4e620a09f248455324db34912b34a --- /dev/null +++ b/Code/Projections/otbGeocentricTransform.h @@ -0,0 +1,87 @@ +/*========================================================================= + +Program: ORFEO Toolbox +Language: C++ +Date: $Date$ +Version: $Revision$ + + +Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. +See OTBCopyright.txt for details. + + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbGeocentricTransform_h +#define __otbGeocentricTransform_h + +#include "itkTransform.h" +#include "otbGenericMapProjection.h" + +#include "base/ossimEllipsoid.h" + +namespace otb +{ + template <InverseOrForwardTransformationEnum TDirectionOfMapping, + class TScalarType = double, + unsigned int NInputDimensions=3, + unsigned int NOutputDimensions=3> + class ITK_EXPORT GeocentricTransform: public itk::Transform<TScalarType, // Data type for scalars + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space + { + public : + /** Standard class typedefs. */ + typedef itk::Transform< TScalarType, + NInputDimensions, + NOutputDimensions > Superclass; + typedef GeocentricTransform Self; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + typedef typename Superclass::ScalarType ScalarType; + typedef ossimProjection OssimMapProjectionType; + typedef itk::Point<ScalarType,NInputDimensions > InputPointType; + typedef itk::Point<ScalarType,NOutputDimensions > OutputPointType; + + /** Method for creation through the object factory. */ + itkNewMacro( Self ); + + /** Run-time type information (and related methods). */ + itkTypeMacro( GeocentricTransform, itk::Transform ); + + + typedef InverseOrForwardTransformationEnum DirectionOfMappingEnumType; + + itkStaticConstMacro(DirectionOfMapping,DirectionOfMappingEnumType,TDirectionOfMapping); + itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions); + itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions); + itkStaticConstMacro(SpaceDimension, unsigned int, NInputDimensions); + itkStaticConstMacro(ParametersDimension, unsigned int,NInputDimensions*(NInputDimensions+1)); + + + OutputPointType TransformPoint(const InputPointType &point) const; + + + protected: + GeocentricTransform(); + virtual ~GeocentricTransform(); + ossimEllipsoid* m_Ellipsoid; + + private : + GeocentricTransform(const Self&); //purposely not implemented + void operator=(const Self&); //purposely not implemented + + }; + +} // namespace otb + +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbGeocentricTransform.txx" +#endif + + +#endif diff --git a/Code/Projections/otbGeocentricTransform.txx b/Code/Projections/otbGeocentricTransform.txx new file mode 100644 index 0000000000000000000000000000000000000000..4596797b08505d2648e512c8f70d1eeabb03205b --- /dev/null +++ b/Code/Projections/otbGeocentricTransform.txx @@ -0,0 +1,57 @@ +/*========================================================================= + +Program: ORFEO Toolbox +Language: C++ +Date: $Date$ +Version: $Revision$ + + +Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. +See OTBCopyright.txt for details. + + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbGeocentricTransform_txx +#define __otbGeocentricTransform_txx + +#include "otbGeocentricTransform.h" + +namespace otb +{ + + template<InverseOrForwardTransformationEnum TransformDirection, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions> + GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions> + ::GeocentricTransform() : Superclass(SpaceDimension,ParametersDimension) + { + m_Ellipsoid = new ossimEllipsoid(); + } + + template<InverseOrForwardTransformationEnum TransformDirection, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions> + GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions> + ::~GeocentricTransform() + { + if (m_Ellipsoid != NULL) + { + delete m_Ellipsoid; + } + } + + template<InverseOrForwardTransformationEnum TransformDirection, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions> + typename GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions>::OutputPointType + GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions> + ::TransformPoint(const InputPointType & point) const + { + OutputPointType outputPoint; + + //To be completed + return outputPoint; + } + + +} // namespace otb + +#endif