38 #include <QLinkedList>
43 #include "qgis_core.h"
80 friend class PolygonCostCalculator;
85 PointSet(
int nbPoints,
double *x,
double *y );
91 std::unique_ptr< PointSet > extractShape(
int nbPtSh,
int imin,
int imax,
int fps,
int fpe,
double fptx,
double fpty );
96 std::unique_ptr< PointSet > clone()
const;
104 bool containsPoint(
double x,
double y )
const;
115 bool containsLabelCandidate(
double x,
double y,
double width,
double height,
double alpha = 0 )
const;
127 static QLinkedList<PointSet *> splitPolygons(
PointSet *inputShape,
double labelWidth,
double labelHeight );
137 void extendLineByDistance(
double startDistance,
double endDistance,
double smoothDistance );
142 void offsetCurveByDistance(
double distance );
153 double minDistanceToPoint(
double px,
double py,
double *rx =
nullptr,
double *ry =
nullptr )
const;
155 void getCentroid(
double &px,
double &py,
bool forceInside =
false )
const;
171 bool boundingBoxIntersects(
const PointSet *other )
const;
186 void getPointByDistance(
double *d,
double *ad,
double dl,
double *px,
double *py );
191 const GEOSGeometry *
geos()
const;
196 double length()
const;
206 bool isClosed()
const;
211 QString toWkt()
const;
216 std::tuple< std::vector< double >,
double > edgeDistances()
const;
219 std::vector< double >
x;
220 std::vector< double >
y;
223 mutable GEOSGeometry *mGeos =
nullptr;
224 mutable bool mOwnsGeom =
false;
233 mutable double mArea = -1;
234 mutable double mLength = -1;
242 void createGeosGeom()
const;
243 const GEOSPreparedGeometry *preparedGeom()
const;
245 void invalidateGeos();
247 double xmin = std::numeric_limits<double>::max();
248 double xmax = std::numeric_limits<double>::lowest();
249 double ymin = std::numeric_limits<double>::max();
250 double ymax = std::numeric_limits<double>::lowest();
254 mutable const GEOSPreparedGeometry *mGeosPreparedBoundary =
nullptr;
255 mutable const GEOSPreparedGeometry *mPreparedGeom =
nullptr;
257 mutable GEOSGeometry *mMultipartGeos =
nullptr;
258 mutable const GEOSPreparedGeometry *mMultipartPreparedGeos =
nullptr;
A rectangle specified with double values.
Calculates label candidate costs considering different factors.
Main class to handle feature.
LabelPosition is a candidate feature label position.
A set of features which influence the labeling process.
The underlying raw pal geometry class.
QgsRectangle boundingBox() const
Returns the point set bounding box.
std::vector< int > convexHull
PointSet * getHoleOf() const
Returns nullptr if this isn't a hole. Otherwise returns pointer to parent pointset.
Contains geos related utilities and functions.
Represents the minimum area, oriented bounding box surrounding a convex hull.