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

Method GetViewportAxisLength

Rendering/Annotation/vtkAxisActor2D.cxx:576–593  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

574
575//------------------------------------------------------------------------------
576double vtkAxisActor2D::GetViewportAxisLength(vtkViewport* viewport)
577{
578 int* x = this->PositionCoordinate->GetComputedViewportValue(viewport);
579 double p1[3];
580 p1[0] = x[0];
581 p1[1] = x[1];
582 p1[2] = 0.0;
583
584 x = this->Position2Coordinate->GetComputedViewportValue(viewport);
585 double p2[3];
586 p2[0] = x[0];
587 p2[1] = x[1];
588 p2[2] = 0.0;
589
590 double axis[3];
591 vtkMath::Subtract(p2, p1, axis);
592 return vtkMath::Norm(axis);
593}
594
595//------------------------------------------------------------------------------
596double vtkAxisActor2D::GetViewportRulerDistance(vtkViewport* viewport)

Callers 2

Calls 3

SubtractFunction · 0.50
NormFunction · 0.50

Tested by

no test coverage detected