Skip to content
Snippets Groups Projects
Commit b883ae63 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH: add method to deal with the AutomaticMode from the application

parent 186dbd71
Branches
Tags
No related merge requests found
...@@ -175,6 +175,24 @@ void Application::MandatoryOff(std::string paramKey) ...@@ -175,6 +175,24 @@ void Application::MandatoryOff(std::string paramKey)
GetParameterByKey(paramKey)->SetMandatory(false); 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 /* Returns true if the parameter has an associated value provided externally
* (not automatically computed by the application) */ * (not automatically computed by the application) */
bool Application::HasUserValue(std::string paramKey) const bool Application::HasUserValue(std::string paramKey) const
......
...@@ -127,6 +127,11 @@ public: ...@@ -127,6 +127,11 @@ public:
/* Return true if the specified parameter is mandatory */ /* Return true if the specified parameter is mandatory */
bool IsMandatory(std::string paramKey) const; 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 /* Returns true if the parameter has an associated value provided externally
* (not automatically computed by the application) */ * (not automatically computed by the application) */
bool HasUserValue(std::string paramKey) const; bool HasUserValue(std::string paramKey) const;
...@@ -277,11 +282,6 @@ public: ...@@ -277,11 +282,6 @@ public:
*/ */
FloatVectorImageType* GetParameterImage(std::string parameter); FloatVectorImageType* GetParameterImage(std::string parameter);
/* Get an image value
*
* Can be called for types :
* \li ParameterType_InputImage
*/
#define otbGetParameterImageMacro( Image ) \ #define otbGetParameterImageMacro( Image ) \
Image##Type * GetParameter##Image( std::string parameter ) \ Image##Type * GetParameter##Image( std::string parameter ) \
{ \ { \
...@@ -321,8 +321,6 @@ public: ...@@ -321,8 +321,6 @@ public:
otbGetParameterImageMacro(Int32RGBAImage); otbGetParameterImageMacro(Int32RGBAImage);
otbGetParameterImageMacro(FloatRGBAImage); otbGetParameterImageMacro(FloatRGBAImage);
otbGetParameterImageMacro(DoubleRGBAImage); otbGetParameterImageMacro(DoubleRGBAImage);
/* Get an image list value /* Get an image list value
* *
* Can be called for types : * Can be called for types :
...@@ -433,6 +431,12 @@ protected: ...@@ -433,6 +431,12 @@ protected:
//TODO: exception if not found ? //TODO: exception if not found ?
return ret; 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 /* Set an output image value
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment