QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
The underlying raw pal geometry class. More...
#include <pointset.h>
Public Member Functions | |
PointSet () | |
PointSet (int nbPoints, double *x, double *y) | |
virtual | ~PointSet () |
double | area () const |
Returns area of polygon geometry. More... | |
QgsRectangle | boundingBox () const |
Returns the point set bounding box. More... | |
bool | boundingBoxIntersects (const PointSet *other) const |
Returns true if the bounding box of this pointset intersects the bounding box of another pointset. More... | |
std::unique_ptr< PointSet > | clone () const |
Returns a copy of the point set. More... | |
OrientedConvexHullBoundingBox | computeConvexHullOrientedBoundingBox (bool &ok) |
Computes an oriented bounding box for the shape's convex hull. More... | |
bool | containsLabelCandidate (double x, double y, double width, double height, double alpha=0) const |
Tests whether a possible label candidate will fit completely within the shape. More... | |
bool | containsPoint (double x, double y) const |
Tests whether point set contains a specified point. More... | |
std::tuple< std::vector< double >, double > | edgeDistances () const |
Returns a vector of edge distances as well as its total length. More... | |
void | extendLineByDistance (double startDistance, double endDistance, double smoothDistance) |
Extends linestrings by the specified amount at the start and end of the line, by extending the existing lines following the same direction as the original line start or end. More... | |
std::unique_ptr< PointSet > | extractShape (int nbPtSh, int imin, int imax, int fps, int fpe, double fptx, double fpty) |
Does... something completely inscrutable. More... | |
const GEOSGeometry * | geos () const |
Returns the point set's GEOS geometry. More... | |
void | getCentroid (double &px, double &py, bool forceInside=false) const |
int | getGeosType () const |
PointSet * | getHoleOf () const |
Returns nullptr if this isn't a hole. Otherwise returns pointer to parent pointset. More... | |
int | getNumPoints () const |
void | getPointByDistance (double *d, double *ad, double dl, double *px, double *py) const |
Gets a point a set distance along a line geometry. More... | |
geos::unique_ptr | interpolatePoint (double distance) const |
Returns a GEOS geometry representing the point interpolated on the shape by distance. More... | |
bool | isClosed () const |
Returns true if pointset is closed. More... | |
double | length () const |
Returns length of line geometry. More... | |
double | lineLocatePoint (const GEOSGeometry *point) const |
Returns the distance along the geometry closest to the specified GEOS point. More... | |
double | minDistanceToPoint (double px, double py, double *rx=nullptr, double *ry=nullptr) const |
Returns the squared minimum distance between the point set geometry and the point (px,py) Optionally, the nearest point is stored in (rx,ry). More... | |
void | offsetCurveByDistance (double distance) |
Offsets linestrings by the specified distance. More... | |
QString | toWkt () const |
Returns a WKT representation of the point set. More... | |
Static Public Member Functions | |
static QLinkedList< PointSet * > | splitPolygons (PointSet *inputShape, double labelWidth, double labelHeight) |
Split a polygon using some random logic into some other polygons. More... | |
Public Attributes | |
int | nbPoints |
std::vector< double > | x |
std::vector< double > | y |
Protected Member Functions | |
PointSet (const PointSet &ps) | |
PointSet (double x, double y) | |
void | createGeosGeom () const |
void | deleteCoords () |
void | invalidateGeos () const |
const GEOSPreparedGeometry * | preparedGeom () const |
Protected Attributes | |
std::vector< int > | convexHull |
PointSet * | holeOf = nullptr |
double | mArea = -1 |
GEOSGeometry * | mGeos = nullptr |
double | mLength = -1 |
bool | mOwnsGeom = false |
PointSet * | parent = nullptr |
int | type |
double | xmax = std::numeric_limits<double>::lowest() |
double | xmin = std::numeric_limits<double>::max() |
double | ymax = std::numeric_limits<double>::lowest() |
double | ymin = std::numeric_limits<double>::max() |
Friends | |
class | CostCalculator |
class | FeaturePart |
class | LabelPosition |
class | Layer |
class | PolygonCostCalculator |
The underlying raw pal geometry class.
Definition at line 76 of file pointset.h.
PointSet::PointSet | ( | ) |
Definition at line 40 of file pointset.cpp.
PointSet::PointSet | ( | int | nbPoints, |
double * | x, | ||
double * | y | ||
) |
Definition at line 46 of file pointset.cpp.
|
virtual |
Definition at line 201 of file pointset.cpp.
|
protected |
Definition at line 62 of file pointset.cpp.
|
protected |
Definition at line 76 of file pointset.cpp.
double PointSet::area | ( | ) | const |
Returns area of polygon geometry.
Definition at line 1084 of file pointset.cpp.
|
inline |
Returns the point set bounding box.
Definition at line 163 of file pointset.h.
bool PointSet::boundingBoxIntersects | ( | const PointSet * | other | ) | const |
Returns true
if the bounding box of this pointset intersects the bounding box of another pointset.
Definition at line 962 of file pointset.cpp.
std::unique_ptr< PointSet > PointSet::clone | ( | ) | const |
Returns a copy of the point set.
Definition at line 265 of file pointset.cpp.
OrientedConvexHullBoundingBox PointSet::computeConvexHullOrientedBoundingBox | ( | bool & | ok | ) |
Computes an oriented bounding box for the shape's convex hull.
Definition at line 716 of file pointset.cpp.
bool PointSet::containsLabelCandidate | ( | double | x, |
double | y, | ||
double | width, | ||
double | height, | ||
double | alpha = 0 |
||
) | const |
Tests whether a possible label candidate will fit completely within the shape.
x | x-coordinate of label candidate |
y | y-coordinate of label candidate |
width | label width |
height | label height |
alpha | label angle |
true
if point set completely contains candidate label Definition at line 289 of file pointset.cpp.
bool PointSet::containsPoint | ( | double | x, |
double | y | ||
) | const |
Tests whether point set contains a specified point.
x | x-coordinate of point |
y | y-coordinate of point |
true
if point set contains a specified point Definition at line 270 of file pointset.cpp.
|
protected |
Definition at line 99 of file pointset.cpp.
|
protected |
Definition at line 232 of file pointset.cpp.
std::tuple< std::vector< double >, double > PointSet::edgeDistances | ( | ) | const |
Returns a vector of edge distances as well as its total length.
Definition at line 1145 of file pointset.cpp.
void PointSet::extendLineByDistance | ( | double | startDistance, |
double | endDistance, | ||
double | smoothDistance | ||
) |
Extends linestrings by the specified amount at the start and end of the line, by extending the existing lines following the same direction as the original line start or end.
The smoothDistance argument specifies the distance over which to smooth the direction of the line at its start and end points.
Definition at line 629 of file pointset.cpp.
std::unique_ptr< PointSet > PointSet::extractShape | ( | int | nbPtSh, |
int | imin, | ||
int | imax, | ||
int | fps, | ||
int | fpe, | ||
double | fptx, | ||
double | fpty | ||
) |
Does... something completely inscrutable.
Definition at line 238 of file pointset.cpp.
const GEOSGeometry * PointSet::geos | ( | ) | const |
Returns the point set's GEOS geometry.
Definition at line 1050 of file pointset.cpp.
void PointSet::getCentroid | ( | double & | px, |
double & | py, | ||
bool | forceInside = false |
||
) | const |
Definition at line 915 of file pointset.cpp.
|
inline |
Definition at line 158 of file pointset.h.
|
inline |
Returns nullptr
if this isn't a hole. Otherwise returns pointer to parent pointset.
Definition at line 175 of file pointset.h.
|
inline |
Definition at line 177 of file pointset.h.
void PointSet::getPointByDistance | ( | double * | d, |
double * | ad, | ||
double | dl, | ||
double * | px, | ||
double * | py | ||
) | const |
Gets a point a set distance along a line geometry.
d | array of distances between points |
ad | cumulative total distance from pt0 to each point (ad0 = pt0->pt0) |
dl | distance to traverse along line |
px | final x coord on line |
py | final y coord on line |
Definition at line 973 of file pointset.cpp.
geos::unique_ptr PointSet::interpolatePoint | ( | double | distance | ) | const |
Returns a GEOS geometry representing the point interpolated on the shape by distance.
Definition at line 1012 of file pointset.cpp.
|
protected |
Definition at line 166 of file pointset.cpp.
bool PointSet::isClosed | ( | ) | const |
Returns true
if pointset is closed.
Definition at line 1111 of file pointset.cpp.
double PointSet::length | ( | ) | const |
Returns length of line geometry.
Definition at line 1058 of file pointset.cpp.
double PointSet::lineLocatePoint | ( | const GEOSGeometry * | point | ) | const |
Returns the distance along the geometry closest to the specified GEOS point.
Definition at line 1030 of file pointset.cpp.
double PointSet::minDistanceToPoint | ( | double | px, |
double | py, | ||
double * | rx = nullptr , |
||
double * | ry = nullptr |
||
) | const |
Returns the squared minimum distance between the point set geometry and the point (px,py) Optionally, the nearest point is stored in (rx,ry).
px | x coordinate of the point |
py | y coordinate of the points |
rx | pointer to x coorinates of the nearest point (can be NULL) |
ry | pointer to y coorinates of the nearest point (can be NULL) |
Definition at line 858 of file pointset.cpp.
void PointSet::offsetCurveByDistance | ( | double | distance | ) |
Offsets linestrings by the specified distance.
Definition at line 545 of file pointset.cpp.
|
protected |
Definition at line 154 of file pointset.cpp.
|
static |
Split a polygon using some random logic into some other polygons.
Definition at line 294 of file pointset.cpp.
QString PointSet::toWkt | ( | ) | const |
Returns a WKT representation of the point set.
Definition at line 1116 of file pointset.cpp.
|
friend |
Definition at line 80 of file pointset.h.
|
friend |
Definition at line 78 of file pointset.h.
|
friend |
Definition at line 79 of file pointset.h.
|
friend |
Definition at line 82 of file pointset.h.
|
friend |
Definition at line 81 of file pointset.h.
|
protected |
Definition at line 237 of file pointset.h.
|
protected |
Definition at line 241 of file pointset.h.
|
mutableprotected |
Definition at line 244 of file pointset.h.
|
mutableprotected |
Definition at line 234 of file pointset.h.
|
mutableprotected |
Definition at line 245 of file pointset.h.
|
mutableprotected |
Definition at line 235 of file pointset.h.
int pal::PointSet::nbPoints |
Definition at line 229 of file pointset.h.
|
protected |
Definition at line 242 of file pointset.h.
|
protected |
Definition at line 239 of file pointset.h.
std::vector< double > pal::PointSet::x |
Definition at line 230 of file pointset.h.
|
protected |
Definition at line 259 of file pointset.h.
|
protected |
Definition at line 258 of file pointset.h.
std::vector< double > pal::PointSet::y |
Definition at line 231 of file pointset.h.
|
protected |
Definition at line 261 of file pointset.h.
|
protected |
Definition at line 260 of file pointset.h.