QGIS API Documentation
2.10.1-Pisa
|
Main class to handle feature. More...
#include <feature.h>
Public Member Functions | |
FeaturePart (Feature *feat, const GEOSGeometry *geom) | |
create a new generic feature More... | |
virtual | ~FeaturePart () |
Delete the feature. More... | |
void | addSizePenalty (int nbp, LabelPosition **lPos, double bbx[4], double bby[4]) |
LabelPosition * | curvedPlacementAtOffset (PointSet *path_positions, double *path_distances, int orientation, int index, double distance) |
bool | getAlwaysShow () |
Feature * | getFeature () |
return the feature More... | |
bool | getFixedPosition () |
bool | getFixedRotation () |
const GEOSGeometry * | getGeometry () const |
return the geometry More... | |
double | getLabelAngle () |
double | getLabelDistance () const |
double | getLabelHeight () const |
double | getLabelWidth () const |
Layer * | getLayer () |
return the layer that feature belongs to More... | |
int | getNumSelfObstacles () const |
PointSet * | getSelfObstacle (int i) |
const char * | getUID () |
get the unique id of the feature More... | |
PalGeometry * | getUserGeometry () |
bool | isConnected (FeaturePart *p2) |
check whether this part is connected with some other part More... | |
bool | mergeWithFeaturePart (FeaturePart *other) |
merge other (connected) part with this one and save the result in this part (other is unchanged). More... | |
void | print () |
Print feature information Print feature unique id, geometry type, points, and holes on screen. More... | |
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 More... | |
int | setPositionForLine (double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width) |
generate candidates for line feature Generate candidates for line features More... | |
int | setPositionForLineCurved (LabelPosition ***lPos, PointSet *mapShape) |
Generate curved candidates for line features. More... | |
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 More... | |
int | setPositionForPolygon (double scale, LabelPosition ***lPos, PointSet *mapShape, double delta_width) |
generate candidates for point feature Generate candidates for point features More... | |
int | setPositionOverPoint (double x, double y, double scale, LabelPosition ***lPos, double delta_width, double angle) |
generate one candidate over specified point More... | |
Public Member Functions inherited from pal::PointSet | |
PointSet () | |
PointSet (int nbPoints, double *x, double *y) | |
virtual | ~PointSet () |
CHullBox * | compute_chull_bbox () |
PointSet * | createProblemSpecificPointSet (double bbmin[2], double bbmax[2], bool *inside) |
PointSet * | extractShape (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) More... | |
int | getGeosType () const |
PointSet * | getHoleOf () |
returns NULL if this isn't a hole. More... | |
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 More... | |
void | removeDuplicatePoints () |
find duplicate (or nearly duplicate points) and remove them. More... | |
Protected Member Functions inherited from pal::PointSet | |
PointSet (double x, double y) | |
PointSet (PointSet &ps) | |
void | deleteCoords () |
Protected Attributes | |
Feature * | f |
PointSet ** | holes |
int | nbHoles |
bool | ownsGeom |
GEOSGeometry * | the_geom |
Protected Attributes inherited from pal::PointSet | |
int * | cHull |
int | cHullSize |
PointSet * | holeOf |
int | nbPoints |
PointSet * | parent |
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) |
pal::FeaturePart::FeaturePart | ( | Feature * | feat, |
const GEOSGeometry * | geom | ||
) |
create a new generic feature
feat | a pointer for a Feat which contains the spatial entites |
geom | a pointer to a GEOS geometry |
Definition at line 98 of file feature.cpp.
|
virtual |
Delete the feature.
Definition at line 115 of file feature.cpp.
void pal::FeaturePart::addSizePenalty | ( | int | nbp, |
LabelPosition ** | lPos, | ||
double | bbx[4], | ||
double | bby[4] | ||
) |
Definition at line 1449 of file feature.cpp.
LabelPosition * pal::FeaturePart::curvedPlacementAtOffset | ( | PointSet * | path_positions, |
double * | path_distances, | ||
int | orientation, | ||
int | index, | ||
double | distance | ||
) |
Definition at line 768 of file feature.cpp.
|
protected |
read coordinates from a GEOS geom
Definition at line 138 of file feature.cpp.
|
inline |
|
inline |
|
inline |
Layer * pal::FeaturePart::getLayer | ( | ) |
return the layer that feature belongs to
Definition at line 267 of file feature.cpp.
|
inline |
|
inline |
const char * pal::FeaturePart::getUID | ( | ) |
get the unique id of the feature
Definition at line 273 of file feature.cpp.
|
inline |
bool pal::FeaturePart::isConnected | ( | FeaturePart * | p2 | ) |
check whether this part is connected with some other part
Definition at line 1489 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 1494 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 1326 of file feature.cpp.
|
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.
|
inline |
|
inline |
|
inline |
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
scale | the map scale is 1:scale |
lPos | pointer to candidates array in which candidates will be put |
bbox_min | min values of the map extent |
bbox_max | max values of the map extent |
mapShape | generate candidates for this spatial entites |
candidates | index for candidates |
Definition at line 1349 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
scale | map scale is 1:scale |
lPos | pointer to an array of candidates, will be filled by generated candidates |
mapShape | a pointer to the line |
delta_width | delta width |
Definition at line 564 of file feature.cpp.
int pal::FeaturePart::setPositionForLineCurved | ( | LabelPosition *** | lPos, |
PointSet * | mapShape | ||
) |
Generate curved candidates for line features.
Definition at line 972 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
x | x coordinates of the point |
y | y coordinates of the point |
scale | map scale is 1:scale |
lPos | pointer to an array of candidates, will be filled by generated candidates |
delta_width | delta width |
angle | orientation of the label |
Definition at line 386 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
scale | map scale is 1:scale |
lPos | pointer to an array of candidates, will be filled by generated candidates |
mapShape | a pointer to the polygon |
delta_width | delta width |
Definition at line 1089 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 327 of file feature.cpp.