1 /*=========================================================================
5 Author : Pierre Seroul (pierre.seroul@gmail.com)
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, version 3 of the License.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 =========================================================================*/
24 #ifndef VVQPROGRESSDIALOGITKCOMMAND_CXX
25 #define VVQPROGRESSDIALOGITKCOMMAND_CXX
27 #include "clitkIOCommon.h"
28 #include "vvQProgressDialogITKCommand.h"
30 //====================================================================
31 vvQProgressDialogITKCommand::vvQProgressDialogITKCommand() {
32 progress.setWindowModality(Qt::WindowModal);
33 progress.setCancelButtonText("Cancel");
35 //====================================================================
37 //====================================================================
38 void vvQProgressDialogITKCommand::Initialize(QString title, float sec, int max) {
39 progress.setMinimumDuration((int)lrint(1000.0*sec)); // number of seconds to wait before displaying dialog
40 progress.setLabelText(title);
42 progress.setMaximum(max);
44 //====================================================================
46 //====================================================================
47 void vvQProgressDialogITKCommand::Execute(itk::Object *caller, const itk::EventObject & event) {
50 if (progress.wasCanceled()) {
51 itk::ProcessObject * o = dynamic_cast<itk::ProcessObject *>(caller);
52 o->SetAbortGenerateData(true);
55 //====================================================================
57 //====================================================================
58 void vvQProgressDialogITKCommand::Execute(const itk::Object *caller, const itk::EventObject & event) {
62 //====================================================================
64 #endif /* end #define VVQPROGRESSDIALOGITKCOMMAND_CXX */