From 430f551b6f5b9fa4a77bf44e77a5e83d2c299f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=A4sken?= Date: Thu, 2 May 2002 16:02:32 +0000 Subject: [PATCH] *** empty log message *** --- Packages/GeoWin/changes.txt | 3 + .../demo/GeoWin/CGAL_delaunay_triang_3.C | 7 +- Packages/GeoWin/demo/GeoWin/CGAL_nef_2.C | 275 ------------------ Packages/GeoWin/demo/GeoWin/Makefile | 5 +- Packages/GeoWin/version | 2 +- 5 files changed, 6 insertions(+), 286 deletions(-) delete mode 100644 Packages/GeoWin/demo/GeoWin/CGAL_nef_2.C diff --git a/Packages/GeoWin/changes.txt b/Packages/GeoWin/changes.txt index b049286231e..54c134b919c 100644 --- a/Packages/GeoWin/changes.txt +++ b/Packages/GeoWin/changes.txt @@ -1,3 +1,6 @@ +1.4.9 (02 May 2002) +- 3d Delaunay demo changed, Nef demo removed + 1.4.8 (29 April 2002) - split of user and reference manual diff --git a/Packages/GeoWin/demo/GeoWin/CGAL_delaunay_triang_3.C b/Packages/GeoWin/demo/GeoWin/CGAL_delaunay_triang_3.C index f5b5592ceda..083d3553d3a 100644 --- a/Packages/GeoWin/demo/GeoWin/CGAL_delaunay_triang_3.C +++ b/Packages/GeoWin/demo/GeoWin/CGAL_delaunay_triang_3.C @@ -53,7 +53,6 @@ int main(int argc, char *argv[]) #include #include #include -#include #include #if defined(LEDA_NAMESPACE) @@ -63,11 +62,7 @@ using namespace leda; typedef double NT; typedef CGAL::Cartesian K; typedef K::Point_3 Point_3; -typedef CGAL::Triangulation_geom_traits_3 Traits_3; -typedef CGAL::Triangulation_vertex_base_3 Vb ; -typedef CGAL::Triangulation_cell_base_3 Fb; -typedef CGAL::Triangulation_data_structure_3 TDS3 ; -typedef CGAL::Delaunay_triangulation_3 Delaunay_3; +typedef CGAL::Delaunay_triangulation_3 Delaunay_3; typedef std::list Point_3_list; void show_d3_points(geo_scene sc, leda_d3_window& W, GRAPH& H) diff --git a/Packages/GeoWin/demo/GeoWin/CGAL_nef_2.C b/Packages/GeoWin/demo/GeoWin/CGAL_nef_2.C deleted file mode 100644 index 828ea6050c6..00000000000 --- a/Packages/GeoWin/demo/GeoWin/CGAL_nef_2.C +++ /dev/null @@ -1,275 +0,0 @@ -// ====================================================================== -// -// 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_nef_2.C -// -// ====================================================================== - -#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 - -#if defined(LEDA_NAMESPACE) -#else -#ifndef LEDA_NAMESPACE_NAME -#define LEDA_NAMESPACE_NAME -#endif -#endif - -#include -#include -#include -#include -#include -#include - -/* -template <> -struct ring_or_field { - typedef ring_with_gcd kind; - typedef leda_integer RT; - static RT gcd(const RT& r1, const RT& r2) - { return LEDA_NAMESPACE_NAME::gcd(r1,r2); } -}; -*/ - -typedef CGAL::Extended_homogeneous EK; -typedef CGAL::Nef_polyhedron_2 Nef; -typedef Nef::Point EPoint; - -// types for Nef polyhedron exploration -typedef Nef::Explorer Explorer; -typedef Explorer::Vertex_const_handle Vertex_const_handle; -typedef Explorer::Halfedge_const_handle Halfedge_const_handle; -typedef Explorer::Halfedge_around_face_const_circulator Halfedge_around_face_const_circulator; -typedef Explorer::Face_const_handle Face_const_handle; -typedef Explorer::Vertex_const_iterator Vertex_const_iterator; -typedef Explorer::Halfedge_const_iterator Halfedge_const_iterator; -typedef Explorer::Face_const_iterator Face_const_iterator; - - -// the polygons for Nef construction .... -typedef CGAL::Cartesian K; -typedef K::Point_2 Point; -typedef K::Segment_2 Segment; -typedef CGAL::Polygon_traits_2 PTraits; -typedef CGAL::Polygon_2 > Polygon; - - -// drawing routine using the visualizor -// see Nef Windowstream ... - -#define USING(t) typedef typename PMCDEC::t t - -namespace CGAL { - -template -class PM_MyBooleanColor -{ - USING(Vertex_const_handle); - USING(Halfedge_const_handle); - USING(Face_const_handle); - USING(Mark); - - Color vertex_cl, hedge_cl, face_cl; -public: - - PM_MyBooleanColor(Color vc, Color hc, Color fc) : vertex_cl(vc), hedge_cl(hc), face_cl(fc) - { } - - Color color(Vertex_const_handle, const Mark& m) const - { return ( m ? vertex_cl : CGAL::Color(190,190,190) ); } - - int width(Vertex_const_handle, const Mark& m) const - { return 3; } - - Color color(Halfedge_const_handle, const Mark& m) const - { return ( m ? hedge_cl : CGAL::Color(190,190,190) ); } - - int width(Halfedge_const_handle, const Mark& m) const - { return 3; } - - Color color(Face_const_handle, const Mark& m) const - { return ( m ? face_cl : CGAL::WHITE ); } -}; - - -template -void draw_nef(CGAL::Window_stream& ws, const Nef_polyhedron_2& P) -{ - typedef Nef_polyhedron_2 Polyhedron; - typedef typename T::RT RT; - typedef typename T::Standard_RT Standard_RT; - typedef typename Polyhedron::Topological_explorer TExplorer; - - typedef CGAL::PM_MyBooleanColor MyColor; - typedef CGAL::PM_visualizor Visualizor; - - TExplorer D = P.explorer(); - const T& E = Nef_polyhedron_2::EK; - - Standard_RT frame_radius = frame_default; - E.determine_frame_radius(D.points_begin(),D.points_end(),frame_radius); - RT::set_R(frame_radius); - - MyColor colors(CGAL::RED, CGAL::RED, CGAL::RED); - T kernel; - - Visualizor PMV(ws,D,kernel,colors); - PMV.draw_map(); -} - -} - -Nef create_nef_polyhedron(Polygon& act) -{ - std::list pts; - Polygon::Vertex_const_iterator it= act.vertices_begin(); - Polygon::Vertex_const_iterator st= act.vertices_end(); - - for(;it != st; it++){ - double xc = (*it).x(); - double yc = (*it).y(); - leda_rat_point rp(leda_point(xc,yc)); - pts.push_back(EPoint(rp.X(),rp.Y(),rp.W())); - } - return Nef(pts.begin(), pts.end()); -} - -// what kind of boolean operation ??? -int op_kind = 0; - -class geo_nef : public LEDA_NAMESPACE_NAME::geowin_update, std::list >, - public LEDA_NAMESPACE_NAME::geowin_redraw -{ -public: - Nef bop_result; - Polygon poly1, poly2; - bool empty; - - geo_nef() : empty(true) { } - - void update(const std::list& L, std::list& Sl) - { - Sl.clear(); - empty = true; - - bop_result = Nef(); - poly1 = Polygon(); poly2 = Polygon(); - - if (L.size() < 2) return; - - // build two Nef polyhedra ... - std::list::const_iterator poly_iter = L.begin(); - Polygon act = *poly_iter; poly1 = act; - Nef N1 = create_nef_polyhedron(act); - poly_iter++; - act = *poly_iter; poly2 = act; - Nef N2 = create_nef_polyhedron(act); - - //perform bop - switch (op_kind) { - case 0: { std::cout << "intersection...\n"; bop_result = N1.intersection(N2); break; } - case 1: { std::cout << "union...\n"; bop_result = N1.join(N2); break; } - case 2: { std::cout << "difference...\n"; bop_result = N1.difference(N2); break; } - case 3: { std::cout << "symmetric difference...\n"; bop_result = N1.symmetric_difference(N2); break; } - } - empty = false; - } - - void draw(leda_window& W,leda_color c1,leda_color c2,double x1,double y1,double x2,double y2) - { - if (! empty) CGAL::draw_nef(W, bop_result); - W.set_color(c1); - W << poly1; W << poly2; - } -}; - -LEDA_NAMESPACE_NAME::GeoWin* gwin; -LEDA_NAMESPACE_NAME::geo_scene result; - -void call_back(int choice) -{ op_kind = choice; result->update(); gwin->redraw(); } - -int main() -{ - LEDA_NAMESPACE_NAME::geowin_init_default_type((std::list*)0, leda_string("CGALPolygonList")); - - std::list L; - - LEDA_NAMESPACE_NAME::GeoWin GW("Boolean operations on 2d nef polyhedra"); - gwin = &GW; -#if __LEDA__ < 430 - GW.add_help_text(leda_string("Nef_2")); -#else - GW.add_special_help_text(leda_string("Nef_2"),true); -#endif - - geo_nef update_obj; - - LEDA_NAMESPACE_NAME::geo_scene my_scene= GW.new_scene(L); - - result = GW.new_scene(update_obj,update_obj,my_scene,leda_string("Boolean operations")); - GW.set_visible(result,true); - - leda_list ops; - ops.append("intersection"); - ops.append("union"); - ops.append("difference"); - ops.append("symmetric difference"); - - GW.message("Input two simple polygons!"); - GW.init_menu(); - GW.get_window().choice_item("Operation:",op_kind,ops,call_back); - - GW.edit(my_scene); - - return 0; -} - -#endif diff --git a/Packages/GeoWin/demo/GeoWin/Makefile b/Packages/GeoWin/demo/GeoWin/Makefile index b17da91f4fe..97504dc0c9d 100644 --- a/Packages/GeoWin/demo/GeoWin/Makefile +++ b/Packages/GeoWin/demo/GeoWin/Makefile @@ -27,9 +27,6 @@ CGAL_ler_2$(EXE_EXT) : CGAL_ler_2$(OBJ_EXT) 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) -CGAL_nef_2$(EXE_EXT) : CGAL_nef_2$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)CGAL_nef_2 CGAL_nef_2$(OBJ_EXT) $(CGDL) - CGAL_partition_2$(EXE_EXT) : CGAL_partition_2$(OBJ_EXT) $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)CGAL_partition_2 CGAL_partition_2$(OBJ_EXT) $(CGDL) @@ -96,7 +93,7 @@ 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_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 +all: 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 : diff --git a/Packages/GeoWin/version b/Packages/GeoWin/version index ae8582ea932..c639bf7b69c 100644 --- a/Packages/GeoWin/version +++ b/Packages/GeoWin/version @@ -1 +1 @@ -1.4.8 (30 Apr 2002) +1.4.9 (02 May 2002)