Skip to content

Parameter bool

Guillaume Pasero requested to merge parameter_bool into develop

Summary

This branch contains a new boolean parameter for ApplicationEngine.

Rationale

The ParameterType_Empty was not correctly designed. This is part of story #1514.

Implementation Details

Classes and files

A       Modules/Wrappers/ApplicationEngine/include/otbWrapperBoolParameter.h
M       Modules/Wrappers/ApplicationEngine/include/otbWrapperEmptyParameter.h
M       Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h
M       Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt
M       Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
A       Modules/Wrappers/ApplicationEngine/src/otbWrapperBoolParameter.cxx
M       Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx
M       Modules/Wrappers/ApplicationEngine/src/otbWrapperMapProjectionParametersHandler.cxx
M       Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx
M       Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx

The new parameter BoolParameter is added to ApplicationEngine, it corresponds to enum value ParameterType_Bool. Its value is independent from its m_Active flag. It is a mandatory parameter, and always has a value (False by default). The state of the parameter can be modified/retrieved using SetParameterInt(), GetParameterInt(), GetParameterString() and SetParameterString() from the class otb::Wrapper::Application. The strings "0", "1", "on", "off", "true", "false", "yes", "no" are supported (case insensitive).

M       Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx
A       Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetBoolParameter.h
M       Modules/Wrappers/QtWidget/src/CMakeLists.txt
A       Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetBoolParameter.cxx
M       Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterFactory.cxx
M       Modules/Wrappers/SWIG/src/otbApplication.i

The different launchers have been updated to handle BoolParameter. Note that the design of the QtWidgetBoolParameter is a bit different from the Empty parameter.

Applications

M       Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx
M       Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx
M       Modules/Applications/AppClassification/app/otbKMeansClassification.cxx
M       Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx
M       Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx
M       Modules/Applications/AppClassification/app/otbVectorClassifier.cxx
M       Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx
M       Modules/Applications/AppClassification/include/otbTrainImagesBase.txx
M       Modules/Applications/AppClassification/include/otbTrainLibSVM.txx
M       Modules/Applications/AppClassification/include/otbTrainSVM.txx
M       Modules/Applications/AppClassification/include/otbTrainVectorBase.txx
M       Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx
M       Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
M       Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
M       Modules/Applications/AppEdge/app/otbLineSegmentDetection.cxx
M       Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx
M       Modules/Applications/AppImageUtils/app/otbManageNoData.cxx
M       Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx
M       Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx
M       Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
M       Modules/Applications/AppProjection/app/otbOrthoRectification.cxx
M       Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx
M       Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx
M       Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
M       Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx
M       Modules/Applications/AppSegmentation/app/otbSegmentation.cxx
M       Modules/Applications/AppStereo/app/otbBlockMatching.cxx
M       Modules/Applications/AppStereo/app/otbStereoFramework.cxx
M       Modules/Applications/AppTest/app/otbTestApplication.cxx
M       Modules/Applications/AppVectorUtils/app/otbOSMDownloader.cxx

The EmptyParameter has been replaced by BoolParameter in OTB Applications.

Tests

M       Modules/Wrappers/SWIG/test/python/PythonNewStyleParametersTest.py

One Python test has been updated.

Documentation

M       Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py

The CookBook generation script has been updated. Other than that, the Empty parameter is not referred to in the documentation.

Additional notes

Merge request reports