|
Walls And Holes
1
|
The Polygon class. More...
#include <polygon.h>
Public Member Functions | |
| BetterPolygon () | |
| BetterPolygon (const QVector< QPointF > &points) | |
| BetterPolygon (const QPolygonF &polygon) | |
| bool | isValid () const |
| bool | chordIsClear (int ind1, int ind2) const |
| chordIsClear More... | |
| bool | connectionIsClear (const BetterPolygon &other, int pointOnThis, int pointOnOther) const |
| bool | overlaps (const BetterPolygon &other) const |
| QPair< BetterPolygon, BetterPolygon > | splitPolygon () const |
| splitPolygon More... | |
| QPair< BetterPolygon, BetterPolygon > | splitPolygon (QPair< int, int > chord) const |
| splitPolygon More... | |
| QList< Triplet< QPointF, QPointF, QPointF > > | triangulate () const |
| triangulate More... | |
| QVector< BetterPolygon > | subtract (const BetterPolygon &other) const |
| QVector< BetterPolygon > | intersect (const BetterPolygon &other) const |
| QVector< BetterPolygon > | united (const BetterPolygon &other) const |
| const QVector< QPointF > & | points () const |
| QVector< QPointF > & | points () |
| void | translate (const QPointF &p) |
| void | translate (float x, float y) |
The Polygon class.
Strict polygon class with floating point precision.
Rules of this are: All points must be unique No edges may overlap Points must be counter clockwise
|
inline |

| BetterPolygon::BetterPolygon | ( | const QVector< QPointF > & | points | ) |

| BetterPolygon::BetterPolygon | ( | const QPolygonF & | polygon | ) |
| bool BetterPolygon::chordIsClear | ( | int | ind1, |
| int | ind2 | ||
| ) | const |
chordIsClear
Returns true if the chord between ind1 and ind2 do not intersect anypart of the polygon
| ind1 | |
| ind2 |


| bool BetterPolygon::connectionIsClear | ( | const BetterPolygon & | other, |
| int | pointOnThis, | ||
| int | pointOnOther | ||
| ) | const |


| QVector< BetterPolygon > BetterPolygon::intersect | ( | const BetterPolygon & | other | ) | const |


| bool BetterPolygon::isValid | ( | ) | const |

| bool BetterPolygon::overlaps | ( | const BetterPolygon & | other | ) | const |


|
inline |

|
inline |
| QPair< BetterPolygon, BetterPolygon > BetterPolygon::splitPolygon | ( | ) | const |
splitPolygon
split this polygon into two with some chord. The chord is choosen at random.


| QPair< BetterPolygon, BetterPolygon > BetterPolygon::splitPolygon | ( | QPair< int, int > | chord | ) | const |
splitPolygon
Attempt to split the polygon at a given chord. If the chord is not clear, this will be returned as the first Polygon, and the second will be empty.
| chord |

| QVector< BetterPolygon > BetterPolygon::subtract | ( | const BetterPolygon & | other | ) | const |


|
inline |
|
inline |
| QList< Triplet< QPointF, QPointF, QPointF > > BetterPolygon::triangulate | ( | ) | const |
triangulate
Returns a list of triangles that represent this polygon

| QVector< BetterPolygon > BetterPolygon::united | ( | const BetterPolygon & | other | ) | const |
