QGIS API Documentation  3.6.0-Noosa (5873452)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
pal::PointSet Class Reference

#include <pointset.h>

Inheritance diagram for pal::PointSet:
Inheritance graph
[legend]

Public Member Functions

 PointSet ()
 
 PointSet (int nbPoints, double *x, double *y)
 
virtual ~PointSet ()
 
CHullBoxcompute_chull_bbox ()
 
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...
 
PointSetextractShape (int nbPtSh, int imin, int imax, int fps, int fpe, double fptx, double fpty)
 
const GEOSGeometry * geos () const
 Returns the point set's GEOS geometry. More...
 
void getBoundingBox (double min[2], double max[2]) const
 
void getCentroid (double &px, double &py, bool forceInside=false) const
 
int getGeosType () const
 
PointSetgetHoleOf ()
 Returns NULL 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)
 Gets a point a set distance along a line geometry. More...
 
bool isClosed () const
 Returns true if pointset is closed. More...
 
double length () const
 Returns length of line geometry. 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...
 

Static Public Member Functions

static void splitPolygons (QLinkedList< PointSet *> &shapes_toProcess, QLinkedList< PointSet *> &shapes_final, double xrm, double yrm)
 Split a concave shape into several convex shapes. More...
 

Protected Member Functions

 PointSet (double x, double y)
 
 PointSet (const PointSet &ps)
 
void createGeosGeom () const
 
void deleteCoords ()
 
void invalidateGeos ()
 
const GEOSPreparedGeometry * preparedGeom () const
 

Protected Attributes

int * cHull = nullptr
 
int cHullSize
 
PointSetholeOf = nullptr
 
GEOSGeometry * mGeos = nullptr
 
bool mOwnsGeom = false
 
int nbPoints
 
PointSetparent = nullptr
 
int type
 
double * x = nullptr
 
double xmax = std::numeric_limits<double>::lowest()
 
double xmin = std::numeric_limits<double>::max()
 
double * y = nullptr
 
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
 

Detailed Description

Note
not available in Python bindings

Definition at line 68 of file pointset.h.

Constructor & Destructor Documentation

◆ PointSet() [1/4]

PointSet::PointSet ( )

Definition at line 40 of file pointset.cpp.

◆ PointSet() [2/4]

PointSet::PointSet ( int  nbPoints,
double *  x,
double *  y 
)

Definition at line 49 of file pointset.cpp.

◆ ~PointSet()

PointSet::~PointSet ( )
virtual

Definition at line 190 of file pointset.cpp.

◆ PointSet() [3/4]

PointSet::PointSet ( double  x,
double  y 
)
protected

Definition at line 66 of file pointset.cpp.

◆ PointSet() [4/4]

PointSet::PointSet ( const PointSet ps)
protected

Definition at line 85 of file pointset.cpp.

Member Function Documentation

◆ compute_chull_bbox()

CHullBox * PointSet::compute_chull_bbox ( )

Definition at line 545 of file pointset.cpp.

◆ containsLabelCandidate()

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.

Parameters
xx-coordinate of label candidate
yy-coordinate of label candidate
widthlabel width
heightlabel height
alphalabel angle
Returns
true if point set completely contains candidate label

Definition at line 263 of file pointset.cpp.

◆ containsPoint()

bool PointSet::containsPoint ( double  x,
double  y 
) const

Tests whether point set contains a specified point.

Parameters
xx-coordinate of point
yy-coordinate of point
Returns
true if point set contains a specified point

Definition at line 242 of file pointset.cpp.

◆ createGeosGeom()

void PointSet::createGeosGeom ( ) const
protected

Definition at line 125 of file pointset.cpp.

◆ deleteCoords()

void PointSet::deleteCoords ( )
protected

Definition at line 206 of file pointset.cpp.

◆ extractShape()

PointSet * PointSet::extractShape ( int  nbPtSh,
int  imin,
int  imax,
int  fps,
int  fpe,
double  fptx,
double  fpty 
)

Definition at line 214 of file pointset.cpp.

◆ geos()

const GEOSGeometry * PointSet::geos ( ) const

Returns the point set's GEOS geometry.

Definition at line 818 of file pointset.cpp.

◆ getBoundingBox()

void pal::PointSet::getBoundingBox ( double  min[2],
double  max[2] 
) const
inline

Definition at line 126 of file pointset.h.

◆ getCentroid()

void PointSet::getCentroid ( double &  px,
double &  py,
bool  forceInside = false 
) const

Definition at line 740 of file pointset.cpp.

◆ getGeosType()

int pal::PointSet::getGeosType ( ) const
inline

Definition at line 124 of file pointset.h.

◆ getHoleOf()

PointSet* pal::PointSet::getHoleOf ( )
inline

Returns NULL if this isn't a hole. Otherwise returns pointer to parent pointset.

Definition at line 135 of file pointset.h.

◆ getNumPoints()

int pal::PointSet::getNumPoints ( ) const
inline

Definition at line 137 of file pointset.h.

◆ getPointByDistance()

void PointSet::getPointByDistance ( double *  d,
double *  ad,
double  dl,
double *  px,
double *  py 
)

Gets a point a set distance along a line geometry.

Parameters
darray of distances between points
adcumulative total distance from pt0 to each point (ad0 = pt0->pt0)
dldistance to traverse along line
pxfinal x coord on line
pyfinal y coord on line

Definition at line 779 of file pointset.cpp.

◆ invalidateGeos()

void PointSet::invalidateGeos ( )
protected

Definition at line 179 of file pointset.cpp.

◆ isClosed()

bool PointSet::isClosed ( ) const

Returns true if pointset is closed.

Definition at line 849 of file pointset.cpp.

◆ length()

double PointSet::length ( ) const

Returns length of line geometry.

Definition at line 826 of file pointset.cpp.

◆ minDistanceToPoint()

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).

Parameters
pxx coordinate of the point
pyy coordinate of the points
rxpointer to x coorinates of the nearest point (can be NULL)
rypointer to y coorinates of the nearest point (can be NULL)
Returns
minimum distance

Definition at line 693 of file pointset.cpp.

◆ preparedGeom()

const GEOSPreparedGeometry * PointSet::preparedGeom ( ) const
protected

Definition at line 167 of file pointset.cpp.

◆ splitPolygons()

void PointSet::splitPolygons ( QLinkedList< PointSet *> &  shapes_toProcess,
QLinkedList< PointSet *> &  shapes_final,
double  xrm,
double  yrm 
)
static

Split a concave shape into several convex shapes.

Definition at line 268 of file pointset.cpp.

Friends And Related Function Documentation

◆ CostCalculator

friend class CostCalculator
friend

Definition at line 72 of file pointset.h.

◆ FeaturePart

friend class FeaturePart
friend

Definition at line 70 of file pointset.h.

◆ LabelPosition

friend class LabelPosition
friend

Definition at line 71 of file pointset.h.

◆ Layer

friend class Layer
friend

Definition at line 74 of file pointset.h.

◆ PolygonCostCalculator

friend class PolygonCostCalculator
friend

Definition at line 73 of file pointset.h.

Member Data Documentation

◆ cHull

int* pal::PointSet::cHull = nullptr
protected

Definition at line 172 of file pointset.h.

◆ cHullSize

int pal::PointSet::cHullSize
protected

Definition at line 173 of file pointset.h.

◆ holeOf

PointSet* pal::PointSet::holeOf = nullptr
protected

Definition at line 177 of file pointset.h.

◆ mGeos

GEOSGeometry* pal::PointSet::mGeos = nullptr
mutableprotected

Definition at line 165 of file pointset.h.

◆ mOwnsGeom

bool pal::PointSet::mOwnsGeom = false
mutableprotected

Definition at line 166 of file pointset.h.

◆ nbPoints

int pal::PointSet::nbPoints
protected

Definition at line 168 of file pointset.h.

◆ parent

PointSet* pal::PointSet::parent = nullptr
protected

Definition at line 178 of file pointset.h.

◆ type

int pal::PointSet::type
protected

Definition at line 175 of file pointset.h.

◆ x

double* pal::PointSet::x = nullptr
protected

Definition at line 169 of file pointset.h.

◆ xmax

double pal::PointSet::xmax = std::numeric_limits<double>::lowest()
protected

Definition at line 190 of file pointset.h.

◆ xmin

double pal::PointSet::xmin = std::numeric_limits<double>::max()
protected

Definition at line 189 of file pointset.h.

◆ y

double* pal::PointSet::y = nullptr
protected

Definition at line 170 of file pointset.h.

◆ ymax

double pal::PointSet::ymax = std::numeric_limits<double>::lowest()
protected

Definition at line 192 of file pointset.h.

◆ ymin

double pal::PointSet::ymin = std::numeric_limits<double>::max()
protected

Definition at line 191 of file pointset.h.


The documentation for this class was generated from the following files: