Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
213
Issues
213
List
Boards
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
32329844
Commit
32329844
authored
Nov 30, 2018
by
Victor Poughon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFAC: remove ParameterType_Empty
parent
8aa9f900
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
11 additions
and
413 deletions
+11
-413
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
+1
-5
Documentation/Cookbook/rst/recipes/python.rst
Documentation/Cookbook/rst/recipes/python.rst
+0
-38
Examples/Application/ApplicationExample.cxx
Examples/Application/ApplicationExample.cxx
+1
-1
Modules/Applications/AppClassification/include/otbTrainDecisionTree.hxx
...ations/AppClassification/include/otbTrainDecisionTree.hxx
+0
-1
Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.hxx
...AppClassification/include/otbTrainGradientBoostedTree.hxx
+0
-3
Modules/Applications/AppClassification/include/otbTrainRandomForests.hxx
...tions/AppClassification/include/otbTrainRandomForests.hxx
+0
-4
Modules/Applications/AppSegmentation/app/otbSegmentation.cxx
Modules/Applications/AppSegmentation/app/otbSegmentation.cxx
+0
-4
Modules/Applications/AppTest/app/otbTestApplication.cxx
Modules/Applications/AppTest/app/otbTestApplication.cxx
+0
-1
Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h
...rappers/ApplicationEngine/include/otbWrapperApplication.h
+2
-6
Modules/Wrappers/ApplicationEngine/include/otbWrapperBoolParameter.h
...ppers/ApplicationEngine/include/otbWrapperBoolParameter.h
+0
-2
Modules/Wrappers/ApplicationEngine/include/otbWrapperEmptyParameter.h
...pers/ApplicationEngine/include/otbWrapperEmptyParameter.h
+0
-86
Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h
Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h
+0
-1
Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
.../Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
+4
-21
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx
...licationEngine/src/otbWrapperInputProcessXMLParameter.cxx
+0
-10
Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx
...icationEngine/src/otbWrapperOutputProcessXMLParameter.cxx
+0
-26
Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx
...appers/ApplicationEngine/src/otbWrapperParameterGroup.cxx
+2
-17
Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
...rappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
+1
-22
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
+0
-5
Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetEmptyParameter.h
...ppers/QtWidget/include/otbWrapperQtWidgetEmptyParameter.h
+0
-59
Modules/Wrappers/QtWidget/src/CMakeLists.txt
Modules/Wrappers/QtWidget/src/CMakeLists.txt
+0
-2
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetEmptyParameter.cxx
...rappers/QtWidget/src/otbWrapperQtWidgetEmptyParameter.cxx
+0
-60
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterBase.cxx
...Wrappers/QtWidget/src/otbWrapperQtWidgetParameterBase.cxx
+0
-9
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx
...ppers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx
+0
-2
Modules/Wrappers/QtWidget/test/otbWrapperQtWidgetParameterFactory.cxx
...pers/QtWidget/test/otbWrapperQtWidgetParameterFactory.cxx
+0
-20
Modules/Wrappers/SWIG/src/otbApplication.i
Modules/Wrappers/SWIG/src/otbApplication.i
+0
-7
Modules/Wrappers/SWIG/test/python/PythonNewStyleParametersTest.py
...Wrappers/SWIG/test/python/PythonNewStyleParametersTest.py
+0
-1
No files found.
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
View file @
32329844
...
...
@@ -115,8 +115,7 @@ def GenerateChoice(app,param,paramlist, count = 0):
return
output
def
GenerateParameterType
(
app
,
param
):
if
app
.
GetParameterType
(
param
)
==
otbApplication
.
ParameterType_Empty
\
or
app
.
GetParameterType
(
param
)
==
otbApplication
.
ParameterType_Bool
:
if
app
.
GetParameterType
(
param
)
==
otbApplication
.
ParameterType_Bool
:
return
"Boolean"
if
app
.
GetParameterType
(
param
)
==
otbApplication
.
ParameterType_Int
\
or
app
.
GetParameterType
(
param
)
==
otbApplication
.
ParameterType_Radius
\
...
...
@@ -367,9 +366,6 @@ def GetApplicationExamplePythonSnippet(app,idx,expand = False, inputpath="",outp
if
paramtype
==
otbApplication
.
ParameterType_Choice
:
#app.SetParameterString(param,value)
output
+=
"
\t
"
+
appname
+
".SetParameterString("
+
EncloseString
(
param
)
+
","
+
EncloseString
(
value
)
+
")"
+
linesep
if
paramtype
==
otbApplication
.
ParameterType_Empty
:
app
.
EnableParameter
(
param
)
output
+=
"
\t
"
+
appname
+
".EnableParameter("
+
EncloseString
(
param
)
+
")"
+
linesep
if
paramtype
==
otbApplication
.
ParameterType_Bool
:
output
+=
"
\t
"
+
appname
+
".SetParameterString("
+
EncloseString
(
param
)
+
","
+
EncloseString
(
value
)
+
")"
+
linesep
if
paramtype
==
otbApplication
.
ParameterType_Int
\
...
...
Documentation/Cookbook/rst/recipes/python.rst
View file @
32329844
...
...
@@ -375,41 +375,3 @@ that relate to geometry, projections, and also calibration.
Future developments will probably offer a more adapted structure to import and
export images between OTB and the Python world.
Setting of EmptyParameter
^^^^^^^^^^^^^^^^^^^^^^^^^
Most of the parameters are set using functions ``SetParameterXXX()``, except for
one type of parameter: the ``EmptyParameter``. This class was the first
implementation of a boolean. It is now **deprecated**, you should use ``BoolParameter``
instead.
Let's take an example with the application ``ReadImageInfo`` when it was still
using an ``EmptyParameter`` for parameter ``keywordlist``:
.. code-block:: python
import otbApplication as otb
app = otb.Registry.CreateApplication("ReadImageInfo")
If you want the get the state of parameter ``keywordlist``, a boolean, use:
.. code-block:: python
app.IsParameterEnabled("keywordlist")
To set this parameter ON/OFF, use the functions:
.. code-block:: python
app.EnableParameter("keywordlist")
app.DisableParameter("keywordlist")
Don't try to use other functions to set the state of a boolean. For instance,
try the following commands:
.. code-block:: python
app.SetParameterInt("keywordlist", 0)
app.IsParameterEnabled("keywordlist")
You will get a state ``True`` even if you asked the opposite.
Examples/Application/ApplicationExample.cxx
View file @
32329844
...
...
@@ -153,7 +153,7 @@ private:
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output Image"
);
AddParameter
(
ParameterType_
Empty
,
"param1"
,
"Example of boolean parameter"
);
AddParameter
(
ParameterType_
Bool
,
"param1"
,
"Example of boolean parameter"
);
MandatoryOff
(
"param1"
);
AddParameter
(
ParameterType_Int
,
"param2"
,
"Example of integer parameter"
);
...
...
Modules/Applications/AppClassification/include/otbTrainDecisionTree.hxx
View file @
32329844
...
...
@@ -65,7 +65,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"regression accuracy parameter, then the node will not be split further."
);
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.dt.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.dt.sur","These splits allow working with missing data and compute variable importance correctly.");
//MaxCategories
...
...
Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.hxx
View file @
32329844
...
...
@@ -79,9 +79,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or "
"if the tree is pruned."
);
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.gbt.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.gbt.sur","These splits allow working with missing data and compute variable importance correctly.");
#endif
}
...
...
Modules/Applications/AppClassification/include/otbTrainRandomForests.hxx
View file @
32329844
...
...
@@ -59,10 +59,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"and the values of the train samples in this node are smaller than this regression accuracy parameter, "
"then the node will not be split."
);
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.rf.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.rf.sur","These splits allow working with missing data and compute variable importance correctly.");
//MaxNumberOfCategories
AddParameter
(
ParameterType_Int
,
"classifier.rf.cat"
,
"Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split"
);
...
...
Modules/Applications/AppSegmentation/app/otbSegmentation.cxx
View file @
32329844
...
...
@@ -189,10 +189,6 @@ private:
SetParameterDescription
(
"filter.meanshift.minsize"
,
"Minimum size of a region (in pixel unit) in segmentation. Smaller clusters will be merged to the neighboring cluster with the closest radiometry."
" If set to 0 no pruning is done."
);
//AddParameter(ParameterType_Empty, "filter.meanshift.useoptim", "use optimization");
//SetParameterDescription("filter.meanshift.useoptim", "Use mode optimization.");
//MandatoryOff("filter.meanshift.useoptim");
SetDefaultParameterInt
(
"filter.meanshift.spatialr"
,
5
);
SetDefaultParameterFloat
(
"filter.meanshift.ranger"
,
15.0
);
SetDefaultParameterFloat
(
"filter.meanshift.thres"
,
0.1
);
...
...
Modules/Applications/AppTest/app/otbTestApplication.cxx
View file @
32329844
...
...
@@ -56,7 +56,6 @@ private:
AddDocTag
(
"Test"
);
//std::cout << "TestApplication::DoInit" << std::endl;
AddParameter
(
ParameterType_Empty
,
"empty"
,
"Boolean (old impl.)"
);
AddParameter
(
ParameterType_Bool
,
"boolean"
,
"Boolean"
);
AddParameter
(
ParameterType_Int
,
"int"
,
"Integer"
);
MandatoryOff
(
"int"
);
...
...
Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h
View file @
32329844
...
...
@@ -190,10 +190,6 @@ public:
* or a value set externally by user */
bool
HasValue
(
std
::
string
paramKey
)
const
;
/* Get active flag of parameter with key paramKey
*/
bool
GetParameterEmpty
(
std
::
string
paramKey
);
/** Set HasUserValue flag of parameter with key paramKey
* Note that when this function is called from DoInit, DoUpdateParameters
* or DoExecute, it will always set this flag to false, because this is
...
...
@@ -226,6 +222,7 @@ public:
*
* Can be called for types :
* \li ParameterType_Int
* \li ParameterType_Bool
* \li ParameterType_Float
* \li ParameterType_Radius
* \li ParameterType_Choice
...
...
@@ -268,8 +265,6 @@ public:
*/
void
SetParameterStringList
(
std
::
string
parameter
,
std
::
vector
<
std
::
string
>
values
,
bool
hasUserValueFlag
=
true
);
void
SetParameterEmpty
(
std
::
string
parameter
,
bool
value
,
bool
hasUserValueFlag
=
true
);
/** Checks if the application is ready to be executed. It checks that there
* is no missing parameter
*/
...
...
@@ -431,6 +426,7 @@ public:
*
* Can be called for types :
* \li ParameterType_Int
* \li ParameterType_Bool
* \li ParameterType_Float
* \li ParameterType_Radius
* \li ParameterType_Choice
...
...
Modules/Wrappers/ApplicationEngine/include/otbWrapperBoolParameter.h
View file @
32329844
...
...
@@ -33,8 +33,6 @@ namespace Wrapper
/** \class BoolParameter
* \brief This class represent a boolean parameter for the wrapper framework
*
* It is intended to replace the deprecated EmptyParameter
*
* \ingroup OTBApplicationEngine
*/
class
OTBApplicationEngine_EXPORT
BoolParameter
...
...
Modules/Wrappers/ApplicationEngine/include/otbWrapperEmptyParameter.h
deleted
100644 → 0
View file @
8aa9f900
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbWrapperEmptyParameter_h
#define otbWrapperEmptyParameter_h
#include "otbWrapperParameter.h"
namespace
otb
{
namespace
Wrapper
{
/** \class EmptyParameter
* \brief This class represent an empty parameter for the wrapper framework (boolean value)
*
* \deprecated in OTB 6.6, use BoolParameter instead
*
* \ingroup OTBApplicationEngine
*/
class
OTBApplicationEngine_EXPORT
EmptyParameter
:
public
Parameter
{
public:
/** Standard class typedef */
typedef
EmptyParameter
Self
;
typedef
Parameter
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Defining ::New() static method */
itkNewMacro
(
Self
);
/** RTTI support */
itkTypeMacro
(
EmptyParameter
,
Parameter
);
/** HasValue */
bool
HasValue
()
const
override
{
return
false
;
}
bool
HasUserValue
()
const
override
{
return
this
->
m_UserValue
;
}
protected:
/** Constructor */
EmptyParameter
()
{
// It does not make sense for an empty parameter to be mandatory
this
->
MandatoryOff
();
}
/** Destructor */
~
EmptyParameter
()
override
{}
private:
EmptyParameter
(
const
EmptyParameter
&
)
=
delete
;
void
operator
=
(
const
EmptyParameter
&
)
=
delete
;
};
// End class Parameter
}
// End namespace Wrapper
}
// End namespace otb
#endif
Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h
View file @
32329844
...
...
@@ -35,7 +35,6 @@ namespace Wrapper
typedef
enum
{
ParameterType_Empty
,
ParameterType_Int
,
ParameterType_Float
,
ParameterType_String
,
...
...
Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
View file @
32329844
...
...
@@ -22,7 +22,6 @@
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperInputFilenameParameter.h"
#include "otbWrapperInputFilenameListParameter.h"
#include "otbWrapperOutputFilenameParameter.h"
...
...
@@ -380,6 +379,10 @@ void Application::SetParameterInt(std::string parameter, int value, bool hasUser
BoolParameter
*
paramBool
=
dynamic_cast
<
BoolParameter
*>
(
param
);
paramBool
->
SetValue
(
static_cast
<
bool
>
(
value
));
}
else
{
otbAppLogWARNING
(
<<
"SetParameterInt on parameter "
+
parameter
);
}
this
->
SetParameterUserValue
(
parameter
,
hasUserValueFlag
);
}
...
...
@@ -538,12 +541,6 @@ void Application::SetParameterStringList(std::string parameter, std::vector<std:
this
->
SetParameterUserValue
(
parameter
,
hasUserValueFlag
);
}
void
Application
::
SetParameterEmpty
(
std
::
string
parameter
,
bool
value
,
bool
hasUserValueFlag
)
{
this
->
SetParameterUserValue
(
parameter
,
hasUserValueFlag
);
GetParameterByKey
(
parameter
)
->
SetActive
(
value
);
}
void
Application
::
SetParameterUserValue
(
std
::
string
paramKey
,
bool
value
)
{
/** UserValue is set/unset parameter must be active.
...
...
@@ -1086,11 +1083,6 @@ Role Application::GetParameterRole(std::string paramKey) const
return
GetParameterByKey
(
paramKey
)
->
GetRole
();
}
bool
Application
::
GetParameterEmpty
(
std
::
string
paramKey
)
{
return
GetParameterByKey
(
paramKey
)
->
GetActive
();
}
/* Return the role (input/output) of a parameter */
void
Application
::
SetParameterRole
(
std
::
string
paramKey
,
Role
role
)
{
...
...
@@ -1116,10 +1108,6 @@ ParameterType Application::GetParameterType(std::string paramKey) const
{
type
=
ParameterType_Radius
;
}
else
if
(
dynamic_cast
<
const
EmptyParameter
*>
(
param
))
{
type
=
ParameterType_Empty
;
}
else
if
(
dynamic_cast
<
const
IntParameter
*>
(
param
))
{
type
=
ParameterType_Int
;
...
...
@@ -1550,11 +1538,6 @@ int Application::GetParameterInt(std::string parameter)
BoolParameter
*
paramBool
=
dynamic_cast
<
BoolParameter
*>
(
param
);
ret
=
static_cast
<
int
>
(
paramBool
->
GetValue
());
}
else
if
(
dynamic_cast
<
EmptyParameter
*>
(
param
))
{
// This case is here for compatibility purpose with deprecated EmptyParameter
ret
=
static_cast
<
int
>
(
this
->
IsParameterEnabled
(
parameter
));
}
else
{
itkExceptionMacro
(
<<
parameter
<<
" parameter can't be casted to int"
);
...
...
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx
View file @
32329844
...
...
@@ -23,7 +23,6 @@
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperInputFilenameParameter.h"
#include "otbWrapperInputFilenameListParameter.h"
#include "otbWrapperOutputFilenameParameter.h"
...
...
@@ -419,15 +418,6 @@ InputProcessXMLParameter::Read(Application::Pointer this_)
std
::
stringstream
(
value
)
>>
floatValue
;
this_
->
SetParameterFloat
(
key
,
floatValue
);
}
else
if
(
type
==
ParameterType_Empty
)
{
bool
emptyValue
=
false
;
if
(
value
==
"true"
)
{
emptyValue
=
true
;
}
this_
->
SetParameterEmpty
(
key
,
emptyValue
);
}
else
if
(
type
==
ParameterType_StringList
||
type
==
ParameterType_ListView
)
{
if
(
values
.
empty
())
...
...
Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx
View file @
32329844
...
...
@@ -23,7 +23,6 @@
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperInputFilenameParameter.h"
#include "otbWrapperInputFilenameListParameter.h"
#include "otbWrapperOutputFilenameParameter.h"
...
...
@@ -243,26 +242,6 @@ OutputProcessXMLParameter::ParseGroup(const std::string& group)
paramExists
=
false
;
}
std
::
string
emptyValue
;
if
(
type
==
ParameterType_Empty
)
{
EmptyParameter
*
eParam
=
dynamic_cast
<
EmptyParameter
*>
(
param
);
if
(
eParam
!=
nullptr
)
{
//Don't use m_Appli->HasUserValue which returns false always because of
//EmptyParameter::HasValue() is false for EmptyParameter
if
(
eParam
->
HasUserValue
())
{
paramExists
=
true
;
emptyValue
=
"false"
;
if
(
eParam
->
GetActive
()
)
{
emptyValue
=
"true"
;
}
}
}
}
if
(
type
==
ParameterType_RAM
)
{
paramExists
=
true
;
...
...
@@ -317,11 +296,6 @@ OutputProcessXMLParameter::ParseGroup(const std::string& group)
strm
<<
m_Appli
->
GetParameterInt
(
"rand"
);
value
=
strm
.
str
();
}
else
if
(
typeAsString
==
"Empty"
)
{
//Nothing to do. copy emptyValue
value
=
emptyValue
;
}
else
if
(
type
==
ParameterType_InputProcessXML
)
{
continue
;
...
...
Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx
View file @
32329844
...
...
@@ -21,7 +21,6 @@
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperInputFilenameParameter.h"
#include "otbWrapperInputFilenameListParameter.h"
#include "otbWrapperOutputFilenameParameter.h"
...
...
@@ -249,10 +248,6 @@ ParameterGroup::GetSelectedItems(std::string paramKey)
{
return
ParameterType_Radius
;
}
else
if
(
type
==
"Empty"
)
{
return
ParameterType_Empty
;
}
else
if
(
type
==
"Int"
)
{
return
ParameterType_Int
;
...
...
@@ -339,8 +334,8 @@ ParameterGroup::GetSelectedItems(std::string paramKey)
}
else
{
std
::
cerr
<<
"Cannot find parameter type code for type: "
<<
type
<<
std
::
endl
;
return
ParameterType_Empty
;
otbLogMacro
(
Error
,
<<
"Cannot find parameter type code for type: "
<<
type
)
;
throw
std
::
invalid_argument
(
"Cannot find parameter type code for type: "
+
type
)
;
}
}
...
...
@@ -351,11 +346,6 @@ std::string ParameterGroup::GetParameterTypeAsString(ParameterType type)
switch
(
type
)
{
case
ParameterType_Empty
:
{
paramType
=
"Empty"
;
}
break
;
case
ParameterType_Int
:
{
paramType
=
"Int"
;
...
...
@@ -515,11 +505,6 @@ ParameterGroup::AddParameter(ParameterType type, std::string paramKey, std::stri
Parameter
::
Pointer
newParam
;
switch
(
type
)
{
case
ParameterType_Empty
:
{
newParam
=
EmptyParameter
::
New
();
}
break
;
case
ParameterType_Int
:
{
newParam
=
IntParameter
::
New
();
...
...
Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
View file @
32329844
...
...
@@ -23,7 +23,6 @@
// Single value parameter
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperInputFilenameParameter.h"
#include "otbWrapperOutputFilenameParameter.h"
#include "otbWrapperInputImageParameter.h"
...
...
@@ -496,26 +495,6 @@ CommandLineLauncher::ParamResultType CommandLineLauncher::LoadParameters()
}
}
}
else
if
(
type
==
ParameterType_Empty
)
{
// Set UserValue flag specific for EmptyParameter, beware that it
// should be done before Enable/Disable because SetParameterUserValue()
// may enable it by default
m_Application
->
SetParameterUserValue
(
paramKey
,
true
);
if
(
values
[
0
]
==
"1"
||
values
[
0
]
==
"true"
)
{
m_Application
->
EnableParameter
(
paramKey
);
}
else
if
(
values
[
0
]
==
"0"
||
values
[
0
]
==
"false"
)
{
m_Application
->
DisableParameter
(
paramKey
);
}
else
{
std
::
cerr
<<
"ERROR: Wrong value for parameter -"
<<
paramKey
<<
"."
<<
std
::
endl
;
return
WRONGPARAMETERVALUE
;
}
}
// Call the DoUpdateParameter to update dependent params
m_Application
->
UpdateParameters
();
}
...
...
@@ -755,7 +734,7 @@ std::string CommandLineLauncher::DisplayParameterHelp(const Parameter::Pointer &
{
oss
<<
"<int32> "
;
}
else
if
(
type
==
ParameterType_
Empty
||
type
==
ParameterType_
Bool
)
else
if
(
type
==
ParameterType_Bool
)
{
oss
<<
"<boolean> "
;
}
...
...
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
View file @
32329844
...
...
@@ -54,7 +54,6 @@ int main(int argc, char* argv[])
assert
(
!
group
.
empty
());
std
::
map
<
ParameterType
,
std
::
string
>
parameterTypeToString
;
parameterTypeToString
[
ParameterType_Empty
]
=
"QgsProcessingParameterBoolean"
;
parameterTypeToString
[
ParameterType_Bool
]
=
"QgsProcessingParameterBoolean"
;
parameterTypeToString
[
ParameterType_Int
]
=
"QgsProcessingParameterNumber"
;
parameterTypeToString
[
ParameterType_Float
]
=
"QgsProcessingParameterNumber"
;
...
...
@@ -272,10 +271,6 @@ int main(int argc, char* argv[])
{
default_value
=
appli
->
GetParameterAsString
(
name
);
}
else
if
(
type
==
ParameterType_Empty
)
{
default_value
=
appli
->
IsParameterEnabled
(
name
)
?
"true"
:
"false"
;
}
else
if
(
type
==
ParameterType_Choice
)
{
std
::
vector
<
std
::
string
>
key_list
=
appli
->
GetChoiceKeys
(
name
);
...
...
Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetEmptyParameter.h
deleted
100644 → 0
View file @
8aa9f900
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbWrapperQtWidgetEmptyParameter_h
#define otbWrapperQtWidgetEmptyParameter_h
#include <QtWidgets>
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperQtWidgetParameterBase.h"
namespace
otb
{
namespace
Wrapper
{
/** \class QtWidgetEmptyParameter
* \brief
*
* \ingroup OTBQtWidget
*/
class
OTBQtWidget_EXPORT
QtWidgetEmptyParameter
:
public
QtWidgetParameterBase
{
Q_OBJECT
public:
QtWidgetEmptyParameter
(
EmptyParameter
*
,
QtWidgetModel
*
,
QWidget
*
);
~
QtWidgetEmptyParameter
()
override
;
private:
QtWidgetEmptyParameter
(
const
QtWidgetEmptyParameter
&
)
=
delete
;
void
operator
=
(
const
QtWidgetEmptyParameter
&
)
=
delete
;
void
DoCreateWidget
()
override
;
void
DoUpdateGUI
()
override
;
};
}
}
#endif
Modules/Wrappers/QtWidget/src/CMakeLists.txt
View file @
32329844
...
...
@@ -50,7 +50,6 @@ set(OTBQtWidget_SRC
otbWrapperQtWidgetParameterBase.cxx
otbWrapperQtWidgetInputImageParameter.cxx
otbWrapperQtWidgetStringListParameter.cxx
otbWrapperQtWidgetEmptyParameter.cxx
otbWrapperQtWidgetOutputVectorDataParameter.cxx
otbWrapperQtWidgetInputFilenameParameter.cxx
otbWrapperQtWidgetInputImageListParameter.cxx
...
...
@@ -62,7 +61,6 @@ set(OTBQtWidget_SRC
)
set
(
OTBQtWidget_MOC_HDR
../include/otbWrapperQtWidgetEmptyParameter.h
../include/otbWrapperQtWidgetFloatParameter.h
../include/otbWrapperQtWidgetIntParameter.h
../include/otbWrapperQtWidgetStringParameter.h
...
...
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetEmptyParameter.cxx
deleted
100644 → 0
View file @
8aa9f900
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbWrapperQtWidgetEmptyParameter.h"
namespace
otb
{
namespace
Wrapper
{
QtWidgetEmptyParameter
::
QtWidgetEmptyParameter
(
EmptyParameter
*
emptyParam
,
QtWidgetModel
*
m
,
QWidget
*
parent
)
:
QtWidgetParameterBase
(
emptyParam
,
m
,
parent
)
{
}
QtWidgetEmptyParameter
::~
QtWidgetEmptyParameter
()
{
}
void
QtWidgetEmptyParameter
::
DoUpdateGUI
()
{
}
void
QtWidgetEmptyParameter
::
DoCreateWidget
()
{
// Set up input text edit
QHBoxLayout
*
hLayout
=
new
QHBoxLayout
;
hLayout
->
setSpacing
(
0
);
hLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
//QCheckBox* checkbox = new QCheckBox(this);
//checkbox->setToolTip(emptyParam->GetDescription());
//QString optionID(emptyParam->GetName());
//hLayout->addWidget(checkbox);
hLayout
->
addStretch
();
this
->
setLayout
(
hLayout
);
}
}
}
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterBase.cxx
View file @
32329844
...
...
@@ -83,18 +83,9 @@ QtWidgetModel* QtWidgetParameterBase::GetModel()
// current widget
void
QtWidgetParameterBase
::
SetActivationState
(
bool
value
)
{
//filter out EmptyParameter
if
(
strcmp
(
m_Param
->
GetNameOfClass
(),
"EmptyParameter"
)
==
0
)
{
//only set user value if there is a change
if
(
value
!=
m_Param
->
GetActive
())
m_Param
->
SetUserValue
(
true
);
}
this
->
setEnabled
(
value
);
this
->
SetChecked
(
value
);
m_Param
->
SetActive
(
value
);
}
const
Parameter
*
...
...
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx
View file @
32329844
...
...
@@ -29,7 +29,6 @@
#include "otbWrapperQtWidgetComplexInputImageParameter.h"
#include "otbWrapperQtWidgetComplexOutputImageParameter.h"
#include "otbWrapperQtWidgetDirectoryParameter.h"
#include "otbWrapperQtWidgetEmptyParameter.h"
#include "otbWrapperQtWidgetFloatParameter.h"
#include "otbWrapperQtWidgetIntParameter.h"
#include "otbWrapperQtWidgetInputFilenameParameter.h"
...
...
@@ -105,7 +104,6 @@ QtWidgetParameterFactory::CreateQtWidget( Parameter* param, QtWidgetModel* model
}
if
(
0
)
{}
CREATEWIDGET
(
EmptyParameter
,
QtWidgetEmptyParameter
)
CREATEWIDGET
(
IntParameter
,
QtWidgetIntParameter
)
CREATEWIDGET
(
FloatParameter
,
QtWidgetFloatParameter
)
CREATEWIDGET
(
InputFilenameParameter
,
QtWidgetInputFilenameParameter
)
...
...
Modules/Wrappers/QtWidget/test/otbWrapperQtWidgetParameterFactory.cxx
View file @
32329844
...
...
@@ -24,7 +24,6 @@
#include "otbWrapperQtWidgetParameterFactory.h"
#include "otbWrapperStringParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperQtWidgetModel.h"
...
...
@@ -84,7 +83,6 @@ int otbWrapperQtWidgetParameterFactory(int argc, char* argv[])
otb
::
Wrapper
::
IntParameter
::
Pointer
intParam
=
otb
::
Wrapper
::
IntParameter
::
New
();
otb
::
Wrapper
::
FloatParameter
::
Pointer
floatParam
=
otb
::
Wrapper
::
FloatParameter
::
New
();
otb
::
Wrapper
::
EmptyParameter
::
Pointer
emptyParam
=
otb
::
Wrapper
::
EmptyParameter
::
New
();
otb
::
Wrapper
::
ChoiceParameter
::
Pointer
choiceParam
=
otb
::
Wrapper
::
ChoiceParameter
::
New
();
intParam
->
SetName
(
"Int parameter"
);