home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- +
- + LEDA 2.1.1 11-15-1991
- +
- +
- + _point_set.c
- +
- +
- + Copyright (c) 1991 by Max-Planck-Institut fuer Informatik
- + Im Stadtwald, 6600 Saarbruecken, FRG
- + All rights reserved.
- +
- *******************************************************************************/
-
-
-
- #include <LEDA/point_set.h>
-
- ps_item Point_Set::insert(point p, void* i)
- { ps_item it = delaunay_tree::insert(p,i);
- T.insert(p.xcoord(),p.ycoord(),it);
- return it;
- }
-
- list(point) Point_Set::all_points()
- { list(point) result;
- list(ps_item) L = all_items();
- ps_item it;
- forall(it,L) result.append(key(it));
- return result;
- }
-
-
- ps_item Point_Set::lookup(point p)
- { double x = p.xcoord();
- double y = p.ycoord();
- dic2_item it = T.lookup(x,y);
- return (it!=nil) ? T.inf(it) : nil;
- }
-
- list(ps_item) Point_Set::range_search(real x0, real x1, real y0, real y1)
- {
- list(dic2_item) Lr = T.range_search(x0,x1,y0,y1);
-
- list(ps_item) Lp;
-
- dic2_item it;
-
- forall(it,Lr) Lp.append(T.inf(it));
-
- return Lp;
-
- }
-
-
- list(ps_item) Point_Set::all_items()
- { list(ps_item) L;
- delaunay_tree::all_items(L);
- return L ;
- }
-
-
- list(ps_item) Point_Set::convex_hull()
- { list(ps_item) L;
- delaunay_tree::convex_hull(L);
- return L;
- }
-