3535#define clipper_hpp
3636
3737#include < mapnik/config.hpp>
38+ #include < mapnik/geometry.hpp>
3839
3940#define CLIPPER_VERSION " 6.2.6"
4041
4647// #define use_xyz
4748
4849// use_lines: Enables line clipping. Adds a very minor cost to performance.
49- // #define use_lines
50+ #define use_lines
5051
5152// use_deprecated: Enables temporary support for the obsolete functions
5253// #define use_deprecated
@@ -76,37 +77,41 @@ enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
7677 static cInt const loRange = 0x7FFF ;
7778 static cInt const hiRange = 0x7FFF ;
7879#else
79- typedef signed long long cInt;
80+ typedef std:: int64_t cInt;
8081 static cInt const loRange = 0x3FFFFFFF ;
8182 static cInt const hiRange = 0x3FFFFFFFFFFFFFFFLL ;
82- typedef signed long long long64; // used by Int128 class
83- typedef unsigned long long ulong64;
83+ typedef std:: int64_t long64; // used by Int128 class
84+ typedef std:: uint64_t ulong64;
8485
8586#endif
86-
87+ /*
8788struct IntPoint {
88- cInt X ;
89- cInt Y ;
89+ cInt x ;
90+ cInt y ;
9091#ifdef use_xyz
91- cInt Z ;
92+ cInt z ;
9293 IntPoint(cInt x = 0, cInt y = 0, cInt z = 0): X(x), Y(y), Z(z) {};
9394#else
94- IntPoint (cInt x = 0 , cInt y = 0 ): X(x ), Y(y ) {};
95+ IntPoint(cInt x_ = 0, cInt y_ = 0): x(x_ ), y(y_ ) {};
9596#endif
9697
9798 friend inline bool operator== (const IntPoint& a, const IntPoint& b)
9899 {
99- return a.X == b.X && a.Y == b.Y ;
100+ return a.x == b.x && a.y == b.y ;
100101 }
101102 friend inline bool operator!= (const IntPoint& a, const IntPoint& b)
102103 {
103- return a.X != b.X || a.Y != b.Y ;
104+ return a.x != b.x || a.y != b.y ;
104105 }
105- };
106+ };*/
107+
108+ typedef mapnik::geometry::point<cInt> IntPoint;
109+
106110// ------------------------------------------------------------------------------
107111
108- typedef std::vector< IntPoint > Path;
109- typedef std::vector< Path > Paths;
112+ // typedef std::vector< IntPoint > Path;
113+ typedef mapnik::geometry::line_string<cInt> Path;
114+ typedef mapnik::geometry::multi_line_string<cInt> Paths;
110115
111116inline Path& operator <<(Path& poly, const IntPoint& p) {poly.push_back (p); return poly;}
112117inline Paths& operator <<(Paths& polys, const Path& p) {polys.push_back (p); return polys;}
@@ -117,10 +122,10 @@ std::ostream& operator <<(std::ostream &s, const Paths &p);
117122
118123struct DoublePoint
119124{
120- double X ;
121- double Y ;
122- DoublePoint (double x = 0 , double y = 0 ) : X(x ), Y(y ) {}
123- DoublePoint (IntPoint ip) : X ((double )ip.X ), Y ((double )ip.Y ) {}
125+ double x ;
126+ double y ;
127+ DoublePoint (double x_ = 0 , double y_ = 0 ) : x(x_ ), y(y_ ) {}
128+ DoublePoint (IntPoint ip) : x ((double )ip.x ), y ((double )ip.y ) {}
124129};
125130// ------------------------------------------------------------------------------
126131
@@ -189,7 +194,7 @@ void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution);
189194
190195void PolyTreeToPaths (const PolyTree& polytree, Paths& paths);
191196void ClosedPathsFromPolyTree (const PolyTree& polytree, Paths& paths);
192- void OpenPathsFromPolyTree (PolyTree& polytree, Paths& paths);
197+ MAPNIK_DECL void OpenPathsFromPolyTree (PolyTree& polytree, Paths& paths);
193198
194199void ReversePath (Path& p);
195200void ReversePaths (Paths& p);
0 commit comments