StereoRectificationGridGenerator, undesired default enabling of -inverse.outleft and -inverse.outright param.
Mantis Issue 995, reported by cpalmann, assigned to jmichel, created: 2014-12-16
Undesired default enabling of -inverse.outleft and -inverse.outright parameters. Moreover MVD2 automatically sets filenames for both these parameters.
MVD2 0.8
Note that this bug is related to this one: #993 (closed).
2014-12-17 09:23 - rashadkm: Are you getting the same error in otbgui_StereoRectificationGridGenerator ?
2014-12-17 15:16 - cpalmann: No! This concerns MVD2 only ;-)
2015-01-06 12:06 - salbert: This bug is general to all OTB-applications for which parameters are initialized when integrating them into the MVD2 GUI (e.g. and especially for input and output filename parameters).
When parameters are initialized in MVD2 (by functions of http://hg.orfeo-toolbox.org/Monteverdi2/file/92bdc7cbc2ee/Code/Common/ApplicationsWrapper/mvdWrapperQtWidgetParameterInitializers.h e.g. by SetupOutputFilename http://hg.orfeo-toolbox.org/Monteverdi2/file/92bdc7cbc2ee/Code/Common/ApplicationsWrapper/mvdWrapperQtWidgetParameterInitializers.h#l598), a call to otb::Wrapper::QtWidgetOutputFilenameParameter::SetFileName() is made. It causes a ParameterChanged() event to be signaled which, in turn, causes a call to:
(1) otb::Wrapper::OutputFilenameParameter::SetValue( const std::string value ) (http://hg.orfeo-toolbox.org/OTB/file/7e86c802a261/Code/ApplicationEngine/otbWrapperOutputFilenameParameter.h#l58)
This method unconditionally sets the Actived flag while it's sometimes need to activate it or not (this is the cause of the bug)!
(2) otb::Wrapper::QtWidgetParameterBase::DoUpdateGUI() (http://hg.orfeo-toolbox.org/OTB/file/7e86c802a261/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.cxx#l44)
This method emits a ParameterActiveStatus( state ) signal which is the always true instead of being false when parameter has been setup from MVD2 and true when input by user from standalone OTB-application.
This is done to check the otb::Wrapper::QtWidgetParameterGroup activation check-box (which is, in turn, always checked).
To solve the bug the otb::Wrapper::OutputFilenameParameter::SetValue( const std::string ) signature must be changed to ::SetValue( const std::string & value, bool activate ).
N.B.: Notive the addition of a reference to avoid needless std::string copies causing memory allocations/deallocations.
N.B. 2: The SetValue() is virtual but no class derived from otb::Wrapper::Input/OutputFilenameParameter.
This is exactly the same for otb::Wrapper::InputFilenameParameter
After having checked the a few other classes derived from otb::Wrapper::Parameter, it seems the problem is generalized (e.g. otb::Wrapper::InputImageParameter, otb::Wrapper::StringParameter etc.)
So, all ::SetValue()/::SetFromFilename()/::SetFromVectorData() etc. methods must be added a boolean activate flag or another general solution must be found.