| 256 | } |
| 257 | |
| 258 | void mitk::LevelWindowManager::Update(const itk::EventObject &) |
| 259 | { |
| 260 | if (m_LevelWindowMutex) // no mutex, should still help |
| 261 | { |
| 262 | return; |
| 263 | } |
| 264 | |
| 265 | m_DataNodesForLevelWindow.clear(); |
| 266 | if (m_AutoTopMost) |
| 267 | { |
| 268 | this->SetAutoTopMostImage(true); |
| 269 | return; |
| 270 | } |
| 271 | |
| 272 | if (m_SelectedImagesMode) |
| 273 | { |
| 274 | this->SetSelectedImages(true); |
| 275 | return; |
| 276 | } |
| 277 | |
| 278 | int maxVisibleLayer = itk::NumericTraits<int>::min(); |
| 279 | DataNode::Pointer topLevelNode = nullptr; |
| 280 | std::vector<DataNode::Pointer> nodesForLevelWindow; |
| 281 | |
| 282 | DataStorage::SetOfObjects::ConstPointer all = this->GetRelevantNodes(); |
| 283 | for (DataStorage::SetOfObjects::ConstIterator it = all->Begin(); it != all->End(); ++it) |
| 284 | { |
| 285 | DataNode::Pointer node = it->Value(); |
| 286 | if (node.IsNull()) |
| 287 | { |
| 288 | continue; |
| 289 | } |
| 290 | |
| 291 | if (false == node->IsVisible(nullptr)) |
| 292 | { |
| 293 | continue; |
| 294 | } |
| 295 | |
| 296 | bool validRenderingMode = HasLevelWindowRenderingMode(node); |
| 297 | if (false == validRenderingMode) |
| 298 | { |
| 299 | continue; |
| 300 | } |
| 301 | |
| 302 | bool prop = false; |
| 303 | node->GetBoolProperty("imageForLevelWindow", prop); |
| 304 | if (prop) |
| 305 | { |
| 306 | nodesForLevelWindow.push_back(node); |
| 307 | continue; |
| 308 | } |
| 309 | |
| 310 | int layer = -1; |
| 311 | node->GetIntProperty("layer", layer); |
| 312 | if (layer <= maxVisibleLayer) |
| 313 | { |
| 314 | continue; |
| 315 | } |
no test coverage detected