Return the refinement rule in Steiner computation + convenience overload

This commit is contained in:
Mael Rouxel-Labbé 2025-11-25 23:12:06 +01:00
parent d1fe2405d4
commit 8c050b7a2d
2 changed files with 26 additions and 7 deletions

View File

@ -937,9 +937,19 @@ private:
return less_squared_radius_of_min_empty_circle(m_sq_alpha, e, m_tr);
}
bool compute_steiner_point(const Face_handle fh,
const Face_handle neighbor,
Point_2& steiner_point) const
Steiner_status compute_steiner_point(const Gate& gate,
Point_2& steiner_point) const
{
const Edge& e = gate.edge();
const Face_handle fh = e.first;
const int s = e.second;
const Face_handle nh = e.first->neighbor(s);
return compute_steiner_point(fh, nh, steiner_point);
}
Steiner_status compute_steiner_point(const Face_handle fh,
const Face_handle neighbor,
Point_2& steiner_point) const
{
CGAL_precondition(!m_tr.is_infinite(neighbor));
@ -989,7 +999,7 @@ private:
#ifdef CGAL_AW2_DEBUG_STEINER_COMPUTATION
std::cout << "Steiner found through first_intersection(): " << steiner_point << std::endl;
#endif
return true;
return Steiner_status::RULE_1;
}
}
@ -1015,14 +1025,14 @@ private:
std::cout << "Steiner: " << steiner_point << std::endl;
#endif
return true;
return Steiner_status::RULE_2;
}
#ifdef CGAL_AW2_DEBUG_STEINER_COMPUTATION
std::cout << "No Steiner point" << std::endl;
#endif
return false;
return Steiner_status::NO_STEINER_POINT;
}
private:
@ -1330,7 +1340,8 @@ private:
}
Point_2 steiner_point;
if(compute_steiner_point(fh, nh, steiner_point))
Steiner_status status = compute_steiner_point(fh, nh, steiner_point);
if(status != Steiner_status::NO_STEINER_POINT)
{
// std::cout << CGAL::abs(CGAL::approximate_sqrt(m_oracle.squared_distance(steiner_point)) - m_offset)
// << " vs " << 1e-2 * m_offset << std::endl;

View File

@ -28,6 +28,14 @@ namespace CGAL {
namespace Alpha_wraps_2 {
namespace internal {
enum class Steiner_status
{
UNKNOWN = 0,
NO_STEINER_POINT,
RULE_1,
RULE_2
};
#ifdef CGAL_AW2_USE_SORTED_PRIORITY_QUEUE
// Represents an alpha-traversable edge in the mutable priority queue