From ad3fb41512bbbaf27b7c747a6e76efae21073b48 Mon Sep 17 00:00:00 2001 From: Otmane Lahlou <otmane.lahlou@c-s.fr> Date: Tue, 13 Dec 2011 15:56:41 +0100 Subject: [PATCH] ENH: add a method to get the activity status of the group elevation --- .../otbWrapperElevationParametersHandler.cxx | 7 +++++++ .../otbWrapperElevationParametersHandler.h | 1 + 2 files changed, 8 insertions(+) diff --git a/Code/ApplicationEngine/otbWrapperElevationParametersHandler.cxx b/Code/ApplicationEngine/otbWrapperElevationParametersHandler.cxx index d981d41329..5c116907b9 100644 --- a/Code/ApplicationEngine/otbWrapperElevationParametersHandler.cxx +++ b/Code/ApplicationEngine/otbWrapperElevationParametersHandler.cxx @@ -28,6 +28,7 @@ void ElevationParametersHandler::AddElevationParameters(Application::Pointer app app->AddParameter(ParameterType_Choice, key, "Elevation management"); app->SetParameterDescription(key, "This group of parameters allows to manage elevation values. Supported formats are SRTM, DTED or any geotiff processed by the DEM import application"); + app->MandatoryOff(key); // DEM directory std::ostringstream oss; @@ -143,5 +144,11 @@ ElevationParametersHandler::IsGeoidUsed(const Application::Pointer app, const st return app->IsParameterEnabled(geoidKey.str()) && app->HasValue(geoidKey.str()); } +bool +ElevationParametersHandler::IsElevationEnabled(const Application::Pointer app, const std::string & key) +{ + return app->IsParameterEnabled(key); +} + }// End namespace Wrapper }// End namespace otb diff --git a/Code/ApplicationEngine/otbWrapperElevationParametersHandler.h b/Code/ApplicationEngine/otbWrapperElevationParametersHandler.h index 47ceefd6a3..82bdf03ad7 100644 --- a/Code/ApplicationEngine/otbWrapperElevationParametersHandler.h +++ b/Code/ApplicationEngine/otbWrapperElevationParametersHandler.h @@ -59,6 +59,7 @@ public: static float GetAverageElevation(const Application::Pointer app, const std::string& key); static const std::string GetGeoidFile(const Application::Pointer app, const std::string& key); static bool IsGeoidUsed(const Application::Pointer app, const std::string& key); + static bool IsElevationEnabled(const Application::Pointer app, const std::string & key); protected: ElevationParametersHandler(); // not implemented -- GitLab