36 #include "qgis_core.h" 63 LabelInfo(
int num,
double height,
double maxinangle = 20.0,
double maxoutangle = -20.0 )
65 max_char_angle_inside = maxinangle;
67 max_char_angle_outside = maxoutangle > 0 ? -maxoutangle : maxoutangle;
68 label_height = height;
138 int createCandidates( QList<LabelPosition *> &lPos,
const GEOSPreparedGeometry *mapBoundary,
PointSet *mapShape, RTree<LabelPosition *, double, 2, double> *candidates );
148 int createCandidatesAroundPoint(
double x,
double y, QList<LabelPosition *> &lPos,
double angle );
158 int createCandidatesOverPoint(
double x,
double y, QList<LabelPosition *> &lPos,
double angle );
168 int createCandidatesAtOrderedPositionsOverPoint(
double x,
double y, QList<LabelPosition *> &lPos,
double angle );
176 int createCandidatesAlongLine( QList<LabelPosition *> &lPos,
PointSet *mapShape );
185 int createCandidatesAlongLineNearStraightSegments( QList<LabelPosition *> &lPos,
PointSet *mapShape );
196 int createCandidatesAlongLineNearMidpoint( QList<LabelPosition *> &lPos,
PointSet *mapShape,
double initialCost = 0.0 );
209 int &orientation,
double distance,
bool &reversed,
bool &flip );
217 int createCurvedCandidatesAlongLine( QList<LabelPosition *> &lPos,
PointSet *mapShape );
225 int createCandidatesForPolygon( QList<LabelPosition *> &lPos,
PointSet *mapShape );
233 bool hasSameLabelFeatureAs(
FeaturePart *part )
const;
288 void addSizePenalty(
int nbp, QList<LabelPosition *> &lPos,
double bbx[4],
double bby[4] );
294 double calculatePriority()
const;
297 bool showUprightLabels()
const;
300 bool nextCharPosition(
double charWidth,
double segmentLength,
PointSet *path_positions,
int &index,
double ¤tDistanceAlongSegment,
301 double &characterStartX,
double &characterStartY,
double &characterEndX,
double &characterEndY )
const;
309 void extractCoords(
const GEOSGeometry *geom );
double obstacleFactor() const
Returns the feature's obstacle factor, which represents the penalty incurred for a label to overlap t...
bool hasFixedPosition() const
Returns true if the feature's label has a fixed position.
double max_char_angle_outside
QgsLabelFeature * feature()
Returns the parent feature.
double getLabelHeight() const
double fixedAngle() const
Returns the fixed angle for the feature's label.
int getNumSelfObstacles() const
Gets number of holes (inner rings) - they are considered as obstacles.
A set of features which influence the labeling process.
double getLabelWidth() const
LabelInfo(int num, double height, double maxinangle=20.0, double maxoutangle=-20.0)
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
double getLabelDistance() const
Optional additional info about label (for curved labels)
bool hasFixedRotation() const
Returns true if the feature's label has a fixed rotation.
Main class to handle feature.
bool isObstacle() const
Returns true if the feature should act as an obstacle to labels.
bool alwaysShow() const
Returns true if the feature's label should always been shown, even when it collides with other labels...
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
QList< FeaturePart * > mHoles
double max_char_angle_inside
FeaturePart * getSelfObstacle(int i)
Gets hole (inner ring) - considered as obstacle.
double repeatDistance() const
Returns the distance between repeating labels for this feature.
LabelPosition is a candidate feature label position.
Quadrant
Position of label candidate relative to feature.