Skip to content
Snippets Groups Projects
Commit 9dbd938e authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

Work in progress

parent 39b01bb5
No related branches found
No related tags found
No related merge requests found
......@@ -15,13 +15,13 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbNetworkedQuadTreeTransform_h
#define __otbNetworkedQuadTreeTransform_h
#ifndef __otbTileMapTransform_h
#define __otbTileMapTransform_h
#include <iostream>
#include <sstream>
#include <stdio.h>
// #include "projection/ossimNetworkedQuadTreeTransform.h"
// #include "projection/ossimTileMapTransform.h"
#include "itkTransform.h"
#include "itkExceptionObject.h"
#include "itkMacro.h"
......@@ -31,13 +31,13 @@ PURPOSE. See the above copyright notices for more information.
#include "base/ossimEllipsoid.h"
#include "base/ossimEllipsoidFactory.h"
#include "base/ossimString.h"
#include "ossim/projection/ossimNetworkedQuadTreeModel.h"
#include "ossim/projection/ossimTileMapModel.h"
#include "otbMapProjection.h"
namespace otb
{
/** \class otbNetworkedQuadTreeTransform
/** \class otbTileMapTransform
* \brief to do
**/
......@@ -46,7 +46,7 @@ namespace otb
class TScalarType = double,
unsigned int NInputDimensions=2,
unsigned int NOutputDimensions=2>
class ITK_EXPORT NetworkedQuadTreeTransform: public itk::Transform<TScalarType, // Data type for scalars
class ITK_EXPORT TileMapTransform: public itk::Transform<TScalarType, // Data type for scalars
NInputDimensions, // Number of dimensions in the input space
NOutputDimensions> // Number of dimensions in the output space
{
......@@ -55,12 +55,12 @@ namespace otb
typedef itk::Transform< TScalarType,
NInputDimensions,
NOutputDimensions > Superclass;
typedef NetworkedQuadTreeTransform Self;
typedef TileMapTransform Self;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef typename Superclass::ScalarType ScalarType;
typedef ossimNetworkedQuadTreeModel OssimNetworkedQuadTreeTransformType;
typedef ossimTileMapModel OssimTileMapTransformType;
typedef itk::Point<ScalarType,NInputDimensions > InputPointType;
typedef itk::Point<ScalarType,NOutputDimensions > OutputPointType;
......@@ -68,7 +68,7 @@ namespace otb
itkNewMacro( Self );
/** Run-time type information (and related methods). */
itkTypeMacro( NetworkedQuadTreeTransform, Transform );
itkTypeMacro( TileMapTransform, Transform );
typedef InverseOrForwardTransformationEnum DirectionOfMappingEnumType;
......@@ -111,19 +111,19 @@ namespace otb
virtual void PrintMap() const ;
protected:
NetworkedQuadTreeTransform();
virtual ~NetworkedQuadTreeTransform();
OssimNetworkedQuadTreeTransformType* m_NetworkedQuadTreeTransform;
TileMapTransform();
virtual ~TileMapTransform();
OssimTileMapTransformType* m_TileMapTransform;
private :
NetworkedQuadTreeTransform(const Self&); //purposely not implemented
TileMapTransform(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
};
} // namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbNetworkedQuadTreeTransform.txx"
#include "otbTileMapTransform.txx"
#endif
#endif
......@@ -15,35 +15,35 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbNetworkedQuadTreeTransform_txx
#define __otbNetworkedQuadTreeTransform_txx
#ifndef __otbTileMapTransform_txx
#define __otbTileMapTransform_txx
#include "otbNetworkedQuadTreeTransform.h"
#include "otbTileMapTransform.h"
#include "otbMacro.h"
namespace otb
{
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::NetworkedQuadTreeTransform() : Superclass(SpaceDimension,ParametersDimension)
TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::TileMapTransform() : Superclass(SpaceDimension,ParametersDimension)
{
m_NetworkedQuadTreeTransform = new OssimNetworkedQuadTreeTransformType();
m_TileMapTransform = new OssimTileMapTransformType();
}
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::~NetworkedQuadTreeTransform()
TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::~TileMapTransform()
{
delete m_NetworkedQuadTreeTransform;
delete m_TileMapTransform;
}
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
typename NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>::OutputPointType
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
typename TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>::OutputPointType
TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::TransformPoint(const InputPointType & point) const
{
OutputPointType outputPoint;
......@@ -59,9 +59,9 @@ namespace otb
//map projection
ossimGpt ossimGPoint;
// ossimGPoint=m_NetworkedQuadTreeTransform->inverse(ossimDPoint);
m_NetworkedQuadTreeTransform->lineSampleToWorld(ossimDPoint, ossimGPoint);
// otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << m_NetworkedQuadTreeTransform->print(std::cout));
// ossimGPoint=m_TileMapTransform->inverse(ossimDPoint);
m_TileMapTransform->lineSampleToWorld(ossimDPoint, ossimGPoint);
// otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << m_TileMapTransform->print(std::cout));
outputPoint[0]=ossimGPoint.lon;
outputPoint[1]=ossimGPoint.lat;
......@@ -76,9 +76,9 @@ namespace otb
//map projection
ossimDpt ossimDPoint;
// ossimDPoint=m_NetworkedQuadTreeTransform->forward(ossimGPoint);
m_NetworkedQuadTreeTransform->worldToLineSample(ossimGPoint, ossimDPoint);
// otbGenericMsgDebugMacro(<< "Forward : ========================= " << std::endl << m_NetworkedQuadTreeTransform->print(std::cout));
// ossimDPoint=m_TileMapTransform->forward(ossimGPoint);
m_TileMapTransform->worldToLineSample(ossimGPoint, ossimDPoint);
// otbGenericMsgDebugMacro(<< "Forward : ========================= " << std::endl << m_TileMapTransform->print(std::cout));
outputPoint[0]=ossimDPoint.x;
outputPoint[1]=ossimDPoint.y;
......@@ -100,11 +100,11 @@ namespace otb
///\return The geographic point corresponding to (0,0)
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
typename NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>::InputPointType
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
typename TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>::InputPointType
TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::Origin()
{
ossimGpt ossimOrigin=m_NetworkedQuadTreeTransform->origin();
ossimGpt ossimOrigin=m_TileMapTransform->origin();
InputPointType otbOrigin;
otbOrigin[0]= ossimOrigin.lat;
otbOrigin[1]= ossimOrigin.lon;
......@@ -118,17 +118,17 @@ namespace otb
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::PrintMap() const
{
std::cout << m_NetworkedQuadTreeTransform->print(std::cout);
std::cout << m_TileMapTransform->print(std::cout);
}
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
void TileMapTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::SetLevel(unsigned char level)
{
m_NetworkedQuadTreeTransform->setDepth(level);
m_TileMapTransform->setDepth(level);
}
} // namespace otb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment