| 124 | } |
| 125 | |
| 126 | void QmitkSliceWidget::InitWidget(mitk::AnatomicalPlane view) |
| 127 | { |
| 128 | m_View = view; |
| 129 | |
| 130 | mitk::SliceNavigationController *controller = m_RenderWindow->GetSliceNavigationController(); |
| 131 | |
| 132 | if (view == mitk::AnatomicalPlane::Axial) |
| 133 | { |
| 134 | controller->SetViewDirection(mitk::AnatomicalPlane::Axial); |
| 135 | } |
| 136 | else if (view == mitk::AnatomicalPlane::Coronal) |
| 137 | { |
| 138 | controller->SetViewDirection(mitk::AnatomicalPlane::Coronal); |
| 139 | } |
| 140 | // init sagittal view for all other cases ('original' is covered here as well) |
| 141 | else |
| 142 | { |
| 143 | controller->SetViewDirection(mitk::AnatomicalPlane::Sagittal); |
| 144 | } |
| 145 | |
| 146 | if (m_SlicedGeometry.IsNull()) |
| 147 | { |
| 148 | return; |
| 149 | } |
| 150 | |
| 151 | mitk::BaseGeometry::Pointer geometry = static_cast<mitk::BaseGeometry *>(m_SlicedGeometry->Clone().GetPointer()); |
| 152 | |
| 153 | const mitk::BoundingBox::Pointer boundingbox = m_DataStorage->ComputeVisibleBoundingBox(GetRenderer(), nullptr); |
| 154 | |
| 155 | if (boundingbox->GetPoints()->Size() > 0) |
| 156 | { |
| 157 | // let's see if we have data with a limited live-span ... |
| 158 | mitk::TimeBounds timebounds = m_DataStorage->ComputeTimeBounds(GetRenderer(), nullptr); |
| 159 | |
| 160 | mitk::ProportionalTimeGeometry::Pointer timeGeometry = mitk::ProportionalTimeGeometry::New(); |
| 161 | timeGeometry->Initialize(geometry, 1); |
| 162 | |
| 163 | { |
| 164 | timeGeometry->SetFirstTimePoint(timebounds[0]); |
| 165 | timeGeometry->SetStepDuration(1.0); |
| 166 | } |
| 167 | |
| 168 | if (timeGeometry->GetBoundingBoxInWorld()->GetDiagonalLength2() >= mitk::eps) |
| 169 | { |
| 170 | controller->SetInputWorldTimeGeometry(timeGeometry); |
| 171 | controller->Update(); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | GetRenderer()->GetCameraController()->Fit(); |
| 176 | mitk::RenderingManager::GetInstance()->RequestUpdate(GetRenderer()->GetRenderWindow()); |
| 177 | } |
| 178 | |
| 179 | void QmitkSliceWidget::UpdateGL() |
| 180 | { |
no test coverage detected