QGIS API Documentation 3.39.0-Master (3aed037ce22)
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 QgsFillSymbol;
37class QgsGeometry;
39
40class QgsCalloutWidget; //stop sip breaking
41
52class CORE_EXPORT QgsCallout
53{
54
55#ifdef SIP_RUN
57 if ( sipCpp->type() == "simple" && dynamic_cast<QgsSimpleLineCallout *>( sipCpp ) != NULL )
58 {
59 sipType = sipType_QgsSimpleLineCallout;
60 }
61 else if ( sipCpp->type() == "manhattan" && dynamic_cast<QgsManhattanLineCallout *>( sipCpp ) != NULL )
62 {
63 sipType = sipType_QgsManhattanLineCallout;
64 }
65 else if ( sipCpp->type() == "curved" && dynamic_cast<QgsCurvedLineCallout *>( sipCpp ) != NULL )
66 {
67 sipType = sipType_QgsCurvedLineCallout;
68 }
69 else if ( sipCpp->type() == "balloon" && dynamic_cast<QgsBalloonCallout *>( sipCpp ) != NULL )
70 {
71 sipType = sipType_QgsBalloonCallout;
72 }
73 else
74 {
75 sipType = 0;
76 }
78#endif
79
80 public:
81
82 // *INDENT-OFF*
85 {
86 MinimumCalloutLength,
87 OffsetFromAnchor,
88 OffsetFromLabel,
89 DrawCalloutToAllParts,
90 AnchorPointPosition,
91 LabelAnchorPointPosition,
92 OriginX,
93 OriginY,
94 DestinationX,
95 DestinationY,
96 Curvature,
97 Orientation,
98 Margins,
99 WedgeWidth,
100 CornerRadius,
101 BlendMode,
102 };
103 // *INDENT-ON*
104
111
114 {
115 PoleOfInaccessibility = 0,
119 };
120
138
142 QgsCallout();
143 virtual ~QgsCallout() = default;
144
148 virtual QString type() const = 0;
149
155 virtual QgsCallout *clone() const = 0 SIP_FACTORY;
156
167 virtual QVariantMap properties( const QgsReadWriteContext &context ) const;
168
178 virtual void readProperties( const QVariantMap &props, const QgsReadWriteContext &context );
179
187 virtual bool saveProperties( QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context ) const;
188
196 virtual void restoreProperties( const QDomElement &element, const QgsReadWriteContext &context );
197
203 bool containsAdvancedEffects() const;
204
213 virtual void startRender( QgsRenderContext &context );
214
223 virtual void stopRender( QgsRenderContext &context );
224
232 virtual QSet< QString > referencedFields( const QgsRenderContext &context ) const;
233
239 virtual DrawOrder drawOrder() const;
240
247 class CORE_EXPORT QgsCalloutContext
248 {
249 public:
251 bool allFeaturePartsLabeled = false;
252
259
266 QgsCoordinateTransform originalFeatureToMapTransform( const QgsRenderContext &renderContext ) const;
267
278 void addCalloutPosition( const QgsCalloutPosition &position ) { return mPositions.push_back( position ); }
279
285 QList< QgsCalloutPosition > positions() const { return mPositions; }
286
287 private:
289 mutable QgsCoordinateTransform mOriginalFeatureToMapTransform;
290
291 QList< QgsCalloutPosition > mPositions;
292 };
293
315 void render( QgsRenderContext &context, const QRectF &rect, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext );
316
321 bool enabled() const { return mEnabled; }
322
327 void setEnabled( bool enabled );
328
333 QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
334
341 const QgsPropertyCollection &dataDefinedProperties() const SIP_SKIP { return mDataDefinedProperties; }
342
351 void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
352
356 static QgsPropertiesDefinition propertyDefinitions();
357
363 AnchorPoint anchorPoint() const { return mAnchorPoint; }
364
370 void setAnchorPoint( AnchorPoint anchor ) { mAnchorPoint = anchor; }
371
377 static QString encodeAnchorPoint( AnchorPoint anchor );
378
387 static QgsCallout::AnchorPoint decodeAnchorPoint( const QString &name, bool *ok = nullptr );
388
389
396 LabelAnchorPoint labelAnchorPoint() const { return mLabelAnchorPoint; }
397
404 void setLabelAnchorPoint( LabelAnchorPoint anchor ) { mLabelAnchorPoint = anchor; }
405
412 static QString encodeLabelAnchorPoint( LabelAnchorPoint anchor );
413
423 static QgsCallout::LabelAnchorPoint decodeLabelAnchorPoint( const QString &name, bool *ok = nullptr );
424
430 QPainter::CompositionMode blendMode() const { return mBlendMode; }
431
437 void setBlendMode( QPainter::CompositionMode mode ) { mBlendMode = mode; }
438
439 protected:
440
459 virtual void draw( QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext ) = 0;
460
465 Q_DECL_DEPRECATED QgsGeometry labelAnchorGeometry( const QRectF &bodyBoundingBox, const double angle, LabelAnchorPoint anchor ) const SIP_DEPRECATED;
466
474 QgsGeometry calloutLabelPoint( const QRectF &bodyBoundingBox, double angle, LabelAnchorPoint anchor, QgsRenderContext &context, const QgsCalloutContext &calloutContext, bool &pinned ) const;
475
486 QgsGeometry calloutLineToPart( const QgsGeometry &labelGeometry, const QgsAbstractGeometry *partGeometry, QgsRenderContext &context, const QgsCalloutContext &calloutContext, bool &pinned ) const;
487
488 private:
489
490 bool mEnabled = false;
491
492 AnchorPoint mAnchorPoint = PoleOfInaccessibility;
493 LabelAnchorPoint mLabelAnchorPoint = LabelPointOnExterior;
494
495 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
496
498 QgsPropertyCollection mDataDefinedProperties;
499
501 static QgsPropertiesDefinition sPropertyDefinitions;
502
503 static void initPropertyDefinitions();
504};
505
512class CORE_EXPORT QgsSimpleLineCallout : public QgsCallout
513{
514 public:
515
518
519#ifndef SIP_RUN
522#endif
523
529 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY;
530
531 QString type() const override;
532 QgsSimpleLineCallout *clone() const override;
533 QVariantMap properties( const QgsReadWriteContext &context ) const override;
534 void readProperties( const QVariantMap &props, const QgsReadWriteContext &context ) override;
535 void startRender( QgsRenderContext &context ) override;
536 void stopRender( QgsRenderContext &context ) override;
537 QSet< QString > referencedFields( const QgsRenderContext &context ) const override;
538
546 QgsLineSymbol *lineSymbol();
547
554 void setLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
555
561 double minimumLength() const { return mMinCalloutLength; }
562
568 void setMinimumLength( double length ) { mMinCalloutLength = length; }
569
575 void setMinimumLengthUnit( Qgis::RenderUnit unit ) { mMinCalloutLengthUnit = unit; }
576
582 Qgis::RenderUnit minimumLengthUnit() const { return mMinCalloutLengthUnit; }
583
590 void setMinimumLengthMapUnitScale( const QgsMapUnitScale &scale ) { mMinCalloutLengthScale = scale; }
591
598 const QgsMapUnitScale &minimumLengthMapUnitScale() const { return mMinCalloutLengthScale; }
599
600
606 double offsetFromAnchor() const { return mOffsetFromAnchorDistance; }
607
613 void setOffsetFromAnchor( double distance ) { mOffsetFromAnchorDistance = distance; }
614
620 void setOffsetFromAnchorUnit( Qgis::RenderUnit unit ) { mOffsetFromAnchorUnit = unit; }
621
627 Qgis::RenderUnit offsetFromAnchorUnit() const { return mOffsetFromAnchorUnit; }
628
635 void setOffsetFromAnchorMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetFromAnchorScale = scale; }
636
643 const QgsMapUnitScale &offsetFromAnchorMapUnitScale() const { return mOffsetFromAnchorScale; }
644
650 double offsetFromLabel() const { return mOffsetFromLabelDistance; }
651
657 void setOffsetFromLabel( double distance ) { mOffsetFromLabelDistance = distance; }
658
664 void setOffsetFromLabelUnit( Qgis::RenderUnit unit ) { mOffsetFromLabelUnit = unit; }
665
671 Qgis::RenderUnit offsetFromLabelUnit() const { return mOffsetFromLabelUnit; }
672
679 void setOffsetFromLabelMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetFromLabelScale = scale; }
680
687 const QgsMapUnitScale &offsetFromLabelMapUnitScale() const { return mOffsetFromLabelScale; }
688
694 bool drawCalloutToAllParts() const { return mDrawCalloutToAllParts; }
695
701 void setDrawCalloutToAllParts( bool drawToAllParts ) { mDrawCalloutToAllParts = drawToAllParts; }
702
703 protected:
704 void draw( QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCallout::QgsCalloutContext &calloutContext ) override;
705
713 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;
714
715 private:
716
717#ifdef SIP_RUN
719 QgsSimpleLineCallout &operator=( const QgsSimpleLineCallout & );
720#endif
721
722 std::unique_ptr< QgsLineSymbol > mLineSymbol;
723 double mMinCalloutLength = 0;
724 Qgis::RenderUnit mMinCalloutLengthUnit = Qgis::RenderUnit::Millimeters;
725 QgsMapUnitScale mMinCalloutLengthScale;
726
727 double mOffsetFromAnchorDistance = 0;
728 Qgis::RenderUnit mOffsetFromAnchorUnit = Qgis::RenderUnit::Millimeters;
729 QgsMapUnitScale mOffsetFromAnchorScale;
730
731 double mOffsetFromLabelDistance = 0;
732 Qgis::RenderUnit mOffsetFromLabelUnit = Qgis::RenderUnit::Millimeters;
733 QgsMapUnitScale mOffsetFromLabelScale;
734
735 bool mDrawCalloutToAllParts = false;
736};
737
738
746{
747 public:
748
750
751#ifndef SIP_RUN
754#endif
755
761 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY;
762
763 QString type() const override;
764 QgsManhattanLineCallout *clone() const override;
765
766 protected:
767 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;
768
769 private:
770#ifdef SIP_RUN
773#endif
774};
775
776
784{
785 public:
786
796
798
799#ifndef SIP_RUN
802#endif
803
809 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY;
810
811 QString type() const override;
812 QgsCurvedLineCallout *clone() const override;
813 QVariantMap properties( const QgsReadWriteContext &context ) const override;
814
822 double curvature() const;
823
831 void setCurvature( double curvature );
832
838 Orientation orientation() const;
839
845 void setOrientation( Orientation orientation );
846
847 protected:
848 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;
849
850 private:
851#ifdef SIP_RUN
853 QgsCurvedLineCallout &operator=( const QgsCurvedLineCallout & );
854#endif
855
859 static Orientation decodeOrientation( const QString &string );
860
864 static QString encodeOrientation( Orientation orientation );
865
866
867 Orientation mOrientation = Automatic;
868 double mCurvature = 0.1;
869};
870
871
878class CORE_EXPORT QgsBalloonCallout : public QgsCallout
879{
880 public:
881
884
885#ifndef SIP_RUN
886 QgsBalloonCallout( const QgsBalloonCallout &other );
888#endif
889
895 static QgsCallout *create( const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) SIP_FACTORY;
896
897 QString type() const override;
898 QgsBalloonCallout *clone() const override;
899 QVariantMap properties( const QgsReadWriteContext &context ) const override;
900 void readProperties( const QVariantMap &props, const QgsReadWriteContext &context ) override;
901 void startRender( QgsRenderContext &context ) override;
902 void stopRender( QgsRenderContext &context ) override;
903 QSet< QString > referencedFields( const QgsRenderContext &context ) const override;
904
912 QgsFillSymbol *fillSymbol();
913
920 void setFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
921
927 double offsetFromAnchor() const { return mOffsetFromAnchorDistance; }
928
934 void setOffsetFromAnchor( double distance ) { mOffsetFromAnchorDistance = distance; }
935
941 void setOffsetFromAnchorUnit( Qgis::RenderUnit unit ) { mOffsetFromAnchorUnit = unit; }
942
948 Qgis::RenderUnit offsetFromAnchorUnit() const { return mOffsetFromAnchorUnit; }
949
956 void setOffsetFromAnchorMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetFromAnchorScale = scale; }
957
964 const QgsMapUnitScale &offsetFromAnchorMapUnitScale() const { return mOffsetFromAnchorScale; }
965
976 const QgsMargins &margins() const { return mMargins; }
977
988 void setMargins( const QgsMargins &margins ) { mMargins = margins; }
989
996 void setMarginsUnit( Qgis::RenderUnit unit ) { mMarginUnit = unit; }
997
1004 Qgis::RenderUnit marginsUnit() const { return mMarginUnit; }
1005
1014 double wedgeWidth() const { return mWedgeWidth; }
1015
1024 void setWedgeWidth( double width ) { mWedgeWidth = width; }
1025
1032 void setWedgeWidthUnit( Qgis::RenderUnit unit ) { mWedgeWidthUnit = unit; }
1033
1040 Qgis::RenderUnit wedgeWidthUnit() const { return mWedgeWidthUnit; }
1041
1049 void setWedgeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWedgeWidthScale = scale; }
1050
1058 const QgsMapUnitScale &wedgeWidthMapUnitScale() const { return mWedgeWidthScale; }
1059
1068 double cornerRadius() const { return mCornerRadius; }
1069
1078 void setCornerRadius( double radius ) { mCornerRadius = radius; }
1079
1086 void setCornerRadiusUnit( Qgis::RenderUnit unit ) { mCornerRadiusUnit = unit; }
1087
1094 Qgis::RenderUnit cornerRadiusUnit() const { return mCornerRadiusUnit; }
1095
1103 void setCornerRadiusMapUnitScale( const QgsMapUnitScale &scale ) { mCornerRadiusScale = scale; }
1104
1112 const QgsMapUnitScale &cornerRadiusMapUnitScale() const { return mCornerRadiusScale; }
1113
1114
1115 protected:
1116 void draw( QgsRenderContext &context, const QRectF &bodyBoundingBox, const double angle, const QgsGeometry &anchor, QgsCallout::QgsCalloutContext &calloutContext ) override;
1117
1118 private:
1119
1120 QPolygonF getPoints( QgsRenderContext &context, QgsPointXY origin, QRectF rect ) const;
1121
1122#ifdef SIP_RUN
1123 QgsBalloonCallout( const QgsBalloonCallout &other );
1124 QgsBalloonCallout &operator=( const QgsBalloonCallout & );
1125#endif
1126
1127 std::unique_ptr< QgsFillSymbol > mFillSymbol;
1128
1129 double mOffsetFromAnchorDistance = 0;
1130 Qgis::RenderUnit mOffsetFromAnchorUnit = Qgis::RenderUnit::Millimeters;
1131 QgsMapUnitScale mOffsetFromAnchorScale;
1132
1133 QgsMargins mMargins;
1135
1136 double mWedgeWidth = 2.64;
1138 QgsMapUnitScale mWedgeWidthScale;
1139
1140 double mCornerRadius = 0.0;
1142 QgsMapUnitScale mCornerRadiusScale;
1143
1144};
1145
1146
1147
1148#endif // QGSCALLOUT_H
1149
RenderUnit
Rendering size units.
Definition qgis.h:4594
@ Millimeters
Millimeters.
Abstract base class for all geometries.
A cartoon talking bubble callout style.
Definition qgscallout.h:879
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:941
void setMarginsUnit(Qgis::RenderUnit unit)
Sets the unit for the margins between the outside of the callout frame and the label's bounding recta...
Definition qgscallout.h:996
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:948
const QgsMapUnitScale & offsetFromAnchorMapUnitScale() const
Returns the map unit scale for the offset from anchor.
Definition qgscallout.h:964
const QgsMargins & margins() const
Returns the margins between the outside of the callout frame and the label's bounding rectangle.
Definition qgscallout.h:976
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:934
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:956
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.
Definition qgscallout.h:988
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:248
void addCalloutPosition(const QgsCalloutPosition &position)
Adds a rendered callout position.
Definition qgscallout.h:278
QList< QgsCalloutPosition > positions() const
Returns the list of rendered callout positions.
Definition qgscallout.h:285
QgsCoordinateReferenceSystem originalFeatureCrs
Contains the CRS of the original feature associated with this callout.
Definition qgscallout.h:258
Abstract base class for callout renderers.
Definition qgscallout.h:53
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the callout's property collection, used for data defined overrides.
Definition qgscallout.h:351
void setBlendMode(QPainter::CompositionMode mode)
Sets the blending mode used for drawing callouts.
Definition qgscallout.h:437
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:333
AnchorPoint anchorPoint() const
Returns the feature's anchor point position.
Definition qgscallout.h:363
LabelAnchorPoint labelAnchorPoint() const
Returns the label's anchor point position.
Definition qgscallout.h:396
AnchorPoint
Feature's anchor point position.
Definition qgscallout.h:114
@ PointOnExterior
A point on the surface's outline closest to the label is used as anchor for polygon geometries.
Definition qgscallout.h:116
@ Centroid
The surface's centroid is used as anchor for polygon geometries.
Definition qgscallout.h:118
@ PointOnSurface
A point guaranteed to be on the surface is used as anchor for polygon geometries.
Definition qgscallout.h:117
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the callout's property collection, used for data defined overrides.
Definition qgscallout.h:341
void setLabelAnchorPoint(LabelAnchorPoint anchor)
Sets the label's anchor point position.
Definition qgscallout.h:404
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:107
@ OrderBelowIndividualLabels
Render callouts below their individual associated labels, some callouts may be drawn over other label...
Definition qgscallout.h:109
@ OrderBelowAllLabels
Render callouts below all labels.
Definition qgscallout.h:108
QPainter::CompositionMode blendMode() const
Returns the blending mode used for drawing callouts.
Definition qgscallout.h:430
LabelAnchorPoint
Label's anchor point position.
Definition qgscallout.h:126
@ LabelPointOnExterior
The point on the label's boundary closest to the feature.
Definition qgscallout.h:127
@ LabelBottomLeft
Bottom left corner of the label's boundary.
Definition qgscallout.h:134
@ LabelBottomMiddle
Bottom middle of the label's boundary.
Definition qgscallout.h:135
@ LabelMiddleLeft
Middle left of the label's boundary.
Definition qgscallout.h:132
@ LabelBottomRight
Bottom right corner of the label's boundary.
Definition qgscallout.h:136
@ LabelMiddleRight
Middle right of the label's boundary.
Definition qgscallout.h:133
@ LabelTopMiddle
Top middle of the label's boundary.
Definition qgscallout.h:130
@ LabelTopLeft
Top left corner of the label's boundary.
Definition qgscallout.h:129
@ LabelCentroid
The labe's centroid.
Definition qgscallout.h:128
@ LabelTopRight
Top right corner of the label's boundary.
Definition qgscallout.h:131
void setAnchorPoint(AnchorPoint anchor)
Sets the feature's anchor point position.
Definition qgscallout.h:370
Property
Data definable properties.
Definition qgscallout.h:85
bool enabled() const
Returns true if the the callout is enabled.
Definition qgscallout.h:321
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:784
QgsCurvedLineCallout & operator=(const QgsCurvedLineCallout &)=delete
Orientation
Curve orientation.
Definition qgscallout.h:791
@ Clockwise
Curve lines in a clockwise direction.
Definition qgscallout.h:793
@ CounterClockwise
Curve lines in a counter-clockwise direction.
Definition qgscallout.h:794
@ Automatic
Automatically choose most cartographically pleasing orientation based on label and callout arrangemen...
Definition qgscallout.h:792
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:746
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 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:513
void setMinimumLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the minimum callout length.
Definition qgscallout.h:590
Qgis::RenderUnit offsetFromAnchorUnit() const
Returns the units for the offset from anchor point.
Definition qgscallout.h:627
QgsSimpleLineCallout & operator=(const QgsSimpleLineCallout &)=delete
void setOffsetFromLabelUnit(Qgis::RenderUnit unit)
Sets the unit for the offset from label area distance.
Definition qgscallout.h:664
double offsetFromLabel() const
Returns the offset distance from label area at which to end the line.
Definition qgscallout.h:650
void setOffsetFromAnchorMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the offset from anchor.
Definition qgscallout.h:635
double offsetFromAnchor() const
Returns the offset distance from the anchor point at which to start the line.
Definition qgscallout.h:606
const QgsMapUnitScale & offsetFromAnchorMapUnitScale() const
Returns the map unit scale for the offset from anchor.
Definition qgscallout.h:643
void setOffsetFromAnchor(double distance)
Sets the offset distance from the anchor point at which to start the line.
Definition qgscallout.h:613
~QgsSimpleLineCallout() override
void setOffsetFromAnchorUnit(Qgis::RenderUnit unit)
Sets the unit for the offset from anchor distance.
Definition qgscallout.h:620
void setMinimumLength(double length)
Sets the minimum length of callout lines.
Definition qgscallout.h:568
const QgsMapUnitScale & minimumLengthMapUnitScale() const
Returns the map unit scale for the minimum callout length.
Definition qgscallout.h:598
bool drawCalloutToAllParts() const
Returns true if callout lines should be drawn to all feature parts.
Definition qgscallout.h:694
void setDrawCalloutToAllParts(bool drawToAllParts)
Sets whether callout lines should be drawn to all feature parts.
Definition qgscallout.h:701
Qgis::RenderUnit offsetFromLabelUnit() const
Returns the units for the offset from label area.
Definition qgscallout.h:671
void setOffsetFromLabelMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the offset from label area.
Definition qgscallout.h:679
void setMinimumLengthUnit(Qgis::RenderUnit unit)
Sets the unit for the minimum length of callout lines.
Definition qgscallout.h:575
void setOffsetFromLabel(double distance)
Sets the offset distance from label area at which to end the line.
Definition qgscallout.h:657
const QgsMapUnitScale & offsetFromLabelMapUnitScale() const
Returns the map unit scale for the minimum callout length.
Definition qgscallout.h:687
Qgis::RenderUnit minimumLengthUnit() const
Returns the units for the minimum length of callout lines.
Definition qgscallout.h:582
#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