Misc minor improvements

This commit is contained in:
Mael Rouxel-Labbé 2023-10-30 23:46:46 +01:00
parent fb682fe9eb
commit 3879b13c0e
6 changed files with 20 additions and 7 deletions

View File

@ -321,7 +321,6 @@ public:
typename AABB_tree::Bounding_box bbox() const typename AABB_tree::Bounding_box bbox() const
{ {
CGAL_precondition(!empty()); CGAL_precondition(!empty());
return tree().bbox(); return tree().bbox();
} }

View File

@ -106,7 +106,7 @@ public:
if(points.empty()) if(points.empty())
{ {
#ifdef CGAL_AW3_DEBUG #ifdef CGAL_AW3_DEBUG
std::cout << "Warning: Input is empty " << std::endl; std::cout << "Warning: Input is empty (PS)" << std::endl;
#endif #endif
return; return;
} }

View File

@ -107,7 +107,7 @@ public:
if(segments.empty()) if(segments.empty())
{ {
#ifdef CGAL_AW3_DEBUG #ifdef CGAL_AW3_DEBUG
std::cout << "Warning: Input is empty " << std::endl; std::cout << "Warning: Input is empty (SS)" << std::endl;
#endif #endif
return; return;
} }

View File

@ -135,7 +135,7 @@ public:
if(is_empty(tmesh)) if(is_empty(tmesh))
{ {
#ifdef CGAL_AW3_DEBUG #ifdef CGAL_AW3_DEBUG
std::cout << "Warning: Input is empty " << std::endl; std::cout << "Warning: Input is empty (TM)" << std::endl;
#endif #endif
return; return;
} }

View File

@ -133,7 +133,7 @@ public:
if(points.empty() || faces.empty()) if(points.empty() || faces.empty())
{ {
#ifdef CGAL_AW3_DEBUG #ifdef CGAL_AW3_DEBUG
std::cout << "Warning: Input is empty " << std::endl; std::cout << "Warning: Input is empty (TS)" << std::endl;
#endif #endif
return; return;
} }
@ -190,8 +190,22 @@ public:
void add_triangle_soup(const TriangleRange& triangles, void add_triangle_soup(const TriangleRange& triangles,
const CGAL_NP_CLASS& /*np*/ = CGAL::parameters::default_values()) const CGAL_NP_CLASS& /*np*/ = CGAL::parameters::default_values())
{ {
if(triangles.empty())
{
#ifdef CGAL_AW3_DEBUG
std::cout << "Warning: Input is empty (TS)" << std::endl;
#endif
return;
}
#ifdef CGAL_AW3_DEBUG
std::cout << "Insert into AABB Tree (triangles)..." << std::endl;
#endif
typename Geom_traits::Is_degenerate_3 is_degenerate = this->geom_traits().is_degenerate_3_object(); typename Geom_traits::Is_degenerate_3 is_degenerate = this->geom_traits().is_degenerate_3_object();
Splitter_base::reserve(triangles.size());
for(const Triangle_3& tr : triangles) for(const Triangle_3& tr : triangles)
{ {
if(is_degenerate(tr)) if(is_degenerate(tr))

View File

@ -687,8 +687,8 @@ public Q_SLOTS:
const bool use_message_box = ui.enableMessageBox->isChecked(); const bool use_message_box = ui.enableMessageBox->isChecked();
std::cout << "Wrapping edges? " << std::boolalpha << wrap_segments << std::endl;
std::cout << "Wrapping faces? " << std::boolalpha << wrap_triangles << std::endl; std::cout << "Wrapping faces? " << std::boolalpha << wrap_triangles << std::endl;
std::cout << "Wrapping edges? " << std::boolalpha << wrap_segments << std::endl;
if(!wrap_triangles) if(!wrap_triangles)
{ {
@ -740,7 +740,7 @@ public Q_SLOTS:
if(alpha <= 0. || offset <= 0.) if(alpha <= 0. || offset <= 0.)
{ {
print_message("Warning: alpha/offset must be strictly positive - nothing to wrap"); print_message("Warning: alpha/offset must be strictly positive");
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
return; return;
} }