QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgscallout.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscallout.h
3 ----------------
4 begin : July 2019
5 copyright : (C) 2019 Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSCALLOUT_H
18#define QGSCALLOUT_H
19
20#include "qgis_core.h"
21#include "qgis_sip.h"
22#include "qgis.h"
23#include "qgsreadwritecontext.h"
25#include "qgsmapunitscale.h"
26#include "qgscalloutposition.h"
27#include "qgsmargins.h"
29
30#include <QPainter>
31#include <QString>
32#include <QRectF>
33#include <memory>
34
35class QgsLineSymbol;
36class QgsMarkerSymbol;
37class QgsFillSymbol;
38class QgsGeometry;
40
41class QgsCalloutWidget; //stop sip breaking
42
53class CORE_EXPORT QgsCallout
54{
55
56#ifdef SIP_RUN
58 if ( sipCpp->type() == "simple" && dynamic_cast<QgsSimpleLineCallout *>( sipCpp ) != NULL )
59 {
60 sipType = sipType_QgsSimpleLineCallout;
61 }
62 else if ( sipCpp->type() == "manhattan" && dynamic_cast<QgsManhattanLineCallout *>( sipCpp ) != NULL )
63 {
64 sipType = sipType_QgsManhattanLineCallout;
65 }
66 else if ( sipCpp->type() == "curved" && dynamic_cast<QgsCurvedLineCallout *>( sipCpp ) != NULL )
67 {
68 sipType = sipType_QgsCurvedLineCallout;
69 }
70 else if ( sipCpp->type() == "balloon" && dynamic_cast<QgsBalloonCallout *>( sipCpp ) != NULL )
71 {
72 sipType = sipType_QgsBalloonCallout;
73 }
74 else
75 {
76 sipType = 0;
77 }
79#endif
80
81 public:
82
83 // *INDENT-OFF*
86 {
87 MinimumCalloutLength,
88 OffsetFromAnchor,
89 OffsetFromLabel,
90 DrawCalloutToAllParts,
91 AnchorPointPosition,
92 LabelAnchorPointPosition,
93 OriginX,
94 OriginY,
95 DestinationX,
96 DestinationY,
97 Curvature,
98 Orientation,
99 Margins,
100 WedgeWidth,
101 CornerRadius,
102 BlendMode,
103 };
104 // *INDENT-ON*
105
112
115 {
116 PoleOfInaccessibility = 0,
120 };
121
139
143 QgsCallout();
144 virtual ~QgsCallout() = default;
145
149 virtual QString type() const = 0;
150
156 virtual QgsCallout *clone() const = 0 SIP_FACTORY;
157
168 virtual QVariantMap properties( const QgsReadWriteContext &context ) const;
169
179 virtual void readProperties( const QVariantMap &props, const QgsReadWriteContext &context );
180
188 virtual bool saveProperties( QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context ) const;
189
197 virtual void restoreProperties( const QDomElement &element, const QgsReadWriteContext &context );
198
204 bool containsAdvancedEffects() const;
205
214 virtual void startRender( QgsRenderContext &context );
215
224 virtual void stopRender( QgsRenderContext &context );
225
233 virtual QSet< QString > referencedFields( const QgsRenderContext &context ) const;
234
240 virtual DrawOrder drawOrder() const;
241
248 class CORE_EXPORT QgsCalloutContext
249 {
250 public:
252 bool allFeaturePartsLabeled = false;
253
260
267 QgsCoordinateTransform originalFeatureToMapTransform( const QgsRenderContext &renderContext ) const;
268
279 void addCalloutPosition( const QgsCalloutPosition &position ) { return mPositions.push_back( position ); }
280
286 QList< QgsCalloutPosition > positions() const { return mPositions; }
287
288 private:
290 mutable QgsCoordinateTransform mOriginalFeatureToMapTransform;
291
292 QList< QgsCalloutPosition > mPositions;
293 };
294
316 void render( QgsRenderContext &context, const QRectF &rect, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext );
317
322 bool enabled() const { return mEnabled; }
323
328 void setEnabled( bool enabled );
329
334 QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
335
342 const QgsPropertyCollection &dataDefinedProperties() const SIP_SKIP { return mDataDefinedProperties; }
343
352 void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
353
357 static QgsPropertiesDefinition propertyDefinitions();
358
364 AnchorPoint anchorPoint() const { return mAnchorPoint; }
365
371 void setAnchorPoint( AnchorPoint anchor ) { mAnchorPoint = anchor; }
372
378 static QString encodeAnchorPoint( AnchorPoint anchor );
379
388 static QgsCallout::AnchorPoint decodeAnchorPoint( const QString &name, bool *ok = nullptr );
389
390
397 LabelAnchorPoint labelAnchorPoint() const { return mLabelAnchorPoint; }
398
405 void setLabelAnchorPoint( LabelAnchorPoint anchor ) { mLabelAnchorPoint = anchor; }
406
413 static QString encodeLabelAnchorPoint( LabelAnchorPoint anchor );
414
424 static QgsCallout::LabelAnchorPoint decodeLabelAnchorPoint( const QString &name, bool *ok = nullptr );
425
431 QPainter::CompositionMode blendMode() const { return mBlendMode; }
432
438 void setBlendMode( QPainter::CompositionMode mode ) { mBlendMode = mode; }
439
440 protected:
441
460 virtual void draw( QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext ) = 0;
461
466 Q_DECL_DEPRECATED QgsGeometry labelAnchorGeometry( const QRectF &bodyBoundingBox, const double angle, LabelAnchorPoint anchor ) const SIP_DEPRECATED;
467
475 QgsGeometry calloutLabelPoint( const QRectF &bodyBoundingBox, double angle, LabelAnchorPoint anchor, QgsRenderContext &context, const QgsCalloutContext &calloutContext, bool &pinned ) const;
476
487 QgsGeometry calloutLineToPart( const QgsGeometry &labelGeometry, const QgsAbstractGeometry *partGeometry, QgsRenderContext &context, const QgsCalloutContext &calloutContext, bool &pinned ) const;
488
489 private:
490
491 bool mEnabled = false;
492
493 AnchorPoint mAnchorPoint = PoleOfInaccessibility;
494 LabelAnchorPoint mLabelAnchorPoint = LabelPointOnExterior;
495
496 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
497
499 QgsPropertyCollection mDataDefinedProperties;
500
502 static QgsPropertiesDefinition sPropertyDefinitions;
503
504 static void initPropertyDefinitions();
505};
506
513class CORE_EXPORT QgsSimpleLineCallout : public QgsCallout
514{
515 public:
516
519
520#ifndef SIP_RUN
523#endif
524
530 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY;
531
532 QString type() const override;
533 QgsSimpleLineCallout *clone() const override;
534 QVariantMap properties( const QgsReadWriteContext &context ) const override;
535 void readProperties( const QVariantMap &props, const QgsReadWriteContext &context ) override;
536 void startRender( QgsRenderContext &context ) override;
537 void stopRender( QgsRenderContext &context ) override;
538 QSet< QString > referencedFields( const QgsRenderContext &context ) const override;
539
547 QgsLineSymbol *lineSymbol();
548
555 void setLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
556
562 double minimumLength() const { return mMinCalloutLength; }
563
569 void setMinimumLength( double length ) { mMinCalloutLength = length; }
570
576 void setMinimumLengthUnit( Qgis::RenderUnit unit ) { mMinCalloutLengthUnit = unit; }
577
583 Qgis::RenderUnit minimumLengthUnit() const { return mMinCalloutLengthUnit; }
584
591 void setMinimumLengthMapUnitScale( const QgsMapUnitScale &scale ) { mMinCalloutLengthScale = scale; }
592
599 const QgsMapUnitScale &minimumLengthMapUnitScale() const { return mMinCalloutLengthScale; }
600
601
607 double offsetFromAnchor() const { return mOffsetFromAnchorDistance; }
608
614 void setOffsetFromAnchor( double distance ) { mOffsetFromAnchorDistance = distance; }
615
621 void setOffsetFromAnchorUnit( Qgis::RenderUnit unit ) { mOffsetFromAnchorUnit = unit; }
622
628 Qgis::RenderUnit offsetFromAnchorUnit() const { return mOffsetFromAnchorUnit; }
629
636 void setOffsetFromAnchorMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetFromAnchorScale = scale; }
637
644 const QgsMapUnitScale &offsetFromAnchorMapUnitScale() const { return mOffsetFromAnchorScale; }
645
651 double offsetFromLabel() const { return mOffsetFromLabelDistance; }
652
658 void setOffsetFromLabel( double distance ) { mOffsetFromLabelDistance = distance; }
659
665 void setOffsetFromLabelUnit( Qgis::RenderUnit unit ) { mOffsetFromLabelUnit = unit; }
666
672 Qgis::RenderUnit offsetFromLabelUnit() const { return mOffsetFromLabelUnit; }
673
680 void setOffsetFromLabelMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetFromLabelScale = scale; }
681
688 const QgsMapUnitScale &offsetFromLabelMapUnitScale() const { return mOffsetFromLabelScale; }
689
695 bool drawCalloutToAllParts() const { return mDrawCalloutToAllParts; }
696
702 void setDrawCalloutToAllParts( bool drawToAllParts ) { mDrawCalloutToAllParts = drawToAllParts; }
703
704 protected:
705 void draw( QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCallout::QgsCalloutContext &calloutContext ) override;
706
714 virtual QgsCurve *createCalloutLine( const QgsPoint &start, const QgsPoint &end, QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCallout::QgsCalloutContext &calloutContext ) const SIP_FACTORY;
715
716 private:
717
718#ifdef SIP_RUN
720 QgsSimpleLineCallout &operator=( const QgsSimpleLineCallout & );
721#endif
722
723 std::unique_ptr< QgsLineSymbol > mLineSymbol;
724 double mMinCalloutLength = 0;
725 Qgis::RenderUnit mMinCalloutLengthUnit = Qgis::RenderUnit::Millimeters;
726 QgsMapUnitScale mMinCalloutLengthScale;
727
728 double mOffsetFromAnchorDistance = 0;
729 Qgis::RenderUnit mOffsetFromAnchorUnit = Qgis::RenderUnit::Millimeters;
730 QgsMapUnitScale mOffsetFromAnchorScale;
731
732 double mOffsetFromLabelDistance = 0;
733 Qgis::RenderUnit mOffsetFromLabelUnit = Qgis::RenderUnit::Millimeters;
734 QgsMapUnitScale mOffsetFromLabelScale;
735
736 bool mDrawCalloutToAllParts = false;
737};
738
739
747{
748 public:
749
751
752#ifndef SIP_RUN
755#endif
756
762 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY; // cppcheck-suppress duplInheritedMember
763
764 QString type() const override;
765 QgsManhattanLineCallout *clone() const override;
766
767 protected:
768 QgsCurve *createCalloutLine( const QgsPoint &start, const QgsPoint &end, QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCallout::QgsCalloutContext &calloutContext ) const override SIP_FACTORY;
769
770 private:
771#ifdef SIP_RUN
774#endif
775};
776
777
785{
786 public:
787
797
799
800#ifndef SIP_RUN
803#endif
804
810 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY; // cppcheck-suppress duplInheritedMember
811
812 QString type() const override;
813 QgsCurvedLineCallout *clone() const override;
814 QVariantMap properties( const QgsReadWriteContext &context ) const override;
815
823 double curvature() const;
824
832 void setCurvature( double curvature );
833
839 Orientation orientation() const;
840
846 void setOrientation( Orientation orientation );
847
848 protected:
849 QgsCurve *createCalloutLine( const QgsPoint &start, const QgsPoint &end, QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext ) const override SIP_FACTORY;
850
851 private:
852#ifdef SIP_RUN
854 QgsCurvedLineCallout &operator=( const QgsCurvedLineCallout & );
855#endif
856
860 static Orientation decodeOrientation( const QString &string );
861
865 static QString encodeOrientation( Orientation orientation );
866
867
868 Orientation mOrientation = Automatic;
869 double mCurvature = 0.1;
870};
871
872
879class CORE_EXPORT QgsBalloonCallout : public QgsCallout
880{
881 public:
882
885
886#ifndef SIP_RUN
887 QgsBalloonCallout( const QgsBalloonCallout &other );
889#endif
890
896 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY;
897
898 QString type() const override;
899 QgsBalloonCallout *clone() const override;
900 QVariantMap properties( const QgsReadWriteContext &context ) const override;
901 void readProperties( const QVariantMap &props, const QgsReadWriteContext &context ) override;
902 void startRender( QgsRenderContext &context ) override;
903 void stopRender( QgsRenderContext &context ) override;
904 QSet< QString > referencedFields( const QgsRenderContext &context ) const override;
905
913 QgsFillSymbol *fillSymbol();
914
921 void setFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
922
935 QgsMarkerSymbol *markerSymbol();
936
948 void setMarkerSymbol( QgsMarkerSymbol *symbol SIP_TRANSFER );
949
955 double offsetFromAnchor() const { return mOffsetFromAnchorDistance; }
956
962 void setOffsetFromAnchor( double distance ) { mOffsetFromAnchorDistance = distance; }
963
969 void setOffsetFromAnchorUnit( Qgis::RenderUnit unit ) { mOffsetFromAnchorUnit = unit; }
970
976 Qgis::RenderUnit offsetFromAnchorUnit() const { return mOffsetFromAnchorUnit; }
977
984 void setOffsetFromAnchorMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetFromAnchorScale = scale; }
985
992 const QgsMapUnitScale &offsetFromAnchorMapUnitScale() const { return mOffsetFromAnchorScale; }
993
1004 const QgsMargins &margins() const { return mMargins; }
1005
1016 void setMargins( const QgsMargins &margins ) { mMargins = margins; }
1017
1024 void setMarginsUnit( Qgis::RenderUnit unit ) { mMarginUnit = unit; }
1025
1032 Qgis::RenderUnit marginsUnit() const { return mMarginUnit; }
1033
1042 double wedgeWidth() const { return mWedgeWidth; }
1043
1052 void setWedgeWidth( double width ) { mWedgeWidth = width; }
1053
1060 void setWedgeWidthUnit( Qgis::RenderUnit unit ) { mWedgeWidthUnit = unit; }
1061
1068 Qgis::RenderUnit wedgeWidthUnit() const { return mWedgeWidthUnit; }
1069
1077 void setWedgeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWedgeWidthScale = scale; }
1078
1086 const QgsMapUnitScale &wedgeWidthMapUnitScale() const { return mWedgeWidthScale; }
1087
1096 double cornerRadius() const { return mCornerRadius; }
1097
1106 void setCornerRadius( double radius ) { mCornerRadius = radius; }
1107
1114 void setCornerRadiusUnit( Qgis::RenderUnit unit ) { mCornerRadiusUnit = unit; }
1115
1122 Qgis::RenderUnit cornerRadiusUnit() const { return mCornerRadiusUnit; }
1123
1131 void setCornerRadiusMapUnitScale( const QgsMapUnitScale &scale ) { mCornerRadiusScale = scale; }
1132
1140 const QgsMapUnitScale &cornerRadiusMapUnitScale() const { return mCornerRadiusScale; }
1141
1142
1143 protected:
1144 void draw( QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCallout::QgsCalloutContext &calloutContext ) override;
1145
1146 private:
1147
1148 QPolygonF getPoints( QgsRenderContext &context, QgsPointXY origin, QRectF rect ) const;
1149
1150#ifdef SIP_RUN
1151 QgsBalloonCallout( const QgsBalloonCallout &other );
1152 QgsBalloonCallout &operator=( const QgsBalloonCallout & );
1153#endif
1154
1155 std::unique_ptr< QgsFillSymbol > mFillSymbol;
1156 std::unique_ptr< QgsMarkerSymbol > mMarkerSymbol;
1157
1158 double mOffsetFromAnchorDistance = 0;
1159 Qgis::RenderUnit mOffsetFromAnchorUnit = Qgis::RenderUnit::Millimeters;
1160 QgsMapUnitScale mOffsetFromAnchorScale;
1161
1162 QgsMargins mMargins;
1164
1165 double mWedgeWidth = 2.64;
1167 QgsMapUnitScale mWedgeWidthScale;
1168
1169 double mCornerRadius = 0.0;
1171 QgsMapUnitScale mCornerRadiusScale;
1172
1173};
1174
1175
1176
1177#endif // QGSCALLOUT_H
1178
RenderUnit
Rendering size units.
Definition qgis.h:4910
@ Millimeters
Millimeters.
Abstract base class for all geometries.
A cartoon talking bubble callout style.
Definition qgscallout.h:880
void setCornerRadius(double radius)
Sets the radius of the corners for the balloon shapes.
double wedgeWidth() const
Returns the width of the wedge shape at the side it connects with the label.
const QgsMapUnitScale & wedgeWidthMapUnitScale() const
Returns the map unit scale for the wedge width.
QgsBalloonCallout & operator=(const QgsBalloonCallout &)=delete
double cornerRadius() const
Returns the corner radius of the balloon shapes.
void setCornerRadiusUnit(Qgis::RenderUnit unit)
Sets the unit for the corner radius.
Qgis::RenderUnit wedgeWidthUnit() const
Returns the units for the wedge width.
void setOffsetFromAnchorUnit(Qgis::RenderUnit unit)
Sets the unit for the offset from anchor distance.
Definition qgscallout.h:969
void setMarginsUnit(Qgis::RenderUnit unit)
Sets the unit for the margins between the outside of the callout frame and the label's bounding recta...
void setCornerRadiusMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the corner radius.
Qgis::RenderUnit offsetFromAnchorUnit() const
Returns the units for the offset from anchor point.
Definition qgscallout.h:976
const QgsMapUnitScale & offsetFromAnchorMapUnitScale() const
Returns the map unit scale for the offset from anchor.
Definition qgscallout.h:992
const QgsMargins & margins() const
Returns the margins between the outside of the callout frame and the label's bounding rectangle.
void setWedgeWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the wedge width.
void setOffsetFromAnchor(double distance)
Sets the offset distance from the anchor point at which to start the line.
Definition qgscallout.h:962
Qgis::RenderUnit marginsUnit() const
Returns the units for the margins between the outside of the callout frame and the label's bounding r...
void setWedgeWidth(double width)
Sets the width of the wedge shape at the side it connects with the label.
void setOffsetFromAnchorMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the offset from anchor.
Definition qgscallout.h:984
const QgsMapUnitScale & cornerRadiusMapUnitScale() const
Returns the map unit scale for the corner radius.
Qgis::RenderUnit cornerRadiusUnit() const
Returns the units for the corner radius.
void setMargins(const QgsMargins &margins)
Sets the margins between the outside of the callout frame and the label's bounding rectangle.
void setWedgeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the wedge width.
~QgsBalloonCallout() override
Represents the calculated placement of a map label callout line.
Base class for widgets which allow control over the properties of callouts.
Contains additional contextual information about the context in which a callout is being rendered.
Definition qgscallout.h:249
void addCalloutPosition(const QgsCalloutPosition &position)
Adds a rendered callout position.
Definition qgscallout.h:279
QList< QgsCalloutPosition > positions() const
Returns the list of rendered callout positions.
Definition qgscallout.h:286
QgsCoordinateReferenceSystem originalFeatureCrs
Contains the CRS of the original feature associated with this callout.
Definition qgscallout.h:259
Abstract base class for callout renderers.
Definition qgscallout.h:54
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the callout's property collection, used for data defined overrides.
Definition qgscallout.h:352
void setBlendMode(QPainter::CompositionMode mode)
Sets the blending mode used for drawing callouts.
Definition qgscallout.h:438
virtual ~QgsCallout()=default
virtual QString type() const =0
Returns a unique string representing the callout type.
virtual QgsCallout * clone() const =0
Duplicates a callout by creating a deep copy of the callout.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the callout's property collection, used for data defined overrides.
Definition qgscallout.h:334
AnchorPoint anchorPoint() const
Returns the feature's anchor point position.
Definition qgscallout.h:364
LabelAnchorPoint labelAnchorPoint() const
Returns the label's anchor point position.
Definition qgscallout.h:397
AnchorPoint
Feature's anchor point position.
Definition qgscallout.h:115
@ PointOnExterior
A point on the surface's outline closest to the label is used as anchor for polygon geometries.
Definition qgscallout.h:117
@ Centroid
The surface's centroid is used as anchor for polygon geometries.
Definition qgscallout.h:119
@ PointOnSurface
A point guaranteed to be on the surface is used as anchor for polygon geometries.
Definition qgscallout.h:118
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the callout's property collection, used for data defined overrides.
Definition qgscallout.h:342
void setLabelAnchorPoint(LabelAnchorPoint anchor)
Sets the label's anchor point position.
Definition qgscallout.h:405
virtual void draw(QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext)=0
Performs the actual rendering of the callout implementation onto the specified render context.
DrawOrder
Options for draw order (stacking) of callouts.
Definition qgscallout.h:108
@ OrderBelowIndividualLabels
Render callouts below their individual associated labels, some callouts may be drawn over other label...
Definition qgscallout.h:110
@ OrderBelowAllLabels
Render callouts below all labels.
Definition qgscallout.h:109
QPainter::CompositionMode blendMode() const
Returns the blending mode used for drawing callouts.
Definition qgscallout.h:431
LabelAnchorPoint
Label's anchor point position.
Definition qgscallout.h:127
@ LabelPointOnExterior
The point on the label's boundary closest to the feature.
Definition qgscallout.h:128
@ LabelBottomLeft
Bottom left corner of the label's boundary.
Definition qgscallout.h:135
@ LabelBottomMiddle
Bottom middle of the label's boundary.
Definition qgscallout.h:136
@ LabelMiddleLeft
Middle left of the label's boundary.
Definition qgscallout.h:133
@ LabelBottomRight
Bottom right corner of the label's boundary.
Definition qgscallout.h:137
@ LabelMiddleRight
Middle right of the label's boundary.
Definition qgscallout.h:134
@ LabelTopMiddle
Top middle of the label's boundary.
Definition qgscallout.h:131
@ LabelTopLeft
Top left corner of the label's boundary.
Definition qgscallout.h:130
@ LabelCentroid
The labe's centroid.
Definition qgscallout.h:129
@ LabelTopRight
Top right corner of the label's boundary.
Definition qgscallout.h:132
void setAnchorPoint(AnchorPoint anchor)
Sets the feature's anchor point position.
Definition qgscallout.h:371
Property
Data definable properties.
Definition qgscallout.h:86
bool enabled() const
Returns true if the the callout is enabled.
Definition qgscallout.h:322
This class represents a coordinate reference system (CRS).
Class for doing transforms between two map coordinate systems.
Abstract base class for curved geometry type.
Definition qgscurve.h:35
Draws curved lines as callouts.
Definition qgscallout.h:785
QgsCurvedLineCallout & operator=(const QgsCurvedLineCallout &)=delete
Orientation
Curve orientation.
Definition qgscallout.h:792
@ Clockwise
Curve lines in a clockwise direction.
Definition qgscallout.h:794
@ CounterClockwise
Curve lines in a counter-clockwise direction.
Definition qgscallout.h:795
@ Automatic
Automatically choose most cartographically pleasing orientation based on label and callout arrangemen...
Definition qgscallout.h:793
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A geometry is the spatial representation of a feature.
A line symbol type, for rendering LineString and MultiLineString geometries.
Draws straight (right angled) lines as callouts.
Definition qgscallout.h:747
QgsManhattanLineCallout & operator=(const QgsManhattanLineCallout &)=delete
Struct for storing maximum and minimum scales for measurements in map units.
The QgsMargins class defines the four margins of a rectangle.
Definition qgsmargins.h:37
A marker symbol type, for rendering Point and MultiPoint geometries.
A class to represent a 2D point.
Definition qgspointxy.h:60
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.
A simple direct line callout style.
Definition qgscallout.h:514
void setMinimumLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the minimum callout length.
Definition qgscallout.h:591
Qgis::RenderUnit offsetFromAnchorUnit() const
Returns the units for the offset from anchor point.
Definition qgscallout.h:628
QgsSimpleLineCallout & operator=(const QgsSimpleLineCallout &)=delete
void setOffsetFromLabelUnit(Qgis::RenderUnit unit)
Sets the unit for the offset from label area distance.
Definition qgscallout.h:665
double offsetFromLabel() const
Returns the offset distance from label area at which to end the line.
Definition qgscallout.h:651
void setOffsetFromAnchorMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the offset from anchor.
Definition qgscallout.h:636
double offsetFromAnchor() const
Returns the offset distance from the anchor point at which to start the line.
Definition qgscallout.h:607
const QgsMapUnitScale & offsetFromAnchorMapUnitScale() const
Returns the map unit scale for the offset from anchor.
Definition qgscallout.h:644
void setOffsetFromAnchor(double distance)
Sets the offset distance from the anchor point at which to start the line.
Definition qgscallout.h:614
~QgsSimpleLineCallout() override
void setOffsetFromAnchorUnit(Qgis::RenderUnit unit)
Sets the unit for the offset from anchor distance.
Definition qgscallout.h:621
void setMinimumLength(double length)
Sets the minimum length of callout lines.
Definition qgscallout.h:569
const QgsMapUnitScale & minimumLengthMapUnitScale() const
Returns the map unit scale for the minimum callout length.
Definition qgscallout.h:599
bool drawCalloutToAllParts() const
Returns true if callout lines should be drawn to all feature parts.
Definition qgscallout.h:695
void setDrawCalloutToAllParts(bool drawToAllParts)
Sets whether callout lines should be drawn to all feature parts.
Definition qgscallout.h:702
Qgis::RenderUnit offsetFromLabelUnit() const
Returns the units for the offset from label area.
Definition qgscallout.h:672
void setOffsetFromLabelMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the offset from label area.
Definition qgscallout.h:680
void setMinimumLengthUnit(Qgis::RenderUnit unit)
Sets the unit for the minimum length of callout lines.
Definition qgscallout.h:576
void setOffsetFromLabel(double distance)
Sets the offset distance from label area at which to end the line.
Definition qgscallout.h:658
const QgsMapUnitScale & offsetFromLabelMapUnitScale() const
Returns the map unit scale for the minimum callout length.
Definition qgscallout.h:688
Qgis::RenderUnit minimumLengthUnit() const
Returns the units for the minimum length of callout lines.
Definition qgscallout.h:583
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:191
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition qgis_sip.h:271
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76
#define SIP_END
Definition qgis_sip.h:208
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
record about vertex coordinates and index of anchor to which it is snapped