From f8bcefa10a455f45cdfac00b3e435375889a9952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Fl=C3=B6totto?= Date: Thu, 4 Dec 2003 13:26:38 +0000 Subject: [PATCH] - suppressed the DataAccess class (it moved to interpolation_functions.h) --- .../Interpolation/linear_interpolation_2.C | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/Packages/Interpolation/examples/Interpolation/linear_interpolation_2.C b/Packages/Interpolation/examples/Interpolation/linear_interpolation_2.C index 445b06c6909..fc99dd81bdc 100644 --- a/Packages/Interpolation/examples/Interpolation/linear_interpolation_2.C +++ b/Packages/Interpolation/examples/Interpolation/linear_interpolation_2.C @@ -15,34 +15,14 @@ struct K : CGAL::Exact_predicates_inexact_constructions_kernel {}; typedef CGAL::Delaunay_triangulation_2 Delaunay_triangulation; typedef CGAL::Interpolation_traits_2 Traits; typedef K::FT Coord_type; - -//Functor for accessing the function values -template< class Map > -struct DataAccess : public std::unary_function< typename Map::key_type, - typename Map::mapped_type> { - typedef typename Map::mapped_type Data_type; - typedef typename Map::key_type Point; - - DataAccess< Map >(const Map& m): map(m){}; - - Data_type operator()(const Point& p) { - - typename Map::const_iterator mit = map.find(p); - if(mit!= map.end()) - return mit->second; - return Data_type(); - }; - - const Map& map; -}; - +typedef K::Point_2 Point; int main() { Delaunay_triangulation T; std::map values; - typedef DataAccess< std::map > - Value_access; + typedef CGAL::DataAccess< std::map > + Value_access; Coord_type a(0.25), bx(1.3), by(-0.7); @@ -63,5 +43,5 @@ int main() std::cout << " Tested interpolation on " << p << " interpolation: " << res << " exact: " << a + bx* p.x()+ by* p.y()<< std::endl; - return 1; + return 0; }