QGIS API Documentation  2.14.11-Essen
qgslabelingenginev2.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgslabelingenginev2.cpp
3  --------------------------------------
4  Date : September 2015
5  Copyright : (C) 2015 by Martin Dobias
6  Email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgslabelingenginev2.h"
17 
18 #include "qgslogger.h"
19 #include "qgsproject.h"
20 
21 #include "feature.h"
22 #include "labelposition.h"
23 #include "layer.h"
24 #include "pal.h"
25 #include "problem.h"
26 
27 
28 
29 // helper function for checking for job cancellation within PAL
30 static bool _palIsCancelled( void* ctx )
31 {
32  return ( reinterpret_cast< QgsRenderContext* >( ctx ) )->renderingStopped();
33 }
34 
35 // helper class for sorting labels into correct draw order
37 {
38  public:
39 
40  QgsLabelSorter( const QgsMapSettings& mapSettings )
41  : mMapSettings( mapSettings )
42  {}
43 
45  {
46  QgsLabelFeature* lf1 = lp1->getFeaturePart()->feature();
47  QgsLabelFeature* lf2 = lp2->getFeaturePart()->feature();
48 
49  if ( !qgsDoubleNear( lf1->zIndex(), lf2->zIndex() ) )
50  return lf1->zIndex() < lf2->zIndex();
51 
52  //equal z-index, so fallback to respecting layer render order
53  int layer1Pos = mMapSettings.layers().indexOf( lf1->provider()->layerId() );
54  int layer2Pos = mMapSettings.layers().indexOf( lf2->provider()->layerId() );
55  if ( layer1Pos != layer2Pos && layer1Pos >= 0 && layer2Pos >= 0 )
56  return layer1Pos > layer2Pos; //higher positions are rendered first
57 
58  //same layer, so render larger labels first
59  return lf1->size().width() * lf1->size().height() > lf2->size().width() * lf2->size().height();
60  }
61 
62  private:
63 
64  const QgsMapSettings& mMapSettings;
65 };
66 
67 
69  : mFlags( RenderOutlineLabels | UsePartialCandidates )
70  , mSearchMethod( QgsPalLabeling::Chain )
71  , mCandPoint( 8 )
72  , mCandLine( 8 )
73  , mCandPolygon( 8 )
74  , mResults( nullptr )
75 {
77 }
78 
80 {
81  delete mResults;
82  qDeleteAll( mProviders );
83  qDeleteAll( mSubProviders );
84 }
85 
87 {
88  provider->setEngine( this );
89  mProviders << provider;
90 }
91 
93 {
94  int idx = mProviders.indexOf( provider );
95  if ( idx >= 0 )
96  {
97  delete mProviders.takeAt( idx );
98  }
99 }
100 
102 {
103  QgsAbstractLabelProvider::Flags flags = provider->flags();
104 
105  // create the pal layer
106  pal::Layer* l = p.addLayer( provider,
107  provider->name(),
108  provider->placement(),
109  provider->priority(),
110  true,
111  flags.testFlag( QgsAbstractLabelProvider::DrawLabels ),
112  flags.testFlag( QgsAbstractLabelProvider::DrawAllLabels ) );
113 
114  // extra flags for placement of labels for linestrings
115  l->setArrangementFlags( static_cast< pal::LineArrangementFlags >( provider->linePlacementFlags() ) );
116 
117  // set label mode (label per feature is the default)
119 
120  // set whether adjacent lines should be merged
122 
123  // set obstacle type
124  l->setObstacleType( provider->obstacleType() );
125 
126  // set whether location of centroid must be inside of polygons
128 
129  // set how to show upside-down labels
130  pal::Layer::UpsideDownLabels upsdnlabels;
131  switch ( provider->upsidedownLabels() )
132  {
134  upsdnlabels = pal::Layer::Upright;
135  break;
137  upsdnlabels = pal::Layer::ShowDefined;
138  break;
140  upsdnlabels = pal::Layer::ShowAll;
141  break;
142  default:
143  Q_ASSERT( "unsupported upside-down label setting" && 0 );
144  return;
145  }
146  l->setUpsidedownLabels( upsdnlabels );
147 
148 
149  QList<QgsLabelFeature*> features = provider->labelFeatures( context );
150 
151  Q_FOREACH ( QgsLabelFeature* feature, features )
152  {
153  try
154  {
155  l->registerFeature( feature );
156  }
157  catch ( std::exception &e )
158  {
159  Q_UNUSED( e );
160  QgsDebugMsgLevel( QString( "Ignoring feature %1 due PAL exception:" ).arg( feature->id() ) + QString::fromLatin1( e.what() ), 4 );
161  continue;
162  }
163  }
164 
165  // any sub-providers?
166  Q_FOREACH ( QgsAbstractLabelProvider* subProvider, provider->subProviders() )
167  {
168  mSubProviders << subProvider;
169  processProvider( subProvider, context, p );
170  }
171 }
172 
173 
175 {
176  pal::Pal p;
177 
179  switch ( mSearchMethod )
180  {
181  default:
183  s = pal::CHAIN;
184  break;
186  s = pal::POPMUSIC_TABU;
187  break;
190  break;
193  break;
195  s = pal::FALP;
196  break;
197  }
198  p.setSearch( s );
199 
200  // set number of candidates generated per feature
201  p.setPointP( mCandPoint );
202  p.setLineP( mCandLine );
203  p.setPolyP( mCandPolygon );
204 
205  p.setShowPartial( mFlags.testFlag( UsePartialCandidates ) );
206 
207 
208  // for each provider: get labels and register them in PAL
209  Q_FOREACH ( QgsAbstractLabelProvider* provider, mProviders )
210  {
211  processProvider( provider, context, p );
212  }
213 
214 
215  // NOW DO THE LAYOUT (from QgsPalLabeling::drawLabeling)
216 
217  QPainter* painter = context.painter();
218 
220  if ( !qgsDoubleNear( mMapSettings.rotation(), 0.0 ) )
221  {
222  //PAL features are prerotated, so extent also needs to be unrotated
224  }
225 
226  QgsRectangle extent = extentGeom->boundingBox();
227  delete extentGeom;
228 
229  p.registerCancellationCallback( &_palIsCancelled, reinterpret_cast< void* >( &context ) );
230 
231  QTime t;
232  t.start();
233 
234  // do the labeling itself
235  double bbox[] = { extent.xMinimum(), extent.yMinimum(), extent.xMaximum(), extent.yMaximum() };
236 
238  pal::Problem *problem;
239  try
240  {
241  problem = p.extractProblem( bbox );
242  }
243  catch ( std::exception& e )
244  {
245  Q_UNUSED( e );
246  QgsDebugMsgLevel( "PAL EXCEPTION :-( " + QString::fromLatin1( e.what() ), 4 );
247  return;
248  }
249 
250 
251  if ( context.renderingStopped() )
252  {
253  delete problem;
254  return; // it has been cancelled
255  }
256 
257 #if 1 // XXX strk
258  // features are pre-rotated but not scaled/translated,
259  // so we only disable rotation here. Ideally, they'd be
260  // also pre-scaled/translated, as suggested here:
261  // http://hub.qgis.org/issues/11856
263  xform.setMapRotation( 0, 0, 0 );
264 #else
265  const QgsMapToPixel& xform = mMapSettings->mapToPixel();
266 #endif
267 
268  // draw rectangles with all candidates
269  // this is done before actual solution of the problem
270  // before number of candidates gets reduced
271  // TODO mCandidates.clear();
272  if ( mFlags.testFlag( DrawCandidates ) && problem )
273  {
274  painter->setBrush( Qt::NoBrush );
275  for ( int i = 0; i < problem->getNumFeatures(); i++ )
276  {
277  for ( int j = 0; j < problem->getFeatureCandidateCount( i ); j++ )
278  {
279  pal::LabelPosition* lp = problem->getFeatureCandidate( i, j );
280 
281  QgsPalLabeling::drawLabelCandidateRect( lp, painter, &xform );
282  }
283  }
284  }
285 
286  // find the solution
287  labels = p.solveProblem( problem, mFlags.testFlag( UseAllLabels ) );
288 
289  QgsDebugMsgLevel( QString( "LABELING work: %1 ms ... labels# %2" ).arg( t.elapsed() ).arg( labels->size() ), 4 );
290  t.restart();
291 
292  if ( context.renderingStopped() )
293  {
294  delete problem;
295  delete labels;
296  return;
297  }
298  painter->setRenderHint( QPainter::Antialiasing );
299 
300  // sort labels
301  qSort( labels->begin(), labels->end(), QgsLabelSorter( mMapSettings ) );
302 
303  // draw the labels
305  for ( ; it != labels->end(); ++it )
306  {
307  if ( context.renderingStopped() )
308  break;
309 
310  QgsLabelFeature* lf = ( *it )->getFeaturePart()->feature();
311  if ( !lf )
312  {
313  continue;
314  }
315 
316  lf->provider()->drawLabel( context, *it );
317  }
318 
319  // Reset composition mode for further drawing operations
320  painter->setCompositionMode( QPainter::CompositionMode_SourceOver );
321 
322  QgsDebugMsgLevel( QString( "LABELING draw: %1 ms" ).arg( t.elapsed() ), 4 );
323 
324  delete problem;
325  delete labels;
326 
327 
328 }
329 
331 {
333  mResults = nullptr;
334  return res;
335 }
336 
337 
339 {
340  bool saved = false;
342  mSearchMethod = static_cast< QgsPalLabeling::Search >( prj->readNumEntry( "PAL", "/SearchMethod", static_cast< int >( QgsPalLabeling::Chain ), &saved ) );
343  mCandPoint = prj->readNumEntry( "PAL", "/CandidatesPoint", 8, &saved );
344  mCandLine = prj->readNumEntry( "PAL", "/CandidatesLine", 8, &saved );
345  mCandPolygon = prj->readNumEntry( "PAL", "/CandidatesPolygon", 8, &saved );
346 
347  mFlags = nullptr;
348  if ( prj->readBoolEntry( "PAL", "/ShowingCandidates", false, &saved ) ) mFlags |= DrawCandidates;
349  if ( prj->readBoolEntry( "PAL", "/DrawRectOnly", false, &saved ) ) mFlags |= DrawLabelRectOnly;
350  if ( prj->readBoolEntry( "PAL", "/ShowingShadowRects", false, &saved ) ) mFlags |= DrawShadowRects;
351  if ( prj->readBoolEntry( "PAL", "/ShowingAllLabels", false, &saved ) ) mFlags |= UseAllLabels;
352  if ( prj->readBoolEntry( "PAL", "/ShowingPartialsLabels", true, &saved ) ) mFlags |= UsePartialCandidates;
353  if ( prj->readBoolEntry( "PAL", "/DrawOutlineLabels", true, &saved ) ) mFlags |= RenderOutlineLabels;
354 }
355 
357 {
358  QgsProject::instance()->writeEntry( "PAL", "/SearchMethod", static_cast< int >( mSearchMethod ) );
359  QgsProject::instance()->writeEntry( "PAL", "/CandidatesPoint", mCandPoint );
360  QgsProject::instance()->writeEntry( "PAL", "/CandidatesLine", mCandLine );
361  QgsProject::instance()->writeEntry( "PAL", "/CandidatesPolygon", mCandPolygon );
362 
363  QgsProject::instance()->writeEntry( "PAL", "/ShowingCandidates", mFlags.testFlag( DrawCandidates ) );
364  QgsProject::instance()->writeEntry( "PAL", "/DrawRectOnly", mFlags.testFlag( DrawLabelRectOnly ) );
365  QgsProject::instance()->writeEntry( "PAL", "/ShowingShadowRects", mFlags.testFlag( DrawShadowRects ) );
366  QgsProject::instance()->writeEntry( "PAL", "/ShowingAllLabels", mFlags.testFlag( UseAllLabels ) );
367  QgsProject::instance()->writeEntry( "PAL", "/ShowingPartialsLabels", mFlags.testFlag( UsePartialCandidates ) );
368  QgsProject::instance()->writeEntry( "PAL", "/DrawOutlineLabels", mFlags.testFlag( RenderOutlineLabels ) );
369 }
370 
371 
372 
374 
376 {
377  return mLayer ? mLayer->provider() : nullptr;
378 
379 }
380 
382  : mEngine( nullptr )
383  , mLayerId( layerId )
384  , mFlags( DrawLabels )
385  , mPlacement( QgsPalLayerSettings::AroundPoint )
386  , mLinePlacementFlags( 0 )
387  , mPriority( 0.5 )
388  , mObstacleType( QgsPalLayerSettings::PolygonInterior )
389  , mUpsidedownLabels( QgsPalLayerSettings::Upright )
390 {
391 }
392 
393 
394 //
395 // QgsLabelingUtils
396 //
397 
399 {
400  QStringList predefinedOrderString;
401  Q_FOREACH ( QgsPalLayerSettings::PredefinedPointPosition position, positions )
402  {
403  switch ( position )
404  {
406  predefinedOrderString << "TL";
407  break;
409  predefinedOrderString << "TSL";
410  break;
412  predefinedOrderString << "T";
413  break;
415  predefinedOrderString << "TSR";
416  break;
418  predefinedOrderString << "TR";
419  break;
421  predefinedOrderString << "L";
422  break;
424  predefinedOrderString << "R";
425  break;
427  predefinedOrderString << "BL";
428  break;
430  predefinedOrderString << "BSL";
431  break;
433  predefinedOrderString << "B";
434  break;
436  predefinedOrderString << "BSR";
437  break;
439  predefinedOrderString << "BR";
440  break;
441  }
442  }
443  return predefinedOrderString.join( "," );
444 }
445 
447 {
449  QStringList predefinedOrderList = positionString.split( ',' );
450  Q_FOREACH ( const QString& position, predefinedOrderList )
451  {
452  QString cleaned = position.trimmed().toUpper();
453  if ( cleaned == "TL" )
455  else if ( cleaned == "TSL" )
457  else if ( cleaned == "T" )
459  else if ( cleaned == "TSR" )
461  else if ( cleaned == "TR" )
463  else if ( cleaned == "L" )
465  else if ( cleaned == "R" )
467  else if ( cleaned == "BL" )
469  else if ( cleaned == "BSL" )
471  else if ( cleaned == "B" )
473  else if ( cleaned == "BSR" )
475  else if ( cleaned == "BR" )
477  }
478  return result;
479 }
Label below point, slightly right of center.
Layer * addLayer(QgsAbstractLabelProvider *provider, const QString &layerName, QgsPalLayerSettings::Placement arrangement, double defaultPriority, bool active, bool toLabel, bool displayAll=false)
add a new layer
Definition: pal.cpp:108
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Label on bottom-left of point.
QgsPoint center() const
Center point of the rectangle.
Definition: qgsrectangle.h:217
void processProvider(QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p)
QString toUpper() const
void setMapRotation(double degrees, double cx, double cy)
Set map rotation in degrees (clockwise)
static bool _palIsCancelled(void *ctx)
Definition: pal.h:63
QgsFeatureId id() const
Identifier of the label (unique within the parent label provider)
void setCompositionMode(CompositionMode mode)
int getFeatureCandidateCount(int i)
Definition: problem.h:121
void setRenderHint(RenderHint hint, bool on)
QgsLabelFeature * feature()
Returns the parent feature.
Definition: feature.h:109
bool readBoolEntry(const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
double rotation() const
Return the rotation of the resulting map image Units are clockwise degrees.
QgsAbstractLabelProvider * provider() const
Return provider of this instance.
Label on top-left of point.
~QgsLabelingEngineV2()
Clean up everything (especially the registered providers)
void registerCancellationCallback(FnIsCancelled fnCancelled, void *context)
Register a function that returns whether this job has been cancelled - PAL calls it during the comput...
Definition: pal.cpp:506
Whether to show debugging rectangles for drop shadows.
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
static void drawLabelCandidateRect(pal::LabelPosition *lp, QPainter *painter, const QgsMapToPixel *xform, QList< QgsLabelCandidate > *candidates=nullptr)
A set of features which influence the labelling process.
Definition: layer.h:55
PredefinedPointPosition
Positions for labels when using the QgsPalLabeling::OrderedPositionsAroundPoint placement mode...
QgsPalLayerSettings::ObstacleType obstacleType() const
How the feature geometries will work as obstacles.
void addProvider(QgsAbstractLabelProvider *provider)
Add provider of label features. Takes ownership of the provider.
bool renderingStopped() const
Main Pal labelling class.
Definition: pal.h:84
is slower and best than TABU, worse and faster than TABU_CHAIN
Definition: pal.h:62
UpsideDownLabels
Definition: layer.h:66
Label on top of point, slightly right of center.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:76
int mCandPoint
Number of candedate positions that will be generated for features.
void setUpsidedownLabels(UpsideDownLabels ud)
Sets how upside down labels will be handled within the layer.
Definition: layer.h:192
T takeAt(int i)
void setShowPartial(bool show)
Set flag show partial label.
Definition: pal.cpp:594
QString join(const QString &separator) const
whether to label each part of multi-part features separately
FeaturePart * getFeaturePart()
return the feature corresponding to this labelposition
void readSettingsFromProject()
Read configuration of the labeling engine from the current project file.
virtual QList< QgsAbstractLabelProvider * > subProviders()
Return list of child providers - useful if the provider needs to put labels into more layers with dif...
void setObstacleType(QgsPalLayerSettings::ObstacleType obstacleType)
Sets the obstacle type, which controls how features within the layer act as obstacles for labels...
Definition: layer.h:151
QgsRectangle visibleExtent() const
Return the actual extent derived from requested extent that takes takes output image size into accoun...
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Definition: qgis.h:285
int readNumEntry(const QString &scope, const QString &key, int def=0, bool *ok=nullptr) const
void setCentroidInside(bool forceInside)
Sets whether labels placed at the centroid of features within the layer are forced to be placed insid...
Definition: layer.h:205
is a little bit better than CHAIN but slower
Definition: pal.h:61
int size() const
whether adjacent lines (with the same label text) should be merged
The QgsMapSettings class contains configuration for rendering of the map.
int indexOf(const T &value, int from) const
void removeProvider(QgsAbstractLabelProvider *provider)
Remove provider if the provider&#39;s initialization failed. Provider instance is deleted.
virtual QList< QgsLabelFeature * > labelFeatures(QgsRenderContext &context)=0
Return list of label features (they are owned by the provider and thus deleted on its destruction) ...
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:34
unsigned int linePlacementFlags() const
For layers with linestring geometries - extra placement flags (or-ed combination of QgsPalLayerSettin...
bool writeEntry(const QString &scope, const QString &key, bool value)
int elapsed() const
double zIndex() const
Returns the label&#39;s z-index.
Label on left of point.
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:34
QgsMapSettings mMapSettings
Associated map settings instance.
QList< QgsAbstractLabelProvider * > mProviders
List of providers (the are owned by the labeling engine)
Whether to draw rectangles of generated candidates (good for debugging)
is the best but slowest
Definition: pal.h:60
QString trimmed() const
struct pal::_chain Chain
bool operator()(pal::LabelPosition *lp1, pal::LabelPosition *lp2) const
void setPointP(int point_p)
set # candidates to generate for points features Higher the value is, longer Pal::labeller will spend...
Definition: pal.cpp:542
whether location of centroid must be inside of polygons
QgsPalLabeling::Search mSearchMethod
search method to use for removal collisions between labels
void setBrush(const QBrush &brush)
void setLineP(int line_p)
set maximum # candidates to generate for lines features Higher the value is, longer Pal::labeller wil...
Definition: pal.cpp:548
int restart()
Reads and writes project states.
Definition: qgsproject.h:70
QgsLabelingResults * mResults
Resulting labeling layout.
void setEngine(const QgsLabelingEngineV2 *engine)
Associate provider with a labeling engine (should be only called internally from QgsLabelingEngineV2)...
whether all features will be labelled even though overlaps occur
QgsPalLayerSettings::Placement placement() const
What placement strategy to use for the labels.
QgsLabelingEngineV2()
Construct the labeling engine with default settings.
const QgsMapToPixel & mapToPixel() const
The QgsAbstractLabelProvider class is an interface class.
void setArrangementFlags(const LineArrangementFlags &flags)
Sets the layer&#39;s arrangement flags.
Definition: layer.h:108
QString layerId() const
Returns ID of associated layer, or empty string if no layer is associated with the provider...
void writeSettingsToProject()
Write configuration of the labeling engine to the current project file.
QSizeF size() const
Size of the label (in map units)
iterator end()
QgsPalLayerSettings::UpsideDownLabels upsidedownLabels() const
How to handle labels that would be upside down.
Flags flags() const
Get flags of the labeling engine.
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
Definition: qgsrectangle.h:202
QgsLabelSorter(const QgsMapSettings &mapSettings)
void run(QgsRenderContext &context)
compute the labeling with given map settings and providers
double xMaximum() const
Get the x maximum value (right side of rectangle)
Definition: qgsrectangle.h:187
Whether to draw all labels even if there would be collisions.
bool registerFeature(QgsLabelFeature *label)
Register a feature in the layer.
Definition: layer.cpp:95
Flags flags() const
Flags associated with the provider.
Whether to use also label candidates that are partially outside of the map view.
static QString encodePredefinedPositionOrder(const QVector< QgsPalLayerSettings::PredefinedPointPosition > &positions)
Encodes an ordered list of predefined point label positions to a string.
Contains information about the context of a rendering operation.
Problem * extractProblem(double bbox[4])
Definition: pal.cpp:512
QPainter * painter()
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
QString name() const
Name of the layer (for statistics, debugging etc.) - does not need to be unique.
Whether to only draw the label rect and not the actual label text (used for unit tests) ...
void setPolyP(int poly_p)
set maximum # candidates to generate for polygon features Higher the value is, longer Pal::labeller w...
Definition: pal.cpp:554
QList< LabelPosition * > * solveProblem(Problem *prob, bool displayAll)
Definition: pal.cpp:517
int getNumFeatures()
Definition: problem.h:119
int rotate(double rotation, const QgsPoint &center)
Rotate this geometry around the Z axis.
static QgsProject * instance()
access to canonical QgsProject instance
Definition: qgsproject.cpp:381
QgsRectangle boundingBox() const
Returns the bounding box of this feature.
void setLabelMode(LabelMode mode)
Sets the layer&#39;s labeling mode.
Definition: layer.h:170
QgsAbstractLabelProvider(const QString &layerId=QString())
Construct the provider with default values.
Label below point, slightly left of center.
double priority() const
Default priority of labels (may be overridden by individual labels)
static QgsGeometry * fromRect(const QgsRectangle &rect)
Creates a new geometry from a QgsRectangle.
LabelPosition is a candidate feature label position.
Definition: labelposition.h:50
double xMinimum() const
Get the x minimum value (left side of rectangle)
Definition: qgsrectangle.h:192
Label on top of point, slightly left of center.
QString fromLatin1(const char *str, int size)
Label on right of point.
Representation of a labeling problem.
Definition: problem.h:99
void start()
double yMaximum() const
Get the y maximum value (top side of rectangle)
Definition: qgsrectangle.h:197
int indexOf(const QRegExp &rx, int from) const
whether the labels should be rendered
LabelPosition * getFeatureCandidate(int fi, int ci)
Definition: problem.h:123
Class that stores computed placement from labeling engine.
static QVector< QgsPalLayerSettings::PredefinedPointPosition > decodePredefinedPositionOrder(const QString &positionString)
Decodes a string to an ordered list of predefined point label positions.
SearchMethod
Search method to use.
Definition: pal.h:57
QStringList layers() const
Get list of layer IDs for map rendering The layers are stored in the reverse order of how they are re...
virtual void drawLabel(QgsRenderContext &context, pal::LabelPosition *label) const =0
draw this label at the position determined by the labeling engine
qreal height() const
is the worst but fastest method
Definition: pal.h:59
Whether to render labels as text or outlines.
QList< QgsAbstractLabelProvider * > mSubProviders
QgsLabelingResults * takeResults()
Return pointer to recently computed results and pass the ownership of results to the caller...
iterator begin()
qreal width() const
void setSearch(SearchMethod method)
Select the search method to use.
Definition: pal.cpp:634
void setMergeConnectedLines(bool merge)
Sets whether connected lines should be merged before labeling.
Definition: layer.h:181