36 #include "qgis_core.h"
62 LabelInfo(
int num,
double height,
double maxinangle = 20.0,
double maxoutangle = -20.0 )
64 max_char_angle_inside = maxinangle;
66 max_char_angle_outside = maxoutangle > 0 ? -maxoutangle : maxoutangle;
67 label_height = height;
132 std::size_t maximumPointCandidates()
const;
137 std::size_t maximumLineCandidates()
const;
142 std::size_t maximumPolygonCandidates()
const;
147 std::vector<std::unique_ptr<LabelPosition> > createCandidates(
Pal *
pal );
157 std::size_t createCandidatesAroundPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
167 std::size_t createCandidatesOverPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
177 std::size_t createCandidateCenteredOverPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
185 std::unique_ptr< LabelPosition > createCandidatePointOnSurface(
PointSet *mapShape );
195 std::size_t createCandidatesAtOrderedPositionsOverPoint(
double x,
double y, std::vector<std::unique_ptr<LabelPosition> > &lPos,
double angle );
205 std::size_t createCandidatesAlongLine( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
bool allowOverrun,
Pal *
pal );
214 std::size_t createHorizontalCandidatesAlongLine( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
Pal *
pal );
224 std::size_t createCandidatesAlongLineNearStraightSegments( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
Pal *
pal );
236 std::size_t createCandidatesAlongLineNearMidpoint( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
double initialCost = 0.0,
Pal *
pal =
nullptr );
249 std::unique_ptr< LabelPosition > curvedPlacementAtOffset(
PointSet *path_positions,
double *path_distances,
250 int &orientation,
double distance,
bool &reversed,
bool &flip,
bool applyAngleConstraints );
260 std::size_t createCurvedCandidatesAlongLine( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
bool allowOverrun,
Pal *
pal );
269 std::size_t createCandidatesForPolygon( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
Pal *
pal );
277 std::size_t createCandidatesOutsidePolygon( std::vector<std::unique_ptr<LabelPosition> > &lPos,
Pal *
pal );
285 bool hasSameLabelFeatureAs(
FeaturePart *part )
const;
347 void addSizePenalty( std::vector<std::unique_ptr<LabelPosition> > &lPos,
double bbx[4],
double bby[4] );
353 double calculatePriority()
const;
356 bool showUprightLabels()
const;
359 bool nextCharPosition(
double charWidth,
double segmentLength,
PointSet *path_positions,
int &index,
double ¤tDistanceAlongSegment,
360 double &characterStartX,
double &characterStartY,
double &characterEndX,
double &characterEndY )
const;
366 int totalRepeats()
const;
372 void setTotalRepeats(
int repeats );
380 void extractCoords(
const GEOSGeometry *geom );
386 int mTotalRepeats = 0;
388 mutable std::size_t mCachedMaxLineCandidates = 0;
389 mutable std::size_t mCachedMaxPolygonCandidates = 0;