CGAL 5.6.1 - Weights
|
#include <CGAL/Weights/discrete_harmonic_weights.h>
2D discrete harmonic weights for polygons.
This class implements 2D discrete harmonic weights ([1], [2], [6]) which can be computed at any point inside a strictly convex polygon.
Discrete harmonic weights are well-defined inside a strictly convex polygon but they are not necessarily positive. These weights are computed analytically using the formulation from the discrete_harmonic_weight()
.
VertexRange | a model of ConstRange whose iterator type is RandomAccessIterator |
GeomTraits | a model of AnalyticWeightTraits_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 | |
Discrete_harmonic_weights_2 (const VertexRange &polygon, const GeomTraits traits=GeomTraits(), const PointMap point_map=PointMap()) | |
initializes all internal data structures. More... | |
Access | |
template<typename OutIterator > | |
OutIterator | operator() (const Point_2 &query, OutIterator w_begin) |
computes 2D discrete harmonic weights. More... | |
CGAL::Weights::Discrete_harmonic_weights_2< VertexRange, GeomTraits, PointMap >::Discrete_harmonic_weights_2 | ( | const VertexRange & | polygon, |
const GeomTraits | traits = GeomTraits() , |
||
const PointMap | point_map = PointMap() |
||
) |
initializes all internal data structures.
This class implements the behavior of discrete harmonic weights for 2D query points inside strictly convex polygons.
polygon | an instance of VertexRange with the vertices of a strictly convex 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::Weights::Discrete_harmonic_weights_2< VertexRange, GeomTraits, PointMap >::operator() | ( | const Point_2 & | query, |
OutIterator | w_begin | ||
) |
computes 2D discrete harmonic weights.
This function fills a destination range with 2D discrete harmonic weights computed at the query
point with respect to the vertices of the input polygon.
The number of computed weights is equal to the number of polygon vertices.
OutIterator | a model of OutputIterator whose value type is FT |
query | a query point |
w_begin | the beginning of the destination range with the computed weights |