1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef VVQPROGRESSDIALOGITKCOMMAND_CXX
19 #define VVQPROGRESSDIALOGITKCOMMAND_CXX
20 #include "clitkImageCommon.h"
21 #include "clitkPortability.h"
22 #include "vvQProgressDialogITKCommand.h"
24 //====================================================================
25 vvQProgressDialogITKCommand::vvQProgressDialogITKCommand()
27 progress.setWindowModality(Qt::WindowModal);
28 progress.setCancelButtonText("Cancel");
30 //====================================================================
32 //====================================================================
33 void vvQProgressDialogITKCommand::Initialize(QString title, float sec, int max)
35 progress.setMinimumDuration((int)lrint(1000.0*sec)); // number of seconds to wait before displaying dialog
36 progress.setLabelText(title);
38 progress.setMaximum(max);
40 //====================================================================
42 //====================================================================
43 void vvQProgressDialogITKCommand::Execute(itk::Object *caller, const itk::EventObject & event)
47 if (progress.wasCanceled()) {
48 itk::ProcessObject * o = dynamic_cast<itk::ProcessObject *>(caller);
49 o->SetAbortGenerateData(true);
52 //====================================================================
54 //====================================================================
55 void vvQProgressDialogITKCommand::Execute(const itk::Object *caller, const itk::EventObject & event)
60 //====================================================================
62 #endif /* end #define VVQPROGRESSDIALOGITKCOMMAND_CXX */