1 // clipper.hxx -- top level routines to take a series of arbitrary areas and
2 // produce a tight fitting puzzle pieces that combine to make a
5 // Written by Curtis Olson, started February 1999.
7 // Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 // (Log is kept at end of this file)
33 # error This library requires C++
37 #include <Include/compiler.h>
40 // include Generic Polygon Clipping Library
42 // http://www.cs.man.ac.uk/aig/staff/alan/software/
55 typedef vector < gpc_polygon * > gpcpoly_container;
56 typedef gpcpoly_container::iterator gpcpoly_iterator;
59 #define FG_MAX_AREAS 20
60 #define EXTRA_SAFETY_CLIP
61 #define FG_MAX_VERTICES 100000
72 gpcpoly_container polys[FG_MAX_AREAS];
73 gpc_polygon safety_base;
81 gpc_vertex_list v_list;
82 // static gpc_polygon poly;
83 FGgpcPolyList polys_in, polys_clipped;
93 // Initialize Clipper (allocate and/or connect structures)
96 // Load a polygon definition file
97 bool load_polys(const string& path);
99 // Do actually clipping work
100 bool clip_all(const point2d& min, const point2d& max);
102 // return output poly list
103 inline FGgpcPolyList get_polys_clipped() const { return polys_clipped; }
107 #endif // _CLIPPER_HXX
111 // Revision 1.3 1999/03/17 23:48:59 curt
112 // minor renaming and a bit of rearranging.
114 // Revision 1.2 1999/03/13 23:51:34 curt
115 // Renamed main.cxx to testclipper.cxx
116 // Converted clipper routines to a class FGClipper.
118 // Revision 1.1 1999/03/01 15:39:39 curt