AdaptationPolicy_2

Definition

The concept AdaptationPolicy_2 defines the requirements on the predicate functors that determine whether a feature of the triangulated Delaunay graph should be rejected or not. It also provides a functor for inserting sites in the Delaunay graph. The last functor is optional and a tag determines whether it is provided or not. Note that while the first two functors do not modify the Delaunay graph they take as an argument, the last ones does.

Refines

DefaultConstructible, CopyConstructible, Assignable

Types

AdaptationPolicy_2::Site_2
A type for the sites of the Voronoi diagram.

AdaptationPolicy_2::Delaunay_graph
A type for the triangulated Delaunay graph. The type Delaunay_graph must be a model of the DelaunayGraph_2 concept.

typedef Delaunay_graph::Vertex_handle
Delaunay_vertex_handle;
typedef Delaunay_graph::Face_handle
Delaunay_face_handle;
typedef Delaunay_graph::Edge Delaunay_edge;
typedef Delaunay_graph::All_edges_iterator
All_Delaunay_edges_iterator;
typedef Delaunay_graph::Finite_edges_iterator
Finite_Delaunay_edges_iterator;
typedef Delaunay_graph::Edge_circulator
Delaunay_edge_circulator;
AdaptationPolicy_2::Edge_rejector
A type for the predicate functor that is responsible for rejecting an edge of the Delaunay graph (or equivalently rejecting its dual edge in the Voronoi diagram). It must be model of the concepts DefaultConstructible, CopyConstructible, Assignable, and AdaptableFunctor (with two arguments). It must provide the following operators:
bool operator()(Delaunay_graph dg, Delaunay_edge e)
bool operator()(Delaunay_graph dg, Delaunay_face_handle f, int i)
bool operator()(Delaunay_graph dg, Delaunay_edge_circulator ec)
bool operator()(Delaunay_graph dg,
All_Delaunay_edges_iterator eit)
bool operator()(Delaunay_graph dg,
Finite_Delaunay_edges_iterator eit)
The functor returns true iff the edge is rejected.

AdaptationPolicy_2::Face_rejector
A type for the predicate functor that is responsible for rejecting a vertex of the Delaunay graph (or equivalently its dual face in the Voronoi diagram - hence the name of the functor). It must be model of the concepts DefaultConstructible, CopyConstructible, Assignable, AdaptableFunctor (with two arguments). It must provide the following operator:
bool operator()(Delaunay graph dg, Delaunay_vertex_handle v)

The functor returns true iff the face is rejected.

AdaptationPolicy_2::Has_inserter
A tag for determining if the adaptation policy class provides a functor for inserting sites in the Delaunay graph. This tag is equal to either CGAL::Tag_true (a site inserter functor is available) or CGAL::Tag_false (a site inserter functor is not available).

AdaptationPolicy_2::Site_inserter
A type for a functor that inserts sites in the Delaunay graph. It must be model of the concepts DefaultConstructible, CopyConstructible, Assignable, AdaptableFunctor (with two arguments). It must provide the following operator
Delaunay_vertex_handle operator()(Delaunay_graph& dg, Site_2 t)

The vertex handle returned either points to the vertex of the Delaunay graph corresponding to the site just inserted or is the default constructed vertex handle. The latter case can happen if the site inserted is hidden, i.e., it has an empty Voronoi cell.
This type is required only if the Has_inserter tag is equal to CGAL::Tag_true.

Access to objects

Edge_rejector ap.edge_rejector_object ()
Face_rejector ap.face_rejector_object ()
Site_inserter ap.site_inserter_object () This method is required only if Has_inserter is equal to CGAL::Tag_true.

Miscellaneous

The following methods are important when the adaptation policy maintains a state. This can happen if we have a caching adaptation policy, i.e., when we cache the results of the edge and face rejectors.

void ap.clear () Clears the state of the adaptation policy.
void ap.swap ( other) The adaptation policies ap and other are swapped. This method should be preferred to ap=other or ap(other) if other is deleted afterwards.
bool ap.is_valid () Tests the validity of the adaptation policy.

bool ap.is_valid ( Delaunay_graph dg) Tests the validity of the adaptation policy using extra information from the Delaunay graph dg.

Has Models

CGAL::Identity_policy_2<DG,AT>
CGAL::Apollonius_graph_degeneracy_removal_policy_2<AG2>
CGAL::Apollonius_graph_caching_degeneracy_removal_policy_2<AG2>
CGAL::Delaunay_triangulation_degeneracy_removal_policy_2<DT2>
CGAL::Delaunay_triangulation_caching_degeneracy_removal_policy_2<DT2>
CGAL::Regular_triangulation_degeneracy_removal_policy_2<RT2>
CGAL::Regular_triangulation_caching_degeneracy_removal_policy_2<RT2>
CGAL::Segment_Delaunay_graph_degeneracy_removal_policy_2<SDG2>
CGAL::Segment_Delaunay_graph_caching_degeneracy_removal_policy_2<SDG2>

See Also

DelaunayGraph_2
AdaptationTraits_2
CGAL::Voronoi_diagram_2<DG,AT,AP>