The class Arr_curve_data_traits_2<Tr,XData,Mrg,CData,Cnv> 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.
#include <CGAL/Arr_curve_data_traits_2.h>
|
| the base traits-class. |
| ||
| the base curve. | |
| ||
| the base x-monotone curve curve. | |
|
| the merge functor. |
|
| the conversion functor. |
|
| the type of data associated with curves. |
|
| the type of data associated with x-monotone curves. |
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.
| |
default constructor.
| |
| |
constructs curve from the given base curve with uninitialized
data field.
| |
| |
constructs curve from the given base curve with an attached
data field.
|
|
| returns the data field (a non-const version, which returns a reference to the data object, is also available). |
|
| sets the data field. |
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.
| |
default constructor.
| |
| |
constructs an x-monotone curve from the given base curve with
uninitialized data field.
| |
| |
constructs an x-monotone curve from the given base x-monotone
curve with an attached data field.
|