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 );
210 int &orientation,
int index,
double distance,
bool &reversed,
bool &flip );
218 int createCurvedCandidatesAlongLine( QList<LabelPosition *> &lPos,
PointSet *mapShape );
226 int createCandidatesForPolygon( QList<LabelPosition *> &lPos,
PointSet *mapShape );
234 bool hasSameLabelFeatureAs(
FeaturePart *part )
const;
289 void addSizePenalty(
int nbp, QList<LabelPosition *> &lPos,
double bbx[4],
double bby[4] );
297 double calculatePriority()
const;
300 bool showUprightLabels()
const;
303 bool nextCharPosition(
double charWidth,
double segment_length,
PointSet *path_positions,
int &index,
double &distance,
304 double &start_x,
double &start_y,
double &end_x,
double &end_y )
const;
312 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...
double fixedAngle() const
Returns the fixed angle for the feature's label.
double max_char_angle_outside
QgsLabelFeature * feature()
Returns the parent feature.
bool hasFixedRotation() const
Returns true if the feature's label has a fixed rotation.
A set of features which influence the labeling process.
bool alwaysShow() const
Returns true if the feature's label should always been shown, even when it collides with other labels...
int getNumSelfObstacles() const
Get number of holes (inner rings) - they are considered as obstacles.
LabelInfo(int num, double height, double maxinangle=20.0, double maxoutangle=-20.0)
double getLabelDistance() const
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 repeatDistance() const
Returns the distance between repeating labels for this feature.
bool isObstacle() const
Returns true if the feature should act as an obstacle to labels.
Optional additional info about label (for curved labels)
double getLabelHeight() const
Main class to handle feature.
bool hasFixedPosition() const
Returns true if the feature's label has a fixed position.
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)
Get hole (inner ring) - considered as obstacle.
double getLabelWidth() const
LabelPosition is a candidate feature label position.
Quadrant
Position of label candidate relative to feature.