CGAL 5.4.4 - 2D Generalized Barycentric Coordinates
CGAL::Barycentric_coordinates Namespace Reference

The namespace Barycentric_coordinates contains implementations of all generalized barycentric coordinates: 2D, 3D, related enumerations, etc. More...

Classes

class  BarycentricCoordinates_2
 A concept that describes the set of methods that should be defined for all coordinate models used to parameterize the class Generalized_barycentric_coordinates_2. More...
 
class  BarycentricTraits_2
 A concept that describes the set of requirements of the template parameter GeomTraits used to parameterize all classes and functions with 2D barycentric coordinates from the namespace CGAL::Barycentric_coordinates. More...
 
class  Delaunay_domain_2
 2D Delaunay domain restricted to a simple polygon. More...
 
class  Discrete_harmonic_2
 The class Discrete_harmonic_2 implements 2D discrete harmonic coordinates ( [2], [9], [1] ). More...
 
class  Discrete_harmonic_coordinates_2
 2D discrete harmonic coordinates. More...
 
class  DiscretizedDomain_2
 A concept that describes the set of methods that should be defined for all discretized domains obtained by meshing the interior part of a simple polygon. More...
 
class  Generalized_barycentric_coordinates_2
 The class Generalized_barycentric_coordinates_2 implements generalized barycentric coordinates along the polygon's boundary and provides a common interface for all coordinate classes. More...
 
class  Harmonic_coordinates_2
 2D harmonic coordinates. More...
 
class  Mean_value_2
 The class Mean_value_2 implements 2D mean value coordinates ( [5], [2], [3] ). More...
 
class  Mean_value_coordinates_2
 2D mean value coordinates. More...
 
class  Segment_coordinates_2
 The class Segment_coordinates_2 implements barycentric coordinates with respect to an arbitrary non-degenerate segment along an arbitrary line in the plane. More...
 
class  Triangle_coordinates_2
 The class Triangle_coordinates_2 implements barycentric coordinates ( [1], [2] ) with respect to an arbitrary non-degenerate triangle in the plane. More...
 
class  Wachspress_2
 The class Wachspress_2 implements 2D Wachspress coordinates ( [2], [8], [10] ). More...
 
class  Wachspress_coordinates_2
 2D Wachspress coordinates. More...
 

Functions

template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator discrete_harmonic_weights_2 (const PointRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator w_begin, const GeomTraits &traits, const Computation_policy_2 policy=Computation_policy_2::FAST_WITH_EDGE_CASES)
 computes 2D discrete harmonic weights. More...
 
template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator discrete_harmonic_coordinates_2 (const PointRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator c_begin, const GeomTraits &traits, const Computation_policy_2 policy=Computation_policy_2::PRECISE_WITH_EDGE_CASES)
 computes 2D discrete harmonic coordinates. More...
 
template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator mean_value_weights_2 (const PointRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator w_begin, const GeomTraits &traits, const Computation_policy_2 policy=Computation_policy_2::FAST_WITH_EDGE_CASES)
 computes 2D mean value weights. More...
 
template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator mean_value_coordinates_2 (const PointRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator c_begin, const GeomTraits &traits, const Computation_policy_2 policy=Computation_policy_2::PRECISE_WITH_EDGE_CASES)
 computes 2D mean value coordinates. More...
 
template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator wachspress_weights_2 (const PointRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator w_begin, const GeomTraits &traits, const Computation_policy_2 policy=Computation_policy_2::FAST_WITH_EDGE_CASES)
 computes 2D Wachspress weights. More...
 
template<typename PointRange , typename OutIterator , typename GeomTraits >
OutIterator wachspress_coordinates_2 (const PointRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator c_begin, const GeomTraits &traits, const Computation_policy_2 policy=Computation_policy_2::PRECISE_WITH_EDGE_CASES)
 computes 2D Wachspress coordinates. More...
 
template<typename VertexRange , typename OutIterator , typename GeomTraits , typename PointMap >
std::pair< OutIterator, bool > boundary_coordinates_2 (const VertexRange &polygon, const typename GeomTraits::Point_2 &query, OutIterator c_begin, const GeomTraits &traits, const PointMap point_map)
 computes 2D boundary coordinates. More...
 
template<typename VertexRange , typename Query_2 , typename OutIterator , typename PointMap = CGAL::Identity_property_map<Query_2>>
std::pair< OutIterator, bool > boundary_coordinates_2 (const VertexRange &polygon, const Query_2 &query, OutIterator c_begin, const PointMap point_map=PointMap())
 computes 2D boundary coordinates. More...
 
template<typename OutIterator , typename GeomTraits >
OutIterator segment_coordinates_2 (const typename GeomTraits::Point_2 &p0, const typename GeomTraits::Point_2 &p1, const typename GeomTraits::Point_2 &query, OutIterator c_begin, const GeomTraits &traits)
 computes segment coordinates. More...
 
template<typename OutIterator , typename GeomTraits >
OutIterator triangle_coordinates_2 (const typename GeomTraits::Point_2 &p0, const typename GeomTraits::Point_2 &p1, const typename GeomTraits::Point_2 &p2, const typename GeomTraits::Point_2 &query, OutIterator c_begin, const GeomTraits &traits)
 computes triangle coordinates. More...
 

Computation Policies

enum  Computation_policy_2 { Computation_policy_2::PRECISE_WITH_EDGE_CASES = 0, PRECISE = 1, Computation_policy_2::FAST_WITH_EDGE_CASES = 2, FAST = 3 }
 Computation_policy_2 provides a way to choose an asymptotic time complexity of the algorithm and its precision for computing 2D barycentric weights and coordinates. More...
 

Locations of a Query Point

enum  Query_point_location {
  UNSPECIFIED_LOCATION, ON_VERTEX, ON_BOUNDARY, ON_BOUNDED_SIDE,
  ON_UNBOUNDED_SIDE
}
 Query_point_location is enumeration with possible locations of a query point provided by the user. More...
 

Types of an Algorithm

enum  Type_of_algorithm { PRECISE, PRECISE = 1, FAST, FAST = 3 }
 Type_of_algorithm is enumeration with possible algorithms to compute coordinates. More...
 

Definition

The namespace Barycentric_coordinates contains implementations of all generalized barycentric coordinates: 2D, 3D, related enumerations, etc.

Enumeration Type Documentation

◆ Computation_policy_2

Computation_policy_2 provides a way to choose an asymptotic time complexity of the algorithm and its precision for computing 2D barycentric weights and coordinates.

Enumerator
PRECISE_WITH_EDGE_CASES 

Computation is very precise but has a quadratic time complexity with respect to the number of polygon vertices.

In addition, we check a position of the query point with respect to the polygon and use different computation strategies for different positions. This is the default policy.

PRECISE 

Computation is very precise but has a quadratic time complexity with respect to the number of polygon vertices.

No extra checks are carried out.

FAST_WITH_EDGE_CASES 

Computation has a linear time complexity with respect to the number of polygon vertices, but may suffer imprecisions near the polygon boundary.

In addition, we check a position of the query point with respect to the polygon and use different computation strategies for different positions.

FAST 

Computation has a linear time complexity with respect to the number of polygon vertices, but may suffer imprecisions near the polygon boundary.

No extra checks are carried out.

Examples:
Barycentric_coordinates_2/discrete_harmonic_coordinates.cpp, and Barycentric_coordinates_2/mean_value_coordinates.cpp.

◆ Query_point_location

Query_point_location is enumeration with possible locations of a query point provided by the user.

Deprecated:
This part of the package is deprecated since the version 5.4 of CGAL.
Enumerator
UNSPECIFIED_LOCATION 

Location is not known apriori and is defined automatically by the algorithm.

ON_VERTEX 

Query point is located at one of the polygon's vertices.

ON_BOUNDARY 

Query point is located on the boundary of the polygon.

ON_BOUNDED_SIDE 

Query point is located inside the polygon, excluding the boundary.

ON_UNBOUNDED_SIDE 

Query point is located outside the polygon, excluding the boundary.

◆ Type_of_algorithm

Type_of_algorithm is enumeration with possible algorithms to compute coordinates.

Deprecated:
This part of the package is deprecated since the version 5.4 of CGAL.
Enumerator
PRECISE 

A default slow algorithm, which is as precise as possible.

PRECISE 

Computation is very precise but has a quadratic time complexity with respect to the number of polygon vertices.

No extra checks are carried out.

FAST 

A fast algorithm, which is less precise but much faster.

FAST 

Computation has a linear time complexity with respect to the number of polygon vertices, but may suffer imprecisions near the polygon boundary.

No extra checks are carried out.