OTB  5.11.0
Orfeo Toolbox
otbWrapperParameterGroup.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef otbWrapperParameterGroup_h
19 #define otbWrapperParameterGroup_h
20 
21 #include "itkObject.h"
22 #include "otbWrapperParameter.h"
23 #include <vector>
24 
25 namespace otb
26 {
27 namespace Wrapper
28 {
29 
35 class OTBApplicationEngine_EXPORT ParameterGroup
36  : public Parameter
37 {
38 public:
43 
44  itkNewMacro(Self);
45 
46  itkTypeMacro(ParameterList, Parameter);
47 
48  void AddParameter(Parameter::Pointer p);
49 
52  bool ReplaceParameter(std::string &key, Parameter::Pointer p);
53 
55  void AddChoice(std::string paramKey, std::string paramName);
56 
58  void ClearChoices(std::string paramKey);
59 
61  std::vector<int> GetSelectedItems(std::string paramKey);
62 
66  void AddParameter(ParameterType type, std::string paramKey, std::string paramName);
67 
68  Parameter::Pointer GetParameterByIndex(unsigned int i, bool follow=true);
69 
70  Parameter::Pointer GetParameterByKey(std::string name, bool follow=true);
71 
73  void AddInXMLParameter();
74 
75  void AddOutXMLParameter();
76 
77  void Clear()
78  {
79  m_ParameterList.clear();
80  }
81 
85  std::string GetParameterTypeAsString(ParameterType paramType);
86 
87  /* Get the parameter type from its string version of ParameterType enum */
88  ParameterType GetParameterTypeFromString(std::string paramType);
89 
90  unsigned int GetNumberOfParameters();
91 
92  std::vector<std::string> GetParametersKeys(bool recursive = true);
93 
94  // Always has value
95  bool HasValue() const ITK_OVERRIDE
96  {
97  return true;
98  }
99 
102  static Parameter* ResolveParameter(Parameter *param);
103 
104 protected:
105  ParameterGroup();
106  ~ParameterGroup() ITK_OVERRIDE;
107 
108  typedef std::vector<Parameter::Pointer> ParameterListType;
109  ParameterListType m_ParameterList;
110 
111 private:
112  ParameterGroup(const ParameterGroup &); //purposely not implemented
113  void operator =(const ParameterGroup&); //purposely not implemented
114 
115 };
116 
117 }
118 }
119 
120 #endif
itk::SmartPointer< Self > Pointer
This class represent a parameter for the wrapper framework This class is a high level class represent...
bool HasValue() const ITK_OVERRIDE
std::vector< Parameter::Pointer > ParameterListType
itk::SmartPointer< const Self > ConstPointer