Navigation: Up, Table of Contents, Bibliography, Index, Title Page

## PlanarMapWithIntersectionsTraits_2

### Definition

A model of the PlanarMapWithIntersectionsTraits_2 concept aggregates the geometric types and primitive operations used by the Planar_map_with_intersections_2<Planar_map> data structure.

Note that the concept PlanarMapWithIntersectionsTraits_2 refines the concept PlanarMapTraits_2 and inherits all its types and operations.

In addition to the requirements of the PlanarMapTraits_2 concept, it must provide the types and operations listed below.

### Refines

PlanarMapTraits_2 .

### Types

The geometric types defined below must have a default constructor, copy constructor, and assignment operator.

PlanarMapWithIntersectionsTraits_2::Curve_2
| A type that holds a general curve in the plane. Its endpoints must be of type Point_2. Curves of type Curve_2 can be inserted into a Planar_map_with_intersections_2<Dcel,Traits> object and are automatically split into X_monotone_curve_2 objects.

### Creation

PlanarMapWithIntersectionsTraits_2 pmwx_traits;
| A default constructor.

### Operations

The following methods that have a curve parameter of type X_monotone_curve_2 have the implicit precondition that requires the curve to be x-monotone.

bool |
pmwx_traits.curves_overlap ( | X_monotone_curve_2 cv1, X_monotone_curve_2 cv2)
|  | returns true if cv1 and cv2 overlap in a one-dimensional subcurve (i.e. at an infinite and uncountable number of points), false. otherwise.
template<class OutputIterator>
OutputIterator |
pmwx_traits.make_x_monotone ( | Curve_2 cv, OutputIterator res)
|  | cuts cv into x-monotone subcurves and stores them in a sequence starting at res. The order in which they are stored defines their order in the hierarchy tree. Returns past-the-end iterator of the sequence. The value type of the output iterators must be X_monotone_curve_2.
void |
pmwx_traits.curve_split ( | X_monotone_curve_2 cv, X_monotone_curve_2& c1, X_monotone_curve_2& c2, Point_2 split_pt)
|  | splits cv at split_pt into two curves, and assigns them to c1 and c2 respectively. Precondition: split_pt is on cv but is not one of its endpoints.
bool |
pmwx_traits.nearest_intersection_to_right ( | X_monotone_curve_2 c1, X_monotone_curve_2 c2, Point_2 pt)
|  | finds the nearest intersection of c1 and c2 lexicographically to the right of a reference point pt, and returns an object that represents the intersection if exists, or an empty object otherwise. Nearest is defined as the lexicographically nearest point, not including the reference point itself. If the intersection of the two curves is an X_monotone_curve_2, that is, there is an overlapping subcurve, that contains the reference point in its x-range, it returns an X_monotone_curve_2 whose interior is strictly to the right of the reference point (that is, whose left endpoint is the projection of the reference point onto the overlapping subcurve).
bool |
pmwx_traits.nearest_intersection_to_left ( | X_monotone_curve c1, X_monotone_curve c2, Point_2 pt)
|  | finds the nearest intersection of c1 and c2 lexicographically to the left of a reference point pt, and returns an object that represents the intersection if exists, or an empty object otherwise. Nearest is defined as the lexicographically nearest point, not including the reference point itself. If the intersection of the two curves is an X_monotone_curve_2, that is, there is an overlapping subcurve, that contains the reference point in its x-range, it returns an X_monotone_curve_2 whose interior is strictly to the left of the reference point (that is, whose right endpoint is the projection of the reference point onto the overlapping subcurve).

### Has Models

The following classes are actually models of the ArrangementTraits_2 concept, that is a refinment of the PlanarMapWithIntersectionsTraits_2 concept.

Arr_segment_traits_2<Kernel>
Arr_segment_cached_traits_2<Kernel>
Arr_polyline_traits<Kernel, Container>
Arr_conic_traits_2<Kernel>

Next: PlanarMapWithIntersectionsChangeNotification_2

Navigation: Table of Contents, Bibliography, Index, Title Page

The CGAL Project . Tue, December 21, 2004 .