- new debug macros:

- CGAL_MESH_3_DIRTY_DEBUG_SPHERES,
  - and CGAL_MESHES_DEBUG_REFINEMENT_POINTS.
- new macro CGAL_MESHES_OUTPUT_STREAM, which is set to std::cout by
default.
- in Mesh_2: new header <CGAL/Mesh_2/Output_stream.h>
This commit is contained in:
Laurent Rineau 2006-07-10 09:25:35 +00:00
parent 08f36ee64c
commit 0d1d892da1
6 changed files with 59 additions and 5 deletions

View File

@ -8,6 +8,7 @@
test/Mesh_3/combined_spheres.cpp.
- major switch from .C to .cpp. Andreas's script left a lot of things that
had to be fixed manually.
- new header <CGAL/Mesh_2/Output_stream.h>
7 July 2006 Laurent Rineau
- add the ability to set the background color, and properties of the layer

View File

@ -0,0 +1,28 @@
// Copyright (c) 2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Laurent Rineau
#ifndef CGAL_MESHES_OUTPUT_STREAM_H
#ifndef CGAL_MESHES_OUTPUT_ON_CERR
#define CGAL_MESHES_OUTPUT_STREAM std::cout
#else
#define CGAL_MESHES_OUTPUT_STREAM std::cerr
#endif
#endif

View File

@ -21,6 +21,7 @@
#define CGAL_MESH_3_DOUBLE_MAP_CONTAINER_H
#include <set>
#include <iostream>
#include <CGAL/Double_map.h>
namespace CGAL {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2005 INRIA Sophia-Antipolis (France).
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
@ -20,6 +20,8 @@
#ifndef CGAL_MESH_3_IMPLICIT_SURFACE_MESHER_VISITOR_H
#define CGAL_MESH_3_IMPLICIT_SURFACE_MESHER_VISITOR_H
#include <CGAL/Mesh_2/Output_stream.h>
namespace CGAL {
namespace Mesh_3 {
@ -50,10 +52,10 @@ namespace CGAL {
{
if(v->point().surface_index() == 0)
{
std::cerr << "?";
CGAL_MESHES_OUTPUT_STREAM << "?";
v->point().set_surface_index(1);
}
std::cout << v->point().surface_index();
CGAL_MESHES_OUTPUT_STREAM << v->point().surface_index();
}
template <typename E, typename P, typename Z>

View File

@ -23,6 +23,8 @@
#include <CGAL/Mesher_level.h>
#include <CGAL/Mesh_2/Triangulation_mesher_level_traits_3.h>
#include <CGAL/Mesh_2/Output_stream.h>
//#include <CGAL/Mesh_3/Refine_edges.h>
//#include <CGAL/Mesh_3/Refine_facets.h>
@ -115,6 +117,9 @@ public:
Point refinement_point_impl(const Cell_handle& c) const
{
#ifdef CGAL_MESHES_DEBUG_REFINEMENT_POINTS
std::cerr << "point from volume mesher: ";
#endif
typename Geom_traits::Construct_circumcenter_3 circumcenter =
triangulation_ref_impl().geom_traits().construct_circumcenter_3_object();
@ -123,7 +128,16 @@ public:
const Point& r = c->vertex(2)->point();
const Point& s = c->vertex(3)->point();
return circumcenter(p, q, r, s);
const Point result = circumcenter(p, q, r, s);
#ifdef CGAL_MESHES_DEBUG_REFINEMENT_POINTS
# ifdef CGAL_MESH_3_DIRTY_DEBUG_SPHERES
std::cerr << " \t\tdistance: "
<< CGAL::sqrt(CGAL::squared_distance(result,
typename Tr::Geom_traits::Point_3(CGAL::ORIGIN)));
# endif
#endif
return result;
}
#if CGAL_MESH_3_DEBUG_BEFORE_CONFLICTS
@ -213,7 +227,7 @@ public:
void after_insertion_impl(const Vertex_handle& v)
{
std::cout << "*";
CGAL_MESHES_OUTPUT_STREAM << "*";
#if CGAL_MESH_3_DEBUG_AFTER_INSERTION
std::cerr << " INSERTED." << std::endl;
#endif

View File

@ -20,6 +20,8 @@
#ifndef CGAL_MESH_CRITERIA_3_H
#define CGAL_MESH_CRITERIA_3_H
#include <iostream>
namespace CGAL {
template <typename Tr>
@ -155,6 +157,12 @@ public:
}; // end Mesh_criteria_3
template <typename Tr>
std::ostream& operator<<(std::ostream& os,
const typename Mesh_criteria_3<Tr>::Quality& q)
{
return os << q.sq_size() << ", " << q.aspect();
}
} // end namespace CGAL