Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkToolCommand.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkToolCommand.h"
18 #include "mitkProgressBar.h"
19 
20 mitk::ToolCommand::ToolCommand() : m_ProgressValue(0), m_StopProcessing(false)
21 {
22 }
23 
24 void mitk::ToolCommand::Execute(itk::Object *, const itk::EventObject &event)
25 {
26  if (typeid(event) == typeid(itk::IterationEvent))
27  {
28  // MITK_INFO << "IterationEvent";
29  }
30 
31  if (typeid(event) == typeid(itk::ProgressEvent))
32  {
33  // MITK_INFO << "ToolCommand::ProgressEvent";
34  }
35 
36  if (typeid(event) == typeid(itk::AnyEvent))
37  {
38  // MITK_INFO << "AnyEvent";
39  }
40 
41  if (typeid(event) == typeid(itk::StartEvent))
42  {
43  // MITK_INFO << "StartEvent";
44  }
45 
46  if (typeid(event) == typeid(itk::EndEvent))
47  {
48  // MITK_INFO << "EndEvent";
49  }
50 
51  if (typeid(event) == typeid(itk::FunctionEvaluationIterationEvent))
52  {
53  // MITK_INFO << "FunctionEvaluationIterationEvent";
54  }
55 
56  if (typeid(event) == typeid(itk::GradientEvaluationIterationEvent))
57  {
58  // MITK_INFO << "GradientEvaluationIterationEvent";
59  }
60 
61  if (typeid(event) == typeid(itk::FunctionAndGradientEvaluationIterationEvent))
62  {
63  // MITK_INFO << "FunctionAndGradientEvaluationIterationEvent";
64  }
65 
67 }
68 
69 void mitk::ToolCommand::Execute(const itk::Object * /*caller*/, const itk::EventObject & /*event*/)
70 {
71 }
72 
74 {
76 }
77 
79 {
81 }
82 
84 {
85  return m_ProgressValue;
86 }
87 
89 {
90  m_StopProcessing = value;
91 }
void Progress(unsigned int steps=1)
Sets the current amount of progress to current progress + steps.
void SetStopProcessing(bool value)
Sets the stop processing flag, which is used to call ...
static ProgressBar * GetInstance()
static method to get the GUI dependent ProgressBar-instance so the methods for steps to do and progre...
void AddStepsToDo(int steps)
Add new steps to the progress bar.
double GetCurrentProgressValue()
Returns the current progress value.
void Execute(itk::Object *caller, const itk::EventObject &event) override
Reacts on events from ITK filters.
void SetProgress(int steps)
Sets the remaining progress to the progress bar when the optimization process is done.
void AddStepsToDo(unsigned int steps)
Adds steps to totalSteps.