QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
34 class 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
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsLabelThinningSettings::setMinimumFeatureSize
void setMinimumFeatureSize(double size)
Sets the minimum feature size (in millimeters) for a feature to be labelled.
Definition: qgslabelthinningsettings.h:78
QgsLabelThinningSettings::setMaximumNumberLabels
void setMaximumNumberLabels(int number)
Sets the maximum number of labels which should be drawn for this layer.
Definition: qgslabelthinningsettings.h:66
QgsLabelThinningSettings::minimumFeatureSize
double minimumFeatureSize() const
Returns the minimum feature size (in millimeters) for a feature to be labelled.
Definition: qgslabelthinningsettings.h:72
qgis_sip.h
QgsLabelThinningSettings
Definition: qgslabelthinningsettings.h:34
QgsLabelThinningSettings::maximumNumberLabels
int maximumNumberLabels() const
Returns the maximum number of labels which should be drawn for this layer.
Definition: qgslabelthinningsettings.h:58
QgsLabelThinningSettings::limitNumberOfLabelsEnabled
bool limitNumberOfLabelsEnabled() const
Returns true if the number of labels drawn for the layer should be limited.
Definition: qgslabelthinningsettings.h:43
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:318
QgsLabelThinningSettings::setLimitNumberLabelsEnabled
void setLimitNumberLabelsEnabled(bool enabled)
Sets whether the the number of labels drawn for the layer should be limited.
Definition: qgslabelthinningsettings.h:50