| 571 | } |
| 572 | |
| 573 | mitk::TimeBounds mitk::DataStorage::ComputeTimeBounds(const char *boolPropertyKey, |
| 574 | const BaseRenderer *renderer, |
| 575 | const char *boolPropertyKey2) |
| 576 | { |
| 577 | TimeBounds timeBounds; |
| 578 | |
| 579 | ScalarType stmin, stmax, cur; |
| 580 | |
| 581 | stmin = itk::NumericTraits<ScalarType>::NonpositiveMin(); |
| 582 | stmax = itk::NumericTraits<ScalarType>::max(); |
| 583 | |
| 584 | timeBounds[0] = stmax; |
| 585 | timeBounds[1] = stmin; |
| 586 | |
| 587 | SetOfObjects::ConstPointer all = this->GetAll(); |
| 588 | for (SetOfObjects::ConstIterator it = all->Begin(); it != all->End(); ++it) |
| 589 | { |
| 590 | DataNode::Pointer node = it->Value(); |
| 591 | if ((node.IsNotNull()) && (node->GetData() != nullptr) && (node->GetData()->IsEmpty() == false) && |
| 592 | node->IsOn(boolPropertyKey, renderer) && node->IsOn(boolPropertyKey2, renderer)) |
| 593 | { |
| 594 | const TimeGeometry *geometry = node->GetData()->GetUpdatedTimeGeometry(); |
| 595 | if (geometry != nullptr) |
| 596 | { |
| 597 | const TimeBounds &curTimeBounds = geometry->GetTimeBounds(); |
| 598 | cur = curTimeBounds[0]; |
| 599 | // is it after -infinity, but before everything else that we found until now? |
| 600 | if ((cur > stmin) && (cur < timeBounds[0])) |
| 601 | timeBounds[0] = cur; |
| 602 | |
| 603 | cur = curTimeBounds[1]; |
| 604 | // is it before infinity, but after everything else that we found until now? |
| 605 | if ((cur < stmax) && (cur > timeBounds[1])) |
| 606 | timeBounds[1] = cur; |
| 607 | } |
| 608 | } |
| 609 | } |
| 610 | if (!(timeBounds[0] < stmax)) |
| 611 | { |
| 612 | timeBounds[0] = stmin; |
| 613 | timeBounds[1] = stmax; |
| 614 | } |
| 615 | return timeBounds; |
| 616 | } |
| 617 | |
| 618 | void mitk::DataStorage::BlockNodeModifiedEvents(bool block) |
| 619 | { |
no test coverage detected