13 #ifndef TimeNavigationController_h
14 #define TimeNavigationController_h
21 #include <itkCommand.h>
83 void SetInputWorldTimeGeometry(
const TimeGeometry* geometry);
91 virtual void Update();
99 virtual void SendTime();
111 bool CheckEvent(const ::itk::EventObject *e)
const override {
return dynamic_cast<const Self *
>(e); }
117 void operator=(
const Self &);
120 template <
typename T>
123 typedef typename itk::ReceptorMemberCommand<T>::Pointer ReceptorMemberCommandPointer;
124 ReceptorMemberCommandPointer eventReceptorCommand = itk::ReceptorMemberCommand<T>::New();
125 eventReceptorCommand->SetCallbackFunction(receiver, &T::SetGeometryTime);
126 unsigned long tag = AddObserver(
TimeEvent(0), eventReceptorCommand);
127 m_ReceiverToObserverTagsMap[
static_cast<void *
>(receiver)].push_back(tag);
131 template <
typename T>
134 auto i = m_ReceiverToObserverTagsMap.find(
static_cast<void*
>(receiver));
135 if (i == m_ReceiverToObserverTagsMap.end())
137 const std::list<unsigned long>& tags = i->second;
138 for (
auto tagIter = tags.begin(); tagIter != tags.end(); ++tagIter)
140 RemoveObserver(*tagIter);
142 m_ReceiverToObserverTagsMap.erase(i);