QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgslabelpointsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelpointsettings.h
3 --------------------------
4 Date : May 2024
5 Copyright : (C) 2024 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 QGSLABELPOINTSETTINGS_H
17#define QGSLABELPOINTSETTINGS_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
21#include "qgsmapunitscale.h"
22
23#include <QString>
24
27
40class CORE_EXPORT QgsLabelPointSettings
41{
42 Q_GADGET
43
44 public:
45
51
57 Qgis::LabelQuadrantPosition quadrant() const { return mQuadrant; }
58
65
74 QVector< Qgis::LabelPredefinedPointPosition > predefinedPositionOrder() const { return mPredefinedPositionOrder; }
75
84 void setPredefinedPositionOrder( const QVector< Qgis::LabelPredefinedPointPosition > &order ) { mPredefinedPositionOrder = order; }
85
99 double maximumDistance() const { return mMaximumDistance; }
100
114 void setMaximumDistance( double distance ) { mMaximumDistance = distance; }
115
123 Qgis::RenderUnit maximumDistanceUnit() const { return mMaximumDistanceUnit; }
124
132 void setMaximumDistanceUnit( Qgis::RenderUnit unit ) { mMaximumDistanceUnit = unit;}
133
141 QgsMapUnitScale maximumDistanceMapUnitScale() const { return mMaximumDistanceMapUnitScale; }
142
150 void setMaximumDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mMaximumDistanceMapUnitScale = scale; }
151
152 private:
153
155
156 QVector< Qgis::LabelPredefinedPointPosition > mPredefinedPositionOrder;
157
158 double mMaximumDistance = 0;
159 Qgis::RenderUnit mMaximumDistanceUnit = Qgis::RenderUnit::Millimeters;
160 QgsMapUnitScale mMaximumDistanceMapUnitScale;
161
162};
163
164#endif // QGSLABELPOINTSETTINGS_H
LabelQuadrantPosition
Label quadrant positions.
Definition qgis.h:1255
@ Over
Center middle.
Definition qgis.h:1260
RenderUnit
Rendering size units.
Definition qgis.h:5183
@ Millimeters
Millimeters.
Definition qgis.h:5184
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Contains settings related to how the label engine places and formats labels for point-like features.
void setMaximumDistance(double distance)
Sets the maximum distance which labels are allowed to be from their corresponding points.
QgsMapUnitScale maximumDistanceMapUnitScale() const
Returns the map unit scale for label maximum distance.
void setMaximumDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for label maximum distance.
double maximumDistance() const
Returns the maximum distance which labels are allowed to be from their corresponding points.
void setQuadrant(Qgis::LabelQuadrantPosition quadrant)
Sets the quadrant in which to offset labels from the point.
Qgis::LabelQuadrantPosition quadrant() const
Returns the quadrant in which to offset labels from the point.
Qgis::RenderUnit maximumDistanceUnit() const
Returns the units for label maximum distance.
void setMaximumDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for label maximum distance.
QVector< Qgis::LabelPredefinedPointPosition > predefinedPositionOrder() const
Returns the ordered list of predefined label positions for points.
void setPredefinedPositionOrder(const QVector< Qgis::LabelPredefinedPointPosition > &order)
Sets the ordered list of predefined label positions for points.
void updateDataDefinedProperties(const QgsPropertyCollection &properties, QgsExpressionContext &context)
Updates the point settings to respect any data defined properties set within the specified properties...
Struct for storing maximum and minimum scales for measurements in map units.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.