Update Clipper to 6.4.1

This commit is contained in:
Alessandro Ranellucci 2016-12-20 19:09:09 +01:00
parent c5a285f435
commit 6f9e1cde6e
2 changed files with 21 additions and 19 deletions

View File

@ -1,10 +1,10 @@
/******************************************************************************* /*******************************************************************************
* * * *
* Author : Angus Johnson * * Author : Angus Johnson *
* Version : 6.4.0 * * Version : 6.4.1 *
* Date : 2 July 2015 * * Date : 5 December 2016 *
* Website : http://www.angusj.com * * Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2015 * * Copyright : Angus Johnson 2010-2016 *
* * * *
* License: * * License: *
* Use, modification & distribution is subject to Boost Software License Ver 1. * * Use, modification & distribution is subject to Boost Software License Ver 1. *
@ -179,7 +179,7 @@ int PolyTree::Total() const
// PolyNode methods ... // PolyNode methods ...
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
PolyNode::PolyNode(): Childs(), Parent(0), Index(0), m_IsOpen(false) PolyNode::PolyNode(): Parent(0), Index(0), m_IsOpen(false)
{ {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -3663,7 +3663,7 @@ void Clipper::FixupFirstLefts3(OutRec* OldOutRec, OutRec* NewOutRec)
{ {
OutRec* outRec = m_PolyOuts[i]; OutRec* outRec = m_PolyOuts[i];
OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft); OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft);
if (outRec->Pts && outRec->FirstLeft == OldOutRec) if (outRec->Pts && firstLeft == OldOutRec)
outRec->FirstLeft = NewOutRec; outRec->FirstLeft = NewOutRec;
} }
} }

View File

@ -1,8 +1,8 @@
/******************************************************************************* /*******************************************************************************
* * * *
* Author : Angus Johnson * * Author : Angus Johnson *
* Version : 6.4.0 * * Version : 6.4.1 *
* Date : 2 July 2015 * * Date : 5 December 2016 *
* Website : http://www.angusj.com * * Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2015 * * Copyright : Angus Johnson 2010-2015 *
* * * *
@ -34,7 +34,7 @@
#ifndef clipper_hpp #ifndef clipper_hpp
#define clipper_hpp #define clipper_hpp
#define CLIPPER_VERSION "6.2.6" #define CLIPPER_VERSION "6.4.1"
//use_int32: When enabled 32bit ints are used instead of 64bit ints. This //use_int32: When enabled 32bit ints are used instead of 64bit ints. This
//improve performance but coordinate values are limited to the range +/- 46340 //improve performance but coordinate values are limited to the range +/- 46340
@ -137,7 +137,7 @@ class PolyNode
{ {
public: public:
PolyNode(); PolyNode();
~PolyNode(){}; virtual ~PolyNode(){};
Path Contour; Path Contour;
PolyNodes Childs; PolyNodes Childs;
PolyNode* Parent; PolyNode* Parent;
@ -146,6 +146,7 @@ public:
bool IsOpen() const; bool IsOpen() const;
int ChildCount() const; int ChildCount() const;
private: private:
//PolyNode& operator =(PolyNode& other);
unsigned Index; //node index in Parent.Childs unsigned Index; //node index in Parent.Childs
bool m_IsOpen; bool m_IsOpen;
JoinType m_jointype; JoinType m_jointype;
@ -159,12 +160,13 @@ private:
class PolyTree: public PolyNode class PolyTree: public PolyNode
{ {
public: public:
~PolyTree(){Clear();}; ~PolyTree(){ Clear(); };
PolyNode* GetFirst() const; PolyNode* GetFirst() const;
void Clear(); void Clear();
int Total() const; int Total() const;
private: private:
PolyNodes AllNodes; //PolyTree& operator =(PolyTree& other);
PolyNodes AllNodes;
friend class Clipper; //to access AllNodes friend class Clipper; //to access AllNodes
}; };
@ -219,17 +221,17 @@ class ClipperBase
{ {
public: public:
ClipperBase(); ClipperBase();
~ClipperBase(); virtual ~ClipperBase();
bool AddPath(const Path &pg, PolyType PolyTyp, bool Closed); virtual bool AddPath(const Path &pg, PolyType PolyTyp, bool Closed);
bool AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed); bool AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed);
void Clear(); virtual void Clear();
IntRect GetBounds(); IntRect GetBounds();
bool PreserveCollinear() {return m_PreserveCollinear;}; bool PreserveCollinear() {return m_PreserveCollinear;};
void PreserveCollinear(bool value) {m_PreserveCollinear = value;}; void PreserveCollinear(bool value) {m_PreserveCollinear = value;};
protected: protected:
void DisposeLocalMinimaList(); void DisposeLocalMinimaList();
TEdge* AddBoundsToLML(TEdge *e, bool IsClosed); TEdge* AddBoundsToLML(TEdge *e, bool IsClosed);
void Reset(); virtual void Reset();
TEdge* ProcessBound(TEdge* E, bool IsClockwise); TEdge* ProcessBound(TEdge* E, bool IsClockwise);
void InsertScanbeam(const cInt Y); void InsertScanbeam(const cInt Y);
bool PopScanbeam(cInt &Y); bool PopScanbeam(cInt &Y);
@ -258,7 +260,7 @@ protected:
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
class Clipper : public ClipperBase class Clipper : public virtual ClipperBase
{ {
public: public:
Clipper(int initOptions = 0); Clipper(int initOptions = 0);
@ -285,7 +287,7 @@ public:
void ZFillFunction(ZFillCallback zFillFunc); void ZFillFunction(ZFillCallback zFillFunc);
#endif #endif
protected: protected:
bool ExecuteInternal(); virtual bool ExecuteInternal();
private: private:
JoinList m_Joins; JoinList m_Joins;
JoinList m_GhostJoins; JoinList m_GhostJoins;
@ -390,8 +392,8 @@ class clipperException : public std::exception
{ {
public: public:
clipperException(const char* description): m_descr(description) {} clipperException(const char* description): m_descr(description) {}
~clipperException() throw() {} virtual ~clipperException() throw() {}
const char* what() const throw() {return m_descr.c_str();} virtual const char* what() const throw() {return m_descr.c_str();}
private: private:
std::string m_descr; std::string m_descr;
}; };