NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Class for collecting ITK signals and sending notifications of them to registered listeners. More...
Public Types | |
typedef std::pair< const itk::Object *, itk::EventObject * > | Signal |
typedef std::vector< Signal > | Signals |
Public Member Functions | |
mitkClassMacroItkParent (ItkSignalCollector, itk::Command) static Pointer New() | |
void | Connect (itk::Object *object, const itk::EventObject &event) |
Connects this object to the events of the given object. The current object will collect the given type of signals of that object. More... | |
void | AddListener (ItkSignalListener *listener) |
Adds a listener that will get notified of the ITK signals that this object is connected to. More... | |
void | RemoveListener (ItkSignalListener *listener) |
Removes a listener. The listener will not get notified about the ITK signals observed by the current object, any more. More... | |
const Signals & | GetSignals () const |
Gets the signals collected by this object. More... | |
Signals | GetSignals (const itk::EventObject &event) const |
Returns a set of the collected ITK signals that are of the given type or its subtype. More... | |
Signals | GetSignals (const itk::Object *object, const itk::EventObject &event=itk::AnyEvent()) const |
Returns a set of the collected ITK signals that are sent from the given object, and are of the given type or its subtype. More... | |
virtual void | Clear () |
Clears all the signals collected by now. More... | |
virtual void | ProcessEvent (const itk::Object *object, const itk::EventObject &event) |
Adds the object-event pair to the list of collected signals. More... | |
Protected Member Functions | |
ItkSignalCollector () | |
Constructs an ItkSignalCollector object. More... | |
virtual | ~ItkSignalCollector () |
Destructs an ItkSignalCollector object. More... | |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
Prints the collected signals to the given stream or to the standard output if no stream is given. More... | |
Class for collecting ITK signals and sending notifications of them to registered listeners.
typedef std::pair<const itk::Object*, itk::EventObject*> niftk::ItkSignalCollector::Signal |
typedef std::vector<Signal> niftk::ItkSignalCollector::Signals |
|
protected |
Constructs an ItkSignalCollector object.
|
protectedvirtual |
Destructs an ItkSignalCollector object.
void niftk::ItkSignalCollector::AddListener | ( | ItkSignalListener * | listener | ) |
Adds a listener that will get notified of the ITK signals that this object is connected to.
Clears all the signals collected by now.
Destruct the copies of the original events.
Remove the elements.
void niftk::ItkSignalCollector::Connect | ( | itk::Object * | object, |
const itk::EventObject & | event | ||
) |
Connects this object to the events of the given object. The current object will collect the given type of signals of that object.
const ItkSignalCollector::Signals & niftk::ItkSignalCollector::GetSignals | ( | ) | const |
Gets the signals collected by this object.
ItkSignalCollector::Signals niftk::ItkSignalCollector::GetSignals | ( | const itk::EventObject & | event | ) | const |
Returns a set of the collected ITK signals that are of the given type or its subtype.
ItkSignalCollector::Signals niftk::ItkSignalCollector::GetSignals | ( | const itk::Object * | object, |
const itk::EventObject & | event = itk::AnyEvent() |
||
) | const |
Returns a set of the collected ITK signals that are sent from the given object, and are of the given type or its subtype.
niftk::ItkSignalCollector::mitkClassMacroItkParent | ( | ItkSignalCollector | , |
itk::Command | |||
) |
|
overrideprotectedvirtual |
Prints the collected signals to the given stream or to the standard output if no stream is given.
|
virtual |
Adds the object-event pair to the list of collected signals.
Create a copy of the event as a newly allocated object.
void niftk::ItkSignalCollector::RemoveListener | ( | ItkSignalListener * | listener | ) |
Removes a listener. The listener will not get notified about the ITK signals observed by the current object, any more.