Commit e615d94f authored by Cédric Traizet's avatar Cédric Traizet
Browse files

REFAC: adds a constructor to GDALRPCTransformer taking a RPCParam struct as input

parent 14dc9359
......@@ -44,10 +44,7 @@ bool RPCTransformBase<TScalarType, NInputDimensions, NOutputDimensions>::SetMeta
}
constexpr bool useDEM = NInputDimensions == 2 ? true : false;
this->m_Transformer = std::make_unique<GDALRPCTransformer>(
m_RPCParam->LineOffset, m_RPCParam->SampleOffset, m_RPCParam->LatOffset, m_RPCParam->LonOffset, m_RPCParam->HeightOffset,
m_RPCParam->LineScale, m_RPCParam->SampleScale, m_RPCParam->LatScale, m_RPCParam->LonScale, m_RPCParam->HeightScale,
m_RPCParam->LineNum, m_RPCParam->LineDen, m_RPCParam->SampleNum, m_RPCParam->SampleDen, useDEM);
this->m_Transformer = std::make_unique<GDALRPCTransformer>(*m_RPCParam, useDEM);
return true;
}
......
......@@ -24,6 +24,7 @@
#include "gdal_alg.h"
#include "otbDEMHandler.h"
#include "otbGeometryMetadata.h"
#include <mutex>
......@@ -66,6 +67,9 @@ public:
GDALRPCTransformer(double LineOffset, double SampleOffset, double LatOffset, double LonOffset, double HeightOffset,
double LineScale, double SampleScale, double LatScale, double LonScale, double HeightScale,
const double (&LineNum)[20], const double (&LineDen)[20], const double (&SampleNum)[20], const double (&SampleDen)[20], bool useDEM);
GDALRPCTransformer(const Projection::RPCParam &, bool useDEM);
~GDALRPCTransformer();
/**
......
......@@ -61,6 +61,14 @@ GDALRPCTransformer::GDALRPCTransformer(double LineOffset, double SampleOffset, d
this->SetOption("RPC_PIXEL_ERROR_THRESHOLD", "0.000001");
}
GDALRPCTransformer::GDALRPCTransformer(const Projection::RPCParam & param, bool useDEM)
: GDALRPCTransformer( param.LineOffset, param.SampleOffset, param.LatOffset, param.LonOffset, param.HeightOffset,
param.LineScale, param.SampleScale, param.LatScale, param.LonScale, param.HeightScale,
param.LineNum, param.LineDen, param.SampleNum, param.SampleDen,
useDEM)
{
}
GDALRPCTransformer::~GDALRPCTransformer()
{
if(m_TransformArg != nullptr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment