------------------------------------------------------------------------------
| 428 | |
| 429 | //------------------------------------------------------------------------------ |
| 430 | void vtkAxisFollower::ExecuteViewAngleVisibility(double normal[3]) |
| 431 | { |
| 432 | if (!normal) |
| 433 | { |
| 434 | vtkErrorMacro("ERROR: Invalid or nullptr normal\n"); |
| 435 | return; |
| 436 | } |
| 437 | |
| 438 | double* cameraPos = this->Camera->GetPosition(); |
| 439 | double dir[3] = { this->Position[0] - cameraPos[0], this->Position[1] - cameraPos[1], |
| 440 | this->Position[2] - cameraPos[2] }; |
| 441 | vtkMath::Normalize(dir); |
| 442 | double dotDir = vtkMath::Dot(dir, normal); |
| 443 | if (fabs(dotDir) < this->ViewAngleLODThreshold) |
| 444 | { |
| 445 | this->VisibleAtCurrentViewAngle = 0; |
| 446 | } |
| 447 | else |
| 448 | { |
| 449 | this->VisibleAtCurrentViewAngle = 1; |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | //------------------------------------------------------------------------------ |
| 454 | void vtkAxisFollower::PrintSelf(ostream& os, vtkIndent indent) |
no test coverage detected