CGAL 5.4.4 - 2D Generalized Barycentric Coordinates
|
#include <CGAL/Barycentric_coordinates_2/Mean_value_coordinates_2.h>
2D mean value coordinates.
This class implements 2D mean value coordinates ( [5], [2], [3] ), which can be computed at any point in the plane.
Mean value coordinates are well-defined everywhere in the plane and are non-negative in the kernel of a star-shaped polygon. The coordinates are computed analytically. See more details in the user manual here.
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 . |
Types | |
typedef GeomTraits::FT | FT |
Number type. | |
typedef GeomTraits::Point_2 | Point_2 |
Point type. | |
Initialization | |
Mean_value_coordinates_2 (const VertexRange &polygon, const Computation_policy_2 policy=Computation_policy_2::PRECISE_WITH_EDGE_CASES, const GeomTraits traits=GeomTraits(), const PointMap point_map=PointMap()) | |
initializes all internal data structures. More... | |
Access | |
template<typename OutIterator > | |
OutIterator | weights (const Point_2 &query, OutIterator w_begin) |
computes 2D mean value weights. More... | |
template<typename OutIterator > | |
OutIterator | operator() (const Point_2 &query, OutIterator c_begin) |
computes 2D mean value coordinates. More... | |
CGAL::Barycentric_coordinates::Mean_value_coordinates_2< VertexRange, GeomTraits, PointMap >::Mean_value_coordinates_2 | ( | const VertexRange & | polygon, |
const Computation_policy_2 | policy = Computation_policy_2::PRECISE_WITH_EDGE_CASES , |
||
const GeomTraits | traits = GeomTraits() , |
||
const PointMap | point_map = PointMap() |
||
) |
initializes all internal data structures.
This class implements the behavior of mean value coordinates for 2D query points.
polygon | an instance of VertexRange with the vertices of a simple polygon |
policy | one of the Computation_policy_2 ; the default is Computation_policy_2::PRECISE_WITH_EDGE_CASES |
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::Mean_value_coordinates_2< VertexRange, GeomTraits, PointMap >::operator() | ( | const Point_2 & | query, |
OutIterator | c_begin | ||
) |
computes 2D mean value coordinates.
This function fills c_begin
with 2D mean value coordinates computed at the query
point with respect to the vertices of the input polygon.
The number of returned coordinates equals to the number of polygon vertices.
After the coordinates \(b_i\) with \(i = 1\dots n\) are computed, where \(n\) is the number of polygon vertices, the query point \(q\) can be obtained as \(q = \sum_{i = 1}^{n}b_ip_i\), where \(p_i\) are the polygon vertices.
OutIterator | a model of OutputIterator that accepts values of type FT |
query | a query point |
c_begin | the beginning of the destination range with the computed coordinates |
OutIterator CGAL::Barycentric_coordinates::Mean_value_coordinates_2< VertexRange, GeomTraits, PointMap >::weights | ( | const Point_2 & | query, |
OutIterator | w_begin | ||
) |
computes 2D mean value weights.
This function fills weights
with 2D mean value weights computed at the query
point with respect to the vertices of the input polygon. If query
belongs to the polygon boundary, the returned weights are normalized.
The number of returned weights equals to the number of polygon vertices.
OutIterator | a model of OutputIterator that accepts values of type FT |
query | a query point |
w_begin | the beginning of the destination range with the computed weights |