21 #ifndef QGSPALLABELING_H
22 #define QGSPALLABELING_H
26 #include <QFontDatabase>
243 FontLetterSpacing = 28,
244 FontWordSpacing = 29,
248 MultiLineWrapChar = 31,
249 MultiLineHeight = 32,
250 MultiLineAlignment = 33,
254 DirSymbPlacement = 37,
266 BufferJoinStyle = 44,
267 BufferBlendMode = 45,
277 ShapeRotationType = 52,
280 ShapeOffsetUnits = 55,
282 ShapeRadiiUnits = 57,
283 ShapeTransparency = 63,
286 ShapeBorderColor = 59,
287 ShapeBorderWidth = 60,
288 ShapeBorderWidthUnits = 61,
294 ShadowOffsetAngle = 67,
295 ShadowOffsetDist = 68,
296 ShadowOffsetUnits = 69,
298 ShadowRadiusUnits = 71,
299 ShadowTransparency = 72,
302 ShadowBlendMode = 75,
312 CurvedCharAngleInOut = 83,
320 RepeatDistanceUnit = 86,
322 PredefinedPositionOrder = 91,
325 ScaleVisibility = 23,
569 bool active,
bool useExpr,
const QString& expr,
const QString& field );
577 void removeAllDataDefinedProperties();
675 enum DataDefinedValueType
693 bool dataDefinedValEval( DataDefinedValueType valType,
697 void parseTextStyle(
QFont& labelFont,
745 , mUseOrigin( false )
747 , mRotationOffset( 0.0 )
748 , mUseRotation( false )
750 , mUseCenter( false )
753 , mPicture( nullptr )
754 , mPictureBuffer( 0.0 )
770 void setRotation(
const double rotation ) { mRotation = rotation; }
810 double mRotationOffset;
826 double mPictureBuffer;
878 void numCandidatePositions(
int& candPoint,
int& candLine,
int& candPolygon );
879 void setNumCandidatePositions(
int candPoint,
int candLine,
int candPolygon );
881 enum Search {
Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain, Falp };
883 void setSearchMethod( Search s );
884 Search searchMethod()
const;
886 bool isShowingCandidates()
const;
887 void setShowingCandidates(
bool showing );
891 bool isShowingShadowRectangles()
const;
892 void setShowingShadowRectangles(
bool showing );
894 bool isShowingAllLabels()
const;
895 void setShowingAllLabels(
bool showing );
897 bool isShowingPartialsLabels()
const;
898 void setShowingPartialsLabels(
bool showing );
901 bool isDrawingOutlineLabels()
const;
902 void setDrawingOutlineLabels(
bool outline );
909 bool drawLabelRectOnly()
const;
917 void setDrawLabelRectOnly(
bool drawRect );
932 static bool staticWillUseLayer(
const QString& layerID );
959 virtual void exit()
override;
991 void loadEngineSettings();
992 void saveEngineSettings();
993 void clearEngineSettings();
1061 void deleteTemporaryData();
1089 #endif // QGSPALLABELING_H
Label below point, slightly right of center.
virtual void exit()=0
called when we're done with rendering
Class for parsing and evaluation of expressions (formerly called "search strings").
virtual void clearActiveLayers()=0
clears all PAL layer settings for registered layers
virtual Q_DECL_DEPRECATED void init(QgsMapRenderer *mp)=0
called when we're going to start with rendering
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
virtual int prepareLayer(QgsVectorLayer *layer, QStringList &attrNames, QgsRenderContext &ctx)=0
called when starting rendering of a layer
void setOrigin(const QgsPoint &point)
SizeUnit repeatDistanceUnit
virtual void clearActiveLayer(const QString &layerID)=0
clears data defined objects from PAL layer settings for a registered layer
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...
virtual Q_DECL_DEPRECATED QgsPalLayerSettings & layer(const QString &layerName)=0
returns PAL layer settings for a registered layer
double rotationOffset() const
virtual int prepareDiagramLayer(QgsVectorLayer *layer, QStringList &attrNames, QgsRenderContext &ctx)
adds a diagram layer to the labeling engine
QgsMapUnitScale shadowOffsetMapUnitScale
const QgsPoint & size() const
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...
const QgsPoint & origin() const
A non GUI class for rendering a map layer set onto a QPainter.
QVector< PredefinedPointPosition > predefinedPositionOrder
Ordered list of predefined label positions for points.
virtual Q_DECL_DEPRECATED QList< QgsLabelPosition > labelsWithinRect(const QgsRectangle &r)=0
return infos about labels within a given (map) rectangle
const QgsPoint & center() const
double maxCurvedCharAngleIn
bool reverseDirectionSymbol
void setRotationOffset(const double rotation)
virtual void registerFeature(const QString &layerID, QgsFeature &feat, QgsRenderContext &context)=0
called for every feature
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...
Arranges candidates following the curvature of a line feature.
QgsMapUnitScale fontSizeMapUnitScale
const QgsPoint & offset() const
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.
virtual Q_DECL_DEPRECATED QList< QgsLabelPosition > labelsAtPosition(const QgsPoint &p)=0
return infos about labels at a given (map) position
const QPicture * picture() const
double rasterCompressFactor
bool bufferSizeInMapUnits
QgsPalLayerSettings mInvalidLayerSettings
virtual QgsLabelingEngineInterface * clone()=0
called when passing engine among map renderers
SizeUnit shapeBorderWidthUnits
QPainter::CompositionMode blendMode
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine...
Q_DECL_DEPRECATED bool isStoredWithProject() const
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.
virtual Q_DECL_DEPRECATED int addDiagramLayer(QgsVectorLayer *layer, const QgsDiagramLayerSettings *s)
adds a diagram layer to the labeling engine
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.
A class to represent a point.
Qt::PenJoinStyle shapeJoinStyle
Offset distance applies from rendered symbol bounds.
void setDpiRatio(const double ratio)
unsigned int placementFlags
#define Q_NOWARN_DEPRECATED_POP
Placement
Placement modes which determine how label candidates are generated for a feature. ...
QString rightDirectionSymbol
virtual void registerDiagramFeature(const QString &layerID, QgsFeature &feat, QgsRenderContext &context)
called for every diagram feature
Arranges candidates over a point (or centroid of a polygon), or at a preset offset from the point...
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.
virtual void drawLabeling(QgsRenderContext &context)=0
called when the map is drawn and labels should be placed
bool shadowRadiusAlphaOnly
OffsetType offsetType
Offset type for layer (only applies in certain placement modes)
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.
bool labelOffsetInMapUnits
double pictureBuffer() const
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.
virtual bool willUseLayer(QgsVectorLayer *layer)=0
called to find out whether the layer is used for labeling
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...
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.