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

Method TriangulateLocalIds

Common/DataModel/vtkPolygon.cxx:1926–1946  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1924
1925//------------------------------------------------------------------------------
1926int vtkPolygon::TriangulateLocalIds(int vtkNotUsed(index), vtkIdList* ptIds)
1927{
1928 this->SuccessfulTriangulation = 1;
1929 int success = this->EarCutTriangulation(ptIds);
1930 if (!success) // Indicate possible failure
1931 {
1932 // Non-planar quads can cause the ear cut triangulation algorithm to fail.
1933 // If that happens, use vtkQuad specifically to triangulate the quad.
1934 if (this->PointIds->GetNumberOfIds() == 4)
1935 {
1936 vtkNew<vtkQuad> quad;
1937 quad->DeepCopy(this);
1938 quad->TriangulateLocalIds(0, ptIds);
1939 }
1940 else
1941 {
1942 vtkDebugMacro(<< "Possible triangulation failure");
1943 }
1944 }
1945 return this->SuccessfulTriangulation;
1946}
1947
1948//------------------------------------------------------------------------------
1949// Samples at three points to compute derivatives in local r-s coordinate

Callers 1

Calls 3

EarCutTriangulationMethod · 0.95
GetNumberOfIdsMethod · 0.45
DeepCopyMethod · 0.45

Tested by

no test coverage detected