MCPcopy Create free account
hub / github.com/cinder/Cinder / IsEar

Method IsEar

src/imgui/imgui_draw.cpp:1964–1975  ·  view source on GitHub ↗

A triangle is an ear is no other vertex is inside it. We can test reflexes vertices only (see reference algorithm)

Source from the content-addressed store, hash-verified

1962
1963// A triangle is an ear is no other vertex is inside it. We can test reflexes vertices only (see reference algorithm)
1964bool ImTriangulator::IsEar(int i0, int i1, int i2, const ImVec2& v0, const ImVec2& v1, const ImVec2& v2) const
1965{
1966 ImTriangulatorNode** p_end = _Reflexes.Data + _Reflexes.Size;
1967 for (ImTriangulatorNode** p = _Reflexes.Data; p < p_end; p++)
1968 {
1969 ImTriangulatorNode* reflex = *p;
1970 if (reflex->Index != i0 && reflex->Index != i1 && reflex->Index != i2)
1971 if (ImTriangleContainsPoint(v0, v1, v2, reflex->Pos))
1972 return false;
1973 }
1974 return true;
1975}
1976
1977void ImTriangulator::ReclassifyNode(ImTriangulatorNode* n1)
1978{

Callers

nothing calls this directly

Calls 1

ImTriangleContainsPointFunction · 0.85

Tested by

no test coverage detected