CGAL 5.5.2 - 2D Conforming Triangulations and Meshes
|
#include <CGAL/Delaunay_mesher_2.h>
This class implements a 2D mesh generator.
CDT | must be a 2D constrained Delaunay triangulation, and type CDT::Face should be a model of the concept DelaunayMeshFaceBase_2 . The geometric traits class of the instance of CDT has to be a model of the concept DelaunayMeshTraits_2 . |
Criteria | must be a model of the concept MeshingCriteria_2 . This traits class defines the shape and size criteria for the triangles of the mesh. Criteria::Face_handle has to be the same as CDT::Face_handle . |
Using This Class
The constructor of the class Delaunay_mesher_2
takes a reference to a CDT
as an argument. A call to the refinement method refine_mesh()
will refine the constrained Delaunay triangulation into a mesh satisfying the size and shape criteria specified in the traits class. Note that if, during the life time of the Delaunay_mesher_2
object, the triangulation is externally modified, any further call to its member methods may crash. Consider constructing a new Delaunay_mesher_2
object if the triangulation has been modified.
Meshing Domain
The domain to be mesh is defined by the constrained edges and a set of seed points. The constrained edges divides the plane into several connected components. The mesh domain is either the union of the bounded connected components including at least one seed, or the union of the bounded connected components that do no contain any seed. Note that the unbounded component of the plane is never meshed.
CGAL::lloyd_optimize_mesh_2
Types | |
typedef CDT::Geom_traits | Geom_traits |
the geometric traits class. | |
typedef unspecified_type | Seeds_iterator |
const iterator over defined seeds. More... | |
Creation | |
Delaunay_mesher_2 (CDT &t, Criteria criteria=Criteria()) | |
Create a new mesher, working on t , with meshing criteria criteria . | |
Seeds functions | |
void | clear_seeds () |
Sets seeds to the empty set. More... | |
template<class InputIterator > | |
void | set_seeds (InputIterator begin, InputIterator end, const bool mark=false) |
Sets seeds to the sequence [begin, end) . More... | |
Seeds_const_iterator | seeds_begin () const |
Start of the seeds sequence. | |
Seeds_const_iterator | seeds_end () const |
Past the end of the seeds sequence. | |
Meshing methods | |
The function This function actually has an optional argument that permits to prevent this recalculation. The filling of the list of bad faces can then be done by a call to | |
void | refine_mesh () |
Refines the constrained Delaunay triangulation into a mesh satisfying the criteria defined by the traits. | |
const Criteria & | get_criteria () |
Returns a const reference to the criteria traits object. | |
void | set_criteria (Criteria criteria) |
Assigns criteria to the criteria traits object. | |
void | set_criteria (Criteria criteria, bool recalculate_bad_faces) |
Assigns criteria to the criteria traits object. More... | |
template<class InputIterator > | |
void | set_bad_faces (InputIterator begin, InputIterator end) |
This method permits to set the list of bad triangles directly, from the sequence [begin, end) , so that the algorithm will not scan the whole set of triangles to find bad ones. More... | |
Step by Step Operations | |
The | |
void | init () |
This method must be called just before the first call to the following step by step refinement method, that is when all vertices and constrained edges have been inserted into the constrained Delaunay triangulation. More... | |
bool | is_refinement_done () |
Tests if the step by step refinement algorithm is done. More... | |
bool | step_by_step_refine_mesh () |
Applies one step of the algorithm, by inserting one point, if the algorithm is not done. More... | |
typedef unspecified_type CGAL::Delaunay_mesher_2< CDT, Criteria >::Seeds_iterator |
const iterator over defined seeds.
Its value type is Geom_traits::Point_2
.
void CGAL::Delaunay_mesher_2< CDT, Criteria >::clear_seeds | ( | ) |
Sets seeds to the empty set.
All finite connected components of the constrained triangulation will be refined.
void CGAL::Delaunay_mesher_2< CDT, Criteria >::init | ( | ) |
This method must be called just before the first call to the following step by step refinement method, that is when all vertices and constrained edges have been inserted into the constrained Delaunay triangulation.
It must be called again before any subsequent calls to the step by step refinement method if new vertices or constrained edges have been inserted since the last call.
bool CGAL::Delaunay_mesher_2< CDT, Criteria >::is_refinement_done | ( | ) |
Tests if the step by step refinement algorithm is done.
If it returns true
, the following calls to step_by_step_refine_mesh
will not insert any points, until some new constrained segments or points are inserted in the triangulation and init
is called again.
void CGAL::Delaunay_mesher_2< CDT, Criteria >::set_bad_faces | ( | InputIterator | begin, |
InputIterator | end | ||
) |
This method permits to set the list of bad triangles directly, from the sequence [begin, end)
, so that the algorithm will not scan the whole set of triangles to find bad ones.
To use if there is a non-naive way to find bad triangles.
InputIterator | must be an input iterator with value type Face_handle . |
void CGAL::Delaunay_mesher_2< CDT, Criteria >::set_criteria | ( | Criteria | criteria, |
bool | recalculate_bad_faces | ||
) |
Assigns criteria
to the criteria traits object.
If recalculate_bad_faces
is false
, the list of bad faces is let empty and the function set_bad_faces()
should be called before refine_mesh
.
void CGAL::Delaunay_mesher_2< CDT, Criteria >::set_seeds | ( | InputIterator | begin, |
InputIterator | end, | ||
const bool | mark = false |
||
) |
Sets seeds to the sequence [begin, end)
.
If mark==true
, the mesh domain is the union of the bounded connected components including at least one seed. If mark==false
, the domain is the union of the bounded components including no seed. Note that the unbounded component of the plane is never meshed.
InputIterator | must be an input iterator with value type Geom_traits::Point_2 . |
bool CGAL::Delaunay_mesher_2< CDT, Criteria >::step_by_step_refine_mesh | ( | ) |
Applies one step of the algorithm, by inserting one point, if the algorithm is not done.
Returns false
iff no point has been inserted because the algorithm is done.