| 118 | } |
| 119 | |
| 120 | void mitk::TimeGeometry::UpdateBoundingBox() |
| 121 | { |
| 122 | assert(m_BoundingBox.IsNotNull()); |
| 123 | typedef BoundingBox::PointsContainer ContainerType; |
| 124 | |
| 125 | unsigned long lastModifiedTime = 0; |
| 126 | unsigned long currentModifiedTime = 0; |
| 127 | |
| 128 | ContainerType::Pointer points = ContainerType::New(); |
| 129 | const TimeStepType numberOfTimesteps = CountTimeSteps(); |
| 130 | |
| 131 | points->reserve(2*numberOfTimesteps); |
| 132 | for (TimeStepType step = 0; step <numberOfTimesteps; ++step) |
| 133 | { |
| 134 | currentModifiedTime = GetGeometryForTimeStep(step)->GetMTime(); |
| 135 | if (currentModifiedTime > lastModifiedTime) |
| 136 | lastModifiedTime = currentModifiedTime; |
| 137 | |
| 138 | for (int i = 0; i < 8; ++i) |
| 139 | { |
| 140 | Point3D cornerPoint = GetGeometryForTimeStep(step)->GetCornerPoint(i); |
| 141 | points->push_back(cornerPoint); |
| 142 | } |
| 143 | } |
| 144 | m_BoundingBox->SetPoints(points); |
| 145 | m_BoundingBox->ComputeBoundingBox(); |
| 146 | if (this->GetMTime() < lastModifiedTime) |
| 147 | this->Modified(); |
| 148 | } |
| 149 | |
| 150 | mitk::ScalarType mitk::TimeGeometry::GetExtentInWorld(unsigned int direction) const |
| 151 | { |
no test coverage detected