From 53a09c553f66d36b7607615ecf62c2be6407cb8f Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 17 Mar 1999 23:48:58 +0000 Subject: [PATCH] minor renaming and a bit of rearranging. --- Clipper/clipper.cxx | 11 +++++++---- Clipper/clipper.hxx | 22 +++++++++++++++++----- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Clipper/clipper.cxx b/Clipper/clipper.cxx index 3ea78c200..9cadba246 100644 --- a/Clipper/clipper.cxx +++ b/Clipper/clipper.cxx @@ -144,7 +144,7 @@ bool FGClipper::load_polys(const string& path) { // Do actually clipping work bool FGClipper::clip_all(const point2d& min, const point2d& max) { gpc_polygon accum, result_diff, result_union, tmp; - polylist_iterator current, last; + gpcpoly_iterator current, last; FG_LOG( FG_CLIPPER, FG_INFO, "Running master clipper" ); @@ -198,7 +198,7 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) { gpc_polygon_clip(GPC_UNION, &accum, &tmp, &result_union); } - polys_out.polys[i].push_back(&result_diff); + polys_clipped.polys[i].push_back(&result_diff); accum = result_union; } } @@ -207,7 +207,7 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) { // clip to accum against original base tile gpc_polygon_clip(GPC_DIFF, &polys_in.safety_base, &accum, - &polys_out.safety_base); + &polys_clipped.safety_base); // tmp output accum FILE *ofp= fopen("accum", "w"); @@ -215,13 +215,16 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) { // tmp output safety_base ofp= fopen("safety_base", "w"); - gpc_write_polygon(ofp, &polys_out.safety_base); + gpc_write_polygon(ofp, &polys_clipped.safety_base); return true; } // $Log$ +// Revision 1.3 1999/03/17 23:48:58 curt +// minor renaming and a bit of rearranging. +// // Revision 1.2 1999/03/13 23:51:33 curt // Renamed main.cxx to testclipper.cxx // Converted clipper routines to a class FGClipper. diff --git a/Clipper/clipper.hxx b/Clipper/clipper.hxx index b9f0d1bed..617b92f45 100644 --- a/Clipper/clipper.hxx +++ b/Clipper/clipper.hxx @@ -48,22 +48,28 @@ extern "C" { #include STL_STRING #include -typedef vector < gpc_polygon * > polylist; -typedef polylist::iterator polylist_iterator; +FG_USING_STD(string); +FG_USING_STD(vector); + + +typedef vector < gpc_polygon * > gpcpoly_container; +typedef gpcpoly_container::iterator gpcpoly_iterator; + #define FG_MAX_AREAS 20 #define EXTRA_SAFETY_CLIP #define FG_MAX_VERTICES 100000 + class point2d { public: double x, y; }; -class FGPolyList { +class FGgpcPolyList { public: - polylist polys[FG_MAX_AREAS]; + gpcpoly_container polys[FG_MAX_AREAS]; gpc_polygon safety_base; }; @@ -74,7 +80,7 @@ private: gpc_vertex_list v_list; // static gpc_polygon poly; - FGPolyList polys_in, polys_out; + FGgpcPolyList polys_in, polys_clipped; public: @@ -92,6 +98,9 @@ public: // Do actually clipping work bool clip_all(const point2d& min, const point2d& max); + + // return output poly list + inline FGgpcPolyList get_polys_clipped() const { return polys_clipped; } }; @@ -99,6 +108,9 @@ public: // $Log$ +// Revision 1.3 1999/03/17 23:48:59 curt +// minor renaming and a bit of rearranging. +// // Revision 1.2 1999/03/13 23:51:34 curt // Renamed main.cxx to testclipper.cxx // Converted clipper routines to a class FGClipper. -- 2.39.2