Код для этой функции приведен ниже:
Код: Выделить всё
angle_deg_t camera_impl::getAzimuth()
{
vtkCamera* cam = this->GetVTKCamera();
double pos[3], foc[3];
cam->GetPosition(pos);
cam->GetFocalPoint(foc);
double viewDir[3];
vtkMath::Subtract(foc, pos, viewDir);
double viewDirProj[2] = { viewDir[0], viewDir[1] };
if (vtkMath::Dot2D(viewDirProj, viewDirProj) < VTK_DBL_EPSILON)
{
return 0.0;
}
return vtkMath::DegreesFromRadians(atan2(viewDirProj[1], viewDirProj[0]));
}
Код: Выделить всё
f3d::angle_deg_t azimuth = cam.getAzimuth();
if (!compareDouble(azimuth, 90.0))
{
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79330964/writing-a-covered-test-in-c-so-it-can-pass-the-codecov-check[/url]
Мобильная версия