From 47a5521a80d3f2f10dadeee51f2d6249eda2e463 Mon Sep 17 00:00:00 2001 From: Manuel Grizonnet <manuel.grizonnet@orfeo-toolbox.org> Date: Wed, 25 Jan 2012 18:34:19 +0100 Subject: [PATCH] STYLE:kwstyle --- .../otbGroundSpacingImageFunction.h | 3 ++- .../otbGroundSpacingImageFunction.txx | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Code/Projections/otbGroundSpacingImageFunction.h b/Code/Projections/otbGroundSpacingImageFunction.h index 5fc834cb12..95de418398 100644 --- a/Code/Projections/otbGroundSpacingImageFunction.h +++ b/Code/Projections/otbGroundSpacingImageFunction.h @@ -54,6 +54,7 @@ public: typedef itk::ImageFunction<TInputImage, FloatType , TCoordRep> Superclass; + typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -107,7 +108,7 @@ private: void operator =(const Self&); //purposely not implemented ValueType m_R; - ValueType m_deg2radCoef; + ValueType m_Deg2radCoef; }; } // end namespace otb diff --git a/Code/Projections/otbGroundSpacingImageFunction.txx b/Code/Projections/otbGroundSpacingImageFunction.txx index 835aa87751..9746b47c47 100644 --- a/Code/Projections/otbGroundSpacingImageFunction.txx +++ b/Code/Projections/otbGroundSpacingImageFunction.txx @@ -38,7 +38,7 @@ GroundSpacingImageFunction<TInputImage, TCoordRep> ::GroundSpacingImageFunction() { m_R = 6371000; - m_deg2radCoef = CONST_PI / 180; + m_Deg2radCoef = CONST_PI / 180; } /** @@ -87,22 +87,22 @@ GroundSpacingImageFunction<TInputImage, TCoordRep> PointType pointSrcX = this->GetPixelLocation(indexSrcX); PointType pointSrcY = this->GetPixelLocation(indexSrcY); - ValueType dLatX = (vcl_fabs(pointSrcX[1] - point[1])) * m_deg2radCoef; - ValueType dLonX = (vcl_fabs(pointSrcX[0] - point[0])) * m_deg2radCoef; + ValueType dLatX = (vcl_fabs(pointSrcX[1] - point[1])) * m_Deg2radCoef; + ValueType dLonX = (vcl_fabs(pointSrcX[0] - point[0])) * m_Deg2radCoef; const ValueType One = itk::NumericTraits<ValueType>::One; const ValueType Two = One + One; - ValueType aX = vcl_sin(dLatX / Two) * vcl_sin(dLatX / Two) + vcl_cos(point[1] * m_deg2radCoef) * vcl_cos( - pointSrcX[1] * m_deg2radCoef) * vcl_sin(dLonX / Two) * vcl_sin(dLonX / Two); + ValueType aX = vcl_sin(dLatX / Two) * vcl_sin(dLatX / Two) + vcl_cos(point[1] * m_Deg2radCoef) * vcl_cos( + pointSrcX[1] * m_Deg2radCoef) * vcl_sin(dLonX / Two) * vcl_sin(dLonX / Two); ValueType cX = Two * vcl_atan2(vcl_sqrt(aX), vcl_sqrt(One - aX)); ValueType dX = m_R * cX; - ValueType dLatY = (vcl_fabs(pointSrcY[1] - point[1])) * m_deg2radCoef; - ValueType dLonY = (vcl_fabs(pointSrcY[0] - point[0])) * m_deg2radCoef; + ValueType dLatY = (vcl_fabs(pointSrcY[1] - point[1])) * m_Deg2radCoef; + ValueType dLonY = (vcl_fabs(pointSrcY[0] - point[0])) * m_Deg2radCoef; - ValueType aY = vcl_sin(dLatY / Two) * vcl_sin(dLatY / Two) + vcl_cos(point[1] * m_deg2radCoef) * vcl_cos( - pointSrcY[1] * m_deg2radCoef) * vcl_sin(dLonY / Two) * vcl_sin(dLonY / Two); + ValueType aY = vcl_sin(dLatY / Two) * vcl_sin(dLatY / Two) + vcl_cos(point[1] * m_Deg2radCoef) * vcl_cos( + pointSrcY[1] * m_Deg2radCoef) * vcl_sin(dLonY / Two) * vcl_sin(dLonY / Two); ValueType cY = Two * vcl_atan2(vcl_sqrt(aY), vcl_sqrt(One - aY)); ValueType dY = m_R * cY; -- GitLab