CGAL 5.5.2 - Weights

#include <CGAL/Weights/mean_value_weights.h>

Mean value weights which can be computed for a query point with respect to the vertices of a simple polygon.

Classes

class  CGAL::Weights::Mean_value_weights_2< VertexRange, GeomTraits, PointMap >
 2D mean value weights for polygons. More...
 

Functions

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

Function Documentation

◆ mean_value_weights_2()

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

#include <CGAL/Weights/mean_value_weights.h>

computes 2D mean value weights for polygons.

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

Internally, the class Mean_value_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 simple 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