| 132 | } |
| 133 | |
| 134 | void mitk::Tool::Activated() |
| 135 | { |
| 136 | // As a legacy solution the display interaction of the new interaction framework is disabled here to avoid conflicts |
| 137 | // with tools |
| 138 | // Note: this only affects InteractionEventObservers (formerly known as Listeners) all DataNode specific interaction |
| 139 | // will still be enabled |
| 140 | m_DisplayInteractionConfigs.clear(); |
| 141 | auto eventObservers = us::GetModuleContext()->GetServiceReferences<InteractionEventObserver>(); |
| 142 | for (const auto& eventObserver : eventObservers) |
| 143 | { |
| 144 | auto displayActionEventBroadcast = dynamic_cast<DisplayActionEventBroadcast*>( |
| 145 | us::GetModuleContext()->GetService<InteractionEventObserver>(eventObserver)); |
| 146 | if (nullptr != displayActionEventBroadcast) |
| 147 | { |
| 148 | // remember the original configuration |
| 149 | m_DisplayInteractionConfigs.insert(std::make_pair(eventObserver, displayActionEventBroadcast->GetEventConfig())); |
| 150 | // here the alternative configuration is loaded |
| 151 | displayActionEventBroadcast->AddEventConfig(m_EventConfig.c_str()); |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | void mitk::Tool::Deactivated() |
| 157 | { |
no test coverage detected