QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgslabelthinningsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelthinningsettings.h
3 --------------------------
4 Date : December 2019
5 Copyright : (C) 2019 by Nyall Dawson
6 Email : nyall dot dawson 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#ifndef QGSLABELTHINNINGSETTINGS_H
17#define QGSLABELTHINNINGSETTINGS_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
21
24
34class CORE_EXPORT QgsLabelThinningSettings
35{
36 public:
37
43 bool limitNumberOfLabelsEnabled() const { return mLimitNumLabels; }
44
50 void setLimitNumberLabelsEnabled( bool enabled ) { mLimitNumLabels = enabled; }
51
58 int maximumNumberLabels() const { return mMaxNumLabels; }
59
66 void setMaximumNumberLabels( int number ) { mMaxNumLabels = number; }
67
72 double minimumFeatureSize() const { return mMinFeatureSize; }
73
78 void setMinimumFeatureSize( double size ) { mMinFeatureSize = size; }
79
84 void updateDataDefinedProperties( const QgsPropertyCollection &properties, QgsExpressionContext &context );
85
86 private:
87
88 bool mLimitNumLabels = false;
89 int mMaxNumLabels = 2000;
90 double mMinFeatureSize = 0;
91};
92
93#endif // QGSLABELTHINNINGSETTINGS_H
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Contains settings related to how the label engine removes candidate label positions and reduces the n...
void setMaximumNumberLabels(int number)
Sets the maximum number of labels which should be drawn for this layer.
double minimumFeatureSize() const
Returns the minimum feature size (in millimeters) for a feature to be labelled.
int maximumNumberLabels() const
Returns the maximum number of labels which should be drawn for this layer.
void setLimitNumberLabelsEnabled(bool enabled)
Sets whether the the number of labels drawn for the layer should be limited.
bool limitNumberOfLabelsEnabled() const
Returns true if the number of labels drawn for the layer should be limited.
void setMinimumFeatureSize(double size)
Sets the minimum feature size (in millimeters) for a feature to be labelled.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.