36 #include "qgis_core.h"
109 std::size_t maximumPointCandidates()
const;
114 std::size_t maximumLineCandidates()
const;
119 std::size_t maximumPolygonCandidates()
const;
124 std::vector<std::unique_ptr<LabelPosition> > createCandidates(
Pal *
pal );
134 std::size_t createCandidatesAroundPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
144 std::size_t createCandidatesOverPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
154 std::size_t createCandidateCenteredOverPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
162 std::unique_ptr< LabelPosition > createCandidatePointOnSurface(
PointSet *mapShape );
172 std::size_t createCandidatesAtOrderedPositionsOverPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
182 std::size_t createCandidatesAlongLine( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
bool allowOverrun,
Pal *
pal );
191 std::size_t createHorizontalCandidatesAlongLine( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
Pal *
pal );
201 std::size_t createCandidatesAlongLineNearStraightSegments( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
Pal *
pal );
213 std::size_t createCandidatesAlongLineNearMidpoint( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
double initialCost = 0.0,
Pal *
pal =
nullptr );
225 std::unique_ptr< LabelPosition > curvedPlacementAtOffset(
PointSet *mapShape,
const std::vector<double> &pathDistances,
236 std::size_t createCurvedCandidatesAlongLine( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
bool allowOverrun,
Pal *
pal );
245 std::size_t createCandidatesForPolygon( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
Pal *
pal );
253 std::size_t createCandidatesOutsidePolygon( std::vector<std::unique_ptr<LabelPosition> > &lPos,
Pal *
pal );
261 bool hasSameLabelFeatureAs(
FeaturePart *part )
const;
323 void addSizePenalty( std::vector<std::unique_ptr<LabelPosition> > &lPos,
double bbx[4],
double bby[4] );
329 double calculatePriority()
const;
332 bool onlyShowUprightLabels()
const;
338 int totalRepeats()
const;
344 void setTotalRepeats(
int repeats );
352 void extractCoords(
const GEOSGeometry *geom );
358 int mTotalRepeats = 0;
360 mutable std::size_t mCachedMaxLineCandidates = 0;
361 mutable std::size_t mCachedMaxPolygonCandidates = 0;
The QgsLabelFeature class describes a feature that should be used within the labeling engine.
Contains settings related to how the label engine treats features as obstacles.
LabelLineDirection
Controls behavior of curved text with respect to line directions.
Main class to handle feature.
bool hasFixedRotation() const
Returns true if the feature's label has a fixed rotation.
double getLabelHeight(double angle=0.0) const
Returns the height of the label, optionally taking an angle into account.
QList< FeaturePart * > mHoles
double getLabelDistance() const
Returns the distance from the anchor point to the label.
bool hasFixedPosition() const
Returns true if the feature's label has a fixed position.
double fixedAngle() const
Returns the fixed angle for the feature's label.
double repeatDistance() const
Returns the distance between repeating labels for this feature.
int getNumSelfObstacles() const
Gets number of holes (inner rings) - they are considered as obstacles.
const QgsLabelObstacleSettings & obstacleSettings() const
Returns the feature's obstacle settings.
double getLabelWidth(double angle=0.0) const
Returns the width of the label, optionally taking an angle into account.
bool alwaysShow() const
Returns true if the feature's label should always been shown, even when it collides with other labels...
PathOffset
Path offset variances used in curved placement.
FeaturePart * getSelfObstacle(int i)
Gets hole (inner ring) - considered as obstacle.
QgsLabelFeature * feature()
Returns the parent feature.
Quadrant
Position of label candidate relative to feature.
A set of features which influence the labeling process.
The underlying raw pal geometry class.
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)
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features