| 607 | } |
| 608 | |
| 609 | unsigned long |
| 610 | ProcessObject::AddObserverToActiveProcessObject(EventCommand & eventCommand) |
| 611 | { |
| 612 | assert(this->m_ActiveProcess); |
| 613 | |
| 614 | if (eventCommand.m_ITKTag != std::numeric_limits<unsigned long>::max()) |
| 615 | { |
| 616 | sitkExceptionMacro("Commands already registered to another process object!"); |
| 617 | } |
| 618 | |
| 619 | const itk::EventObject & itkEvent = GetITKEventObject(eventCommand.m_Event); |
| 620 | |
| 621 | // adapt sitk command to itk command |
| 622 | SimpleAdaptorCommand::Pointer itkCommand = SimpleAdaptorCommand::New(); |
| 623 | itkCommand->SetSimpleCommand(eventCommand.m_Command); |
| 624 | itkCommand->SetObjectName(eventCommand.m_Command->GetName() + " " + itkEvent.GetEventName()); |
| 625 | |
| 626 | return eventCommand.m_ITKTag = this->AddITKObserver(itkEvent, itkCommand); |
| 627 | } |
| 628 | |
| 629 | void |
| 630 | ProcessObject::RemoveObserverFromActiveProcessObject(EventCommand & e) |
no test coverage detected