44#include <unordered_map>
117 void removeLayer(
Layer *layer );
119 typedef bool ( *FnIsCanceled )(
void *ctx );
122 void registerCancellationCallback( FnIsCanceled fnCanceled,
void *context );
125 inline bool isCanceled() {
return fnIsCanceled ? fnIsCanceled( fnIsCanceledContext ) :
false; }
148 QList<LabelPosition *> solveProblem(
Problem *prob,
QgsRenderContext &context,
bool displayAll, QList<pal::LabelPosition *> *unlabeled =
nullptr );
155 void setShowPartialLabels(
bool show );
162 bool showPartialLabels()
const;
249 std::unordered_map< QgsAbstractLabelProvider *, std::unique_ptr< Layer > > mLayers;
261 int mEjChainDeg = 50;
263 double mCandListSize = 0.2;
265 unsigned int mNextCandidateId = 1;
266 mutable QHash< QPair< unsigned int, unsigned int >,
bool > mCandidateConflicts;
271 bool mShowPartialLabels =
true;
273 double mMaxLineCandidatesPerMapUnit = 0;
274 double mMaxPolygonCandidatesPerMapUnitSquared = 0;
276 int mGlobalCandidatesLimitPoint = 0;
277 int mGlobalCandidatesLimitLine = 0;
278 int mGlobalCandidatesLimitPolygon = 0;
283 FnIsCanceled fnIsCanceled =
nullptr;
285 void *fnIsCanceledContext =
nullptr;
291 void setPopmusicR(
int r );
297 void setMinIt(
int min_it );
303 void setMaxIt(
int max_it );
309 void setTenure(
int tenure );
315 void setEjChainDeg(
int degree );
321 void setCandListSize(
double fact );
328 int getMinIt()
const;
334 int getMaxIt()
const;
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
LabelPlacementEngineVersion
Labeling placement engine version.
The QgsAbstractLabelProvider class is an interface class.
A geometry is the spatial representation of a feature.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Main class to handle feature.
LabelPosition is a candidate feature label position.
A set of features which influence the labeling process.
double maximumLineCandidatesPerMapUnit() const
Returns the maximum number of line label candidate positions per map unit.
int globalCandidatesLimitPoint() const
Returns the global candidates limit for point features, or 0 if no global limit is in effect.
double maximumPolygonCandidatesPerMapUnitSquared() const
Returns the maximum number of polygon label candidate positions per map unit squared.
void setMaximumPolygonCandidatesPerMapUnitSquared(double candidates)
Sets the maximum number of polygon label candidates per map unit squared.
int globalCandidatesLimitLine() const
Returns the global candidates limit for line features, or 0 if no global limit is in effect.
void setMaximumLineCandidatesPerMapUnit(double candidates)
Sets the maximum number of line label candidates per map unit.
bool isCanceled()
Check whether the job has been canceled.
Pal(const Pal &other)=delete
Pal cannot be copied.
int globalCandidatesLimitPolygon() const
Returns the global candidates limit for polygon features, or 0 if no global limit is in effect.
Pal & operator=(const Pal &other)=delete
Pal cannot be copied.
Representation of a labeling problem.
SearchMethod
Search method to use.
@ FALP
Only initial solution.
@ POPMUSIC_TABU
Is a little bit better than CHAIN but slower.
@ POPMUSIC_CHAIN
Is slower and best than TABU, worse and faster than TABU_CHAIN.
@ CHAIN
Is the worst but fastest method.
@ POPMUSIC_TABU_CHAIN
Is the best but slowest.