Parameter bool
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
Activity
added 68 commits
-
2ed55283...99723cb9 - 67 commits from branch
develop
- 47c79d52 - MRG: Synchronize with branch develop
-
2ed55283...99723cb9 - 67 commits from branch
added 1 commit
- a3ab4813 - DOC: clarification about EmptyParameter/BoolParameter
mentioned in commit 751d1724
I think this MR broke the automatic generation of application documentation in RST for Cookbook:
All apps: ['BandMath', 'BinaryMorphologicalOperation', 'BlockMatching', 'BundleToPerfectSensor', 'ClassificationMapRegularization', 'ColorMapping', 'CompareImages', 'ComputeConfusionMatrix', 'ComputeImagesStatistics', 'ComputeModulusAndPhase', 'ComputeOGRLayersFeaturesStatistics', 'ComputePolylineFeatureFromImage', 'ConcatenateImages', 'ConcatenateVectorData', 'ConnectedComponentSegmentation', 'ContrastEnhancement', 'Convert', 'ConvertCartoToGeoPoint', 'ConvertSensorToGeoPoint', 'DEMConvert', 'DSFuzzyModelEstimation', 'Despeckle', 'DimensionalityReduction', 'DisparityMapToElevationMap', 'DomainTransform', 'DownloadSRTMTiles', 'DynamicConvert', 'EdgeExtraction', 'ExtractROI', 'FineRegistration', 'FusionOfClassifications', 'GeneratePlyFile', 'GenerateRPCSensorModel', 'GrayScaleMorphologicalOperation', 'GridBasedImageResampling', 'HaralickTextureExtraction', 'HomologousPointsExtraction', 'HooverCompareSegmentation', 'HyperspectralUnmixing', 'ImageClassifier', 'ImageDimensionalityReduction', 'ImageEnvelope', 'KMeansClassification', 'LSMSSegmentation', 'LSMSSmallRegionsMerging', 'LSMSVectorization', 'LargeScaleMeanShift', 'LineSegmentDetection', 'LocalStatisticExtraction', 'ManageNoData', 'MeanShiftSmoothing', 'MorphologicalClassification', 'MorphologicalMultiScaleDecomposition', 'MorphologicalProfilesAnalysis', 'MultiImageSamplingRate', 'MultiResolutionPyramid', 'MultivariateAlterationDetector', 'OGRLayerClassifier', 'OSMDownloader', 'ObtainUTMZoneFromGeoPoint', 'OpticalCalibration', 'OrthoRectification', 'Pansharpening', 'PixelValue', 'PolygonClassStatistics', 'PredictRegression', 'Quicklook', 'RadiometricIndices', 'Rasterization', 'ReadImageInfo', 'RefineSensorModel', 'Rescale', 'RigidTransformResample', 'SARCalibration', 'SARDeburst', 'SARDecompositions', 'SARPolarMatrixConvert', 'SARPolarSynth', 'SFSTextureExtraction', 'SOMClassification', 'SampleExtraction', 'SampleSelection', 'Segmentation', 'Smoothing', 'SplitImage', 'StereoFramework', 'StereoRectificationGridGenerator', 'Superimpose', 'TileFusion', 'TrainDimensionalityReduction', 'TrainImagesClassifier', 'TrainRegression', 'TrainVectorClassifier', 'VectorClassifier', 'VectorDataDSValidation', 'VectorDataExtractROI', 'VectorDataReprojection', 'VectorDataSetField', 'VectorDataTransform', 'VectorDimensionalityReduction', 'VertexComponentAnalysis'] Generating BandMath.rst on tag Miscellaneous Traceback (most recent call last): File "/home/michelj/dev/src/otb/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py", line 587, in <module> GenerateRstForApplications() File "/home/michelj/dev/src/otb/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py", line 567, in GenerateRstForApplications out = ApplicationToRst(appName) File "/home/michelj/dev/src/otb/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py", line 460, in ApplicationToRst output += ApplicationParametersToRstV2(app,app.GetParametersKeys(),deep) + linesep File "/home/michelj/dev/src/otb/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py", line 272, in ApplicationParametersToRstV2 output += GenerateParametersTable(app,paramlist) File "/home/michelj/dev/src/otb/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py", line 189, in GenerateParametersTable colLength = FindLengthOfLargestColumnText(app, paramlist) File "/home/michelj/dev/src/otb/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py", line 159, in FindLengthOfLargestColumnText lenpdescr = len(GenerateParameterType(app, param)) File "/home/michelj/dev/src/otb/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py", line 99, in GenerateParameterType or app.GetParameterType(param) == otbApplication.ParameterType_Bool: AttributeError: 'module' object has no attribute 'ParameterType_Bool' CMakeFiles/generate_otbapps_rst.dir/build.make:57 : la recette pour la cible « CMakeFiles/generate_otbapps_rst » a échouée make[2]: *** [CMakeFiles/generate_otbapps_rst] Erreur 1 CMakeFiles/Makefile2:584 : la recette pour la cible « CMakeFiles/generate_otbapps_rst.dir/all » a échouée make[1]: *** [CMakeFiles/generate_otbapps_rst.dir/all] Erreur 2 Makefile:94 : la recette pour la cible « all » a échouée make: *** [all] Erreur 2
mentioned in merge request !307 (merged)
mentioned in issue remote_modules/diapotb#3 (closed)