Generic Points and Segments

This commit is contained in:
Pavel Emeliyanenko 2007-09-21 16:50:36 +00:00
parent e28194efed
commit e668e2ff75
1 changed files with 39 additions and 16 deletions

View File

@ -12,19 +12,18 @@
//
// ============================================================================
#ifndef CGAL_GPA_2_H
#define CGAL_GPA_2_H
/*! \file GPA_2.h
* \brief defines class \c GPA_2
*
* General Points and Segments
*/
#ifndef CGAL_GPA_2_H
#define CGAL_GPA_2_H
#include <CGAL/basic.h>
#include <CGAL/GPA_2/Point_2.h>
#include <CGAL/GPA_2/Arc_2.h>
#include <CGAL/GPA_2/GPA_2_functors.h>
CGAL_BEGIN_NAMESPACE
@ -32,12 +31,12 @@ CGAL_BEGIN_NAMESPACE
template < class CurveKernel_2 >
class GPA_2 {
// declares GPA functors and for each functor defines a member function
// declares GPA functors, for each functor defines a member function
// returning an instance of this functor
#define CGAL_GPA_pred(Y,Z) \
#define CGAL_GPA_pred(Y, Z) \
typedef GPA_2_Functors::Y<Self> Y; \
Y Z() const { return Y(); }
#define CGAL_GPA_cons(Y,Z) CGAL_GPA_pred(Y,Z)
Y Z() const { return Y(this); }
#define CGAL_GPA_cons(Y, Z) CGAL_GPA_pred(Y, Z)
public:
//! \name public typedefs
@ -71,24 +70,35 @@ public:
typedef CGAL::Tag_true Has_merge_category;
//! tag specifies that infinite functors supported
typedef CGAL::Tag_true Has_infinite_category;
//! tag specifies that unbounded arcs are supported
//! tag specifies that unbounded arcs supported
typedef CGAL::Tag_true Has_boundary_category;
//!@}
public:
//! \name Constructors
//@{
//! default constructor
GPA_2() :
_m_kernel(Curve_kernel_2()) {
}
//! constructor uses specific \c Curve_kernel_2 instance (for controlling)
GPA_2(const Curve_kernel_2& kernel) :
_m_kernel(kernel) {
}
//!@}
//!\name embedded types and predicates for \c Arrangement_2 package
//!@{
//! type of a point on generic curve
// or shall we alias Xy_coordinate_2 as a "finite" point to be used by
// ArrangementTraits_2, while Point_2 is only for internal purposes ?
typedef CGALi::Point_2<Self> Point_2;
//! type of an arc on generic curve
typedef CGALi::Arc_2<Self> Arc_2;
//! type of weakly x-monotone arc for \c ArrangementTraits_2
typedef Arc_2 X_monotone_curve;
typedef Arc_2 X_monotone_curve_2;
CGAL_GPA_pred(Compare_x_2, compare_x_2_object) +
CGAL_GPA_pred(Compare_xy_2, compare_xy_2_object) +
@ -96,8 +106,6 @@ public:
CGAL_GPA_pred(Is_vertical_2, is_vertical_2_object) +
CGAL_GPA_cons(Construct_min_vertex_2, construct_min_vertex_2_object) +
CGAL_GPA_cons(Construct_max_vertex_2, construct_max_vertex_2_object) +
CGAL_GPA_pred(Infinite_in_x_2, infinite_in_x_2_object) + ?
CGAL_GPA_pred(Infinite_in_y_2, infinite_in_y_2_object) + ?
CGAL_GPA_pred(Boundary_in_x_2, boundary_in_x_2_object) +
CGAL_GPA_pred(Boundary_in_y_2, boundary_in_y_2_object) +
CGAL_GPA_pred(Compare_y_at_x_2, compare_y_at_x_2_object) +
@ -111,13 +119,28 @@ public:
CGAL_GPA_pred(Are_mergeable_2, are_mergeable_2_object) +
CGAL_GPA_cons(Merge_2, merge_2_object) +
CGAL_GPA_pred(Do_overlap_2, do_overlap_2_object); +
CGAL_GPA_cons(Trim_2, trim_2_object);
CGAL_GPA_cons(Trim_2, trim_2_object); +
CGAL_GPA_pred(Is_in_x_range_2, is_in_x_range_2_object); +
/*CGAL_GPA_cons(Approximate_2, approximate_2_object)
CGAL_GPA_cons(Construct_x_monotone_curve_2,
construct_x_monotone_curve_2_object)*/
//! returns internal \c Curve_kernel_2 instance
Curve_kernel_2 kernel() const {
return _m_kernel;
}
#under CGAL_GPA_pred
#under CGAL_GPA_cons
//!@}
private:
//!@{
//!\name private members
Curve_kernel_2 _m_kernel;
//!@}
}; // class GPA_2