ArrangementDirectionalXMonotoneTraits_2

Definition

This concept refines the basic arrangement x-monotone traits concept. A model of this concept is able to handle directed x-monotone curves that intersect in their interior. Namely, an instance of the X_monotone_curve_2 type defined by a model of the concept ArrangementXMonotoneTraits_2 is only required to have a left (lexicographically smaller) endpoint and a right endpoint. If the traits class is also a model of ArrangementDirectionalXMonotoneTraits_2, the x-monotone curve is also required to have a direction, namely one of these two endpoint is viewed as its source and the other as its target.

Refines

ArrangementXMonotoneTraits_2

Functor Types

ArrangementDirectionalXMonotoneTraits_2::Compare_endpoints_xy_2
provides the operator :
Comparison_result operator() (X_monotone_curve_2 c)
which accepts an input curve c and compare its source and target point. It returns SMALLER if the curve is directed from left to right (lexicographically - i.e., in case of a vertical line segment, this means it is directed upward), and LARGER if it is directed from right to left.


ArrangementDirectionalXMonotoneTraits_2::Construct_opposite_2
provides the operator :
X_monotone_curve_2 operator() (X_monotone_curve_2 c)
which accepts an x-monotone curve c and returns its opposite curve, namely a curve whose graph is the same as c's, and whose source and target are swapped with respect to c's source and target.

In addition, the two following functors, required by the concept ArrangementXMonotoneTraits_2 should operate as follows:

ArrangementDirectionalXMonotoneTraits_2::Intersect_2
provides the operator (templated by the OutputIterator type) :
OutputIterator operator() (X_monotone_curve_2 c1, X_monotone_curve_2 c2, OutputIterator oi)
which computes the intersections of c1 and c2 and inserts them in an ascending lexicographic xy-order into the output iterator. The value-type of OutputIterator is CGAL::Object, where each Object either wraps a pair<Point_2,Multiplicity> instance, which represents an intersection point with its multiplicity (in case the multiplicity is undefined or not known, it should be set to 0) or an X_monotone_curve_2 instance, representing an overlapping subcurve of c1 and c2. In the latter case, if c1 and c2 have the same direction, then the overlapping subcurves should also be directed the same way; otherwise, they can be associated with an arbitrary direction. The operator returns a past-the-end iterator for the output sequence.


ArrangementDirectionalXMonotoneTraits_2::Split_2
provides the operator :
void operator() (X_monotone_curve_2 c, Point_2 p, X_monotone_curve_2& c1, X_monotone_curve_2& c2)
which accepts an input curve c and a split point p in its interior. It splits c at the split point into two subcurves c1 and c2, such that p is c1's right endpoint and c2's left endpoint. The direction of c should be preserved: in case c is directed from left to right then p becomes c1's target and c2's source; otherwise, p becomes c2's target and c1's source.

Creation

ArrangementDirectionalXMonotoneTraits_2 traits;
default constructor.

ArrangementDirectionalXMonotoneTraits_2 traits ( other);
copy constructor

ArrangementDirectionalXMonotoneTraits_2
traits = other assignment operator.

Accessing Functor Objects

Compare_endpoints_xy_2 traits.compare_endpoints_xy_2_object ()
Construct_opposite_2 traits.construct_opposite_2_object ()

Has Models

CGAL::Arr_segment_traits_2<Kernel>
CGAL::Arr_non_caching_segment_traits_2<Kernel>
CGAL::Arr_circle_segment_traits_2<Kernel>
CGAL::Arr_conic_traits_2<RatKernel,AlgKernel,NtTraits>
CGAL::Arr_rational_arc_traits_2<AlgKernel,NtTraits>

See Also

ArrangementXMonotoneTraits_2