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

Method ExecuteViewAngleVisibility

Rendering/Annotation/vtkAxisFollower.cxx:430–451  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

428
429//------------------------------------------------------------------------------
430void 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//------------------------------------------------------------------------------
454void vtkAxisFollower::PrintSelf(ostream& os, vtkIndent indent)

Callers 1

Calls 3

NormalizeFunction · 0.50
DotFunction · 0.50
GetPositionMethod · 0.45

Tested by

no test coverage detected