CGAL 5.1.4 - 2D Arrangements
CGAL::Arr_curve_data_traits_2< Tr, XData, Mrg, CData, Cnv > Class Template Reference

#include <CGAL/Arr_curve_data_traits_2.h>

Inherits from

Tr.

Definition

The class Arr_curve_data_traits_2 is a model of the ArrangementTraits_2 concept and serves as a decorator class that allows the extension of the curves defined by the base traits-class (the Tr parameter), which serves as a geometric traits-class (a model of the ArrangementTraits_2 concept), with extraneous (non-geometric) data fields.

The traits class inherits its point type from Traits::Point_2, and defines an extended Curve_2 and X_monotone_curve_2 types, as detailed below.

Each Curve_2 object is associated with a single data field of type CData, and each X_monotone_curve_2 object is associated with a single data field of type XData. When a curve is subdivided into \( x\)-monotone subcurves, its data field is converted using the conversion functor, which is specified by the Cnv template-parameter, and the resulting objects is copied to all X_monotone_curve_2 objects induced by this curve. The conversion functor should provide an operator with the following prototype:

XData operator() (const CData& d) const;

By default, the two data types are the same, so the conversion operator is trivial:

CData = XData
Cnv = _Default_convert_functor<CData,XData>

In case two (or more) \( x\)-monotone curves overlap, their data fields are merged to a single field, using the merge functor functor, which is specified by the Mrg template-parameter. This functor should provide an operator with the following prototype:

XData operator() (const XData& d1, const XData& d2) const;

which returns a single data object that represents the merged data field of d1 and d2. The \( x\)-monotone curve that represents the overlap is associated with the output of this functor.

Is Model Of:
ArrangementTraits_2
Examples:
Arrangement_on_surface_2/dual_with_data.cpp, and Arrangement_on_surface_2/generic_curve_data.cpp.

Classes

class  Curve_2
 The Curve_2 class nested within the curve-data traits extends the Base_traits_2::Curve_2 type with an extra data field of type Data. More...
 
class  X_monotone_curve_2
 The X_monotone_curve_2 class nested within the curve-data traits extends the Base_traits_2::X_monotone_curve_2 type with an extra data field. More...
 

Types

typedef Tr Base_traits_2
 the base traits-class.
 
typedef Base_traits_2::Curve_2 Base_curve_2
 the base curve.
 
typedef Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2
 the base \( x\)-monotone curve curve.
 
typedef Mrg Merge
 the merge functor.
 
typedef Cnv Convert
 the conversion functor.
 
typedef CData Curve_data
 the type of data associated with curves.
 
typedef XData X_monotone_curve_data
 the type of data associated with \( x\)-monotone curves.