------------------------------------------------------------------------------
| 389 | |
| 390 | //------------------------------------------------------------------------------ |
| 391 | int vtkAxisFollower::TestDistanceVisibility() |
| 392 | { |
| 393 | if (!this->Camera->GetParallelProjection()) |
| 394 | { |
| 395 | double cameraClippingRange[2]; |
| 396 | |
| 397 | this->Camera->GetClippingRange(cameraClippingRange); |
| 398 | |
| 399 | // We are considering the far clip plane for evaluation. In certain |
| 400 | // odd conditions it might not work. |
| 401 | const double maxVisibleDistanceFromCamera = |
| 402 | this->DistanceLODThreshold * (cameraClippingRange[1]); |
| 403 | |
| 404 | double dist = |
| 405 | sqrt(vtkMath::Distance2BetweenPoints(this->Camera->GetPosition(), this->Position)); |
| 406 | |
| 407 | if (dist > maxVisibleDistanceFromCamera) |
| 408 | { |
| 409 | // Need to make sure we are not looking at a flat axis and therefore should enable it anyway |
| 410 | if (this->Axis) |
| 411 | { |
| 412 | vtkBoundingBox bbox(this->Axis->GetBounds()); |
| 413 | return (bbox.GetDiagonalLength() > (cameraClippingRange[1] - cameraClippingRange[0])) ? 1 |
| 414 | : 0; |
| 415 | } |
| 416 | return 0; |
| 417 | } |
| 418 | else |
| 419 | { |
| 420 | return 1; |
| 421 | } |
| 422 | } |
| 423 | else |
| 424 | { |
| 425 | return 1; |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | //------------------------------------------------------------------------------ |
| 430 | void vtkAxisFollower::ExecuteViewAngleVisibility(double normal[3]) |
no test coverage detected