QGIS API Documentation 3.41.0-Master (af5edcb665c)
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#include <QString>
23
26
37class CORE_EXPORT QgsLabelPointSettings
38{
39 Q_GADGET
40
41 public:
42
47 void updateDataDefinedProperties( const QgsPropertyCollection &properties, QgsExpressionContext &context );
48
54 Qgis::LabelQuadrantPosition quadrant() const { return mQuadrant; }
55
61 void setQuadrant( Qgis::LabelQuadrantPosition quadrant ) { mQuadrant = quadrant; }
62
71 QVector< Qgis::LabelPredefinedPointPosition > predefinedPositionOrder() const { return mPredefinedPositionOrder; }
72
81 void setPredefinedPositionOrder( const QVector< Qgis::LabelPredefinedPointPosition > &order ) { mPredefinedPositionOrder = order; }
82
96 double maximumDistance() const { return mMaximumDistance; }
97
111 void setMaximumDistance( double distance ) { mMaximumDistance = distance; }
112
120 Qgis::RenderUnit maximumDistanceUnit() const { return mMaximumDistanceUnit; }
121
129 void setMaximumDistanceUnit( Qgis::RenderUnit unit ) { mMaximumDistanceUnit = unit;}
130
138 QgsMapUnitScale maximumDistanceMapUnitScale() const { return mMaximumDistanceMapUnitScale; }
139
147 void setMaximumDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mMaximumDistanceMapUnitScale = scale; }
148
149 private:
150
152
153 QVector< Qgis::LabelPredefinedPointPosition > mPredefinedPositionOrder;
154
155 double mMaximumDistance = 0;
156 Qgis::RenderUnit mMaximumDistanceUnit = Qgis::RenderUnit::Millimeters;
157 QgsMapUnitScale mMaximumDistanceMapUnitScale;
158
159};
160
161#endif // QGSLABELPOINTSETTINGS_H
LabelQuadrantPosition
Label quadrant positions.
Definition qgis.h:1186
RenderUnit
Rendering size units.
Definition qgis.h:4910
@ Millimeters
Millimeters.
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 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.
Struct for storing maximum and minimum scales for measurements in map units.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.