QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
36 #include "qgis_core.h"
44 #include <QStringList>
45 #include <unordered_map>
95 Pal(
const Pal &other ) =
delete;
97 Pal &operator=(
const Pal &other ) =
delete;
118 void removeLayer(
Layer *layer );
120 typedef bool ( *FnIsCanceled )(
void *ctx );
123 void registerCancellationCallback( FnIsCanceled fnCanceled,
void *context );
126 inline bool isCanceled() {
return fnIsCanceled ? fnIsCanceled( fnIsCanceledContext ) :
false; }
149 QList<LabelPosition *> solveProblem(
Problem *prob,
QgsRenderContext &context,
bool displayAll, QList<pal::LabelPosition *> *unlabeled =
nullptr );
156 void setShowPartialLabels(
bool show );
163 bool showPartialLabels()
const;
250 std::unordered_map< QgsAbstractLabelProvider *, std::unique_ptr< Layer > > mLayers;
262 int mEjChainDeg = 50;
264 double mCandListSize = 0.2;
266 unsigned int mNextCandidateId = 1;
267 mutable QHash< QPair< unsigned int, unsigned int >,
bool > mCandidateConflicts;
272 bool mShowPartialLabels =
true;
274 double mMaxLineCandidatesPerMapUnit = 0;
275 double mMaxPolygonCandidatesPerMapUnitSquared = 0;
277 int mGlobalCandidatesLimitPoint = 0;
278 int mGlobalCandidatesLimitLine = 0;
279 int mGlobalCandidatesLimitPolygon = 0;
284 FnIsCanceled fnIsCanceled =
nullptr;
286 void *fnIsCanceledContext =
nullptr;
292 void setPopmusicR(
int r );
298 void setMinIt(
int min_it );
304 void setMaxIt(
int max_it );
310 void setTenure(
int tenure );
316 void setEjChainDeg(
int degree );
322 void setCandListSize(
double fact );
329 int getMinIt()
const;
335 int getMaxIt()
const;
bool isCanceled()
Check whether the job has been canceled.
@ POPMUSIC_TABU_CHAIN
Is the best but slowest.
double maximumPolygonCandidatesPerMapUnitSquared() const
Returns the maximum number of polygon label candidate positions per map unit squared.
void setMaximumLineCandidatesPerMapUnit(double candidates)
Sets the maximum number of line label candidates per map unit.
LabelPosition is a candidate feature label position.
Contains information about the context of a rendering operation.
int globalCandidatesLimitLine() const
Returns the global candidates limit for line features, or 0 if no global limit is in effect.
double maximumLineCandidatesPerMapUnit() const
Returns the maximum number of line label candidate positions per map unit.
Representation of a labeling problem.
A rectangle specified with double values.
PlacementEngineVersion
Placement engine version.
SearchMethod
Search method to use.
The QgsAbstractLabelProvider class is an interface class. Implementations return list of labels and t...
@ CHAIN
Is the worst but fastest method.
void setMaximumPolygonCandidatesPerMapUnitSquared(double candidates)
Sets the maximum number of polygon label candidates per map unit squared.
Main class to handle feature.
@ FALP
Only initial solution.
@ POPMUSIC_CHAIN
Is slower and best than TABU, worse and faster than TABU_CHAIN.
A geometry is the spatial representation of a feature.
A set of features which influence the labeling process.
@ PlacementEngineVersion2
Version 2 (default for new projects since QGIS 3.12)
@ POPMUSIC_TABU
Is a little bit better than CHAIN but slower.
int globalCandidatesLimitPolygon() const
Returns the global candidates limit for polygon features, or 0 if no global limit is in effect.
int globalCandidatesLimitPoint() const
Returns the global candidates limit for point features, or 0 if no global limit is in effect.
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.