21 #ifndef QGSPALLABELING_H
22 #define QGSPALLABELING_H
26 #include <QFontDatabase>
178 FontLetterSpacing = 28,
179 FontWordSpacing = 29,
183 MultiLineWrapChar = 31,
184 MultiLineHeight = 32,
185 MultiLineAlignment = 33,
189 DirSymbPlacement = 37,
201 BufferJoinStyle = 44,
202 BufferBlendMode = 45,
212 ShapeRotationType = 52,
215 ShapeOffsetUnits = 55,
217 ShapeRadiiUnits = 57,
218 ShapeTransparency = 63,
221 ShapeBorderColor = 59,
222 ShapeBorderWidth = 60,
223 ShapeBorderWidthUnits = 61,
229 ShadowOffsetAngle = 67,
230 ShadowOffsetDist = 68,
231 ShadowOffsetUnits = 69,
233 ShadowRadiusUnits = 71,
234 ShadowTransparency = 72,
237 ShadowBlendMode = 75,
247 CurvedCharAngleInOut = 83,
255 RepeatDistanceUnit = 86,
258 ScaleVisibility = 23,
443 bool active,
bool useExpr,
const QString& expr,
const QString& field );
543 bool dataDefinedValEval(
const QString& valType,
547 void parseTextStyle(
QFont& labelFont,
551 void parseTextBuffer();
553 void parseTextFormatting();
555 void parseShapeBackground();
557 void parseDropShadow();
590 , mUseOrigin( false )
592 , mRotationOffset( 0.0 )
593 , mUseRotation( false )
595 , mUseCenter( false )
599 , mPictureBuffer( 0.0 )
615 void setRotation(
const double rotation ) { mRotation = rotation; }
655 double mRotationOffset;
671 double mPictureBuffer;
719 void numCandidatePositions(
int& candPoint,
int& candLine,
int& candPolygon );
720 void setNumCandidatePositions(
int candPoint,
int candLine,
int candPolygon );
722 enum Search {
Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain, Falp };
724 void setSearchMethod( Search s );
725 Search searchMethod()
const;
757 static bool staticWillUseLayer(
const QString& layerID );
773 virtual void exit()
override;
808 void loadEngineSettings();
809 void saveEngineSettings();
810 void clearEngineSettings();
875 void deleteTemporaryData();
913 #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").
void setShowingCandidates(bool showing)
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
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 QgsMapSettings * mMapSettings
const QString & text() const
virtual void clearActiveLayer(const QString &layerID)=0
clears data defined objects from PAL layer settings for a registered layer
virtual QgsPalLayerSettings & layer(const QString &layerName)=0
returns PAL layer settings for a registered layer
A class to query the labeling structure at a given point (small wraper around pal RTree class) ...
void setShowingPartialsLabels(bool showing)
QPainter::CompositionMode bufferBlendMode
A layer of spacial entites.
double rotationOffset() const
QgsMapUnitScale shadowOffsetMapUnitScale
const QgsPoint & size() const
bool mShowingPartialsLabels
#define Q_NOWARN_DEPRECATED_PUSH
QuadrantPosition quadOffset
void setUseOrigin(const bool use)
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
void setUseCenter(const bool use)
QgsMapUnitScale repeatDistanceMapUnitScale
MultiLineAlign multilineAlign
virtual int addDiagramLayer(QgsVectorLayer *layer, const QgsDiagramLayerSettings *s)
adds a diagram layer to the labeling engine
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)
void setRotation(const double rotation)
QList< QgsPalGeometry * > geometries
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
QHash< QString, QgsDiagramLayerSettings > mActiveDiagramLayers
Q_DECL_DEPRECATED bool isStoredWithProject() const
void setCenter(const QgsPoint &point)
const QgsMapToPixel * xform
QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined * > dataDefinedProperties
Map of current data defined properties.
bool isShowingPartialsLabels() const
void setText(const QString &text)
QgsMapUnitScale bufferSizeMapUnitScale
QPainter::CompositionMode shapeBlendMode
SizeUnit shadowOffsetUnits
SizeUnit
Units used for option sizes, before being converted to rendered sizes.
const QList< QgsLabelCandidate > & candidates()
A class to represent a point.
QHash< QString, QgsPalLayerSettings > mActiveLayers
Qt::PenJoinStyle shapeJoinStyle
unsigned int upsidedownLabels
void setDpiRatio(const double ratio)
unsigned int placementFlags
#define Q_NOWARN_DEPRECATED_POP
QString rightDirectionSymbol
bool isShowingCandidates() const
void setDrawingOutlineLabels(bool outline)
Contains information about the context of a rendering operation.
void setShowingShadowRectangles(bool showing)
void setPicture(QPicture *picture)
void setOffset(const QgsPoint &point)
virtual void registerFeature(const QString &layerID, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext(), QString dxfLayer=QString::null)=0
called for every feature
QgsMapUnitScale distMapUnitScale
virtual void drawLabeling(QgsRenderContext &context)=0
called when the map is drawn and labels should be placed
bool shadowRadiusAlphaOnly
SizeUnit shadowRadiusUnits
QgsLabelCandidate(QRectF r, double c)
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
bool isShowingAllLabels() const
void setShowingAllLabels(bool showing)
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...
bool isShowingShadowRectangles() const
QgsMapUnitScale shapeOffsetMapUnitScale
QList< QgsLabelCandidate > mCandidates
Labeling engine interface.
void setPictureBuffer(const double buffer)
SizeUnit shapeOffsetUnits
bool isDrawingOutlineLabels() const
void setUseRotation(const bool use)
virtual void registerDiagramFeature(const QString &layerID, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext())
called for every diagram feature
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
QgsLabelingResults * mResults
const QgsFields * mCurFields
DirectionSymbols placeDirectionSymbol