Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkToolCommand.h"
14 #include "mitkProgressBar.h"
15 
16 mitk::ToolCommand::ToolCommand() : m_ProgressValue(0), m_StopProcessing(false)
17 {
18 }
19 
20 void mitk::ToolCommand::Execute(itk::Object *, const itk::EventObject &event)
21 {
22  if (typeid(event) == typeid(itk::IterationEvent))
23  {
24  // MITK_INFO << "IterationEvent";
25  }
26 
27  if (typeid(event) == typeid(itk::ProgressEvent))
28  {
29  // MITK_INFO << "ToolCommand::ProgressEvent";
30  }
31 
32  if (typeid(event) == typeid(itk::AnyEvent))
33  {
34  // MITK_INFO << "AnyEvent";
35  }
36 
37  if (typeid(event) == typeid(itk::StartEvent))
38  {
39  // MITK_INFO << "StartEvent";
40  }
41 
42  if (typeid(event) == typeid(itk::EndEvent))
43  {
44  // MITK_INFO << "EndEvent";
45  }
46 
47  if (typeid(event) == typeid(itk::FunctionEvaluationIterationEvent))
48  {
49  // MITK_INFO << "FunctionEvaluationIterationEvent";
50  }
51 
52  if (typeid(event) == typeid(itk::GradientEvaluationIterationEvent))
53  {
54  // MITK_INFO << "GradientEvaluationIterationEvent";
55  }
56 
57  if (typeid(event) == typeid(itk::FunctionAndGradientEvaluationIterationEvent))
58  {
59  // MITK_INFO << "FunctionAndGradientEvaluationIterationEvent";
60  }
61 
63 }
64 
65 void mitk::ToolCommand::Execute(const itk::Object * /*caller*/, const itk::EventObject & /*event*/)
66 {
67 }
68 
70 {
72 }
73 
75 {
77 }
78 
80 {
81  return m_ProgressValue;
82 }
83 
85 {
86  m_StopProcessing = value;
87 }
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.