QGIS API Documentation
2.8.2-Wien
|
Main class to handle feature. More...
#include <feature.h>
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]) |
LabelPosition * | curvedPlacementAtOffset (PointSet *path_positions, double *path_distances, int orientation, int index, double distance) |
bool | getAlwaysShow () |
Feature * | getFeature () |
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 |
Layer * | getLayer () |
return the layer that feature belongs to | |
int | getNumSelfObstacles () const |
PointSet * | getSelfObstacle (int i) |
const char * | getUID () |
get the unique id of the feature | |
PalGeometry * | getUserGeometry () |
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 () |
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) | |
int | getGeosType () const |
PointSet * | getHoleOf () |
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 | |
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 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.
|
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 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.
|
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 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
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 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
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 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
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 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.