CGAL 6.1.1 - 2D Triangulations

Loading...
Searching...
No Matches
List of all members
TriangulationTraits_2 Concept Reference
Reference Manual » Concepts

## Definition

Refines
  `SpatialSortingTraits_2`

The concept `TriangulationTraits_2` describes the set of requirements to be fulfilled by any class used to instantiate the first template parameter of the class `CGAL::Triangulation_2<Traits,Tds>`. This concept provides the types of the geometric primitives used in the triangulation and some function object types for the required predicates on those primitives.

Has models
  All models of the CGAL concept `Kernel`
  `CGAL::Projection_traits_3<K>`
  `CGAL::Projection_traits_xy_3<K>`
  `CGAL::Projection_traits_yz_3<K>`
  `CGAL::Projection_traits_xz_3<K>`

See also
  `CGAL::Triangulation_2`

## Types
typedef unspecified_type | Point_2
| The point type.
typedef unspecified_type | Segment_2
| The segment type.
typedef unspecified_type | Triangle_2
| The triangle type.
typedef unspecified_type | Construct_point_2
| A function object to construct a `Point_2`.
typedef unspecified_type | Construct_segment_2
| A function object to construct a `Segment_2`.
typedef unspecified_type | Construct_triangle_2
| A function object to construct a `Triangle_2`.
typedef unspecified_type | Less_x_2
| A function object to compare the x-coordinate of two points.
typedef unspecified_type | Less_y_2
| A function object to compare the y-coordinate of two points.
typedef unspecified_type | Compare_x_2
| A function object to compare the x-coordinate of two points.
typedef unspecified_type | Compare_y_2
| A function object to compare the y-coordinate of two points.
typedef unspecified_type | Compare_xy_2
| A function object that lexicographically compares two points by their Cartesian coordinates.
typedef unspecified_type | Orientation_2
| A function object to compute the orientation of three points.
typedef unspecified_type | Side_of_oriented_circle_2
| A function object to perform the incircle test for four points.
typedef unspecified_type | Construct_circumcenter_2
| A function object to compute the circumcentr of three points.

## Creation
Only a default constructor, copy constructor and an assignment operator are required. Note that further constructors can be provided.
| TriangulationTraits_2 ()
| default constructor.
| TriangulationTraits_2 (TriangulationTraits_2 gtr)
| Copy constructor.
TriangulationTraits_2 | operator= (TriangulationTraits_2 gtr)
| Assignment operator.

## Predicate Functions
The following functions give access to the predicate and constructor objects.
Construct_point_2 | construct_point_2_object ()
Construct_segment_2 | construct_segment_2_object ()
Construct_triangle_2 | construct_triangle_2_object ()
Less_x_2 | less_x_2_object ()
Less_y_2 | less_y_2_object ()
Compare_x_2 | compare_x_2_object ()
Compare_y_2 | compare_y_2_object ()
Compare_xy_2 | compare_xy_2_object ()
Orientation_2 | orientation_2_object ()
Side_of_oriented_circle_2 | side_of_oriented_circle_2_object ()
| Required only if `side_of_oriented_circle` is called called.
Construct_circumcenter_2 | construct_circumcenter_2_object ()
| Required only if `circumcenter` is called.

## Member Typedef Documentation

## ◆ Compare_x_2

typedef unspecified_type TriangulationTraits_2::Compare_x_2

A function object to compare the x-coordinate of two points.

Provides the operator:

`Comparison_result operator()(Point p, Point q)`

which returns `SMALLER, EQUAL` or `LARGER` according to the \( x\)-ordering of points `p` and `q`.

## ◆ Compare_xy_2

typedef unspecified_type TriangulationTraits_2::Compare_xy_2

A function object that lexicographically compares two points by their Cartesian coordinates.

It provides the operator:

`Comparison_result operator()(Point p, Point q)`

which returns (`SMALLER, EQUAL` or `LARGER`) according to the lexicographical order of points `p` and `q`.

## ◆ Compare_y_2

typedef unspecified_type TriangulationTraits_2::Compare_y_2

A function object to compare the y-coordinate of two points.

Provides the operator:

`Comparison_result operator()(Point p, Point q)`

which returns (`SMALLER, EQUAL` or `LARGER`) according to the \( y\)-ordering of points `p` and `q`.

## ◆ Construct_circumcenter_2

typedef unspecified_type TriangulationTraits_2::Construct_circumcenter_2

A function object to compute the circumcentr of three points.

Provides the operator:

`Point operator()(Point p, Point q, Point r)`

which returns the circumcenter of the three points `p, q` and `r`. This type is required only if the function `Point circumcenter(Face_handle f)`is called.

## ◆ Construct_point_2

typedef unspecified_type TriangulationTraits_2::Construct_point_2

A function object to construct a `Point_2`.

Provides:

`Point_2 operator()(Point_2 p)`,

which simply returns p.

Note
  It is advised to return a const reference to `p` to avoid useless copies.
  This peculiar requirement is necessary because `CGAL::Triangulation_2` internally manipulates points with a `Point` type that is not always `Point_2`.

## ◆ Construct_segment_2

typedef unspecified_type TriangulationTraits_2::Construct_segment_2

A function object to construct a `Segment_2`.

Provides:

`Segment_2 operator()(Point_2 p,Point_2 q)`,

which constructs a segment from two points.

## ◆ Construct_triangle_2

typedef unspecified_type TriangulationTraits_2::Construct_triangle_2

A function object to construct a `Triangle_2`.

Provides:

`Triangle_2 operator()(Point_2 p,Point_2 q,Point_2 r )`,

which constructs a triangle from three points.

## ◆ Less_x_2

typedef unspecified_type TriangulationTraits_2::Less_x_2

A function object to compare the x-coordinate of two points.

Provides the operator:

`bool operator()(Point p, Point q)`

which returns `true` if `p` is before `q` according to the \( x\)-ordering of points.

## ◆ Less_y_2

typedef unspecified_type TriangulationTraits_2::Less_y_2

A function object to compare the y-coordinate of two points.

Provides the operator:

`bool operator()(Point p, Point q)`

which returns `true` if `p` is before `q` according to the \( y\)-ordering of points.

## ◆ Orientation_2

typedef unspecified_type TriangulationTraits_2::Orientation_2

A function object to compute the orientation of three points.

Provides the operator:

`Orientation operator()(Point p, Point q, Point r)`

which returns `LEFT_TURN`, `RIGHT_TURN` or `COLLINEAR` depending on \( r\) being, with respect to the oriented line `pq`, on the left side , on the right side or on the line.

## ◆ Side_of_oriented_circle_2

typedef unspecified_type TriangulationTraits_2::Side_of_oriented_circle_2

A function object to perform the incircle test for four points.

Provides the operator:

`Oriented_side operator()(Point p, Point q, Point r, Point s)` which takes four points \( p, q, r, s\) as arguments and returns `ON_POSITIVE_SIDE`, `ON_NEGATIVE_SIDE` or, `ON_ORIENTED_BOUNDARY` according to the position of points `s` with respect to the oriented circle through through \( p,q\) and \( r\). This type is required only if the function `side_of_oriented_circle(Face_handle f, Point p)` is called.