From b5e5f69684834ebf595cdc0fc6fdc9a88bf8ff22 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath <rashad.kanavath@c-s.fr> Date: Fri, 28 Aug 2015 10:11:01 +0200 Subject: [PATCH] Revert "use boost::lexical_cast from otbStringUtils" This reverts commit 0c2138ff30a77c5d421383c3a6766ebd9ff522c9. --- .../src/otbIkonosImageMetadataInterface.cxx | 2 +- .../src/otbPleiadesImageMetadataInterface.cxx | 38 ++++++++++--------- .../src/otbTerraSarImageMetadataInterface.cxx | 16 +++++--- .../otbWorldView2ImageMetadataInterface.cxx | 2 +- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Modules/Core/Metadata/src/otbIkonosImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbIkonosImageMetadataInterface.cxx index 7cf23145d8..1751f14b93 100644 --- a/Modules/Core/Metadata/src/otbIkonosImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbIkonosImageMetadataInterface.cxx @@ -18,7 +18,7 @@ #include "otbIkonosImageMetadataInterface.h" -#include "otbStringUtils.h" +#include <boost/algorithm/string.hpp> #include "itkMetaDataObject.h" #include "otbImageKeywordlist.h" diff --git a/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx index 54e14a358d..4dd3f84191 100644 --- a/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx @@ -18,17 +18,19 @@ #include "otbPleiadesImageMetadataInterface.h" +#include <boost/algorithm/string.hpp> #include "otbMacro.h" #include "itkMetaDataObject.h" #include "otbImageKeywordlist.h" - -#include "otbStringUtils.h" +#include <boost/lexical_cast.hpp> //useful constants #include <otbMath.h> namespace otb { +using boost::lexical_cast; +using boost::bad_lexical_cast; PleiadesImageMetadataInterface ::PleiadesImageMetadataInterface() @@ -223,9 +225,9 @@ PleiadesImageMetadataInterface::GetDay() const int value; try { - value = boost::lexical_cast<int> (outputValues[2]); + value = lexical_cast<int> (outputValues[2]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Day"); } @@ -261,9 +263,9 @@ PleiadesImageMetadataInterface::GetMonth() const int value; try { - value = boost::lexical_cast<int> (outputValues[1]); + value = lexical_cast<int> (outputValues[1]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Month"); } @@ -298,9 +300,9 @@ PleiadesImageMetadataInterface::GetYear() const int value; try { - value = boost::lexical_cast<int> (outputValues[0]); + value = lexical_cast<int> (outputValues[0]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Year"); } @@ -335,9 +337,9 @@ PleiadesImageMetadataInterface::GetHour() const int value; try { - value = boost::lexical_cast<int> (outputValues[3]); + value = lexical_cast<int> (outputValues[3]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Hour"); } @@ -372,9 +374,9 @@ PleiadesImageMetadataInterface::GetMinute() const int value; try { - value = boost::lexical_cast<int> (outputValues[4]); + value = lexical_cast<int> (outputValues[4]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Minute"); } @@ -409,9 +411,9 @@ PleiadesImageMetadataInterface::GetProductionDay() const int value; try { - value = boost::lexical_cast<int> (outputValues[2]); + value = lexical_cast<int> (outputValues[2]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Day"); } @@ -446,9 +448,9 @@ PleiadesImageMetadataInterface::GetProductionMonth() const int value; try { - value = boost::lexical_cast<int> (outputValues[1]); + value = lexical_cast<int> (outputValues[1]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Month"); } @@ -485,9 +487,9 @@ PleiadesImageMetadataInterface::GetProductionYear() const int value; try { - value = boost::lexical_cast<int> (outputValues[0]); + value = lexical_cast<int> (outputValues[0]); } - catch (boost::bad_lexical_cast &) + catch (bad_lexical_cast &) { itkExceptionMacro(<< "Invalid Year"); } diff --git a/Modules/Core/Metadata/src/otbTerraSarImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbTerraSarImageMetadataInterface.cxx index e1ab8dd2d5..05ce27346d 100644 --- a/Modules/Core/Metadata/src/otbTerraSarImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbTerraSarImageMetadataInterface.cxx @@ -17,6 +17,8 @@ =========================================================================*/ #include "otbTerraSarImageMetadataInterface.h" + +#include <boost/algorithm/string.hpp> #include "otbMath.h" #include "itkIndex.h" #include "itkMetaDataObject.h" @@ -1177,8 +1179,8 @@ TerraSarImageMetadataInterface for (unsigned int i = 0; i < cornerIncidenceAngleIndex.size(); ++i) { - p0[0] = cornerIncidenceAngleIndex[i][0]; - p0[1] = cornerIncidenceAngleIndex[i][1]; + p0[0] = cornerIncidenceAngleIndex.at(i)[0]; + p0[1] = cornerIncidenceAngleIndex.at(i)[1]; points->SetPoint(noPoint, p0); points->SetPointData(noPoint, cornerIncidenceAngleValue[i] * CONST_PI_180); @@ -1198,11 +1200,13 @@ TerraSarImageMetadataInterface return polynomSize; } -/** Get the R, G, B channel */ -TerraSarImageMetadataInterface::UIntVectorType -TerraSarImageMetadataInterface::GetDefaultDisplay() const + + /** Get the R, G, B channel */ +std::vector<unsigned int> +TerraSarImageMetadataInterface +::GetDefaultDisplay() const { - UIntVectorType rgb(3); + std::vector<unsigned int> rgb(3); rgb[0] = 0; rgb[1] = 0; rgb[2] = 0; diff --git a/Modules/Core/Metadata/src/otbWorldView2ImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbWorldView2ImageMetadataInterface.cxx index bd7c36eea4..7f78cf6280 100644 --- a/Modules/Core/Metadata/src/otbWorldView2ImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbWorldView2ImageMetadataInterface.cxx @@ -18,9 +18,9 @@ #include "otbWorldView2ImageMetadataInterface.h" +#include <boost/algorithm/string.hpp> #include "itkMetaDataObject.h" #include "otbImageKeywordlist.h" -#include "otbStringUtils.h" namespace otb { -- GitLab