21 #ifndef QGSPALLABELING_H
22 #define QGSPALLABELING_H
26 #include <QFontDatabase>
196 FontLetterSpacing = 28,
197 FontWordSpacing = 29,
201 MultiLineWrapChar = 31,
202 MultiLineHeight = 32,
203 MultiLineAlignment = 33,
207 DirSymbPlacement = 37,
219 BufferJoinStyle = 44,
220 BufferBlendMode = 45,
230 ShapeRotationType = 52,
233 ShapeOffsetUnits = 55,
235 ShapeRadiiUnits = 57,
236 ShapeTransparency = 63,
239 ShapeBorderColor = 59,
240 ShapeBorderWidth = 60,
241 ShapeBorderWidthUnits = 61,
247 ShadowOffsetAngle = 67,
248 ShadowOffsetDist = 68,
249 ShadowOffsetUnits = 69,
251 ShadowRadiusUnits = 71,
252 ShadowTransparency = 72,
255 ShadowBlendMode = 75,
265 CurvedCharAngleInOut = 83,
273 RepeatDistanceUnit = 86,
277 ScaleVisibility = 23,
503 bool active,
bool useExpr,
const QString& expr,
const QString& field );
511 void removeAllDataDefinedProperties();
607 enum DataDefinedValueType
625 bool dataDefinedValEval( DataDefinedValueType valType,
629 void parseTextStyle(
QFont& labelFont,
675 , mUseOrigin( false )
677 , mRotationOffset( 0.0 )
678 , mUseRotation( false )
680 , mUseCenter( false )
684 , mPictureBuffer( 0.0 )
700 void setRotation(
const double rotation ) { mRotation = rotation; }
740 double mRotationOffset;
756 double mPictureBuffer;
807 void numCandidatePositions(
int& candPoint,
int& candLine,
int& candPolygon );
808 void setNumCandidatePositions(
int candPoint,
int candLine,
int candPolygon );
810 enum Search {
Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain, Falp };
812 void setSearchMethod( Search s );
813 Search searchMethod()
const;
815 bool isShowingCandidates()
const;
816 void setShowingCandidates(
bool showing );
820 bool isShowingShadowRectangles()
const;
821 void setShowingShadowRectangles(
bool showing );
823 bool isShowingAllLabels()
const;
824 void setShowingAllLabels(
bool showing );
826 bool isShowingPartialsLabels()
const;
827 void setShowingPartialsLabels(
bool showing );
830 bool isDrawingOutlineLabels()
const;
831 void setDrawingOutlineLabels(
bool outline );
838 bool drawLabelRectOnly()
const;
846 void setDrawLabelRectOnly(
bool drawRect );
861 static bool staticWillUseLayer(
const QString& layerID );
889 virtual void exit()
override;
921 void loadEngineSettings();
922 void saveEngineSettings();
923 void clearEngineSettings();
990 void deleteTemporaryData();
1018 #endif // QGSPALLABELING_H
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.
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
const QString & text() const
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
QgsLabelCandidate(const QRectF &r, double c)
QPainter::CompositionMode bufferBlendMode
virtual void registerFeature(const QString &layerID, QgsFeature &feat, QgsRenderContext &context, const QString &dxfLayer=QString::null)=0
called for every feature
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
#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.
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.
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)
Qt::PenJoinStyle bufferJoinStyle
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
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)
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
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
void setDpiRatio(const double ratio)
unsigned int placementFlags
#define Q_NOWARN_DEPRECATED_POP
QString rightDirectionSymbol
virtual void registerDiagramFeature(const QString &layerID, QgsFeature &feat, QgsRenderContext &context)
called for every diagram feature
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
SizeUnit shadowRadiusUnits
LabelPosition is a candidate feature label position.
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
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
QgsLabelingEngineV2 * mEngine
New labeling engine to interface with PAL.