From ed2d89182c088a1054c54e70db72a917a9f3e7bb Mon Sep 17 00:00:00 2001
From: Otmane Lahlou <otmane.lahlou@c-s.fr>
Date: Thu, 20 Oct 2011 16:09:34 +0200
Subject: [PATCH] ENH: add the concept of Role for parameters (input/output)

---
 Code/ApplicationEngine/otbWrapperParameter.h | 10 ++++++++++
 Code/ApplicationEngine/otbWrapperTypes.h     |  7 +++++++
 2 files changed, 17 insertions(+)

diff --git a/Code/ApplicationEngine/otbWrapperParameter.h b/Code/ApplicationEngine/otbWrapperParameter.h
index 73a85a8139..8e9a1aa696 100644
--- a/Code/ApplicationEngine/otbWrapperParameter.h
+++ b/Code/ApplicationEngine/otbWrapperParameter.h
@@ -126,6 +126,12 @@ public:
   /** Get the user access level */
   itkGetEnumMacro(UserLevel, UserLevel);
 
+  /** Set the parameter io type*/
+  itkSetEnumMacro(Role, Role);
+
+  /** Get the user access level */
+  itkGetEnumMacro(Role, Role);
+
   /** Reset to the the default value. Default implementation does
    * nothing
    */
@@ -210,6 +216,7 @@ protected:
                 m_UserValue(false),
                 m_DefaultValueMode(DefaultValueMode_UNKNOWN),
                 m_UserLevel(UserLevel_Basic),
+                m_Role(Role_Input),
                 m_AutomaticValue(false),
                 m_IsChecked(false)
   {}
@@ -244,6 +251,9 @@ protected:
 
   UserLevel                          m_UserLevel;
 
+  /** Default iotype mode */
+  Role                               m_Role;
+
   /** List of parents Parameters */
   Parameter::Pointer                 m_Root;
 
diff --git a/Code/ApplicationEngine/otbWrapperTypes.h b/Code/ApplicationEngine/otbWrapperTypes.h
index a840c047f3..ce03697cc1 100644
--- a/Code/ApplicationEngine/otbWrapperTypes.h
+++ b/Code/ApplicationEngine/otbWrapperTypes.h
@@ -69,6 +69,13 @@ typedef enum
   ImagePixelType_double,
 } ImagePixelType;
 
+typedef enum
+{
+  Role_Input,
+  Role_Output
+} Role;
+
+
 typedef otb::Image<char>                       Int8ImageType;
 typedef otb::Image<unsigned char>              UInt8ImageType;
 typedef otb::Image<short>                      Int16ImageType;
-- 
GitLab