CGAL 6.2 - 2D Generalized Barycentric Coordinates: CGAL::Barycentric_coordinates::Triangle_coordinates_2< Traits > Class Template Reference

CGAL 6.2 - 2D Generalized Barycentric Coordinates

Loading...
Searching...
No Matches
List of all members | Related Functions
CGAL::Barycentric_coordinates::Triangle_coordinates_2< Traits > Class Template Reference
Reference Manual » Deprecated

`#include <CGAL/Barycentric_coordinates_2/triangle_coordinates_2.h>`

## Definition

template<class Traits>
class CGAL::Barycentric_coordinates::Triangle_coordinates_2< Traits >

The class `Triangle_coordinates_2` implements barycentric coordinates ( [1], [2] ) with respect to an arbitrary non-degenerate triangle in the plane.

This class is parameterized by a traits class `Traits`.

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

Template Parameters

  Traits | must be a model of the concept `BarycentricTraits_2`.

## Related Functions
(Note that these are not member functions.)
template<class Traits >
std::array< typename Traits::FT, 3 > | compute_triangle_coordinates_2 (const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &third_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits=Traits())
| This is a global function that takes three vertices of a triangle and computes triangle coordinates at a given query point with respect to these vertices.

## Types
typedef Traits::FT | FT
| Number type.
typedef Traits::Point_2 | Point_2
| Point type.
typedef unspecified_type | Vertex_range
| Range of vertices in a triangle.

## Creation
| Triangle_coordinates_2 (const Point_2 &first_vertex, const Point_2 &second_vertex, const Point_2 &third_vertex, const Traits &b_traits=Traits())
| Creates the class `Triangle_coordinates_2` that implements triangle coordinates with respect to an arbitrary non-degenerate triangle in the plane.

## Computation
template<class OutputIterator >
std::optional< OutputIterator > | operator() (const Point_2 &query_point, OutputIterator output)
| Computes triangle barycentric coordinates for a chosen query point with respect to all three vertices of the triangle.

## Endpoint Accessors
const Vertex_range & | vertices () const
| Returns all the vertices of the triangle.
const Point_2 & | first_vertex () const
| Returns the first vertex of the triangle.
const Point_2 & | second_vertex () const
| Returns the second vertex of the triangle.
const Point_2 & | third_vertex () const
| Returns the third vertex of the triangle.

## Member Typedef Documentation

## ◆ Vertex_range

template<class Traits >

typedef unspecified_type CGAL::Barycentric_coordinates::Triangle_coordinates_2< Traits >::Vertex_range

Range of vertices in a triangle.

This type is a model of the concept `Range`. Its iterator type is `RandomAccessIterator`, and its value type is `Traits::Point_2`.

## Constructor & Destructor Documentation

## ◆ Triangle_coordinates_2()

template<class Traits >

CGAL::Barycentric_coordinates::Triangle_coordinates_2< Traits >::Triangle_coordinates_2 | ( | const Point_2 & | first_vertex,
|  | const Point_2 & | second_vertex,
|  | const Point_2 & | third_vertex,
|  | const Traits & | b_traits = `Traits()`
| ) |  |

Creates the class `Triangle_coordinates_2` that implements triangle coordinates with respect to an arbitrary non-degenerate triangle in the plane.

The triangle is given by its three vertices.

Precondition
  Triangle is not degenerate.

## Member Function Documentation

## ◆ operator()()

template<class Traits >
template<class OutputIterator >

std::optional< OutputIterator > CGAL::Barycentric_coordinates::Triangle_coordinates_2< Traits >::operator() | ( | const Point_2 & | query_point,
|  | OutputIterator | output
| ) |  |

Computes triangle barycentric coordinates for a chosen query point with respect to all three vertices of the triangle.

Computed coordinates are stored in the output iterator `output`.

## Friends And Related Function Documentation

## ◆ compute_triangle_coordinates_2()

template<class Traits >

std::array< typename Traits::FT, 3 > compute_triangle_coordinates_2 | ( | const typename Traits::Point_2 & | first_vertex,
|  | const typename Traits::Point_2 & | second_vertex,
|  | const typename Traits::Point_2 & | third_vertex,
|  | const typename Traits::Point_2 & | query_point,
|  | const Traits & | barycentric_traits = `Traits()`
| ) |  |
| related

This is a global function that takes three vertices of a triangle and computes triangle coordinates at a given query point with respect to these vertices.

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

Template Parameters

  Traits | must be a model of the concept `BarycentricTraits_2`.