QGIS API Documentation  master-6227475
QgsPalLayerSettings Class Reference

#include <qgspallabeling.h>

+ Collaboration diagram for QgsPalLayerSettings:

List of all members.

Public Types

enum  DataDefinedProperties {
  Size = 0, Bold = 1, Italic = 2, Underline = 3,
  Color = 4, Strikeout = 5, Family = 6, FontStyle = 21,
  FontSizeUnit = 22, FontTransp = 18, FontCase = 27, FontLetterSpacing = 28,
  FontWordSpacing = 29, FontBlendMode = 30, MultiLineWrapChar = 31, MultiLineHeight = 32,
  MultiLineAlignment = 33, DirSymbDraw = 34, DirSymbLeft = 35, DirSymbRight = 36,
  DirSymbPlacement = 37, DirSymbReverse = 38, NumFormat = 39, NumDecimals = 40,
  NumPlusSign = 41, BufferDraw = 42, BufferSize = 7, BufferUnit = 43,
  BufferColor = 8, BufferTransp = 19, BufferJoinStyle = 44, BufferBlendMode = 45,
  ShapeDraw = 46, ShapeKind = 47, ShapeSVGFile = 48, ShapeSizeType = 49,
  ShapeSizeX = 50, ShapeSizeY = 85, ShapeSizeUnits = 51, ShapeRotationType = 52,
  ShapeRotation = 53, ShapeOffset = 54, ShapeOffsetUnits = 55, ShapeRadii = 56,
  ShapeRadiiUnits = 57, ShapeTransparency = 63, ShapeBlendMode = 64, ShapeFillColor = 58,
  ShapeBorderColor = 59, ShapeBorderWidth = 60, ShapeBorderWidthUnits = 61, ShapeJoinStyle = 62,
  ShadowDraw = 65, ShadowUnder = 66, ShadowOffsetAngle = 67, ShadowOffsetDist = 68,
  ShadowOffsetUnits = 69, ShadowRadius = 70, ShadowRadiusUnits = 71, ShadowTransparency = 72,
  ShadowScale = 73, ShadowColor = 74, ShadowBlendMode = 75, CentroidWhole = 76,
  OffsetQuad = 77, OffsetXY = 78, OffsetUnits = 80, LabelDistance = 13,
  DistanceUnits = 81, OffsetRotation = 82, CurvedCharAngleInOut = 83, PositionX = 9,
  PositionY = 10, Hali = 11, Vali = 12, Rotation = 14,
  ScaleVisibility = 23, MinScale = 16, MaxScale = 17, FontLimitPixel = 24,
  FontMinPixel = 25, FontMaxPixel = 26, Show = 15, AlwaysShow = 20
}
enum  DirectionSymbols { SymbolLeftRight, SymbolAbove, SymbolBelow }
enum  LinePlacementFlags { OnLine = 1, AboveLine = 2, BelowLine = 4, MapOrientation = 8 }
enum  MultiLineAlign { MultiLeft = 0, MultiCenter, MultiRight }
enum  Placement {
  AroundPoint, OverPoint, Line, Curved,
  Horizontal, Free
}
enum  QuadrantPosition {
  QuadrantAboveLeft, QuadrantAbove, QuadrantAboveRight, QuadrantLeft,
  QuadrantOver, QuadrantRight, QuadrantBelowLeft, QuadrantBelow,
  QuadrantBelowRight
}
enum  RotationType { RotationSync = 0, RotationOffset, RotationFixed }
enum  ShadowType { ShadowLowest = 0, ShadowText, ShadowBuffer, ShadowShape }
enum  ShapeType {
  ShapeRectangle = 0, ShapeSquare, ShapeEllipse, ShapeCircle,
  ShapeSVG
}
enum  SizeType { SizeBuffer = 0, SizeFixed, SizePercent }
enum  SizeUnit { Points = 0, MM, MapUnits, Percent }
 Units used for option sizes, before being converted to rendered sizes. More...
enum  UpsideDownLabels { Upright, ShowDefined, ShowAll }

Public Member Functions

 QgsPalLayerSettings ()
 QgsPalLayerSettings (const QgsPalLayerSettings &s)
 ~QgsPalLayerSettings ()
void calculateLabelSize (const QFontMetricsF *fm, QString text, double &labelX, double &labelY, QgsFeature *f=0)
bool dataDefinedEvaluate (QgsPalLayerSettings::DataDefinedProperties p, QVariant &exprVal) const
 Get data defined property value from expression string or attribute field name.
bool dataDefinedIsActive (QgsPalLayerSettings::DataDefinedProperties p) const
 Whether data definition is active.
QMap< QString, QString > dataDefinedMap (QgsPalLayerSettings::DataDefinedProperties p) const
 Get property value as separate values split into Qmap.
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 property key, and a reference to old-style numeric key (< QGIS 2.0)
QgsDataDefineddataDefinedProperty (DataDefinedProperties p)
 Get a data defined property pointer.
QList
< QgsPalLayerSettings::DataDefinedProperties
dataDefinedPropertyList ()
 Get current data defined properties.
bool dataDefinedUseExpression (QgsPalLayerSettings::DataDefinedProperties p) const
 Whether data definition is set to use an expression.
QVariant dataDefinedValue (QgsPalLayerSettings::DataDefinedProperties p, QgsFeature &f, const QgsFields &fields) const
 Get data defined property value from expression string or attribute field name.
QgsExpressiongetLabelExpression ()
 Returns the QgsExpression for this label settings.
void readFromLayer (QgsVectorLayer *layer)
void registerFeature (QgsVectorLayer *layer, QgsFeature &f, const QgsRenderContext &context)
void removeDataDefinedProperty (QgsPalLayerSettings::DataDefinedProperties p)
 Set a property to static instead data defined.
double scaleToPixelContext (double size, const QgsRenderContext &c, SizeUnit unit, bool rasterfactor=false) const
 Calculates size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
void setDataDefinedProperty (QgsPalLayerSettings::DataDefinedProperties p, bool active, bool useExpr, const QString &expr, const QString &field)
 Set a property as data defined.
int sizeToPixel (double size, const QgsRenderContext &c, SizeUnit unit, bool rasterfactor=false) const
 Calculates pixel size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
QString updateDataDefinedString (const QString &value)
 Convert old property value to new one as delimited values.
void writeToLayer (QgsVectorLayer *layer)

Public Attributes

bool addDirectionSymbol
double angleOffset
QPainter::CompositionMode blendMode
QPainter::CompositionMode bufferBlendMode
QColor bufferColor
bool bufferDraw
bool bufferDrawOld
Qt::PenJoinStyle bufferJoinStyle
bool bufferNoFill
double bufferSize
bool bufferSizeInMapUnits
int bufferTransp
bool centroidWhole
const QgsCoordinateTransformct
QMap
< QgsPalLayerSettings::DataDefinedProperties,
QgsDataDefined * > 
dataDefinedProperties
 Stores field names for data defined layer properties.
int decimals
bool displayAll
double dist
bool distInMapUnits
bool enabled
QgsGeometryextentGeom
int fieldIndex
QString fieldName
bool fontLimitPixelSize
int fontMaxPixelSize
int fontMinPixelSize
bool fontSizeInMapUnits
bool formatNumbers
QList< QgsPalGeometry * > geometries
bool isExpression
 Is this label made from a expression string eg FieldName || 'mm'.
bool labelOffsetInMapUnits
bool labelPerPart
QString leftDirectionSymbol
bool limitNumLabels
double maxCurvedCharAngleIn
double maxCurvedCharAngleOut
int maxNumLabels
QgsFeaturemCurFeat
const QgsFieldsmCurFields
bool mergeLines
int mFeatsRegPal
int mFeatsSendingToPal
int mFeaturesToLabel
double minFeatureSize
MultiLineAlign multilineAlign
double multilineHeight
bool obstacle
pal::Layer * palLayer
DirectionSymbols placeDirectionSymbol
Placement placement
unsigned int placementFlags
bool plusSign
bool preserveRotation
QColor previewBkgrdColor
int priority
QgsPoint ptOne
QgsPoint ptZero
QuadrantPosition quadOffset
double rasterCompressFactor
bool reverseDirectionSymbol
QString rightDirectionSymbol
int scaleMax
int scaleMin
bool scaleVisibility
QPainter::CompositionMode shadowBlendMode
QColor shadowColor
bool shadowDraw
int shadowOffsetAngle
double shadowOffsetDist
bool shadowOffsetGlobal
SizeUnit shadowOffsetUnits
double shadowRadius
bool shadowRadiusAlphaOnly
SizeUnit shadowRadiusUnits
int shadowScale
int shadowTransparency
ShadowType shadowUnder
QPainter::CompositionMode shapeBlendMode
QColor shapeBorderColor
double shapeBorderWidth
SizeUnit shapeBorderWidthUnits
bool shapeDraw
QColor shapeFillColor
Qt::PenJoinStyle shapeJoinStyle
QPointF shapeOffset
SizeUnit shapeOffsetUnits
QPointF shapeRadii
SizeUnit shapeRadiiUnits
double shapeRotation
RotationType shapeRotationType
QPointF shapeSize
SizeType shapeSizeType
SizeUnit shapeSizeUnits
QString shapeSVGFile
int shapeTransparency
ShapeType shapeType
bool showingShadowRects
QColor textColor
QFont textFont
QString textNamedStyle
int textTransp
unsigned int upsidedownLabels
double vectorScaleFactor
QString wrapChar
const QgsMapToPixelxform
double xOffset
double yOffset

Private Member Functions

bool checkMinimumSizeMM (const QgsRenderContext &ct, QgsGeometry *geom, double minSize) const
 Checks if a feature is larger than a minimum size (in mm)
bool dataDefinedValEval (const QString &valType, QgsPalLayerSettings::DataDefinedProperties p, QVariant &exprVal)
void parseDropShadow ()
void parseShapeBackground ()
void parseTextBuffer ()
void parseTextFormatting ()
void parseTextStyle (QFont &labelFont, QgsPalLayerSettings::SizeUnit fontunits, const QgsRenderContext &context)
void readDataDefinedProperty (QgsVectorLayer *layer, QgsPalLayerSettings::DataDefinedProperties p, QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined * > &propertyMap)
void readDataDefinedPropertyMap (QgsVectorLayer *layer, QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined * > &propertyMap)
void updateFontViaStyle (QFont &font, const QString &fontstyle)
 Updates font with named style.
void writeDataDefinedPropertyMap (QgsVectorLayer *layer, const QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined * > &propertyMap)

Private Attributes

QMap< DataDefinedProperties,
QVariant > 
dataDefinedValues
QgsExpressionexpression
QMap
< QgsPalLayerSettings::DataDefinedProperties,
QPair< QString, int > > 
mDataDefinedNames
QFontDatabase mFontDB

Detailed Description

Definition at line 61 of file qgspallabeling.h.


Member Enumeration Documentation

Enumerator:
Size 
Bold 
Italic 
Underline 
Color 
Strikeout 
Family 
FontStyle 
FontSizeUnit 
FontTransp 
FontCase 
FontLetterSpacing 
FontWordSpacing 
FontBlendMode 
MultiLineWrapChar 
MultiLineHeight 
MultiLineAlignment 
DirSymbDraw 
DirSymbLeft 
DirSymbRight 
DirSymbPlacement 
DirSymbReverse 
NumFormat 
NumDecimals 
NumPlusSign 
BufferDraw 
BufferSize 
BufferUnit 
BufferColor 
BufferTransp 
BufferJoinStyle 
BufferBlendMode 
ShapeDraw 
ShapeKind 
ShapeSVGFile 
ShapeSizeType 
ShapeSizeX 
ShapeSizeY 
ShapeSizeUnits 
ShapeRotationType 
ShapeRotation 
ShapeOffset 
ShapeOffsetUnits 
ShapeRadii 
ShapeRadiiUnits 
ShapeTransparency 
ShapeBlendMode 
ShapeFillColor 
ShapeBorderColor 
ShapeBorderWidth 
ShapeBorderWidthUnits 
ShapeJoinStyle 
ShadowDraw 
ShadowUnder 
ShadowOffsetAngle 
ShadowOffsetDist 
ShadowOffsetUnits 
ShadowRadius 
ShadowRadiusUnits 
ShadowTransparency 
ShadowScale 
ShadowColor 
ShadowBlendMode 
CentroidWhole 
OffsetQuad 
OffsetXY 
OffsetUnits 
LabelDistance 
DistanceUnits 
OffsetRotation 
CurvedCharAngleInOut 
PositionX 
PositionY 
Hali 
Vali 
Rotation 
ScaleVisibility 
MinScale 
MaxScale 
FontLimitPixel 
FontMinPixel 
FontMaxPixel 
Show 
AlwaysShow 

Definition at line 161 of file qgspallabeling.h.

Enumerator:
SymbolLeftRight 
SymbolAbove 
SymbolBelow 

Definition at line 106 of file qgspallabeling.h.

Enumerator:
OnLine 
AboveLine 
BelowLine 
MapOrientation 

Definition at line 78 of file qgspallabeling.h.

Enumerator:
MultiLeft 
MultiCenter 
MultiRight 

Definition at line 113 of file qgspallabeling.h.

Enumerator:
AroundPoint 
OverPoint 
Line 
Curved 
Horizontal 
Free 

Definition at line 68 of file qgspallabeling.h.

Enumerator:
QuadrantAboveLeft 
QuadrantAbove 
QuadrantAboveRight 
QuadrantLeft 
QuadrantOver 
QuadrantRight 
QuadrantBelowLeft 
QuadrantBelow 
QuadrantBelowRight 

Definition at line 86 of file qgspallabeling.h.

Enumerator:
RotationSync 
RotationOffset 
RotationFixed 

Definition at line 136 of file qgspallabeling.h.

Enumerator:
ShadowLowest 
ShadowText 
ShadowBuffer 
ShadowShape 

Definition at line 152 of file qgspallabeling.h.

Enumerator:
ShapeRectangle 
ShapeSquare 
ShapeEllipse 
ShapeCircle 
ShapeSVG 

Definition at line 120 of file qgspallabeling.h.

Enumerator:
SizeBuffer 
SizeFixed 
SizePercent 

Definition at line 129 of file qgspallabeling.h.

Units used for option sizes, before being converted to rendered sizes.

Enumerator:
Points 
MM 
MapUnits 
Percent 

Definition at line 144 of file qgspallabeling.h.

Enumerator:
Upright 
ShowDefined 
ShowAll 

Definition at line 99 of file qgspallabeling.h.


Constructor & Destructor Documentation

Definition at line 199 of file qgspallabeling.cpp.

References addDirectionSymbol, AlwaysShow, angleOffset, AroundPoint, blendMode, Bold, BufferBlendMode, bufferBlendMode, BufferColor, bufferColor, BufferDraw, bufferDraw, bufferDrawOld, BufferJoinStyle, bufferJoinStyle, bufferNoFill, BufferSize, bufferSize, bufferSizeInMapUnits, BufferTransp, bufferTransp, BufferUnit, CentroidWhole, centroidWhole, Color, CurvedCharAngleInOut, decimals, DirSymbDraw, DirSymbLeft, DirSymbPlacement, DirSymbReverse, DirSymbRight, displayAll, dist, DistanceUnits, distInMapUnits, enabled, Family, FontBlendMode, FontCase, FontLetterSpacing, FontLimitPixel, fontLimitPixelSize, FontMaxPixel, fontMaxPixelSize, FontMinPixel, fontMinPixelSize, fontSizeInMapUnits, FontSizeUnit, FontStyle, FontTransp, FontWordSpacing, formatNumbers, Hali, Italic, LabelDistance, labelOffsetInMapUnits, labelPerPart, leftDirectionSymbol, limitNumLabels, maxCurvedCharAngleIn, maxCurvedCharAngleOut, maxNumLabels, MaxScale, mDataDefinedNames, mergeLines, minFeatureSize, MinScale, MM, MultiLeft, multilineAlign, MultiLineAlignment, MultiLineHeight, multilineHeight, MultiLineWrapChar, NumDecimals, NumFormat, NumPlusSign, obstacle, OffsetQuad, OffsetRotation, OffsetUnits, OffsetXY, placeDirectionSymbol, placement, placementFlags, plusSign, PositionX, PositionY, preserveRotation, previewBkgrdColor, priority, quadOffset, QuadrantOver, rasterCompressFactor, reverseDirectionSymbol, rightDirectionSymbol, Rotation, RotationSync, scaleMax, scaleMin, ScaleVisibility, scaleVisibility, ShadowBlendMode, shadowBlendMode, ShadowColor, shadowColor, ShadowDraw, shadowDraw, ShadowLowest, ShadowOffsetAngle, shadowOffsetAngle, ShadowOffsetDist, shadowOffsetDist, shadowOffsetGlobal, ShadowOffsetUnits, shadowOffsetUnits, ShadowRadius, shadowRadius, shadowRadiusAlphaOnly, ShadowRadiusUnits, shadowRadiusUnits, ShadowScale, shadowScale, ShadowTransparency, shadowTransparency, ShadowUnder, shadowUnder, ShapeBlendMode, shapeBlendMode, ShapeBorderColor, shapeBorderColor, ShapeBorderWidth, shapeBorderWidth, ShapeBorderWidthUnits, shapeBorderWidthUnits, ShapeDraw, shapeDraw, ShapeFillColor, shapeFillColor, ShapeJoinStyle, shapeJoinStyle, ShapeKind, ShapeOffset, shapeOffset, ShapeOffsetUnits, shapeOffsetUnits, ShapeRadii, shapeRadii, ShapeRadiiUnits, shapeRadiiUnits, ShapeRectangle, ShapeRotation, shapeRotation, ShapeRotationType, shapeRotationType, shapeSize, ShapeSizeType, shapeSizeType, ShapeSizeUnits, shapeSizeUnits, ShapeSizeX, ShapeSizeY, ShapeSVGFile, shapeSVGFile, ShapeTransparency, shapeTransparency, shapeType, Show, showingShadowRects, Size, SizeBuffer, Strikeout, SymbolLeftRight, textColor, textFont, textNamedStyle, textTransp, Underline, Upright, upsidedownLabels, Vali, vectorScaleFactor, wrapChar, xOffset, and yOffset.

Definition at line 425 of file qgspallabeling.cpp.

References addDirectionSymbol, angleOffset, blendMode, bufferBlendMode, bufferColor, bufferDraw, bufferJoinStyle, bufferNoFill, bufferSize, bufferSizeInMapUnits, bufferTransp, centroidWhole, ct, dataDefinedProperties, decimals, displayAll, dist, distInMapUnits, enabled, expression, extentGeom, fieldName, fontLimitPixelSize, fontMaxPixelSize, fontMinPixelSize, fontSizeInMapUnits, formatNumbers, isExpression, labelOffsetInMapUnits, labelPerPart, leftDirectionSymbol, limitNumLabels, maxCurvedCharAngleIn, maxCurvedCharAngleOut, maxNumLabels, mDataDefinedNames, mergeLines, minFeatureSize, multilineAlign, multilineHeight, obstacle, placeDirectionSymbol, placement, placementFlags, plusSign, preserveRotation, previewBkgrdColor, priority, quadOffset, rasterCompressFactor, reverseDirectionSymbol, rightDirectionSymbol, scaleMax, scaleMin, scaleVisibility, shadowBlendMode, shadowColor, shadowDraw, shadowOffsetAngle, shadowOffsetDist, shadowOffsetGlobal, shadowOffsetUnits, shadowRadius, shadowRadiusAlphaOnly, shadowRadiusUnits, shadowScale, shadowTransparency, shadowUnder, shapeBlendMode, shapeBorderColor, shapeBorderWidth, shapeBorderWidthUnits, shapeDraw, shapeFillColor, shapeJoinStyle, shapeOffset, shapeOffsetUnits, shapeRadii, shapeRadiiUnits, shapeRotation, shapeRotationType, shapeSize, shapeSizeType, shapeSizeUnits, shapeSVGFile, shapeTransparency, shapeType, textColor, textFont, textNamedStyle, textTransp, upsidedownLabels, vectorScaleFactor, wrapChar, xOffset, and yOffset.


Member Function Documentation

bool QgsPalLayerSettings::checkMinimumSizeMM ( const QgsRenderContext ct,
QgsGeometry geom,
double  minSize 
) const [private]

Checks if a feature is larger than a minimum size (in mm)

Returns:
true if above size, false if below

Definition at line 1255 of file qgspallabeling.cpp.

References QgsGeometry::area(), QgsGeometry::length(), QGis::Line, QgsRenderContext::mapToPixel(), QgsMapToPixel::mapUnitsPerPixel(), QGis::Point, QGis::Polygon, QgsRenderContext::scaleFactor(), and QgsGeometry::type().

Referenced by registerFeature().

Get data defined property value from expression string or attribute field name.

Returns:
true/false whether result is null or invalid
Note:
not available in python bindings; added in 1.9

Definition at line 1213 of file qgspallabeling.cpp.

References dataDefinedValue(), mCurFeat, and mCurFields.

Referenced by dataDefinedValEval(), parseDropShadow(), parseShapeBackground(), parseTextFormatting(), parseTextStyle(), and registerFeature().

Whether data definition is active.

Definition at line 1231 of file qgspallabeling.cpp.

References dataDefinedProperties.

Get property value as separate values split into Qmap.

Note:
not available in python bindings; added in 1.9

Definition at line 1145 of file qgspallabeling.cpp.

References dataDefinedProperties.

Map of data defined enum to names and old-style indecies The QPair contains a new string for layer property key, and a reference to old-style numeric key (< QGIS 2.0)

Note:
not available in python bindings; added in 1.9

Definition at line 493 of file qgspallabeling.h.

Get a data defined property pointer.

Note:
added in 1.9, helpful for Python access

Definition at line 1130 of file qgspallabeling.cpp.

References dataDefinedProperties.

Get current data defined properties.

Note:
added in 1.9, helpful for Python access

Definition at line 1140 of file qgspallabeling.cpp.

References dataDefinedProperties.

Whether data definition is set to use an expression.

Definition at line 1243 of file qgspallabeling.cpp.

References dataDefinedProperties.

Returns the QgsExpression for this label settings.

Definition at line 560 of file qgspallabeling.cpp.

References expression, and fieldName.

Referenced by QgsPalLabeling::prepareLayer(), and registerFeature().

Definition at line 801 of file qgspallabeling.cpp.

References _readColor(), addDirectionSymbol, angleOffset, blendMode, QgsMapRenderer::BlendMultiply, QgsMapRenderer::BlendNormal, bufferBlendMode, bufferColor, bufferDraw, bufferDrawOld, bufferJoinStyle, bufferNoFill, bufferSize, bufferSizeInMapUnits, bufferTransp, centroidWhole, QgsMapLayer::customProperty(), dataDefinedProperties, decimals, displayAll, dist, distInMapUnits, enabled, fieldName, fontLimitPixelSize, fontMaxPixelSize, fontMinPixelSize, fontSizeInMapUnits, formatNumbers, QgsMapRenderer::getCompositionMode(), isExpression, labelOffsetInMapUnits, labelPerPart, leftDirectionSymbol, limitNumLabels, maxCurvedCharAngleIn, maxCurvedCharAngleOut, maxNumLabels, mergeLines, minFeatureSize, MM, MultiLeft, multilineAlign, multilineHeight, obstacle, placeDirectionSymbol, placement, placementFlags, plusSign, preserveRotation, previewBkgrdColor, priority, quadOffset, QuadrantOver, readDataDefinedPropertyMap(), reverseDirectionSymbol, rightDirectionSymbol, RotationSync, scaleMax, scaleMin, scaleVisibility, shadowBlendMode, shadowColor, shadowDraw, ShadowLowest, shadowOffsetAngle, shadowOffsetDist, shadowOffsetGlobal, shadowOffsetUnits, shadowRadius, shadowRadiusAlphaOnly, shadowRadiusUnits, shadowScale, shadowTransparency, shadowUnder, shapeBlendMode, shapeBorderColor, shapeBorderWidth, shapeBorderWidthUnits, shapeDraw, shapeFillColor, shapeJoinStyle, shapeOffset, shapeOffsetUnits, shapeRadii, shapeRadiiUnits, ShapeRectangle, shapeRotation, shapeRotationType, shapeSize, shapeSizeType, shapeSizeUnits, shapeSVGFile, shapeTransparency, shapeType, SizeBuffer, SymbolLeftRight, textColor, textFont, textNamedStyle, textTransp, updateFontViaStyle(), Upright, upsidedownLabels, wrapChar, xOffset, and yOffset.

Referenced by QgsPalLabeling::prepareLayer(), and QgsPalLabeling::willUseLayer().

void QgsPalLayerSettings::registerFeature ( QgsVectorLayer layer,
QgsFeature f,
const QgsRenderContext context 
)

Definition at line 1450 of file qgspallabeling.cpp.

References _decodeUnits(), QgsPalGeometry::addDataDefinedValue(), AlwaysShow, MathUtils::angle(), angleOffset, AroundPoint, QgsGeometry::asGeos(), QgsFeature::attribute(), calculateLabelSize(), CentroidWhole, centroidWhole, checkMinimumSizeMM(), QgsGeometry::contains(), ct, Curved, CurvedCharAngleInOut, dataDefinedEvaluate(), dataDefinedValues, decimals, QgsSymbolLayerV2Utils::decodePoint(), dist, DistanceUnits, distInMapUnits, QgsExpression::evalErrorString(), QgsExpression::evaluate(), extentGeom, fieldIndex, FontLimitPixel, fontLimitPixelSize, FontMaxPixel, fontMaxPixelSize, FontMinPixel, fontMinPixelSize, fontSizeInMapUnits, FontSizeUnit, formatNumbers, geometries, QgsFeature::geometry(), getLabelExpression(), Hali, QgsExpression::hasEvalError(), QgsExpression::hasParserError(), QgsFeature::id(), QgsPalGeometry::info(), QgsGeometry::intersection(), isExpression, LabelDistance, labelOffsetInMapUnits, limitNumLabels, M_PI, QgsRenderContext::mapToPixel(), MapUnits, QgsMapToPixel::mapUnitsPerPixel(), maxCurvedCharAngleIn, maxCurvedCharAngleOut, maxNumLabels, MaxScale, mCurFeat, mFeatsRegPal, mFeatsSendingToPal, mFeaturesToLabel, minFeatureSize, MinScale, NumDecimals, NumFormat, NumPlusSign, OffsetQuad, OffsetUnits, OffsetXY, OverPoint, palLayer, parseDropShadow(), QgsExpression::parserErrorString(), parseShapeBackground(), parseTextBuffer(), parseTextFormatting(), parseTextStyle(), placement, plusSign, Points, QGis::Polygon, PositionX, PositionY, ptOne, ptZero, QgsDebugMsgLevel, quadOffset, QuadrantAbove, QuadrantAboveLeft, QuadrantAboveRight, QuadrantBelow, QuadrantBelowLeft, QuadrantBelowRight, QuadrantLeft, QuadrantOver, QuadrantRight, rasterCompressFactor, QgsRenderContext::rendererScale(), Rotation, QgsRenderContext::scaleFactor(), scaleMax, scaleMin, ScaleVisibility, scaleVisibility, QgsPalGeometry::setDefinedFont(), QgsPalGeometry::setIsPinned(), QgsExpression::setScale(), Show, size, Size, sizeToPixel(), QgsPalGeometry::strId(), textFont, QgsGeometry::transform(), QgsCoordinateTransform::transformInPlace(), QgsGeometry::type(), Vali, vectorScaleFactor, QgsPoint::x(), xform, xOffset, and yOffset.

Referenced by QgsPalLabeling::registerFeature().

Set a property to static instead data defined.

Definition at line 1103 of file qgspallabeling.cpp.

References dataDefinedProperties.

double QgsPalLayerSettings::scaleToPixelContext ( double  size,
const QgsRenderContext c,
SizeUnit  unit,
bool  rasterfactor = false 
) const

Calculates size (considering output size should be in pixel or map units, scale factors and optionally oversampling)

Parameters:
sizesize to convert
crendercontext
unitSizeUnit enum value of size
rasterfactorwhether to consider oversampling
Returns:
size that will render, as double
Note:
added in 1.9, as a better precision replacement for sizeToPixel

Definition at line 2948 of file qgspallabeling.cpp.

References QgsRenderContext::mapToPixel(), MapUnits, QgsMapToPixel::mapUnitsPerPixel(), Points, QgsRenderContext::rasterScaleFactor(), QgsRenderContext::scaleFactor(), and size.

Referenced by QgsPalLabeling::drawLabelBackground(), QgsPalLabeling::drawLabelBuffer(), QgsPalLabeling::drawLabelShadow(), and sizeToPixel().

void QgsPalLayerSettings::setDataDefinedProperty ( QgsPalLayerSettings::DataDefinedProperties  p,
bool  active,
bool  useExpr,
const QString &  expr,
const QString &  field 
)

Set a property as data defined.

Note:
added in 1.9, helpful for Python access

Definition at line 1079 of file qgspallabeling.cpp.

References dataDefinedProperties, QgsDataDefined::setActive(), QgsDataDefined::setExpressionString(), QgsDataDefined::setField(), and QgsDataDefined::setUseExpression().

int QgsPalLayerSettings::sizeToPixel ( double  size,
const QgsRenderContext c,
SizeUnit  unit,
bool  rasterfactor = false 
) const

Calculates pixel size (considering output size should be in pixel or map units, scale factors and optionally oversampling)

Parameters:
sizesize to convert
crendercontext
unitSizeUnit enum value of size
rasterfactorwhether to consider oversampling
Returns:
font pixel size

Definition at line 2943 of file qgspallabeling.cpp.

References scaleToPixelContext().

Referenced by parseTextStyle(), and registerFeature().

QString QgsPalLayerSettings::updateDataDefinedString ( const QString &  value)

Convert old property value to new one as delimited values.

Note:
not available in python bindings; added in 1.9, as temporary solution until refactoring of project settings

Definition at line 1113 of file qgspallabeling.cpp.

Referenced by readDataDefinedProperty().

void QgsPalLayerSettings::updateFontViaStyle ( QFont &  font,
const QString &  fontstyle 
) [private]

Updates font with named style.

Definition at line 780 of file qgspallabeling.cpp.

References mFontDB.

Referenced by parseTextStyle(), and readFromLayer().

Definition at line 954 of file qgspallabeling.cpp.

References _writeColor(), addDirectionSymbol, angleOffset, blendMode, bufferBlendMode, bufferColor, bufferDraw, bufferJoinStyle, bufferNoFill, bufferSize, bufferSizeInMapUnits, bufferTransp, centroidWhole, dataDefinedProperties, decimals, displayAll, dist, distInMapUnits, enabled, fieldName, fontLimitPixelSize, fontMaxPixelSize, fontMinPixelSize, fontSizeInMapUnits, formatNumbers, QgsMapRenderer::getBlendModeEnum(), isExpression, labelOffsetInMapUnits, labelPerPart, leftDirectionSymbol, limitNumLabels, maxCurvedCharAngleIn, maxCurvedCharAngleOut, maxNumLabels, mergeLines, minFeatureSize, multilineAlign, multilineHeight, obstacle, placeDirectionSymbol, placement, placementFlags, plusSign, preserveRotation, previewBkgrdColor, priority, quadOffset, reverseDirectionSymbol, rightDirectionSymbol, scaleMax, scaleMin, scaleVisibility, QgsMapLayer::setCustomProperty(), shadowBlendMode, shadowColor, shadowDraw, shadowOffsetAngle, shadowOffsetDist, shadowOffsetGlobal, shadowOffsetUnits, shadowRadius, shadowRadiusAlphaOnly, shadowRadiusUnits, shadowScale, shadowTransparency, shadowUnder, shapeBlendMode, shapeBorderColor, shapeBorderWidth, shapeBorderWidthUnits, shapeDraw, shapeFillColor, shapeJoinStyle, shapeOffset, shapeOffsetUnits, shapeRadii, shapeRadiiUnits, shapeRotation, shapeRotationType, shapeSize, shapeSizeType, shapeSizeUnits, shapeSVGFile, shapeTransparency, shapeType, textColor, textFont, textNamedStyle, textTransp, upsidedownLabels, wrapChar, writeDataDefinedPropertyMap(), xOffset, and yOffset.


Member Data Documentation

Is this label made from a expression string eg FieldName || 'mm'.

Definition at line 274 of file qgspallabeling.h.

Referenced by QgsPalLabeling::prepareLayer(), QgsPalLayerSettings(), readFromLayer(), registerFeature(), and writeToLayer().

Definition at line 507 of file qgspallabeling.h.

Referenced by registerFeature().

QFontDatabase QgsPalLayerSettings::mFontDB [private]

Definition at line 549 of file qgspallabeling.h.

Referenced by parseTextStyle(), and updateFontViaStyle().

Definition at line 496 of file qgspallabeling.h.

Referenced by QgsPalLabeling::prepareLayer(), and registerFeature().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines