diff --git a/Packages/GeoWin/changes.txt b/Packages/GeoWin/changes.txt index cd226b707f4..2cf2fb9e790 100644 --- a/Packages/GeoWin/changes.txt +++ b/Packages/GeoWin/changes.txt @@ -1,3 +1,7 @@ +1.4.6 (23 April 2002) +- a few demo were changed to remove warnings +- Largest empty rectangle demo (CGAL_ler_2) added + 1.4.5 (02 April 2002) - Nef_2 and Min_sphere_3 demos changed (because there were changes in these packages breaking code) diff --git a/Packages/GeoWin/demo/GeoWin/CGAL_ler_2.C b/Packages/GeoWin/demo/GeoWin/CGAL_ler_2.C new file mode 100644 index 00000000000..ff823c5f1f0 --- /dev/null +++ b/Packages/GeoWin/demo/GeoWin/CGAL_ler_2.C @@ -0,0 +1,107 @@ +// ====================================================================== +// +// Copyright (c) 1999 The GALIA Consortium +// +// This software and related documentation is part of the +// Computational Geometry Algorithms Library (CGAL). +// +// Every use of CGAL requires a license. Licenses come in three kinds: +// +// - For academic research and teaching purposes, permission to use and +// copy the software and its documentation is hereby granted free of +// charge, provided that +// (1) it is not a component of a commercial product, and +// (2) this notice appears in all copies of the software and +// related documentation. +// - Development licenses grant access to the source code of the library +// to develop programs. These programs may be sold to other parties as +// executable code. To obtain a development license, please contact +// the GALIA Consortium (at cgal@cs.uu.nl). +// - Commercialization licenses grant access to the source code and the +// right to sell development licenses. To obtain a commercialization +// license, please contact the GALIA Consortium (at cgal@cs.uu.nl). +// +// This software and documentation is provided "as-is" and without +// warranty of any kind. In no event shall the CGAL Consortium be +// liable for any damage of any kind. +// +// The GALIA Consortium consists of Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), Free University of Berlin (Germany), +// INRIA Sophia-Antipolis (France), Trier University +// (Germany), Max-Planck-Institute Saarbrucken (Germany), +// and Tel-Aviv University (Israel). +// +// ---------------------------------------------------------------------- +// +// file : demo/GeoWin/CGAL_ler_2.C +// +// ====================================================================== +// Largest empty rectangle demo + +#include +#if !defined(CGAL_USE_LEDA) || (__LEDA__ < 400) +#include + +int main(int argc, char *argv[]) +{ + std::cout << "No LEDA 4.0 or higher installed!\n"; + std::cout << "A LEDA version >= 4.0 is required to run GeoWin!\n"; + return 0; +} +#else + +#include +#include +#include + +#if defined(LEDA_NAMESPACE) +using namespace leda; +#endif + +typedef double NT; +typedef CGAL::Cartesian K; +typedef CGAL::Largest_empty_iso_rectangle_2 LER; +typedef K::Iso_rectangle_2 Iso_rectangle; +typedef K::Point_2 Point; + +std::list bbox; // stores the bounding box ... + +class geo_ler : public geowin_update, std::list > +{ +public: + void update(const std::list& L, std::list& R) + { + R.clear(); + if (bbox.size() == 0) return; + LER largest_empty_rec(* bbox.begin()); + largest_empty_rec.insert(L.begin(),L.end()); + Iso_rectangle result = largest_empty_rec.get_largest_empty_iso_rectangle(); + R.push_back(result); + } +}; + +int main() +{ + geowin_init_default_type((std::list*)0, leda_string("CGALPointList")); + geowin_init_default_type((std::list*)0, leda_string("CGALIsorectangleList")); + + std::list L; + GeoWin GW("2d Largest empty rectangle in a set of points"); + GW.message("You have to input a bounding box in the isorectangle scene"); + + geo_ler update_obj; + geo_scene my_scene= GW.new_scene(L); + geo_scene rect_scene= GW.new_scene(bbox); + GW.set_fill_color(rect_scene, leda_invisible); + + geo_scene result = GW.new_scene(update_obj,my_scene,leda_string("LER")); + GW.set_color(result, leda_red); + GW.set_fill_color(result, leda_red); + GW.set_line_width(result, 2); + + GW.add_dependence(rect_scene, result); + GW.set_all_visible(true); + GW.edit(my_scene); + return 0; +} +#endif diff --git a/Packages/GeoWin/demo/GeoWin/CGAL_min_sphere_3.C b/Packages/GeoWin/demo/GeoWin/CGAL_min_sphere_3.C index c0f693316d7..0cca222b15e 100644 --- a/Packages/GeoWin/demo/GeoWin/CGAL_min_sphere_3.C +++ b/Packages/GeoWin/demo/GeoWin/CGAL_min_sphere_3.C @@ -149,7 +149,7 @@ void generate_sphere_graph(const leda_d3_sphere& Sph, GRAPH& double ymin = Sph.center().ycoord() - 0.99*r; double ymax = Sph.center().ycoord() + 0.99*r; double yakt = ymin, ystep = 0.15*r; - double xmin,xmax; + double xmin; leda_point ct2(ct.xcoord(), ct.ycoord()); leda_circle C(ct2,r); leda_circle C2; @@ -167,8 +167,8 @@ void generate_sphere_graph(const leda_d3_sphere& Sph, GRAPH& leda_segment S(leda_point(ct.xcoord()-r-100.0,yakt), leda_point(ct.xcoord()+r+100.0,yakt)); leda_list res = C.intersection(S); leda_point p1 = res.pop(), p2 = res.pop(); - if (p1.xcoord() < p2.xcoord()) { xmin = p1.xcoord(); xmax =p2.xcoord(); } - else { xmin = p2.xcoord(); xmax =p1.xcoord(); } + if (p1.xcoord() < p2.xcoord()) { xmin = p1.xcoord(); } + else { xmin = p2.xcoord(); } C2 = leda_circle(ct2,ct.xcoord()-xmin); leda_list LS = zoom_segments(Lseg,ct2,ct.xcoord()-xmin); diff --git a/Packages/GeoWin/demo/GeoWin/CGAL_poly_triang_2.C b/Packages/GeoWin/demo/GeoWin/CGAL_poly_triang_2.C index 39fc3b7e4b9..a08e2e519bb 100644 --- a/Packages/GeoWin/demo/GeoWin/CGAL_poly_triang_2.C +++ b/Packages/GeoWin/demo/GeoWin/CGAL_poly_triang_2.C @@ -58,7 +58,6 @@ int main(int argc, char *argv[]) #include #include - #if defined(LEDA_NAMESPACE) using namespace leda; #endif @@ -81,7 +80,6 @@ typedef CT::Edge_iterator Edge_iterator; typedef CT::Edge_circulator Edge_circulator; typedef CT::Vertex_circulator Vertex_circulator; - //polygon typedefs typedef CGAL::Polygon_traits_2 PTraits; typedef CGAL::Polygon_2 > Polygon; @@ -108,7 +106,6 @@ void handle_inc_edges(CT& ct, Vertex_handle vsucc= *vhelp; Edge_circulator ec = ct.incident_edges(vact); - Edge_circulator es = ec; bool pred_found = false; bool succ_found = false; diff --git a/Packages/GeoWin/demo/GeoWin/Makefile b/Packages/GeoWin/demo/GeoWin/Makefile index 45a84806154..b17da91f4fe 100644 --- a/Packages/GeoWin/demo/GeoWin/Makefile +++ b/Packages/GeoWin/demo/GeoWin/Makefile @@ -21,6 +21,9 @@ LDFLAGS = CGDL = \ $(LDFLAGS) $(CGAL_GEOWIN_LDFLAGS) +CGAL_ler_2$(EXE_EXT) : CGAL_ler_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)CGAL_ler_2 CGAL_ler_2$(OBJ_EXT) $(CGDL) + CGAL_poly_triang_2$(EXE_EXT) : CGAL_poly_triang_2$(OBJ_EXT) $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)CGAL_poly_triang_2 CGAL_poly_triang_2$(OBJ_EXT) $(CGDL) @@ -93,12 +96,12 @@ CGAL_min_sphere_3$(EXE_EXT) : CGAL_min_sphere_3$(OBJ_EXT) CGAL_planar_map_2$(EXE_EXT) : CGAL_planar_map_2$(OBJ_EXT) $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)CGAL_planar_map_2 CGAL_planar_map_2$(OBJ_EXT) $(CGDL) -all: CGAL_nef_2 CGAL_poly_triang_2 CGAL_partition_2 CGAL_alpha_shape_2 CGAL_arrangement_2 CGAL_delaunay_triang_3 CGAL_constrained_triang_2 CGAL_min_sphere_3 CGAL_regular_triang_2 CGAL_delaunay_triang_3 CGAL_geometry_2 CGAL_min_circle_2 CGAL_delaunay_triang_2 CGAL_demo CGAL_convex_hull_2 CGAL_segment_intersection_2 CGAL_triangulation_2 CGAL_max_k_gon_2 CGAL_all_furthest_neighbors_2 CGAL_polygon_2 CGAL_convex_hull_3 CGAL_kdtree_2 CGAL_kdtree_3 CGAL_min_ellipse_2 +all: CGAL_nef_2 CGAL_ler_2 CGAL_poly_triang_2 CGAL_partition_2 CGAL_alpha_shape_2 CGAL_arrangement_2 CGAL_delaunay_triang_3 CGAL_constrained_triang_2 CGAL_min_sphere_3 CGAL_regular_triang_2 CGAL_delaunay_triang_3 CGAL_geometry_2 CGAL_min_circle_2 CGAL_delaunay_triang_2 CGAL_demo CGAL_convex_hull_2 CGAL_segment_intersection_2 CGAL_triangulation_2 CGAL_max_k_gon_2 CGAL_all_furthest_neighbors_2 CGAL_polygon_2 CGAL_convex_hull_3 CGAL_kdtree_2 CGAL_kdtree_3 CGAL_min_ellipse_2 clean : rm -f tt *~ *.o core *.obj *.exe - rm -f CGAL_nef_2 CGAL_poly_triang_2 CGAL_partition_2 CGAL_alpha_shape_2 CGAL_arrangement_2 CGAL_constrained_triang_2 CGAL_min_sphere_3 CGAL_regular_triang_2 CGAL_delaunay_triang_3 CGAL_geometry_2 CGAL_min_circle_2 CGAL_delaunay_triang_2 CGAL_demo CGAL_convex_hull_2 CGAL_segment_intersection_2 CGAL_triangulation_2 CGAL_max_k_gon_2 CGAL_all_furthest_neighbors_2 CGAL_polygon_2 CGAL_convex_hull_3 CGAL_kdtree_2 CGAL_kdtree_3 CGAL_min_ellipse_2 CGAL_planar_map_2 + rm -f CGAL_ler_2 CGAL_nef_2 CGAL_poly_triang_2 CGAL_partition_2 CGAL_alpha_shape_2 CGAL_arrangement_2 CGAL_constrained_triang_2 CGAL_min_sphere_3 CGAL_regular_triang_2 CGAL_delaunay_triang_3 CGAL_geometry_2 CGAL_min_circle_2 CGAL_delaunay_triang_2 CGAL_demo CGAL_convex_hull_2 CGAL_segment_intersection_2 CGAL_triangulation_2 CGAL_max_k_gon_2 CGAL_all_furthest_neighbors_2 CGAL_polygon_2 CGAL_convex_hull_3 CGAL_kdtree_2 CGAL_kdtree_3 CGAL_min_ellipse_2 CGAL_planar_map_2 cleano : diff --git a/Packages/GeoWin/version b/Packages/GeoWin/version index a46d24b5dc4..713a238da7e 100644 --- a/Packages/GeoWin/version +++ b/Packages/GeoWin/version @@ -1 +1 @@ -1.4.5 ( 4 Apr 2002) +1.4.6 ( 23 Apr 2002)