QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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. More...
 
int getNumPoints () const
 
void getPointByDistance (double *d, double *ad, double dl, double *px, double *py)
 Get a point a set distance along a line geometry. More...
 
double length () const
 Returns length of line geometry. More...
 
double minDistanceToPoint (double px, double py, double *rx=0, double *ry=0) 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, const QString &uid)
 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
 
int cHullSize
 
PointSetholeOf
 
GEOSGeometry * mGeos
 
bool mOwnsGeom
 
int nbPoints
 
PointSetparent
 
int type
 
double * x
 
double xmax
 
double xmin
 
double * y
 
double ymax
 
double ymin
 

Friends

class CostCalculator
 
class FeaturePart
 
class LabelPosition
 
class Layer
 
class PolygonCostCalculator
 

Detailed Description

Definition at line 61 of file pointset.h.

Constructor & Destructor Documentation

pal::PointSet::PointSet ( )

Definition at line 48 of file pointset.cpp.

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

Definition at line 66 of file pointset.cpp.

pal::PointSet::~PointSet ( )
virtual

Definition at line 223 of file pointset.cpp.

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

Definition at line 92 of file pointset.cpp.

pal::PointSet::PointSet ( const PointSet ps)
protected

Definition at line 114 of file pointset.cpp.

Member Function Documentation

CHullBox * pal::PointSet::compute_chull_bbox ( )

Definition at line 729 of file pointset.cpp.

bool pal::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 317 of file pointset.cpp.

bool pal::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 295 of file pointset.cpp.

void pal::PointSet::createGeosGeom ( ) const
protected

Definition at line 158 of file pointset.cpp.

void pal::PointSet::deleteCoords ( )
protected

Definition at line 240 of file pointset.cpp.

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

Definition at line 250 of file pointset.cpp.

const GEOSGeometry * pal::PointSet::geos ( ) const

Returns the point set's GEOS geometry.

Definition at line 1025 of file pointset.cpp.

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

Definition at line 115 of file pointset.h.

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

Definition at line 944 of file pointset.cpp.

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

Definition at line 113 of file pointset.h.

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

Returns NULL if this isn't a hole.

Otherwise returns pointer to parent pointset.

Definition at line 122 of file pointset.h.

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

Definition at line 124 of file pointset.h.

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

Get 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 986 of file pointset.cpp.

void pal::PointSet::invalidateGeos ( )
protected

Definition at line 212 of file pointset.cpp.

double pal::PointSet::length ( ) const

Returns length of line geometry.

Definition at line 1033 of file pointset.cpp.

double pal::PointSet::minDistanceToPoint ( double  px,
double  py,
double *  rx = 0,
double *  ry = 0 
) 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 896 of file pointset.cpp.

const GEOSPreparedGeometry * pal::PointSet::preparedGeom ( ) const
protected

Definition at line 200 of file pointset.cpp.

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

Split a concave shape into several convex shapes.

Definition at line 365 of file pointset.cpp.

Friends And Related Function Documentation

friend class CostCalculator
friend

Definition at line 65 of file pointset.h.

friend class FeaturePart
friend

Definition at line 63 of file pointset.h.

friend class LabelPosition
friend

Definition at line 64 of file pointset.h.

friend class Layer
friend

Definition at line 67 of file pointset.h.

friend class PolygonCostCalculator
friend

Definition at line 66 of file pointset.h.

Member Data Documentation

int* pal::PointSet::cHull
protected

Definition at line 151 of file pointset.h.

int pal::PointSet::cHullSize
protected

Definition at line 152 of file pointset.h.

PointSet* pal::PointSet::holeOf
protected

Definition at line 156 of file pointset.h.

GEOSGeometry* pal::PointSet::mGeos
mutableprotected

Definition at line 144 of file pointset.h.

bool pal::PointSet::mOwnsGeom
mutableprotected

Definition at line 145 of file pointset.h.

int pal::PointSet::nbPoints
protected

Definition at line 147 of file pointset.h.

PointSet* pal::PointSet::parent
protected

Definition at line 157 of file pointset.h.

int pal::PointSet::type
protected

Definition at line 154 of file pointset.h.

double* pal::PointSet::x
protected

Definition at line 148 of file pointset.h.

double pal::PointSet::xmax
protected

Definition at line 169 of file pointset.h.

double pal::PointSet::xmin
protected

Definition at line 168 of file pointset.h.

double* pal::PointSet::y
protected

Definition at line 149 of file pointset.h.

double pal::PointSet::ymax
protected

Definition at line 171 of file pointset.h.

double pal::PointSet::ymin
protected

Definition at line 170 of file pointset.h.


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