- brought in clipper (alternative to gpc)
- moved poly_extra from genapts to polygon library (add intermediate nodes) - change TGPolyList to arrays of superpolys and texparams in preperation for generating tex coordinates for line data
This commit is contained in:
parent
bc3ecf8fe9
commit
a6058dff58
11 changed files with 703 additions and 283 deletions
|
@ -8,8 +8,7 @@ add_executable(genapts
|
|||
global.hxx
|
||||
lights.hxx lights.cxx
|
||||
main.cxx
|
||||
point2d.cxx point2d.hxx
|
||||
poly_extra.cxx poly_extra.hxx
|
||||
point2d.cxx point2d.hxx
|
||||
runway.cxx runway.hxx
|
||||
rwy_common.cxx rwy_common.hxx
|
||||
rwy_nonprec.cxx rwy_nonprec.hxx
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include <simgear/misc/texcoord.hxx>
|
||||
|
||||
#include <Geometry/poly_support.hxx>
|
||||
#include <Geometry/poly_extra.hxx>
|
||||
#include <Geometry/trinodes.hxx>
|
||||
#include <Output/output.hxx>
|
||||
#include <Polygon/chop.hxx>
|
||||
|
@ -62,7 +63,6 @@
|
|||
#include "elevations.hxx"
|
||||
#include "lights.hxx"
|
||||
#include "point2d.hxx"
|
||||
#include "poly_extra.hxx"
|
||||
#include "runway.hxx"
|
||||
#include "rwy_common.hxx"
|
||||
#include "rwy_nonprec.hxx"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include "global.hxx"
|
||||
#include "poly_extra.hxx"
|
||||
#include "rwy_common.hxx"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <simgear/constants.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include "poly_extra.hxx"
|
||||
#include "rwy_common.hxx"
|
||||
#include "rwy_nonprec.hxx"
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <simgear/constants.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include "poly_extra.hxx"
|
||||
#include "rwy_common.hxx"
|
||||
#include "taxiway.hxx"
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ add_library(Geometry STATIC
|
|||
contour_tree.cxx
|
||||
line.cxx
|
||||
poly_support.cxx
|
||||
poly_extra.cxx
|
||||
rectangle.cxx
|
||||
trinodes.cxx
|
||||
trisegs.cxx
|
||||
|
@ -12,6 +13,7 @@ add_library(Geometry STATIC
|
|||
line.hxx
|
||||
point3d.hxx
|
||||
poly_support.hxx
|
||||
poly_extra.hxx
|
||||
rectangle.hxx
|
||||
trinodes.hxx
|
||||
trisegs.hxx
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
add_library(Polygon STATIC
|
||||
chop-bin.cxx
|
||||
clipper.cpp
|
||||
index.cxx
|
||||
polygon.cxx
|
||||
simple_clip.cxx
|
||||
superpoly.cxx
|
||||
chop.hxx
|
||||
clipper.hpp
|
||||
index.hxx
|
||||
names.hxx
|
||||
point2d.hxx
|
||||
polygon.hxx
|
||||
simple_clip.hxx
|
||||
superpoly.hxx
|
||||
clipper.cpp
|
||||
clipper.hpp
|
||||
)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,40 +29,6 @@
|
|||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
/* which clipping lib to use? Looks like we should go with clipper
|
||||
* It appears to be both faster and generates better accuracy
|
||||
*/
|
||||
|
||||
//#define CLIP_GPC
|
||||
#define CLIP_CLIPPER
|
||||
|
||||
/* Set to 1 to allow keeping accum poly in native clipping lib format
|
||||
* Although it seems to work on some airports, EHAM is pretty broken
|
||||
* when turned on
|
||||
*/
|
||||
|
||||
#define CLIP_NATIVE 0
|
||||
|
||||
#ifdef CLIP_GPC
|
||||
extern "C" {
|
||||
#include <gpc.h>
|
||||
}
|
||||
|
||||
#if CLIP_NATIVE // optimization apparently causing errors
|
||||
typedef gpc_polygon ClipPolyType;
|
||||
#endif
|
||||
|
||||
#endif /* CLIP_GPC */
|
||||
|
||||
#ifdef CLIP_CLIPPER
|
||||
#include "clipper.hpp"
|
||||
using namespace ClipperLib;
|
||||
|
||||
#if CLIP_NATIVE // optimization apparently causing errors
|
||||
typedef Polygons ClipPolyType;
|
||||
#endif
|
||||
|
||||
#endif /* CLIP_CLIPPER */
|
||||
|
||||
#include <simgear/compiler.h>
|
||||
#include <simgear/math/sg_types.hxx>
|
||||
|
@ -74,6 +40,50 @@ typedef Polygons ClipPolyType;
|
|||
|
||||
#include "point2d.hxx"
|
||||
|
||||
/* which clipping lib to use? Looks like we should go with clipper
|
||||
* It appears to be both faster and generates better accuracy
|
||||
*/
|
||||
|
||||
// forward declaration
|
||||
class TGPolygon;
|
||||
|
||||
#define CLIP_GPC
|
||||
// #define CLIP_CLIPPER
|
||||
|
||||
/* Set to 1 to allow keeping accum poly in native clipping lib format
|
||||
* Although it seems to work on some airports, EHAM is pretty broken
|
||||
* when turned on
|
||||
*/
|
||||
|
||||
#define CLIP_NATIVE 0
|
||||
|
||||
#ifdef CLIP_GPC
|
||||
extern "C" {
|
||||
#include <gpc.h>
|
||||
}
|
||||
|
||||
#if CLIP_NATIVE // optimization apparently causing errors
|
||||
typedef gpc_polygon ClipPolyType;
|
||||
#else
|
||||
typedef TGPolygon ClipPolyType;
|
||||
#endif
|
||||
|
||||
#endif /* CLIP_GPC */
|
||||
|
||||
#ifdef CLIP_CLIPPER
|
||||
#include "clipper.hpp"
|
||||
using namespace ClipperLib;
|
||||
|
||||
#if CLIP_NATIVE // optimization apparently causing errors
|
||||
typedef Polygons ClipPolyType;
|
||||
#else
|
||||
typedef TGPolygon ClipPolyType;
|
||||
#endif
|
||||
|
||||
#endif /* CLIP_CLIPPER */
|
||||
|
||||
|
||||
|
||||
#define FG_MAX_VERTICES 1500000
|
||||
|
||||
|
||||
|
@ -238,10 +248,6 @@ void write_contour( const int contour, const std::string& file ) const;
|
|||
};
|
||||
|
||||
|
||||
#if !CLIP_NATIVE
|
||||
typedef TGPolygon ClipPolyType;
|
||||
#endif
|
||||
|
||||
typedef std::vector < TGPolygon > poly_list;
|
||||
typedef poly_list::iterator poly_list_iterator;
|
||||
typedef poly_list::const_iterator const_poly_list_iterator;
|
||||
|
|
Loading…
Add table
Reference in a new issue