CGAL 5.4 - Weights
CGAL::Weights::Wachspress_weights_2< VertexRange, GeomTraits, PointMap > Class Template Reference

#include <CGAL/Weights/wachspress_weights.h>

Definition

template<typename VertexRange, typename GeomTraits, typename PointMap = CGAL::Identity_property_map<typename GeomTraits::Point_2>>
class CGAL::Weights::Wachspress_weights_2< VertexRange, GeomTraits, PointMap >

2D Wachspress weights for polygons.

This class implements 2D Wachspress weights ( [2], [5], [7] ) which can be computed at any point inside a strictly convex polygon.

Wachspress weights are well-defined and non-negative inside a strictly convex polygon. The weights are computed analytically using the formulation from the wachspress_weight().

Template Parameters
VertexRangea model of ConstRange whose iterator type is RandomAccessIterator
GeomTraitsa model of AnalyticWeightTraits_2
PointMapa model of ReadablePropertyMap whose key type is VertexRange::value_type and value type is Point_2. The default is CGAL::Identity_property_map.
Is Model Of:
BarycentricWeights_2
Examples:
Weights/coordinates_multiple_queries.cpp.

Types

typedef GeomTraits::FT FT
 Number type.
 
typedef GeomTraits::Point_2 Point_2
 Point type.
 

Initialization

 Wachspress_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 Wachspress weights. More...
 

Constructor & Destructor Documentation

◆ Wachspress_weights_2()

template<typename VertexRange , typename GeomTraits , typename PointMap = CGAL::Identity_property_map<typename GeomTraits::Point_2>>
CGAL::Weights::Wachspress_weights_2< VertexRange, GeomTraits, PointMap >::Wachspress_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 Wachspress weights for 2D query points inside strictly convex polygons.

Parameters
polygonan instance of VertexRange with the vertices of a strictly convex polygon
traitsa traits class with geometric objects, predicates, and constructions; the default initialization is provided
point_mapan instance of PointMap that maps a vertex from polygon to Point_2; the default initialization is provided
Precondition
polygon.size() >= 3
polygon is simple
polygon is strictly convex

Member Function Documentation

◆ operator()()

template<typename VertexRange , typename GeomTraits , typename PointMap = CGAL::Identity_property_map<typename GeomTraits::Point_2>>
template<typename OutIterator >
OutIterator CGAL::Weights::Wachspress_weights_2< VertexRange, GeomTraits, PointMap >::operator() ( const Point_2 query,
OutIterator  w_begin 
)

computes 2D Wachspress weights.

This function fills a destination range with 2D Wachspress 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.

Template Parameters
OutIteratora model of OutputIterator whose value type is FT
Parameters
querya query point
w_beginthe beginning of the destination range with the computed weights
Returns
an output iterator to the element in the destination range, one past the last weight stored