MCPcopy Create free account
hub / github.com/Kitware/VTK / UpdateOrientation

Method UpdateOrientation

Interaction/Image/vtkImageViewer2.cxx:298–326  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

296
297//------------------------------------------------------------------------------
298void vtkImageViewer2::UpdateOrientation()
299{
300 // Set the camera position
301
302 vtkCamera* cam = this->Renderer ? this->Renderer->GetActiveCamera() : nullptr;
303 if (cam)
304 {
305 switch (this->SliceOrientation)
306 {
307 case vtkImageViewer2::SLICE_ORIENTATION_XY:
308 cam->SetFocalPoint(0, 0, 0);
309 cam->SetPosition(0, 0, 1); // -1 if medical ?
310 cam->SetViewUp(0, 1, 0);
311 break;
312
313 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
314 cam->SetFocalPoint(0, 0, 0);
315 cam->SetPosition(0, -1, 0); // 1 if medical ?
316 cam->SetViewUp(0, 0, 1);
317 break;
318
319 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
320 cam->SetFocalPoint(0, 0, 0);
321 cam->SetPosition(1, 0, 0); // -1 if medical ?
322 cam->SetViewUp(0, 0, 1);
323 break;
324 }
325 }
326}
327
328//------------------------------------------------------------------------------
329void vtkImageViewer2::UpdateDisplayExtent()

Callers 2

SetRendererMethod · 0.95
SetSliceOrientationMethod · 0.95

Calls 4

GetActiveCameraMethod · 0.80
SetViewUpMethod · 0.80
SetFocalPointMethod · 0.45
SetPositionMethod · 0.45

Tested by

no test coverage detected