![]() |
Each Curve_2 object is associated with a single data field of type Data, and each X_monotone_curve_2 object is associated with a set of unique data objects. When a curve is subdivided into x-monotone subcurves, all resulting subcurves are associated with a list containing a single data object, copied from the inducing curve. When an x-monotone curve is split, its data set is duplicated, and inserted into the sets of both resulting subcurves. In case two (or more) x-monotone curves overlap, their data sets are consolidated, and are inserted into the set of the x-monotone curve that represents the overlap.
#include <CGAL/Arr_consolidated_curve_data_traits_2.h>
Arr_curve_data_traits_2< | Traits, |
_Unique_list<Data>, | |
_Consolidate_unique_lists<Data>, | |
Data> |
typedef Traits | Base_traits_2; | the base traits-class. |
typedef typename Base_traits_2::Curve_2 | ||
Base_curve_2; | the base curve. | |
typedef typename Base_traits_2::X_monotone_curve_2 | ||
Base_x_monotone_curve_2; | the base x-monotone curve curve. |
The Data_container class nested within the consolidated curve-data traits and associated with the Traits::X_monotone_curve_2 type is maintained as a list with unique data objects. This representation is simple and efficient in terms of memory consumption. It also requires that the Data class supports only the equality operator. Note however that most set operations require linear time.
Arr_consolidated_curve_data_traits_2<Traits,Data>:: Data_container dset; | |
default constructor.
| |
Arr_consolidated_curve_data_traits_2<Traits,Data>:: Data_container dset ( Data data); | |
constructs set containing a single data object.
|
bool | dset == Data_container other const | |
check if the two sets contain the same data objects (regardless of order). | ||
Data_iterator | dset.find ( Data data) | find the given data object in the set and returns an iterator for this object, or end() if it is not found. |
bool | dset.insert ( Data data) | inserts the given data object into the set. Returns true on success, or false if the set already contains the object. |
bool | dset.erase ( Data data) | erases the given data object from the set. Returns true on success, or false if the set does not contain the object. |
void | dset.clear () | clears the set. |