1 #ifndef SIMPT_EDITOR_POLYGON_UTILS_H_INCLUDED
2 #define SIMPT_EDITOR_POLYGON_UTILS_H_INCLUDED
58 static QPolygonF
OpenPolygon(
const QPolygonF &polygon);
87 static std::list<QPolygonF>
ClipPolygon(
const QPolygonF& polygon1,
const QPolygonF& polygon2);
99 static std::list<QPolygonF>
SlicePolygon(
const QPolygonF& polygon, QLineF cut);
110 static int Turn(
const QLineF &line1,
const QLineF &line2);
112 static constexpr
double g_accuracy = 1.0e-12;
117 #endif // end_of_include_guard
static QPolygonF OpenPolygon(const QPolygonF &polygon)
Opens the polygon, ie.
Namespace for SimPT tissue editor package.
static std::list< QPolygonF > ClipPolygon(const QPolygonF &polygon1, const QPolygonF &polygon2)
Clip a polygon with another polygon and return the intersecting subpolygons.
static QPolygonF Counterclockwise(const QPolygonF &polygon)
Checks if the order of the polygon's points is clockwise and if so, reverts it, else the original pol...
static bool IsClockwise(const QPolygonF &polygon)
Checks whether the vertices of a polygon are ordered clockwise or counterclockwise.
static std::list< QPolygonF > SlicePolygon(const QPolygonF &polygon, QLineF cut)
Slice an open, simple and valid polygon in multiple polygons with a given line.
static double CalculateArea(const QPolygonF &polygon)
Calculate the area of a polygon.
Functions to manipulate polygons.
static bool IsSimplePolygon(const QPolygonF &polygon)
Checks whether a polygon is simple.