Comments & debug code

This commit is contained in:
Mael Rouxel-Labbé 2024-05-30 14:46:19 +02:00
parent 99613eb99c
commit b80c1d8f48
2 changed files with 33 additions and 6 deletions

View File

@ -394,11 +394,12 @@ compute_placement()
// A1 * v = b1
// A2 * v = b2
//
// Which in matrix form is : A * v = b
// Which in matrix form is: A * v = b
//
// (with 'A' a 3x3 matrix and 'b' a vector)
//
// The member variable mConstrinas contains A and b. Indidivual constraints (Ai,bi) can be added to it.
// The member variables mConstraints_A and mConstraints_b contain A and b.
// Indidivual constraints (Ai,bi) can be added to it.
// Once 3 such constraints have been added 'v' is directly solved a:
//
// v = b*inverse(A)
@ -421,7 +422,7 @@ compute_placement()
// In that case there is simply no good vertex placement
if(mConstraints_n == 3)
{
// If the matrix is singular it's inverse cannot be computed so an 'absent' value is returned.
// If the matrix is singular its inverse cannot be computed so an 'absent' value is returned.
std::optional<Matrix> lOptional_Ai = inverse_matrix(mConstraints_A);
if(lOptional_Ai)
{

View File

@ -296,6 +296,8 @@ private:
void insert_in_PQ(const halfedge_descriptor h, Edge_data& data)
{
CGAL_SMS_TRACE(5, "Insert " << edge_to_string(h) << " in PQ");
CGAL_assertion(is_primary_edge(h));
CGAL_expensive_assertion(!data.is_in_PQ());
CGAL_expensive_assertion(!mPQ->contains(h));
@ -594,12 +596,33 @@ loop()
std::optional<halfedge_descriptor> opt_h;
// #define CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
#ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
int i_rm = 0;
#endif
while((opt_h = pop_from_PQ()))
for(;;)
{
#ifdef CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE
if(5 <= CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE)
{
CGAL_SMS_TRACE_IMPL("== Current queue ==");
auto mPQ_clone = *mPQ;
std::optional<halfedge_descriptor> opt_th;
while(opt_th = mPQ_clone.extract_top())
{
CGAL_SMS_TRACE_IMPL("\t" + edge_to_string(*opt_th));
Cost_type tcost = get_data(*opt_th).cost();
if(tcost)
CGAL_SMS_TRACE_IMPL("\t" + std::to_string(CGAL::to_double(*tcost)));
}
}
#endif
if(!(opt_h = pop_from_PQ()))
break;
CGAL_SMS_TRACE(1, "Popped " << edge_to_string(*opt_h));
CGAL_assertion(!is_constrained(*opt_h));
@ -639,7 +662,7 @@ loop()
m_visitor.OnNonCollapsable(profile);
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" );
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (filter)" );
}
#ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
@ -660,7 +683,7 @@ loop()
m_visitor.OnNonCollapsable(profile);
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" );
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (topology)" );
}
}
else
@ -823,7 +846,10 @@ is_collapse_topologically_valid(const Profile& profile)
{
/// ensure two constrained edges cannot get merged
if(is_edge_adjacent_to_a_constrained_edge(profile, m_ecm))
{
CGAL_SMS_TRACE(3," edge to collapse is adjacent to a constrained edge.");
return false;
}
if(profile.is_v0_v1_a_border())
{