Stop button for graphic applications

Guillaume Pasero requested to merge stop_appli_button into develop


Provides a Cancel button that stops the processing of an Application. This button is available in GUI launchers, Monteverdi, and Mapla.


This is a long-awaited feature, also part of the story #1514. It allows users to cancel a long processing when the parameters needs to be changed.

Implementation Details

Classes and files

M       Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h
M       Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.txx
M       Modules/IO/ImageIO/include/otbImageFileWriter.h
M       Modules/IO/ImageIO/include/otbImageFileWriter.txx
M       Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h
M       Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.txx

The flag AbortGenerateData inherited from itk::ProcessObject has been protected with a mutex. This flag is now used to interupt the processing between 2 stream divisions. A specific exception is thrown in order to stop the thread.

M       Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h
M       Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx

The class Application has a new Stop() function. It uses the processObject in m_ProgressSource, meaning that the application can stop any process that is currently monitored after a call to AddProcess().

M       Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetModel.h
M       Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetModel.cxx

The QtWidgetModel transfer the Stop() signal to its application.

M       Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetView.h
M       Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetView.cxx

Update and refactoring for the QtWidgetView. It now implement the Stop() mechanism and is now a base class for mvd::Wrapper::QtWidgetView (which was a duplicate).

M       Modules/Visualization/MonteverdiGui/include/mvdQtWidgetView.h
M       Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx
M       Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx
M       Modules/Visualization/MonteverdiGui/src/mvdApplicationLauncher.cxx

Refactoring of mvd::Wrapper::QtWidgetView which is now a derived class of otb::Wrapper::QtWidgetView. Monteverdi and Mapla can now use the Stop() button without effort.




Additional notes

With the current implementation the stop message can only interrupt a processing between two streaming chunks. It means that if you launch a processing with a RAM value high enough to store the full output, your cancel signal will be processed, but only after the full image has been processed. To test the behaviour, please set low RAM parameters.

Merge request reports