38 #include <QLinkedList>
43 #include "qgis_core.h"
76 friend class PolygonCostCalculator;
81 PointSet(
int nbPoints,
double *x,
double *y );
87 std::unique_ptr< PointSet > extractShape(
int nbPtSh,
int imin,
int imax,
int fps,
int fpe,
double fptx,
double fpty );
92 std::unique_ptr< PointSet > clone()
const;
100 bool containsPoint(
double x,
double y )
const;
111 bool containsLabelCandidate(
double x,
double y,
double width,
double height,
double alpha = 0 )
const;
122 static void splitPolygons( QLinkedList<PointSet *> &inputShapes,
123 QLinkedList<PointSet *> &outputShapes,
124 double xrm,
double yrm );
134 void extendLineByDistance(
double startDistance,
double endDistance,
double smoothDistance );
145 double minDistanceToPoint(
double px,
double py,
double *rx =
nullptr,
double *ry =
nullptr )
const;
147 void getCentroid(
double &px,
double &py,
bool forceInside =
false )
const;
163 bool boundingBoxIntersects(
const PointSet *other )
const;
178 void getPointByDistance(
double *d,
double *ad,
double dl,
double *px,
double *py );
183 const GEOSGeometry *
geos()
const;
188 double length()
const;
198 bool isClosed()
const;
201 std::vector< double >
x;
202 std::vector< double >
y;
205 mutable GEOSGeometry *mGeos =
nullptr;
206 mutable bool mOwnsGeom =
false;
208 int *cHull =
nullptr;
216 mutable double mArea = -1;
217 mutable double mLength = -1;
225 void createGeosGeom()
const;
226 const GEOSPreparedGeometry *preparedGeom()
const;
227 void invalidateGeos();
229 double xmin = std::numeric_limits<double>::max();
230 double xmax = std::numeric_limits<double>::lowest();
231 double ymin = std::numeric_limits<double>::max();
232 double ymax = std::numeric_limits<double>::lowest();
236 mutable const GEOSPreparedGeometry *mPreparedGeom =
nullptr;