------------------------------------------------------------------------------
| 594 | |
| 595 | //------------------------------------------------------------------------------ |
| 596 | double vtkAxisActor2D::GetViewportRulerDistance(vtkViewport* viewport) |
| 597 | { |
| 598 | double wp1[3], wp2[3], wp21[3]; |
| 599 | this->PositionCoordinate->GetValue(wp1); |
| 600 | this->Position2Coordinate->GetValue(wp2); |
| 601 | vtkMath::Subtract(wp2, wp1, wp21); |
| 602 | |
| 603 | const double worldLength = vtkMath::Norm(wp21); |
| 604 | // Tick distance was computed in world coordinates, convert to viewport |
| 605 | // coordinates. |
| 606 | double length = this->GetViewportAxisLength(viewport); |
| 607 | const double worldToLocalRatio = (worldLength <= 0.0 ? 0.0 : length / worldLength); |
| 608 | return this->RulerDistance * worldToLocalRatio; |
| 609 | } |
| 610 | |
| 611 | //------------------------------------------------------------------------------ |
| 612 | double vtkAxisActor2D::GetAxisAngle(vtkViewport* viewport) |
no test coverage detected