mirror of https://github.com/CGAL/cgal
Enhance the debugging tools in Mesh_3
This commit is contained in:
parent
ac875956a1
commit
6fe18d8068
|
|
@ -470,7 +470,7 @@ public:
|
||||||
std::string debug_info_element_impl(const Cell_handle &ch) const
|
std::string debug_info_element_impl(const Cell_handle &ch) const
|
||||||
{
|
{
|
||||||
std::stringstream sstr;
|
std::stringstream sstr;
|
||||||
sstr << "Cell { " << std::endl
|
sstr << "Cell " << (void*)(ch.operator->()) << " { " << std::endl
|
||||||
<< " " << *ch->vertex(0) << std::endl
|
<< " " << *ch->vertex(0) << std::endl
|
||||||
<< " " << *ch->vertex(1) << std::endl
|
<< " " << *ch->vertex(1) << std::endl
|
||||||
<< " " << *ch->vertex(2) << std::endl
|
<< " " << *ch->vertex(2) << std::endl
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ protected:
|
||||||
if ( size > min_sq_length*sq_radius_edge_bound_ )
|
if ( size > min_sq_length*sq_radius_edge_bound_ )
|
||||||
{
|
{
|
||||||
#ifdef CGAL_MESH_3_DEBUG_CELL_CRITERIA
|
#ifdef CGAL_MESH_3_DEBUG_CELL_CRITERIA
|
||||||
std::cerr << "bad cell (radius-edge bound): radius-edge["
|
std::cerr << "bad cell " << (void*)(ch.operator->()) << " (radius-edge bound): radius-edge["
|
||||||
<< size/min_sq_length << "] bound[" << sq_radius_edge_bound_
|
<< size/min_sq_length << "] bound[" << sq_radius_edge_bound_
|
||||||
<< "]\n" ;
|
<< "]\n" ;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -185,7 +185,7 @@ protected:
|
||||||
if ( size > sq_radius_bound_ )
|
if ( size > sq_radius_bound_ )
|
||||||
{
|
{
|
||||||
#ifdef CGAL_MESH_3_DEBUG_CELL_CRITERIA
|
#ifdef CGAL_MESH_3_DEBUG_CELL_CRITERIA
|
||||||
std::cerr << "bad cell (radius bound): size[" << size
|
std::cerr << "bad cell " << (void*)(ch.operator->()) << " (radius bound): size[" << size
|
||||||
<< "] bound[" << sq_radius_bound_ << "]\n" ;
|
<< "] bound[" << sq_radius_bound_ << "]\n" ;
|
||||||
#endif
|
#endif
|
||||||
return Is_bad(Quality(sq_radius_bound_/size));
|
return Is_bad(Quality(sq_radius_bound_/size));
|
||||||
|
|
@ -262,7 +262,7 @@ protected:
|
||||||
if ( size > sq_bound )
|
if ( size > sq_bound )
|
||||||
{
|
{
|
||||||
#ifdef CGAL_MESH_3_DEBUG_CELL_CRITERIA
|
#ifdef CGAL_MESH_3_DEBUG_CELL_CRITERIA
|
||||||
std::cerr << "bad cell (radius bound): size[" << size
|
std::cerr << "bad cell " << (void*)(ch.operator->()) << " (radius bound): size[" << size
|
||||||
<< "] bound[" << sq_bound << "]\n" ;
|
<< "] bound[" << sq_bound << "]\n" ;
|
||||||
#endif
|
#endif
|
||||||
return Is_bad(Quality(sq_bound/size));
|
return Is_bad(Quality(sq_bound/size));
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,25 @@ namespace CGAL {
|
||||||
return m.empty();
|
return m.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CGAL_MESHES_DEBUG_DOUBLE_MAP
|
||||||
|
template <typename Element_type>
|
||||||
|
std::ostream& debug_element(std::ostream& os, const Element_type& e) {
|
||||||
|
return os << (void*)(e.operator->());
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Cell_handle>
|
||||||
|
std::ostream& debug_element(std::ostream& os, const std::pair<Cell_handle, int>& e) {
|
||||||
|
return os << "Facet{" << (void*)(e.first.operator->()) << ", " << e.second << "}";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Element get_next_element_impl()
|
Element get_next_element_impl()
|
||||||
{
|
{
|
||||||
CGAL_assertion(!m.empty());
|
CGAL_assertion(!m.empty());
|
||||||
#if CGAL_MESHES_DEBUG_DOUBLE_MAP
|
#if CGAL_MESHES_DEBUG_DOUBLE_MAP
|
||||||
std::cerr << "get_next_element_impl(" << &*(m.front()->second)
|
std::cerr << "get_next_element_impl(";
|
||||||
<< ")\n";
|
debug_element(std::cerr, m.front()->second);
|
||||||
|
std::cerr << ")\n";
|
||||||
#endif
|
#endif
|
||||||
return m.front()->second;
|
return m.front()->second;
|
||||||
|
|
||||||
|
|
@ -56,7 +69,9 @@ namespace CGAL {
|
||||||
void add_bad_element(const Element& e, const Quality& q)
|
void add_bad_element(const Element& e, const Quality& q)
|
||||||
{
|
{
|
||||||
#if CGAL_MESHES_DEBUG_DOUBLE_MAP
|
#if CGAL_MESHES_DEBUG_DOUBLE_MAP
|
||||||
std::cerr << "add_bad_element(" << &*e << ")\n";
|
std::cerr << "add_bad_element(";
|
||||||
|
debug_element(std::cerr, e);
|
||||||
|
std::cerr << ")\n";
|
||||||
#endif
|
#endif
|
||||||
m.insert(e, q);
|
m.insert(e, q);
|
||||||
}
|
}
|
||||||
|
|
@ -69,7 +84,9 @@ namespace CGAL {
|
||||||
void remove_element(const Element& e)
|
void remove_element(const Element& e)
|
||||||
{
|
{
|
||||||
#if CGAL_MESHES_DEBUG_DOUBLE_MAP
|
#if CGAL_MESHES_DEBUG_DOUBLE_MAP
|
||||||
std::cerr << "remove_element(" << &*e << ")\n";
|
std::cerr << "remove_element(";
|
||||||
|
debug_element(std::cerr, e);
|
||||||
|
std::cerr << ")\n";
|
||||||
#endif
|
#endif
|
||||||
m.erase(e);
|
m.erase(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue