CGAL 6.1.2 - Weights

Loading...
Searching...
No Matches
List of all members
CGAL::Weights::Mean_value_weights_2< VertexRange, GeomTraits, PointMap > Class Template Reference
Reference Manual » Barycentric Weights » Mean Value Weights

`#include <CGAL/Weights/mean_value_weights.h>`

## Definition

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

2D mean value weights for polygons.

This class implements 2D mean value weights ([2], [3], [4]) which can be computed at any point inside and outside a simple polygon.

Mean value weights are well-defined inside and outside a simple polygon and are non-negative in the kernel of a star-shaped polygon. These weights are computed analytically using the formulation from `tangent_weight()`.

Template Parameters

  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`.

Is model of
  `BarycentricWeights_2`

## Types
typedef GeomTraits::FT | FT
| Number type.
typedef GeomTraits::Point_2 | Point_2
| Point type.

## Initialization
| Mean_value_weights_2 (const VertexRange &polygon, const GeomTraits traits=GeomTraits(), const PointMap point_map=PointMap())
| initializes all internal data structures.

## Access
template<typename OutIterator >
OutIterator | operator() (const Point_2 &query, OutIterator w_begin)
| computes 2D mean value weights.

## Constructor & Destructor Documentation

## ◆ Mean_value_weights_2()

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

CGAL::Weights::Mean_value_weights_2< VertexRange, GeomTraits, PointMap >::Mean_value_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 mean value weights for 2D query points inside simple polygons.

Parameters

  polygon | an instance of `VertexRange` with the vertices of a simple 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

Precondition
  polygon.size() >= 3
  polygon is simple

## 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::Mean_value_weights_2< VertexRange, GeomTraits, PointMap >::operator() | ( | const Point_2 & | query,
|  | OutIterator | w_begin
| ) |  |

computes 2D mean value weights.

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

  OutIterator | a model of `OutputIterator` whose value type is `FT`

Parameters

  query | a query point
  w_begin | the 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