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 );
248 std::unique_ptr< LabelPosition > curvedPlacementAtOffset(
PointSet *path_positions,
double *path_distances,
249 int &orientation,
double distance,
bool &reversed,
bool &flip );
259 std::size_t createCurvedCandidatesAlongLine( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
bool allowOverrun,
Pal *
pal );
268 std::size_t createCandidatesForPolygon( std::vector<std::unique_ptr<LabelPosition> > &lPos,
PointSet *mapShape,
Pal *
pal );
276 std::size_t createCandidatesOutsidePolygon( std::vector<std::unique_ptr<LabelPosition> > &lPos,
Pal *
pal );
284 bool hasSameLabelFeatureAs(
FeaturePart *part )
const;
345 void addSizePenalty( std::vector<std::unique_ptr<LabelPosition> > &lPos,
double bbx[4],
double bby[4] );
351 double calculatePriority()
const;
354 bool showUprightLabels()
const;
357 bool nextCharPosition(
double charWidth,
double segmentLength,
PointSet *path_positions,
int &index,
double ¤tDistanceAlongSegment,
358 double &characterStartX,
double &characterStartY,
double &characterEndX,
double &characterEndY )
const;
364 int totalRepeats()
const;
370 void setTotalRepeats(
int repeats );
378 void extractCoords(
const GEOSGeometry *geom );
384 int mTotalRepeats = 0;
386 mutable std::size_t mCachedMaxLineCandidates = 0;
387 mutable std::size_t mCachedMaxPolygonCandidates = 0;