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

Method SetImageOrientation

Interaction/Style/vtkInteractorStyleImage.cxx:567–584  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

565
566//------------------------------------------------------------------------------
567void vtkInteractorStyleImage::SetImageOrientation(
568 const double leftToRight[3], const double bottomToTop[3])
569{
570 if (this->CurrentRenderer)
571 {
572 // the cross product points out of the screen
573 double vector[3];
574 vtkMath::Cross(leftToRight, bottomToTop, vector);
575 double focus[3];
576 vtkCamera* camera = this->CurrentRenderer->GetActiveCamera();
577 camera->GetFocalPoint(focus);
578 double d = camera->GetDistance();
579 camera->SetPosition(
580 focus[0] + d * vector[0], focus[1] + d * vector[1], focus[2] + d * vector[2]);
581 camera->SetFocalPoint(focus);
582 camera->SetViewUp(bottomToTop);
583 }
584}
585
586//------------------------------------------------------------------------------
587// This is a way of dealing with images as if they were layers.

Callers 1

OnCharMethod · 0.95

Calls 6

GetActiveCameraMethod · 0.80
SetViewUpMethod · 0.80
CrossFunction · 0.50
GetDistanceMethod · 0.45
SetPositionMethod · 0.45
SetFocalPointMethod · 0.45

Tested by

no test coverage detected