CGAL 5.6 - Weights

#include <CGAL/Weights/wachspress_weights.h>

Wachspress weights which can be computed for a query point with respect to the vertices of a strictly convex polygon.

Classes

class  CGAL::Weights::Wachspress_weights_2< VertexRange, GeomTraits, PointMap >
 2D Wachspress weights for polygons. More...
 

Functions

template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator CGAL::Weights::wachspress_weights_2 (const PointRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator w_begin, const GeomTraits &traits)
 computes 2D Wachspress weights for polygons. More...
 

Function Documentation

◆ wachspress_weights_2()

template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator CGAL::Weights::wachspress_weights_2 ( const PointRange &  polygon,
const typename GeomTraits::Point_2 &  query,
OutIterator  w_begin,
const GeomTraits &  traits 
)

#include <CGAL/Weights/wachspress_weights.h>

computes 2D Wachspress weights for polygons.

This function computes 2D Wachspress weights at a given query point with respect to the vertices of a strictly convex polygon, that is one weight per vertex. The weights are stored in a destination range beginning at w_begin.

Internally, the class Wachspress_weights_2 is used. If one wants to process multiple query points, it is better to use that class. When using the free function, internal memory is allocated for each query point, while when using the class, it is allocated only once which is much more efficient. However, for a few query points, it is easier to use this function. It can also be used when the processing time is not a concern.

Template Parameters
PointRangea model of ConstRange whose iterator type is RandomAccessIterator and value type is GeomTraits::Point_2
OutIteratora model of OutputIterator whose value type is GeomTraits::FT
GeomTraitsa model of AnalyticWeightTraits_2
Parameters
polygonan instance of PointRange with 2D points which form a strictly convex polygon
querya query point
w_beginthe beginning of the destination range with the computed weights
traitsa traits class with geometric objects, predicates, and constructions; this parameter can be omitted if the traits class can be deduced from the point type
Returns
an output iterator to the element in the destination range, one past the last weight stored
Precondition
polygon.size() >= 3
polygon is simple
polygon is strictly convex