cgal/Packages/Cartesian_kernel/include/CGAL/Cartesian.h

73 lines
2.2 KiB
C++

// ======================================================================
//
// Copyright (c) 2000,2001,2002,2003 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
// intended for general use.
//
// ----------------------------------------------------------------------
//
// release :
// release_date :
//
// file : include/CGAL/Cartesian.h
// revision : $Revision$
// revision_date : $Date$
// author(s) : Herve Bronnimann, Sylvain Pion
// coordinator : INRIA Sophia-Antipolis
//
// ======================================================================
#ifndef CGAL_CARTESIAN_H
#define CGAL_CARTESIAN_H
#include <CGAL/Cartesian/Cartesian_base.h>
#include <CGAL/Handle_for.h>
#include <CGAL/Kernel/Type_equality_wrapper.h>
#include <CGAL/Kernel/function_objects.h>
CGAL_BEGIN_NAMESPACE
template < typename FT_ >
class Cartesian
: public Type_equality_wrapper< Cartesian_base< Cartesian<FT_> > >
{
typedef Cartesian<FT_> Kernel;
public:
typedef FT_ RT;
typedef FT_ FT;
// The mecanism that allows to specify reference-counting or not.
template < typename T >
struct Handle {
typedef Handle_for<T> type;
};
// Undocumented stuff.
typedef Data_accessorC2<Kernel> Data_accessor_2;
typedef CGAL::Conic_2<Kernel> Conic_2;
// TODO: cleanup (use Rational_traits<> instead)
static FT make_FT(const RT & num, const RT& denom) { return num/denom;}
static FT make_FT(const RT & num) { return num;}
static RT FT_numerator(const FT &r) { return r;}
static RT FT_denominator(const FT &) { return RT(1);}
// Functors types and access functions.
#define CGAL_Kernel_pred(Y,Z) typedef CGALi::Y<Kernel> Y; \
Y Z() const { return Y(); }
#define CGAL_Kernel_cons(Y,Z) CGAL_Kernel_pred(Y,Z)
#include <CGAL/Kernel/interface_macros.h>
};
CGAL_END_NAMESPACE
CGAL_ITERATOR_TRAITS_POINTER_SPEC_TEMPLATE(CGAL::Cartesian)
#endif // CGAL_CARTESIAN_H