LS + S. Tayeb:

* Rename obsolete Mesh_3 files to avoid conflicts with new Mesh_3 implementation.

* TODO: 
Modify Poisson_refine_triangulation.h to use new Mesh_3 implementation.
This commit is contained in:
Laurent Saboret 2009-06-26 15:04:39 +00:00
parent 1819dc507d
commit e70a056e75
4 changed files with 59 additions and 59 deletions

View File

@ -17,8 +17,8 @@
// //
// Author(s) : Laurent RINEAU // Author(s) : Laurent RINEAU
#ifndef CGAL_MESH_3_REFINE_TETS_H #ifndef CGAL_MESH_3_POISSON_REFINE_CELLS_3_H
#define CGAL_MESH_3_REFINE_TETS_H #define CGAL_MESH_3_POISSON_REFINE_CELLS_3_H
#include <CGAL/Mesher_level.h> #include <CGAL/Mesher_level.h>
#include <CGAL/Meshes/Triangulation_mesher_level_traits_3.h> #include <CGAL/Meshes/Triangulation_mesher_level_traits_3.h>
@ -40,9 +40,9 @@ template <class Tr,
class Container = class Container =
Meshes::Double_map_container< Meshes::Double_map_container<
typename Tr::Cell_handle, typename Tr::Cell_handle,
typename Criteria::Quality> typename Criteria::Cell_quality>
> >
class Refine_tets_base : class Poisson_refine_tets_base :
public Container, public Container,
public Triangulation_mesher_level_traits_3<Tr>, public Triangulation_mesher_level_traits_3<Tr>,
public No_test_point_conflict public No_test_point_conflict
@ -63,14 +63,14 @@ protected:
typedef typename Tr::Facet Facet; typedef typename Tr::Facet Facet;
public: public:
typedef typename Criteria::Quality Quality; typedef typename Criteria::Cell_quality Cell_quality;
using Triangulation_mesher_level_traits_3<Tr>::triangulation_ref_impl; using Triangulation_mesher_level_traits_3<Tr>::triangulation_ref_impl;
public: public:
/** \name CONSTRUCTORS */ /** \name CONSTRUCTORS */
Refine_tets_base(Tr& t, Criteria crit) Poisson_refine_tets_base(Tr& t, Criteria crit)
: Triangulation_mesher_level_traits_3<Tr>(t), criteria(crit) {} : Triangulation_mesher_level_traits_3<Tr>(t), criteria(crit) {}
protected: protected:
@ -81,20 +81,20 @@ protected:
protected: protected:
/* --- protected functions --- */ /* --- protected functions --- */
bool should_be_refined(const Cell_handle c, Quality& qual) const bool should_be_refined(const Cell_handle c, Cell_quality& qual) const
{ {
return criteria.is_bad_object()(c,qual); return criteria.is_bad_object()(c,qual);
} }
bool should_be_refined(const Cell_handle c) const bool should_be_refined(const Cell_handle c) const
{ {
Quality q; Cell_quality q;
return should_be_refined(c, q); return should_be_refined(c, q);
} }
bool test_if_cell_is_bad(const Cell_handle c) bool test_if_cell_is_bad(const Cell_handle c)
{ {
Quality q; Cell_quality q;
if( c->is_in_domain() && should_be_refined(c, q) ) if( c->is_in_domain() && should_be_refined(c, q) )
{ {
this->add_bad_element(c, q); this->add_bad_element(c, q);
@ -137,7 +137,7 @@ public:
#if CGAL_MESH_3_DEBUG_BEFORE_CONFLICTS #if CGAL_MESH_3_DEBUG_BEFORE_CONFLICTS
void before_conflicts_impl(const Cell_handle&, const Point& p) void before_conflicts_impl(const Cell_handle&, const Point& p)
{ {
std::cerr << "Refine_tets: before conflicts of " << p; std::cerr << "Poisson_refine_tets: before conflicts of " << p;
} }
#else #else
void before_conflicts_impl(const Cell_handle&, const Point&) void before_conflicts_impl(const Cell_handle&, const Point&)
@ -152,7 +152,7 @@ public:
std::cerr << " REJECTED!" << std::endl; std::cerr << " REJECTED!" << std::endl;
#endif #endif
} }
}; // end Refine_tets_base }; // end Poisson_refine_tets_base
template <class Tr, template <class Tr,
class Criteria, class Criteria,
@ -160,16 +160,16 @@ template <class Tr,
class Oracle, class Oracle,
class Container = Meshes::Double_map_container< class Container = Meshes::Double_map_container<
typename Tr::Cell_handle, typename Tr::Cell_handle,
typename Criteria::Quality> typename Criteria::Cell_quality>
> >
class Refine_tets_with_oracle_base class Poisson_refine_tets_with_oracle_base
: public Refine_tets_base<Tr, : public Poisson_refine_tets_base<Tr,
Criteria, Criteria,
Container> Container>
{ {
public: public:
typedef Refine_tets_base<Tr, Criteria, Container> Base; typedef Poisson_refine_tets_base<Tr, Criteria, Container> Base;
typedef Refine_tets_with_oracle_base<Tr, typedef Poisson_refine_tets_with_oracle_base<Tr,
Criteria, Criteria,
Surface, Surface,
Oracle, Oracle,
@ -186,7 +186,7 @@ public:
/** \name CONSTRUCTORS */ /** \name CONSTRUCTORS */
Refine_tets_with_oracle_base(Tr& t, Criteria crit, Surface& s, Oracle& o) Poisson_refine_tets_with_oracle_base(Tr& t, Criteria crit, Surface& s, Oracle& o)
: Base(t, crit), surface(s), oracle(o) {} : Base(t, crit), surface(s), oracle(o) {}
public: public:
@ -198,7 +198,7 @@ public:
#ifdef CGAL_MESHES_DEBUG_REFINEMENT_POINTS #ifdef CGAL_MESHES_DEBUG_REFINEMENT_POINTS
// Check if triangulation's geometric traits provides a robust circumcenter computation // Check if triangulation's geometric traits provides a robust circumcenter computation
if (triangulation_ref_impl().side_of_sphere(c, p, true) != ON_BOUNDED_SIDE) if (triangulation_ref_impl().side_of_sphere(c, p, true) != ON_BOUNDED_SIDE)
std::cerr << "Refine_tets_with_oracle_base::conflicts_zone_impl: ERROR: circumcenter out of sphere!\n"; std::cerr << "Poisson_refine_tets_with_oracle_base::conflicts_zone_impl: ERROR: circumcenter out of sphere!\n";
#endif #endif
zone.cell = c; zone.cell = c;
@ -263,21 +263,21 @@ protected:
Surface& surface; Surface& surface;
Oracle& oracle; Oracle& oracle;
}; // end Refine_tets_with_oracle_base }; // end Poisson_refine_tets_with_oracle_base
template <typename Tr, template <typename Tr,
typename Criteria, typename Criteria,
typename Surface, typename Surface,
typename Oracle, // BEURK typename Oracle, // BEURK
typename BaseP = // workaround for VC7, see below typename BaseP = // workaround for VC7, see below
Refine_tets_with_oracle_base<Tr, Criteria, Surface, Oracle>, Poisson_refine_tets_with_oracle_base<Tr, Criteria, Surface, Oracle>,
typename Facets_level = Refine_facets<Tr> typename Facets_level = Refine_facets<Tr>
> >
class Refine_tets : class Poisson_refine_tets :
public BaseP, public BaseP,
public Mesher_level < public Mesher_level <
Tr, Tr,
Refine_tets<Tr, Criteria, Surface, Oracle, BaseP, Facets_level>, Poisson_refine_tets<Tr, Criteria, Surface, Oracle, BaseP, Facets_level>,
typename Tr::Cell_handle, typename Tr::Cell_handle,
Facets_level, Facets_level,
Triangulation_mesher_level_traits_3<Tr> Triangulation_mesher_level_traits_3<Tr>
@ -287,16 +287,16 @@ class Refine_tets :
Facets_level& facets_level; Facets_level& facets_level;
public: public:
typedef Refine_tets<Tr, Criteria, Surface, Oracle, Base, Facets_level> Self; typedef Poisson_refine_tets<Tr, Criteria, Surface, Oracle, Base, Facets_level> Self;
typedef Mesher_level < typedef Mesher_level <
Tr, Tr,
Refine_tets<Tr, Criteria, Surface, Oracle, Base, Facets_level>, Poisson_refine_tets<Tr, Criteria, Surface, Oracle, Base, Facets_level>,
typename Tr::Cell_handle, typename Tr::Cell_handle,
Facets_level, Facets_level,
Triangulation_mesher_level_traits_3<Tr> Triangulation_mesher_level_traits_3<Tr>
> Mesher; > Mesher;
Refine_tets(Tr& t, Criteria crit, Surface& surface, Oracle& oracle, Facets_level& facets_level) Poisson_refine_tets(Tr& t, Criteria crit, Surface& surface, Oracle& oracle, Facets_level& facets_level)
: Base(t, crit, surface, oracle), Mesher(facets_level), facets_level(facets_level) : Base(t, crit, surface, oracle), Mesher(facets_level), facets_level(facets_level)
{} // here VC7 complain about default constructor of Base, if the {} // here VC7 complain about default constructor of Base, if the
// workaround is not used. // workaround is not used.
@ -315,9 +315,9 @@ public:
return s.str(); return s.str();
} }
}; // end class Refine_tets }; // end class Poisson_refine_tets
}; // end namespace Mesh_3 }; // end namespace Mesh_3
}; // end namespace CGAL }; // end namespace CGAL
#endif // CGAL_MESH_3_REFINE_TETS_H #endif // CGAL_MESH_3_POISSON_REFINE_CELLS_3_H

View File

@ -17,41 +17,32 @@
// //
// Author(s) : Laurent RINEAU // Author(s) : Laurent RINEAU
#ifndef CGAL_MESH_CRITERIA_3_H #ifndef CGAL_POISSON_MESH_CRITERIA_3_H
#define CGAL_MESH_CRITERIA_3_H #define CGAL_POISSON_MESH_CRITERIA_3_H
#include <iostream> #include <iostream>
namespace CGAL { namespace CGAL {
template <typename Tr> template <class Tr>
class Mesh_criteria_3 class Poisson_mesh_cell_criteria_3
{ {
double squared_radius_bound_; double squared_radius_bound_;
double radius_edge_bound_; double radius_edge_bound_;
public: public:
typedef typename Tr::Cell_handle Cell_handle; struct Cell_quality : public std::pair<double, double>
Mesh_criteria_3(const double radius_edge_bound = 2, //< radius edge ratio bound (ignored if zero)
const double radius_bound = 0) //< cell radius bound (ignored if zero)
: squared_radius_bound_(radius_bound*radius_bound),
radius_edge_bound_(radius_edge_bound)
{
};
struct Quality : public std::pair<double, double>
{ {
typedef std::pair<double, double> Base; typedef std::pair<double, double> Base;
Quality() : Base() {}; Cell_quality() : Base() {};
Quality(double _aspect, double _sq_size) : Base(_aspect, _sq_size) {}; Cell_quality(double _aspect, double _sq_size) : Base(_aspect, _sq_size) {};
const double& sq_size() const { return second; } const double& sq_size() const { return second; }
const double& aspect() const { return first; } const double& aspect() const { return first; }
// q1<q2 means q1 is prioritised over q2 // q1<q2 means q1 is prioritised over q2
// ( q1 == *this, q2 == q ) // ( q1 == *this, q2 == q )
bool operator<(const Quality& q) const bool operator<(const Cell_quality& q) const
{ {
if( sq_size() > 1 ) if( sq_size() > 1 )
if( q.sq_size() > 1 ) if( q.sq_size() > 1 )
@ -71,6 +62,15 @@ public:
return squared_radius_bound_; return squared_radius_bound_;
}; };
typedef typename Tr::Cell_handle Cell_handle;
Poisson_mesh_cell_criteria_3(const double radius_edge_bound = 2, //< radius edge ratio bound (ignored if zero)
const double radius_bound = 0) //< cell radius bound (ignored if zero)
: squared_radius_bound_(radius_bound*radius_bound),
radius_edge_bound_(radius_edge_bound)
{
};
inline inline
void set_squared_radius_bound(const double squared_radius_bound) void set_squared_radius_bound(const double squared_radius_bound)
{ {
@ -103,7 +103,7 @@ public:
squared_radius_bound_(squared_radius_bound) {}; squared_radius_bound_(squared_radius_bound) {};
bool operator()(const Cell_handle& c, bool operator()(const Cell_handle& c,
Quality& qual) const Cell_quality& qual) const
{ {
const Point_3& p = c->vertex(0)->point(); const Point_3& p = c->vertex(0)->point();
const Point_3& q = c->vertex(1)->point(); const Point_3& q = c->vertex(1)->point();
@ -133,7 +133,7 @@ public:
} }
if( radius_edge_bound_ == 0 ) if( radius_edge_bound_ == 0 )
{ {
qual = Quality(0,1); qual = Cell_quality(0,1);
return false; return false;
} }
@ -155,15 +155,15 @@ public:
Is_bad is_bad_object() const Is_bad is_bad_object() const
{ return Is_bad(radius_edge_bound_, squared_radius_bound_); } { return Is_bad(radius_edge_bound_, squared_radius_bound_); }
}; // end Mesh_criteria_3 }; // end Poisson_mesh_cell_criteria_3
template <typename Tr> template <typename Tr>
std::ostream& operator<<(std::ostream& os, std::ostream& operator<<(std::ostream& os,
const typename Mesh_criteria_3<Tr>::Quality& q) const typename Poisson_mesh_cell_criteria_3<Tr>::Cell_quality& q)
{ {
return os << q.sq_size() << ", " << q.aspect(); return os << q.sq_size() << ", " << q.aspect();
} }
} // end namespace CGAL } // end namespace CGAL
#endif // CGAL_MESH_CRITERIA_3_H #endif // CGAL_POISSON_MESH_CRITERIA_3_H

View File

@ -282,8 +282,8 @@ private:
CGAL_TRACE("Calls delaunay_refinement(radius_edge_ratio_bound=%lf, cell_radius_bound=%lf, max_vertices=%u, enlarge_ratio=%lf)\n", CGAL_TRACE("Calls delaunay_refinement(radius_edge_ratio_bound=%lf, cell_radius_bound=%lf, max_vertices=%u, enlarge_ratio=%lf)\n",
radius_edge_ratio_bound, cell_radius_bound, max_vertices, enlarge_ratio); radius_edge_ratio_bound, cell_radius_bound, max_vertices, enlarge_ratio);
Sphere enlarged_bbox = enlarged_bounding_sphere(enlarge_ratio); Sphere elarged_bsphere = enlarged_bounding_sphere(enlarge_ratio);
unsigned int nb_vertices_added = poisson_refine_triangulation(*m_tr,radius_edge_ratio_bound,cell_radius_bound,max_vertices,enlarged_bbox); unsigned int nb_vertices_added = poisson_refine_triangulation(*m_tr,radius_edge_ratio_bound,cell_radius_bound,max_vertices,elarged_bsphere);
CGAL_TRACE("End of delaunay_refinement()\n"); CGAL_TRACE("End of delaunay_refinement()\n");

View File

@ -21,8 +21,8 @@
// CGAL // CGAL
#include <CGAL/Mesher_level.h> #include <CGAL/Mesher_level.h>
#include <CGAL/Mesh_3/Refine_tets.h> #include <CGAL/Mesh_3/Poisson_refine_cells_3.h>
#include <CGAL/Mesh_criteria_3.h> #include <CGAL/Poisson_mesh_cell_criteria_3.h>
#include <CGAL/surface_reconstruction_points_assertions.h> #include <CGAL/surface_reconstruction_points_assertions.h>
CGAL_BEGIN_NAMESPACE CGAL_BEGIN_NAMESPACE
@ -39,12 +39,12 @@ template <class Tr,
class Surface, class Surface,
class Oracle, class Oracle,
class Container = Meshes::Double_map_container<typename Tr::Cell_handle, class Container = Meshes::Double_map_container<typename Tr::Cell_handle,
typename Criteria::Quality> typename Criteria::Cell_quality>
> >
class Poisson_mesher_level_impl_base : class Poisson_mesher_level_impl_base :
public Mesh_3::Refine_tets_with_oracle_base<Tr, Criteria, Surface, Oracle, Container> public Mesh_3::Poisson_refine_tets_with_oracle_base<Tr, Criteria, Surface, Oracle, Container>
{ {
typedef Mesh_3::Refine_tets_with_oracle_base<Tr, Criteria, Surface, Oracle, Container> Base; typedef Mesh_3::Poisson_refine_tets_with_oracle_base<Tr, Criteria, Surface, Oracle, Container> Base;
public: public:
// Inherited methods and fields used below // Inherited methods and fields used below
@ -56,7 +56,7 @@ public:
typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Vertex_handle Vertex_handle;
typedef typename Tr::Cell_handle Cell_handle; typedef typename Tr::Cell_handle Cell_handle;
typedef typename Tr::Point Point; typedef typename Tr::Point Point;
typedef typename Base::Quality Quality; typedef typename Base::Cell_quality Cell_quality;
public: public:
/** \name CONSTRUCTORS */ /** \name CONSTRUCTORS */
@ -73,7 +73,7 @@ protected:
bool test_if_cell_is_bad(const Cell_handle c) bool test_if_cell_is_bad(const Cell_handle c)
{ {
Quality q; Cell_quality q;
if( is_in_domain(c) && should_be_refined(c, q) ) if( is_in_domain(c) && should_be_refined(c, q) )
{ {
this->add_bad_element(c, q); this->add_bad_element(c, q);
@ -218,7 +218,7 @@ unsigned int poisson_refine_triangulation(
typedef typename Gt::Point_3 Point; typedef typename Gt::Point_3 Point;
// Mesher_level types // Mesher_level types
typedef Mesh_criteria_3<Tr> Tets_criteria; typedef Poisson_mesh_cell_criteria_3<Tr> Tets_criteria;
typedef typename CGAL::Surface_mesh_traits_generator_3<Surface>::type Oracle; typedef typename CGAL::Surface_mesh_traits_generator_3<Surface>::type Oracle;
typedef Poisson_mesher_level<Tr, Tets_criteria, Surface, Oracle, Null_mesher_level> Refiner; typedef Poisson_mesher_level<Tr, Tets_criteria, Surface, Oracle, Null_mesher_level> Refiner;