// ====================================================================== // // Copyright (c) 2000,2001 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 // coordinator : INRIA Sophia-Antipolis (Mariette.Yvinec@sophia.inria.fr) // // ====================================================================== #ifndef CGAL_CARTESIAN_H #define CGAL_CARTESIAN_H #define CGAL_REP_CLASS_DEFINED #define CGAL_CARTESIAN_CLASS_DEFINED #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include CGAL_BEGIN_NAMESPACE template< class R, class FT_ > struct Cartesian_base { typedef FT_ RT; typedef FT_ FT; typedef Cartesian_tag Rep_tag; typedef Cartesian_tag Kernel_tag; // The mecanism that allows to specify reference-counting or not. template < typename T > struct Handle { typedef Handle_for type; }; typedef CGAL::Object Object_2; typedef CGAL::Object Object_3; typedef PointC2 Point_2; typedef VectorC2 Vector_2; typedef DirectionC2 Direction_2; typedef SegmentC2 Segment_2; typedef LineC2 Line_2; typedef RayC2 Ray_2; typedef TriangleC2 Triangle_2; typedef CircleC2 Circle_2; typedef Iso_rectangleC2 Iso_rectangle_2; typedef Aff_transformationC2 Aff_transformation_2; typedef Data_accessorC2 Data_accessor_2; typedef ConicCPA2 Conic_2; typedef PointC3 Point_3; typedef VectorC3 Vector_3; typedef DirectionC3 Direction_3; typedef LineC3 Line_3; typedef PlaneC3 Plane_3; typedef RayC3 Ray_3; typedef SegmentC3 Segment_3; typedef TriangleC3 Triangle_3; typedef TetrahedronC3 Tetrahedron_3; typedef Iso_cuboidC3 Iso_cuboid_3; typedef SphereC3 Sphere_3; typedef Aff_transformationC3 Aff_transformation_3; }; template< class FT_ > struct Cartesian : public Cartesian_base< Cartesian, FT_ > { // Number types and representation tag (to avoid ambiguity) typedef FT_ RT; typedef FT_ FT; typedef Cartesian_tag Rep_tag; typedef Cartesian_tag Kernel_tag; typedef Cartesian Self; typedef Cartesian R; typedef Cartesian_base Kernel_base; // Now CGAL::Point_2 is only a wrapper around CGAL::PointC2 // It is necessary to redefine here the classes to ensure that // Cartesian::Point_2 is exactly CGAL::Point_2< Cartesian > typedef typename Kernel_base::Object_2 Object_2; typedef typename Kernel_base::Object_3 Object_3; // Note: necessary to qualify Point_2 by CGAL:: to disambiguate between // Point_2 in the current scope (nested within CGAL) and // CGAL::Point_2< R > (which is in the CGAL namespace) typedef CGAL::Point_2 Point_2; typedef CGAL::Vector_2 Vector_2; typedef CGAL::Direction_2 Direction_2; typedef CGAL::Line_2 Line_2; typedef CGAL::Ray_2 Ray_2; typedef CGAL::Segment_2 Segment_2; typedef CGAL::Triangle_2 Triangle_2; typedef CGAL::Circle_2 Circle_2; typedef CGAL::Iso_rectangle_2 Iso_rectangle_2; typedef CGAL::Aff_transformation_2 Aff_transformation_2; typedef Data_accessorC2 Data_accessor_2; typedef CGAL::Conic_2 Conic_2; typedef CGAL::Point_3 Point_3; typedef CGAL::Vector_3 Vector_3; typedef CGAL::Direction_3 Direction_3; typedef CGAL::Line_3 Line_3; typedef CGAL::Plane_3 Plane_3; typedef CGAL::Ray_3 Ray_3; typedef CGAL::Segment_3 Segment_3; typedef CGAL::Triangle_3 Triangle_3; typedef CGAL::Tetrahedron_3 Tetrahedron_3; typedef CGAL::Sphere_3 Sphere_3; typedef CGAL::Iso_cuboid_3 Iso_cuboid_3; typedef CGAL::Aff_transformation_3 Aff_transformation_3; // TODO: cleanup 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);} #define CGAL_Kernel_pred(Y,Z) typedef CGALi::Y Y; Y Z() const {return Y();} #define CGAL_Kernel_cons(Y,Z) CGAL_Kernel_pred(Y,Z) #include }; CGAL_END_NAMESPACE CGAL_ITERATOR_TRAITS_POINTER_SPEC_TEMPLATE(CGAL::Cartesian) #endif // CGAL_CARTESIAN_H