-----------------------------------------------------------------------------
| 38 | |
| 39 | //----------------------------------------------------------------------------- |
| 40 | int TestPyramid(int, char*[]) |
| 41 | { |
| 42 | constexpr double tol = 0.000001; |
| 43 | |
| 44 | vtkNew<vtkPyramid> pyramid; |
| 45 | pyramid->GetPoints()->SetPoint(0, 1.0, 1.0, 1.0); |
| 46 | pyramid->GetPoints()->SetPoint(1, -1.0, 1.0, 1.0); |
| 47 | pyramid->GetPoints()->SetPoint(2, -1.0, -1.0, 1.0); |
| 48 | pyramid->GetPoints()->SetPoint(3, 1.0, -1.0, 1.0); |
| 49 | pyramid->GetPoints()->SetPoint(4, 0.0, 0.0, 0.0); |
| 50 | |
| 51 | // Testing vtkPyramid::ComputeCentroid and vtkPyramid::GetCentroid |
| 52 | std::array<double, 3> centroid; |
| 53 | bool res = pyramid->GetCentroid(centroid.data()); |
| 54 | VTK_REQUIRE(res, "vtkPyramid::GetCentroid FAILED: couldn't determine centroid"); |
| 55 | VTK_REQUIRE(FuzzyCompare(centroid, { 0.0, 0.0, 0.75 }, tol), |
| 56 | "vtkPyramid::GetCentroid FAILED: wrong centroid"); |
| 57 | return EXIT_SUCCESS; |
| 58 | } |
nothing calls this directly
no test coverage detected