CGAL 6.0 - 2D Generalized Barycentric Coordinates
|
#include <CGAL/Barycentric_coordinates_2/Delaunay_domain_2.h>
2D Delaunay domain restricted to a simple polygon.
This class implements a discretized domain restricted to a simple polygon. The interior part of the input polygon is triangulated and refined with respect to the user-specified shape size parameter. The final triangulation is a constrained Delaunay triangulation, where the constraints are the polygon edges.
Internally, the package 2D Conforming Triangulations and Meshes is used. See it for more details.
VertexRange | a model of ConstRange whose iterator type is RandomAccessIterator |
GeomTraits | a model of BarycentricTraits_2 |
PointMap | a model of ReadablePropertyMap whose key type is VertexRange::value_type and value type is Point_2 . The default is CGAL::Identity_property_map . |
DiscretizedDomain_2
Types | |
typedef GeomTraits::FT | FT |
Number type. | |
typedef GeomTraits::Point_2 | Point_2 |
Point type. | |
Initialization | |
Delaunay_domain_2 (const VertexRange &polygon, const GeomTraits traits=GeomTraits(), const PointMap point_map=PointMap()) | |
initializes all internal data structures. | |
template<typename PointRange > | |
void | create (const FT max_edge_length, const PointRange &seeds) |
creates a refined Delaunay triangulation restricted to the input polygon. | |
Access | |
template<typename OutIterator > | |
OutIterator | barycenters (OutIterator b_begin) const |
computes barycenters of all generated triangles. | |
std::size_t | number_of_vertices () const |
returns the number of triangulation vertices. | |
const Point_2 & | vertex (const std::size_t query_index) const |
returns a const reference to the triangulation vertex with the index query_index . | |
bool | is_on_boundary (const std::size_t query_index) const |
controls if the triangulation vertex with the index query_index is on the polygon boundary. | |
void | operator() (const std::size_t query_index, std::vector< std::size_t > &neighbors) const |
returns the one-ring neighborhood of the triangulation vertex with the index query_index . | |
void | locate (const Point_2 &query, std::vector< std::size_t > &triangle) const |
locates a triangle that contains a given query point. | |
Memory Management | |
void | clear () |
clears all internal data structures. | |
void | release_memory () |
releases all memory that is used internally. | |
CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::Delaunay_domain_2 | ( | const VertexRange & | polygon, |
const GeomTraits | traits = GeomTraits() , |
||
const PointMap | point_map = PointMap() |
||
) |
initializes all internal data structures.
polygon | an instance of VertexRange with the vertices of a simple polygon |
traits | a traits class with geometric objects, predicates, and constructions; the default initialization is provided |
point_map | an instance of PointMap that maps a vertex from polygon to Point_2 ; the default initialization is provided |
OutIterator CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::barycenters | ( | OutIterator | b_begin | ) | const |
computes barycenters of all generated triangles.
OutIterator | a model of OutputIterator that accepts points of type Point_2 |
b_begin | the beginning of the destination range with the computed barycenters |
void CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::create | ( | const FT | max_edge_length, |
const PointRange & | seeds | ||
) |
creates a refined Delaunay triangulation restricted to the input polygon.
After the construction is completed, the first n vertices are the polygon vertices, the next m vertices are the vertices generated along the polygon boundary, the last k vertices are the vertices generated in the interior part of the polygon.
PointRange | a model of ConstRange whose value type is GeomTraits::Point_2 |
max_edge_length | an upper bound on the length of the longest edge; see Delaunay_mesh_size_criteria_2 for more details |
seeds | contains seed points indicating, which parts of the input polygon should be partitioned and subdivided |
bool CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::is_on_boundary | ( | const std::size_t | query_index | ) | const |
controls if the triangulation vertex with the index query_index
is on the polygon boundary.
This function implements DiscretizedDomain_2::is_on_boundary()
.
query_index | an index of the query vertex |
void CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::locate | ( | const Point_2 & | query, |
std::vector< std::size_t > & | triangle | ||
) | const |
locates a triangle that contains a given query point.
If triangle
is empty, the query point does not belong to the domain.
This function implements DiscretizedDomain_2::locate()
.
query | a query point |
triangle | stores indices of the vertices, which form a triangle, that contains the query point |
std::size_t CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::number_of_vertices | ( | ) | const |
returns the number of triangulation vertices.
This function implements DiscretizedDomain_2::number_of_vertices()
.
void CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::operator() | ( | const std::size_t | query_index, |
std::vector< std::size_t > & | neighbors | ||
) | const |
returns the one-ring neighborhood of the triangulation vertex with the index query_index
.
This function implements DiscretizedDomain_2::operator()()
.
query_index | an index of the query vertex |
neighbors | stores indices of the vertices, which from the one-ring neighborhood of the query vertex |
const Point_2 & CGAL::Barycentric_coordinates::Delaunay_domain_2< VertexRange, GeomTraits, PointMap >::vertex | ( | const std::size_t | query_index | ) | const |
returns a const reference to the triangulation vertex with the index query_index
.
This function implements DiscretizedDomain_2::vertex()
.
query_index | an index of the requested vertex |