QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pal::FeaturePart Class Reference

Main class to handle feature. More...

#include <feature.h>

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

Public Member Functions

 FeaturePart (Feature *feat, const GEOSGeometry *geom)
 create a new generic feature
virtual ~FeaturePart ()
 Delete the feature.
void addSizePenalty (int nbp, LabelPosition **lPos, double bbx[4], double bby[4])
LabelPositioncurvedPlacementAtOffset (PointSet *path_positions, double *path_distances, int orientation, int index, double distance)
bool getAlwaysShow ()
FeaturegetFeature ()
 return the feature
bool getFixedPosition ()
bool getFixedRotation ()
const GEOSGeometry * getGeometry () const
 return the geometry
double getLabelAngle ()
double getLabelDistance () const
double getLabelHeight () const
double getLabelWidth () const
LayergetLayer ()
 return the layer that feature belongs to
int getNumSelfObstacles () const
PointSetgetSelfObstacle (int i)
const char * getUID ()
 get the unique id of the feature
PalGeometrygetUserGeometry ()
bool isConnected (FeaturePart *p2)
 check whether this part is connected with some other part
bool mergeWithFeaturePart (FeaturePart *other)
 merge other (connected) part with this one and save the result in this part (other is unchanged).
void print ()
 Print feature information Print feature unique id, geometry type, points, and holes on screen.
void setLabelDistance (double dist)
void setLabelInfo (LabelInfo *info)
void setLabelSize (double lx, double ly)
int setPosition (double scale, LabelPosition ***lPos, double bbox_min[2], double bbox_max[2], PointSet *mapShape, RTree< LabelPosition *, double, 2, double > *candidates)
 generic method to generate candidates This method will call either setPositionFromPoint(), setPositionFromLine or setPositionFromPolygon
int setPositionForLine (double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width)
 generate candidates for line feature Generate candidates for line features
int setPositionForLineCurved (LabelPosition ***lPos, PointSet *mapShape)
 Generate curved candidates for line features.
int setPositionForPoint (double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle)
 generate candidates for point feature Generate candidates for point features
int setPositionForPolygon (double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width)
 generate candidates for point feature Generate candidates for point features
int setPositionOverPoint (double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle)
 generate one candidate over specified point
- Public Member Functions inherited from pal::PointSet
 PointSet ()
 PointSet (int nbPoints, double *x, double *y)
virtual ~PointSet ()
CHullBoxcompute_chull_bbox ()
PointSetcreateProblemSpecificPointSet (double bbmin[2], double bbmax[2], bool *inside)
PointSetextractShape (int nbPtSh, int imin, int imax, int fps, int fpe, double fptx, double fpty)
void getBoundingBox (double min[2], double max[2]) const
void getCentroid (double &px, double &py, bool forceInside=false)
double getDist (double px, double py, double *rx, double *ry)
 return the minimum distance bw this and the point (px,py)
int getGeosType () const
PointSetgetHoleOf ()
 returns NULL if this isn't a hole.
int getNumPoints () const
void getPoint (double *d, double *ad, double dl, double *px, double *py)

Protected Member Functions

void extractCoords (const GEOSGeometry *geom)
 read coordinates from a GEOS geom
void removeDuplicatePoints ()
 find duplicate (or nearly duplicate points) and remove them.
- Protected Member Functions inherited from pal::PointSet
 PointSet (double x, double y)
 PointSet (PointSet &ps)
void deleteCoords ()

Protected Attributes

Featuref
PointSet ** holes
int nbHoles
bool ownsGeom
GEOSGeometry * the_geom
- Protected Attributes inherited from pal::PointSet
int * cHull
int cHullSize
PointSetholeOf
int nbPoints
PointSetparent
int type
double * x
double xmax
double xmin
double * y
double ymax
double ymin

Additional Inherited Members

- Static Public Member Functions inherited from pal::PointSet
static void splitPolygons (LinkedList< PointSet * > *shapes_toProcess, LinkedList< PointSet * > *shapes_final, double xrm, double yrm, char *uid)

Detailed Description

Main class to handle feature.

Definition at line 138 of file feature.h.

Constructor & Destructor Documentation

pal::FeaturePart::FeaturePart ( Feature feat,
const GEOSGeometry *  geom 
)

create a new generic feature

Parameters
feata pointer for a Feat which contains the spatial entites
geoma pointer to a GEOS geometry

Definition at line 98 of file feature.cpp.

pal::FeaturePart::~FeaturePart ( )
virtual

Delete the feature.

Definition at line 115 of file feature.cpp.

Member Function Documentation

void pal::FeaturePart::addSizePenalty ( int  nbp,
LabelPosition **  lPos,
double  bbx[4],
double  bby[4] 
)

Definition at line 1408 of file feature.cpp.

LabelPosition * pal::FeaturePart::curvedPlacementAtOffset ( PointSet path_positions,
double *  path_distances,
int  orientation,
int  index,
double  distance 
)

Definition at line 727 of file feature.cpp.

void pal::FeaturePart::extractCoords ( const GEOSGeometry *  geom)
protected

read coordinates from a GEOS geom

Definition at line 138 of file feature.cpp.

bool pal::FeaturePart::getAlwaysShow ( )
inline

Definition at line 310 of file feature.h.

Feature* pal::FeaturePart::getFeature ( )
inline

return the feature

Returns
the feature

Definition at line 244 of file feature.h.

bool pal::FeaturePart::getFixedPosition ( )
inline

Definition at line 309 of file feature.h.

bool pal::FeaturePart::getFixedRotation ( )
inline

Definition at line 307 of file feature.h.

const GEOSGeometry* pal::FeaturePart::getGeometry ( ) const
inline

return the geometry

Returns
the geometry

Definition at line 250 of file feature.h.

double pal::FeaturePart::getLabelAngle ( )
inline

Definition at line 308 of file feature.h.

double pal::FeaturePart::getLabelDistance ( ) const
inline

Definition at line 304 of file feature.h.

double pal::FeaturePart::getLabelHeight ( ) const
inline

Definition at line 302 of file feature.h.

double pal::FeaturePart::getLabelWidth ( ) const
inline

Definition at line 301 of file feature.h.

Layer * pal::FeaturePart::getLayer ( )

return the layer that feature belongs to

Returns
the layer of the feature

Definition at line 267 of file feature.cpp.

int pal::FeaturePart::getNumSelfObstacles ( ) const
inline

Definition at line 312 of file feature.h.

PointSet* pal::FeaturePart::getSelfObstacle ( int  i)
inline

Definition at line 313 of file feature.h.

const char * pal::FeaturePart::getUID ( )

get the unique id of the feature

Returns
the feature unique identifier

Definition at line 273 of file feature.cpp.

PalGeometry* pal::FeaturePart::getUserGeometry ( )
inline

Definition at line 298 of file feature.h.

bool pal::FeaturePart::isConnected ( FeaturePart p2)

check whether this part is connected with some other part

Definition at line 1448 of file feature.cpp.

bool pal::FeaturePart::mergeWithFeaturePart ( FeaturePart other)

merge other (connected) part with this one and save the result in this part (other is unchanged).

Return true on success, false if the feature wasn't modified

Definition at line 1453 of file feature.cpp.

void pal::FeaturePart::print ( )

Print feature information Print feature unique id, geometry type, points, and holes on screen.

Definition at line 1285 of file feature.cpp.

void pal::FeaturePart::removeDuplicatePoints ( )
protected

find duplicate (or nearly duplicate points) and remove them.

Probably to avoid numerical errors in geometry algorithms.

Definition at line 220 of file feature.cpp.

void pal::FeaturePart::setLabelDistance ( double  dist)
inline

Definition at line 303 of file feature.h.

void pal::FeaturePart::setLabelInfo ( LabelInfo info)
inline

Definition at line 305 of file feature.h.

void pal::FeaturePart::setLabelSize ( double  lx,
double  ly 
)
inline

Definition at line 300 of file feature.h.

int pal::FeaturePart::setPosition ( double  scale,
LabelPosition ***  lPos,
double  bbox_min[2],
double  bbox_max[2],
PointSet mapShape,
RTree< LabelPosition *, double, 2, double > *  candidates 
)

generic method to generate candidates This method will call either setPositionFromPoint(), setPositionFromLine or setPositionFromPolygon

Parameters
scalethe map scale is 1:scale
lPospointer to candidates array in which candidates will be put
bbox_minmin values of the map extent
bbox_maxmax values of the map extent
mapShapegenerate candidates for this spatial entites
candidatesindex for candidates
Returns
the number of candidates in *lPos

Definition at line 1308 of file feature.cpp.

int pal::FeaturePart::setPositionForLine ( double  scale,
LabelPosition ***  lPos,
PointSet mapShape,
double  delta_width 
)

generate candidates for line feature Generate candidates for line features

Parameters
scalemap scale is 1:scale
lPospointer to an array of candidates, will be filled by generated candidates
mapShapea pointer to the line
delta_widthdelta width
Returns
the number of generated cadidates

Definition at line 523 of file feature.cpp.

int pal::FeaturePart::setPositionForLineCurved ( LabelPosition ***  lPos,
PointSet mapShape 
)

Generate curved candidates for line features.

Definition at line 931 of file feature.cpp.

int pal::FeaturePart::setPositionForPoint ( double  x,
double  y,
double  scale,
LabelPosition ***  lPos,
double  delta_width,
double  angle 
)

generate candidates for point feature Generate candidates for point features

Parameters
xx coordinates of the point
yy coordinates of the point
scalemap scale is 1:scale
lPospointer to an array of candidates, will be filled by generated candidates
delta_widthdelta width
angleorientation of the label
Returns
the number of generated cadidates

Definition at line 356 of file feature.cpp.

int pal::FeaturePart::setPositionForPolygon ( double  scale,
LabelPosition ***  lPos,
PointSet mapShape,
double  delta_width 
)

generate candidates for point feature Generate candidates for point features

Parameters
scalemap scale is 1:scale
lPospointer to an array of candidates, will be filled by generated candidates
mapShapea pointer to the polygon
delta_widthdelta width
Returns
the number of generated cadidates

Definition at line 1048 of file feature.cpp.

int pal::FeaturePart::setPositionOverPoint ( double  x,
double  y,
double  scale,
LabelPosition ***  lPos,
double  delta_width,
double  angle 
)

generate one candidate over specified point

Definition at line 278 of file feature.cpp.

Member Data Documentation

Feature* pal::FeaturePart::f
protected

Definition at line 142 of file feature.h.

PointSet** pal::FeaturePart::holes
protected

Definition at line 145 of file feature.h.

int pal::FeaturePart::nbHoles
protected

Definition at line 144 of file feature.h.

bool pal::FeaturePart::ownsGeom
protected

Definition at line 148 of file feature.h.

GEOSGeometry* pal::FeaturePart::the_geom
protected

Definition at line 147 of file feature.h.


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