Partially revert e483dacc3b44f4772043ccffa1a52c46ffcabdbe.

this function is needed in the demo plugin
This commit is contained in:
Jane Tournois 2024-04-15 09:46:33 +02:00
parent ed72bfc811
commit b4c28e6806
1 changed files with 22 additions and 0 deletions

View File

@ -792,6 +792,28 @@ bool is_edge_in_complex(const typename C3t3::Vertex_handle& v0,
return false;
}
// this function is used in the demo plugin
template<typename C3t3>
bool protecting_balls_intersect(const typename C3t3::Edge& e,
const C3t3& c3t3)
{
const auto vv = c3t3.triangulation().vertices(e);
if( c3t3.in_dimension(vv[0]) > 1
|| c3t3.in_dimension(vv[1]) > 1)
return false;
const auto& p0 = vv[0]->point();
const auto& p1 = vv[1]->point();
if(p0.weight() == 0 || p1.weight() == 0)
return false;
const auto r0 = CGAL::approximate_sqrt(p0.weight());
const auto r1 = CGAL::approximate_sqrt(p1.weight());
const auto d = CGAL::approximate_sqrt(CGAL::squared_distance(p0, p1));
return d < r0 + r1;
}
template<typename C3t3, typename OutputIterator>
OutputIterator incident_subdomains(const typename C3t3::Vertex_handle v,
const C3t3& c3t3,