From 6550f19921a405f4f7a85e554a26f5cd915a4c6b Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Sat, 5 Mar 2011 23:13:07 -0800 Subject: [PATCH] COMP: remove switch case --- Code/Projections/otbGeocentricTransform.txx | 24 ++++++--------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/Code/Projections/otbGeocentricTransform.txx b/Code/Projections/otbGeocentricTransform.txx index 5ed52dd089..467d45164c 100644 --- a/Code/Projections/otbGeocentricTransform.txx +++ b/Code/Projections/otbGeocentricTransform.txx @@ -50,29 +50,17 @@ GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDi { OutputPointType outputPoint; - switch (DirectionOfMapping) + if (DirectionOfMapping == INVERSE) { - case INVERSE: - { - m_Ellipsoid->XYZToLatLonHeight(point[0], point[1], point[2], outputPoint[1], outputPoint[0], outputPoint[2]); - break; - } - case FORWARD: - { - m_Ellipsoid->latLonHeightToXYZ(point[1], point[0], point[2], outputPoint[0], outputPoint[1], outputPoint[2]); - - break; - } - default: - { - itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); - break; - } + m_Ellipsoid->XYZToLatLonHeight(point[0], point[1], point[2], outputPoint[1], outputPoint[0], outputPoint[2]); + } + if (DirectionOfMapping == FORWARD) + { + m_Ellipsoid->latLonHeightToXYZ(point[1], point[0], point[2], outputPoint[0], outputPoint[1], outputPoint[2]); } //To be completed return outputPoint; } } // namespace otb - #endif -- GitLab