diff --git a/Code/ApplicationEngine/otbWrapperApplication.cxx b/Code/ApplicationEngine/otbWrapperApplication.cxx index bb6deb868bf9eb36a9dc936dcc91aafefcbbfbf6..0ad683b33cddd48cb9c4b05497dda998ce578b36 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.cxx +++ b/Code/ApplicationEngine/otbWrapperApplication.cxx @@ -175,6 +175,24 @@ void Application::MandatoryOff(std::string paramKey) GetParameterByKey(paramKey)->SetMandatory(false); } +/* Return true if the specified parameter was set automatically in the + * application + */ +bool Application::HasAutomaticValue(std::string paramKey) const +{ + return GetParameterByKey(paramKey)->GetAutomaticValue(); +} + +void Application::AutomaticValueOn(std::string paramKey) +{ + GetParameterByKey(paramKey)->SetAutomaticValue(true); +} + +void Application::AutomaticValueOff(std::string paramKey) +{ + GetParameterByKey(paramKey)->SetAutomaticValue(false); +} + /* Returns true if the parameter has an associated value provided externally * (not automatically computed by the application) */ bool Application::HasUserValue(std::string paramKey) const diff --git a/Code/ApplicationEngine/otbWrapperApplication.h b/Code/ApplicationEngine/otbWrapperApplication.h index 7f8fa5c7ab563dcbcbf628c0328e4ed77ed70eb8..6c85fc320eaef2f91cf0485e6c59bd4198dedebd 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.h +++ b/Code/ApplicationEngine/otbWrapperApplication.h @@ -127,6 +127,11 @@ public: /* Return true if the specified parameter is mandatory */ bool IsMandatory(std::string paramKey) const; + /* Return true if the specified parameter was set automtically in + * the applciation + */ + bool HasAutomaticValue(std::string paramKey) const; + /* Returns true if the parameter has an associated value provided externally * (not automatically computed by the application) */ bool HasUserValue(std::string paramKey) const; @@ -277,11 +282,6 @@ public: */ FloatVectorImageType* GetParameterImage(std::string parameter); - /* Get an image value - * - * Can be called for types : - * \li ParameterType_InputImage - */ #define otbGetParameterImageMacro( Image ) \ Image##Type * GetParameter##Image( std::string parameter ) \ { \ @@ -321,8 +321,6 @@ public: otbGetParameterImageMacro(Int32RGBAImage); otbGetParameterImageMacro(FloatRGBAImage); otbGetParameterImageMacro(DoubleRGBAImage); - - /* Get an image list value * * Can be called for types : @@ -433,6 +431,12 @@ protected: //TODO: exception if not found ? return ret; } + + /** Declare a parameter as having an automatic value */ + void AutomaticValueOn(std::string paramKey); + + /** Declare a parameter as NOT having an automatic value */ + void AutomaticValueOff(std::string paramKey); /* Set an output image value *