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 *
* Version : 6.4.0 *
* Date : 2 July 2015 *
* Version : 6.4.1 *
* Date : 5 December 2016 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2015 *
* Copyright : Angus Johnson 2010-2016 *
* *
* License: *
* Use, modification & distribution is subject to Boost Software License Ver 1. *
@ -179,7 +179,7 @@ int PolyTree::Total() const
// 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* firstLeft = ParseFirstLeft(outRec->FirstLeft);
if (outRec->Pts && outRec->FirstLeft == OldOutRec)
if (outRec->Pts && firstLeft == OldOutRec)
outRec->FirstLeft = NewOutRec;
}
}

View File

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