#ifndef POLYGONCALCULUS_H #define POLYGONCALCULUS_H
#include <QPointF> #include <QPolygonF> #include "PlanimetryCalculus.h"
namespace PolygonCalculus {
enum JoinPolygonError { NotSimplePolygon, PolygonJoined, Disjoint, PathSizeLow}; int closestVertexIndex (const QPolygonF &polygon, const QPointF &coordinate); QPointF closestVertex (const QPolygonF &polygon, const QPointF &coordinate); int nextPolygonIndex (int pathsize, int index); int previousPolygonIndex(int pathsize, int index); JoinPolygonError joinPolygon (QPolygonF polygon1, QPolygonF polygon2, QPolygonF &joinedPolygon); bool isSimplePolygon (const QPolygonF &polygon); bool hasClockwiseWinding (const QPolygonF &path); void reversePath (QPolygonF &path); bool offsetPolygon (QPolygonF &polygon, double offset); double distanceInsidePolygon (const QPointF &c1, const QPointF &c2, QPolygonF polygon);
} #endif // POLYGONCALCULUS_H