diff --git a/Packages/Map_overlay_2/include/CGAL/Bops/Bops_traits.h b/Packages/Map_overlay_2/include/CGAL/Bops/Bops_traits.h new file mode 100644 index 00000000000..b67b699fe45 --- /dev/null +++ b/Packages/Map_overlay_2/include/CGAL/Bops/Bops_traits.h @@ -0,0 +1,112 @@ +// ====================================================================== +// +// Copyright (c) 1997 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 : $CGAL_Revision: CGAL-2.4-I-84 $ +// release_date : $CGAL_Date: 2002/05/01 $ +// +// file : include/CGAL/Pm_segment_traits_2.h +// package : Planar_map (5.109) +// maintainer : Eyal Flato +// source : +// revision : +// revision_date : +// author(s) : Iddo Hanniel +// Eyal Flato +// Oren Nechushtan +// Shai Hirsch +// Efi Fogel +// +// coordinator : Tel-Aviv University (Dan Halperin ) +// +// Chapter : +// ====================================================================== +#ifndef CGAL_BOPS_TRAITS_2_H +#define CGAL_BOPS_TRAITS_2_H + +#ifndef CGAL_POLYGON_2_H +#include +#endif + +#ifndef CGAL_RAY_2_SEGMENT_2_INTERSECTION_H +#include +#endif + +CGAL_BEGIN_NAMESPACE + +template +class Bops_traits_2 +{ +public: + + typedef Polygon_2 Polygon_2; + + typedef typename Polygon_2::Vertex_iterator Vertex_iterator; + typedef typename Polygon_2::Vertex_const_iterator Vertex_const_iterator; + typedef typename Polygon_2::Edge_const_iterator Edge_const_iterator; + + typedef typename Polygon_2::Point_2 Point_2; + typedef typename Polygon_2::Segment_2 Segment_2; + + typedef Ray_2 Ray; + +public: + Bops_traits_2() {} + + Vertex_iterator vertices_begin(Polygon_2& polygon) + { + return polygon.vertices_begin(); + } + + Vertex_iterator vertices_end(Polygon_2& polygon) + { + return polygon.vertices_end(); + } + + Vertex_const_iterator vertices_begin(const Polygon_2& polygon) const + { + return polygon.vertices_begin(); + } + + Vertex_const_iterator vertices_end(const Polygon_2& polygon) const + { + return polygon.vertices_end(); + } + + Edge_const_iterator edges_begin(const Polygon_2& polygon) const + { + return polygon.edges_begin(); + } + + Edge_const_iterator edges_end(const Polygon_2& polygon) const + { + return polygon.edges_end(); + } + + //---------------------- Ray interface + + bool do_intersect(const Segment_2& segment, const Ray& ray) + { + return do_intersect(segment, ray); + } + + bool intersection(const Segment_2& segment, const Ray& ray, Point_2& p) + { + Object obj=CGAL::intersection(segment, ray); + + return assign(p, obj); + } + +}; + +CGAL_END_NAMESPACE + +#endif // CGAL_BOPS_TRAITS_2_H +// EOF +