moved leda demos to Leda_window directory

This commit is contained in:
Efi Fogel 2003-07-02 14:05:34 +00:00
parent 9c9e54f83d
commit 377c8649d7
11 changed files with 287 additions and 0 deletions

View File

@ -0,0 +1,58 @@
#include <CGAL/basic.h>
#include <CGAL/leda_rational.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Arr_2_bases.h>
#include <CGAL/Pm_default_dcel.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Pm_naive_point_location.h>
#include <list>
/////////////////////////////////////////////////////////////////////////
// Type definitions
/////////////////////////////////////////////////////////////////////////
typedef leda_rational NT;
typedef CGAL::Cartesian<NT> R;
typedef CGAL::Arr_segment_traits_2<R> Traits;
typedef Traits::X_monotone_curve_2 X_curve;
typedef Traits::Point_2 Point;
typedef CGAL::Arr_base_node<X_curve> Base_node;
typedef CGAL::Polygon_traits_2<R> Polygon_traits;
typedef std::list<Point> Polygon_Container;
typedef CGAL::Polygon_2<Polygon_traits, Polygon_Container > Polygon;
typedef std::list<Polygon> Polygon_list;
//a face with a counter for overlapping polygons (counter is initialized to -1)
struct Face_with_counter : public CGAL::Arr_2_face_base {
Face_with_counter() : CGAL::Arr_2_face_base(), counter(-1) {}
int counter;
};
//a DCEL with Face_with_counter
typedef CGAL::Pm_dcel<CGAL::Arr_2_vertex_base<Point>,
CGAL::Arr_2_halfedge_base<Base_node >,
Face_with_counter > Dcel;
typedef CGAL::Arrangement_2<Dcel,Traits,Base_node > Arr_2;
typedef CGAL::Pm_naive_point_location<Arr_2::Planar_map> Arr_naive_pl;
typedef Arr_2::Ccb_halfedge_circulator Ccb_halfedge_circulator;
typedef Arr_2::Face_handle Face_handle;
typedef Arr_2::Face_iterator Face_iterator;
typedef Arr_2::Holes_iterator Holes_iterator;
typedef std::list<Arr_2::Curve_iterator> ArrCurvesList;
/////////////////////////////////////////////////////////////////////////
// Function Prototypes
/////////////////////////////////////////////////////////////////////////
bool intersect_polygons(Polygon_list &in_poly_list,
Polygon_list &out_poly_list);

View File

@ -0,0 +1,88 @@
# Created by the script create_makefile
# This is the makefile for compiling a CGAL application.
#---------------------------------------------------------------------#
# include platform specific settings
#---------------------------------------------------------------------#
# Choose the right include file from the <cgalroot>/make directory.
# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE
include $(CGAL_MAKEFILE)
#---------------------------------------------------------------------#
# compiler flags
#---------------------------------------------------------------------#
CXXFLAGS = \
-Iinclude \
$(CGAL_CXXFLAGS) \
$(LONG_NAME_PROBLEM_CXXFLAGS) \
$(DEBUG_OPT)
#---------------------------------------------------------------------#
# linker flags
#---------------------------------------------------------------------#
LIBPATH = \
$(CGAL_WINDOW_LIBPATH)
LDFLAGS = \
$(LONG_NAME_PROBLEM_LDFLAGS) \
$(CGAL_WINDOW_LDFLAGS)
#---------------------------------------------------------------------#
# target entries
#---------------------------------------------------------------------#
all: \
Circle_arr_from_file$(EXE_EXT) \
Polyline_arr_from_file$(EXE_EXT) \
Polyline_arr_from_mouse$(EXE_EXT) \
Seg_circ_arr_from_file$(EXE_EXT) \
Segment_arr_from_file$(EXE_EXT) \
Conics_arr_from_file$(EXE_EXT) \
Segment_arr_from_mouse$(EXE_EXT) \
Polygon_intersection_demo$(EXE_EXT)
Circle_arr_from_file$(EXE_EXT): Circle_arr_from_file$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Circle_arr_from_file Circle_arr_from_file$(OBJ_EXT) $(LDFLAGS)
Polyline_arr_from_file$(EXE_EXT): Polyline_arr_from_file$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Polyline_arr_from_file Polyline_arr_from_file$(OBJ_EXT) $(LDFLAGS)
Polyline_arr_from_mouse$(EXE_EXT): Polyline_arr_from_mouse$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Polyline_arr_from_mouse Polyline_arr_from_mouse$(OBJ_EXT) $(LDFLAGS)
Seg_circ_arr_from_file$(EXE_EXT): Seg_circ_arr_from_file$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Seg_circ_arr_from_file Seg_circ_arr_from_file$(OBJ_EXT) $(LDFLAGS)
Segment_arr_from_file$(EXE_EXT): Segment_arr_from_file$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Segment_arr_from_file Segment_arr_from_file$(OBJ_EXT) $(LDFLAGS)
Conics_arr_from_file$(EXE_EXT): Conics_arr_from_file$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Conics_arr_from_file Conics_arr_from_file$(OBJ_EXT) $(LDFLAGS)
Segment_arr_from_mouse$(EXE_EXT): Segment_arr_from_mouse$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Segment_arr_from_mouse Segment_arr_from_mouse$(OBJ_EXT) $(LDFLAGS)
Polygon_intersection_demo$(EXE_EXT): Polygon_intersection_demo$(OBJ_EXT) Polygon_intersection$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Polygon_intersection_demo Polygon_intersection_demo$(OBJ_EXT) Polygon_intersection$(OBJ_EXT) $(LDFLAGS)
clean: \
Circle_arr_from_file.clean \
Polyline_arr_from_file.clean \
Polyline_arr_from_mouse.clean \
Seg_circ_arr_from_file.clean \
Segment_arr_from_file.clean \
Conics_arr_from_file.clean \
Polygon_intersection.clean \
Segment_arr_from_mouse.clean \
Polygon_intersection_demo.clean
#---------------------------------------------------------------------#
# suffix rules
#---------------------------------------------------------------------#
.C$(OBJ_EXT):
$(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $<

View File

@ -0,0 +1,14 @@
13
s 0 1 1 0
s 1 0 0 -1
s 0 -1 -1 0
s -1 0 0 1
c 0 0 1
s 0 2 2 0
s 2 0 0 -2
s 0 -2 -2 0
s -2 0 0 2
a -2 0 4 -2 2 -2 -2
a 2 0 4 2 -2 2 2
s -2 -2 2 2
s -2 2 2 -2

View File

@ -0,0 +1,7 @@
5
c 0 0 1
c 1 0 1
c 0 1 1
c -1 0 1
c 0 -1 1

View File

@ -0,0 +1,15 @@
14
c 0 0 4
c 0 0 36
c 0 4 4
c 0 4 16
c 0 -4 4
c 0 -4 16
c 4 0 4
c 4 0 16
c -4 0 4
c -4 0 16
c 0 4 1
c 0 -4 1
c 4 0 1
c -4 0 1

View File

@ -0,0 +1,7 @@
5
c 0 0 1
a 0 0 4 0 -2 0 2
c 1 1 1
s -3 -3 3 3
s -1 -2 1 2

View File

@ -0,0 +1,9 @@
8
-100 -100 100 100
-100 0 100 0
-50 -100 -50 100
50 -100 50 100
30 20 20 30
40 40 100 -10
-200 -200 150 100
-200 -190 150 90

View File

@ -0,0 +1,22 @@
12
-100 100 100 100
-90 110 -90 0
-100 90 100 90
-80 110 -80 0
-100 80 100 80
-70 110 -70 0
-100 70 100 70
-60 110 -60 0
-100 60 100 60
-50 110 -50 0
-100 50 100 50
-40 110 -40 0
-100 40 100 40
-30 110 -30 0
-100 30 100 30
-20 110 -20 0
-100 20 100 20
-10 110 -10 0
-100 10 100 10
0 110 0 0

View File

@ -0,0 +1,22 @@
20
-100 100 100 100
-90 110 -90 0
-100 90 100 90
-80 110 -80 0
-100 80 100 80
-70 110 -70 0
-100 70 100 70
-60 110 -60 0
-100 60 100 60
-50 110 -50 0
-100 50 100 50
-40 110 -40 0
-100 40 100 40
-30 110 -30 0
-100 30 100 30
-20 110 -20 0
-100 20 100 20
-10 110 -10 0
-100 10 100 10
0 110 0 0

View File

@ -0,0 +1,6 @@
4
-100 -100 100 100
-100 0 100 0
-50 -100 -50 100
50 -100 50 100

View File

@ -0,0 +1,39 @@
#include <CGAL/config.h>
#if defined(CGAL_CFG_LONGNAME_BUG)
#define Quotient Qt
#define Homogeneous Hs
#define Cartesian Cn
#define Simple_cartesian SC
#define Filtered_kernel FKl
#define Segment_2 St
#define Point_2 Pt2
#define Topological_map TM
#define Planar_map_2 PMp
#define Arrangement_2 Ar
#define I_Polyhedron_iterator IPI
#define I_Polyhedron_const_iterator IPCI
#define Arr_2_default_dcel ADD
#define Arr_segment_traits_2 AST
#define Arr_circles_real_traits ACRT
#define Arr_polyline_traits APT
#define Arr_base_node ABN
#define Arr_2_halfedge_base AHB
#define Arr_2_vertex_base AVB
#define Arr_2_face_base AFB
#if ! defined(_MSC_VER)
#define bidirectional_iterator_tag BIT
#endif
#define In_place_list_iterator IPLI
#define In_place_list_const_iterator IPLCI
#define allocator All
#define Pm_traits_wrap_2 PmTW
#define Td_X_trapezoid TXT
#define PL_X_curve_plus PXCP
#if defined(_MSC_VER)
// Has no effect, probably bug in MSVC
#pragma warning(disable:4503)
#endif
#endif