Skip to content

Commit

Permalink
Merge pull request #13 from c42f/vertex-id
Browse files Browse the repository at this point in the history
Vertex id
  • Loading branch information
ivanfratric authored Jul 31, 2016
2 parents 585f34a + 2573d1e commit 886dbf5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/polypartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,7 @@ int TPPLPartition::TriangulateMonotone(TPPLPoly *inPoly, list<TPPLPoly> *triangl
if(numpoints < 3) return 0;
if(numpoints == 3) {
triangles->push_back(*inPoly);
return 1;
}

topindex = 0; bottomindex=0;
Expand Down
25 changes: 15 additions & 10 deletions src/polypartition.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ typedef double tppl_float;
struct TPPLPoint {
tppl_float x;
tppl_float y;
// User-specified vertex identifier. Note that this isn't used internally
// by the library, but will be faithfully copied around.
int id;

TPPLPoint operator + (const TPPLPoint& p) const {
TPPLPoint r;
Expand Down Expand Up @@ -71,10 +74,11 @@ struct TPPLPoint {
if((x == p.x)&&(y==p.y)) return false;
else return true;
}
};

//Polygon implemented as an array of points with a 'hole' flag
class TPPLPoly {
};


//Polygon implemented as an array of points with a 'hole' flag
class TPPLPoly {
protected:

TPPLPoint *points;
Expand Down Expand Up @@ -139,9 +143,10 @@ struct TPPLPoint {
// TPPL_CCW : sets vertices in counter-clockwise order
// TPPL_CW : sets vertices in clockwise order
void SetOrientation(int orientation);
};

class TPPLPartition {
};


class TPPLPartition {
protected:
struct PartitionVertex {
bool isActive;
Expand Down Expand Up @@ -344,7 +349,7 @@ struct TPPLPoint {
// parts : resulting list of convex polygons
//returns 1 on success, 0 on failure
int ConvexPartition_OPT(TPPLPoly *poly, std::list<TPPLPoly> *parts);
};
};


#endif

0 comments on commit 886dbf5

Please sign in to comment.