21 #ifndef QGSPALLABELING_H 22 #define QGSPALLABELING_H 26 #include <QFontDatabase> 248 FontLetterSpacing = 28,
249 FontWordSpacing = 29,
253 MultiLineWrapChar = 31,
254 MultiLineHeight = 32,
255 MultiLineAlignment = 33,
259 DirSymbPlacement = 37,
271 BufferJoinStyle = 44,
272 BufferBlendMode = 45,
282 ShapeRotationType = 52,
285 ShapeOffsetUnits = 55,
287 ShapeRadiiUnits = 57,
288 ShapeTransparency = 63,
291 ShapeBorderColor = 59,
292 ShapeBorderWidth = 60,
293 ShapeBorderWidthUnits = 61,
299 ShadowOffsetAngle = 67,
300 ShadowOffsetDist = 68,
301 ShadowOffsetUnits = 69,
303 ShadowRadiusUnits = 71,
304 ShadowTransparency = 72,
307 ShadowBlendMode = 75,
317 CurvedCharAngleInOut = 83,
325 RepeatDistanceUnit = 86,
327 PredefinedPositionOrder = 91,
330 ScaleVisibility = 23,
579 bool active,
bool useExpr,
const QString& expr,
const QString& field );
587 void removeAllDataDefinedProperties();
685 enum DataDefinedValueType
703 bool dataDefinedValEval( DataDefinedValueType valType,
707 void parseTextStyle(
QFont& labelFont,
757 , mUseOrigin( false )
759 , mRotationOffset( 0.0 )
760 , mUseRotation( false )
762 , mUseCenter( false )
765 , mPicture( nullptr )
766 , mPictureBuffer( 0.0 )
782 void setRotation(
const double rotation ) { mRotation = rotation; }
822 double mRotationOffset;
838 double mPictureBuffer;
893 void numCandidatePositions(
int& candPoint,
int& candLine,
int& candPolygon );
894 void setNumCandidatePositions(
int candPoint,
int candLine,
int candPolygon );
896 enum Search {
Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain, Falp };
898 void setSearchMethod(
Search s );
899 Search searchMethod()
const;
901 bool isShowingCandidates()
const;
902 void setShowingCandidates(
bool showing );
906 bool isShowingShadowRectangles()
const;
907 void setShowingShadowRectangles(
bool showing );
909 bool isShowingAllLabels()
const;
910 void setShowingAllLabels(
bool showing );
912 bool isShowingPartialsLabels()
const;
913 void setShowingPartialsLabels(
bool showing );
916 bool isDrawingOutlineLabels()
const;
917 void setDrawingOutlineLabels(
bool outline );
924 bool drawLabelRectOnly()
const;
932 void setDrawLabelRectOnly(
bool drawRect );
938 Q_DECL_DEPRECATED
virtual void init(
QgsMapRenderer* mr )
override;
947 static bool staticWillUseLayer(
const QString& layerID );
950 virtual void clearActiveLayers()
override;
952 virtual void clearActiveLayer(
const QString& layerID )
override;
974 virtual void exit()
override;
1006 void loadEngineSettings();
1007 void saveEngineSettings();
1008 void clearEngineSettings();
1076 void deleteTemporaryData();
1104 #endif // QGSPALLABELING_H
Label below point, slightly right of center.
Class for parsing and evaluation of expressions (formerly called "search strings").
A rectangle specified with double values.
Label on bottom-left of point.
double maxCurvedCharAngleOut
QHash< QString, QgsVectorLayerLabelProvider * > mLabelProviders
hashtable of label providers, being filled during labeling (key = layer ID)
QString leftDirectionSymbol
QgsMapUnitScale shapeSizeMapUnitScale
A container class for data source field mapping or expression.
QgsMapUnitScale shadowRadiusMapUnitScale
double rotationOffset() const
void setOrigin(const QgsPoint &point)
SizeUnit repeatDistanceUnit
A class to query the labeling structure at a given point (small wraper around pal RTree class) ...
UpsideDownLabels upsidedownLabels
double obstacleFactor
Obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels, 1.0 less likely to be covered
Label on top-left of point.
QgsLabelCandidate(const QRectF &r, double c)
QPainter::CompositionMode bufferBlendMode
PredefinedPointPosition
Positions for labels when using the QgsPalLabeling::OrderedPositionsAroundPoint placement mode...
QgsMapUnitScale shadowOffsetMapUnitScale
Candidates are placed in predefined positions around a point.
#define Q_NOWARN_DEPRECATED_PUSH
QuadrantPosition quadOffset
void setUseOrigin(const bool use)
Class that adds extra information to QgsLabelFeature for text labels.
The QgsLabelingEngineV2 class provides map labeling functionality.
Container of fields for a vector layer.
Label on top of point, slightly right of center.
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
A geometry is the spatial representation of a feature.
bool drawLabels
Whether to draw labels for this layer.
QHash< QString, QgsVectorLayerDiagramProvider * > mDiagramProviders
hashtable of diagram providers (key = layer ID)
void setUseCenter(const bool use)
QgsMapUnitScale repeatDistanceMapUnitScale
MultiLineAlign multilineAlign
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
A non GUI class for rendering a map layer set onto a QPainter.
QMap< QgsPalLayerSettings::DataDefinedProperties, QPair< QString, int > > dataDefinedNames() const
Map of data defined enum to names and old-style indecies The QPair contains a new string for layer pr...
QVector< PredefinedPointPosition > predefinedPositionOrder
Ordered list of predefined label positions for points.
double maxCurvedCharAngleIn
bool reverseDirectionSymbol
void setRotationOffset(const double rotation)
const QgsPoint & offset() const
Qt::PenJoinStyle bufferJoinStyle
double zIndex
Z-Index of label, where labels with a higher z-index are rendered on top of labels with a lower z-ind...
QgsStringReplacementCollection substitutions
Substitution collection for automatic text substitution with labels.
Arranges candidates following the curvature of a line feature.
QgsMapUnitScale fontSizeMapUnitScale
The QgsMapSettings class contains configuration for rendering of the map.
QgsMapUnitScale shapeBorderWidthMapUnitScale
Perform transforms between map coordinates and device coordinates.
Q_DECL_DEPRECATED void setStoredWithProject(bool store)
ObstacleType obstacleType
Controls how features act as obstacles for labels.
void setRotation(const double rotation)
const QgsCoordinateTransform * ct
QgsMapUnitScale shapeRadiiMapUnitScale
Offset distance applies from point geometry.
double rasterCompressFactor
bool bufferSizeInMapUnits
QgsPalLayerSettings mInvalidLayerSettings
SizeUnit shapeBorderWidthUnits
QPainter::CompositionMode blendMode
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setCenter(const QgsPoint &point)
Arranges candidates in a circle around a point (or centroid of a polygon).
const QgsMapToPixel * xform
QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined *> dataDefinedProperties
Map of current data defined properties.
void setText(const QString &text)
QgsMapUnitScale bufferSizeMapUnitScale
OffsetType
Behaviour modifier for label offset and distance, only applies in some label placement modes...
QPainter::CompositionMode shapeBlendMode
SizeUnit shadowOffsetUnits
SizeUnit
Units used for option sizes, before being converted to rendered sizes.
const QgsPoint & center() const
A class to represent a point.
Qt::PenJoinStyle shapeJoinStyle
Offset distance applies from rendered symbol bounds.
const QgsPoint & origin() const
void setDpiRatio(const double ratio)
double pictureBuffer() const
Stores the settings for rendering of all diagrams for a layer.
unsigned int placementFlags
#define Q_NOWARN_DEPRECATED_POP
Placement
Placement modes which determine how label candidates are generated for a feature. ...
QString rightDirectionSymbol
Arranges candidates over a point (or centroid of a polygon), or at a preset offset from the point...
const QgsPoint & size() const
Contains information about the context of a rendering operation.
void setPicture(QPicture *picture)
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
void setOffset(const QgsPoint &point)
QgsMapUnitScale distMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
bool fitInPolygonOnly
True if only labels which completely fit within a polygon are allowed.
A collection of string replacements (specified using QgsStringReplacement objects).
bool shadowRadiusAlphaOnly
OffsetType offsetType
Offset type for layer (only applies in certain placement modes)
bool useSubstitutions
True if substitutions should be applied.
Label below point, slightly left of center.
SizeUnit shadowRadiusUnits
LabelPosition is a candidate feature label position.
Label on top of point, slightly left of center.
const QPicture * picture() const
bool labelOffsetInMapUnits
QPainter::CompositionMode shadowBlendMode
bool isExpression
Is this label made from a expression string eg FieldName || 'mm'.
void setSize(const QgsPoint &point)
Class that stores computed placement from labeling engine.
QgsMapUnitScale shapeOffsetMapUnitScale
LinePlacementFlags
Line placement flags, which control how candidates are generated for a linear feature.
QList< QgsLabelCandidate > mCandidates
Labeling engine interface.
void setPictureBuffer(const double buffer)
SizeUnit shapeOffsetUnits
Q_DECL_DEPRECATED const QList< QgsLabelCandidate > & candidates()
void setUseRotation(const bool use)
Represents a vector layer which manages a vector based data sets.
Maintains current state of more grainular and temporal values when creating/painting component parts ...
RotationType shapeRotationType
QgsMapUnitScale labelOffsetMapUnitScale
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels...
DirectionSymbols placeDirectionSymbol
Arranges candidates scattered throughout a polygon feature.
QgsLabelingEngineV2 * mEngine
New labeling engine to interface with PAL.
Q_DECL_DEPRECATED bool isStoredWithProject() const