MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
mlITKCommandIterationUpdate.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#pragma once
14
17#include "mlModuleIncludes.h"
18#include <itkCommand.h>
19
21
22//----------------------------------------------------------------------------------
24//----------------------------------------------------------------------------------
26{
27public:
30
32 typedef itk::Command Superclass;
33
35 typedef itk::SmartPointer<Self> Pointer;
36
38 typedef itk::SmartPointer<const Self> ConstPointer;
39
42
45
48 void setObject(itk::Object* object);
49
53
57
61
64
66 void reset();
67
68protected:
71
74
76 void Execute(itk::Object* obj, const itk::EventObject& event) override;
77
80 void Execute(const itk::Object* obj, const itk::EventObject& event) override;
81
82private:
84 unsigned long _observerHandleStartEvent;
85
87 unsigned long _observerHandleIterationEvent;
88
90 unsigned long _observerHandleEndEvent;
91
93 unsigned long _registered;
94
96 itk::Object* _object;
97
99 ml::StringField* _stringField;
100
102 ml::Field* _endEventField;
103
105 int _eventCounter;
106};
107
Base class for all fields used in the ML.
Definition mlField.h:73
Implementation of the Command Pattern to be invoked every iteration.
void setEndEventField(Field *strField)
Set field to be notified on EndEvents.
~ITKCommandIterationUpdate()
Destructor. Purposely implemented protected.
void Execute(itk::Object *obj, const itk::EventObject &event) override
Wrapper call to the const version.
void reset()
Reset update state.
itkNewMacro(Self)
Method for creation through the object factory.
void setObject(itk::Object *object)
Set object to be observed.
itk::SmartPointer< const Self > ConstPointer
ConstSmart pointer typedef support.
itk::SmartPointer< Self > Pointer
Smart pointer typedef support.
ITKCommandIterationUpdate Self
Standard Self typedef.
void Execute(const itk::Object *obj, const itk::EventObject &event) override
Gets object state and updates _stringField with process information if stringField is valid.
void setStringField(StringField *strField)
Set string field to be updated on object changes.
Field * getEndEventField() const
Get field to be notified on EndEvents or NULL if no field is set.
itk::Command Superclass
Standard "Superclass" typedef.
StringField * getStringField() const
Get string field to be updated on object changes or NULL if no field is set.
itkTypeMacro(ITKCommandIterationUpdate, ::itk::Command)
Run-time type information (and related methods).
ITKCommandIterationUpdate()
Constructor. Purposely implemented protected.
Field to encapsulate a string value.
Definition mlFields.h:634
#define MLITK_SUPPORT_EXPORT
When included by other libraries MLITK_SUPPORT_EXPORT is compiled as import symbol.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.