QGIS API Documentation  2.4.0-Chugiak
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsPalLabeling Class Reference

#include <qgspallabeling.h>

Inheritance diagram for QgsPalLabeling:
Inheritance graph
[legend]
Collaboration diagram for QgsPalLabeling:
Collaboration graph
[legend]

Public Types

enum  DrawLabelType {
  LabelText = 0, LabelBuffer, LabelShape, LabelSVG,
  LabelShadow
}
 
enum  Search {
  Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain,
  Falp
}
 

Public Member Functions

 QgsPalLabeling ()
 
 ~QgsPalLabeling ()
 
QgsPalLayerSettingslayer (const QString &layerName)
 returns PAL layer settings for a registered layer More...
 
void numCandidatePositions (int &candPoint, int &candLine, int &candPolygon)
 
void setNumCandidatePositions (int candPoint, int candLine, int candPolygon)
 
void setSearchMethod (Search s)
 
Search searchMethod () const
 
bool isShowingCandidates () const
 
void setShowingCandidates (bool showing)
 
const QList< QgsLabelCandidate > & candidates ()
 
bool isShowingShadowRectangles () const
 
void setShowingShadowRectangles (bool showing)
 
bool isShowingAllLabels () const
 
void setShowingAllLabels (bool showing)
 
bool isShowingPartialsLabels () const
 
void setShowingPartialsLabels (bool showing)
 
bool isDrawingOutlineLabels () const
 
void setDrawingOutlineLabels (bool outline)
 
virtual Q_DECL_DEPRECATED void init (QgsMapRenderer *mr)
 called when we're going to start with rendering More...
 
virtual void init (const QgsMapSettings &mapSettings)
 called when we're going to start with rendering More...
 
virtual bool willUseLayer (QgsVectorLayer *layer)
 called to find out whether the layer is used for labeling More...
 
virtual void clearActiveLayers ()
 clears all PAL layer settings for registered layers More...
 
virtual void clearActiveLayer (const QString &layerID)
 clears data defined objects from PAL layer settings for a registered layer More...
 
virtual int prepareLayer (QgsVectorLayer *layer, QStringList &attrNames, QgsRenderContext &ctx)
 hook called when drawing layer before issuing select() More...
 
virtual int addDiagramLayer (QgsVectorLayer *layer, const QgsDiagramLayerSettings *s)
 adds a diagram layer to the labeling engine More...
 
virtual void registerFeature (const QString &layerID, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext())
 hook called when drawing for every feature in a layer More...
 
virtual void registerDiagramFeature (const QString &layerID, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext())
 called for every diagram feature More...
 
virtual void drawLabeling (QgsRenderContext &context)
 called when the map is drawn and labels should be placed More...
 
virtual void exit ()
 called when we're done with rendering More...
 
virtual Q_DECL_DEPRECATED
QList< QgsLabelPosition
labelsAtPosition (const QgsPoint &p)
 return infos about labels at a given (map) position More...
 
virtual Q_DECL_DEPRECATED
QList< QgsLabelPosition
labelsWithinRect (const QgsRectangle &r)
 return infos about labels within a given (map) rectangle More...
 
QgsLabelingResultstakeResults ()
 Return pointer to recently computed results (in drawLabeling()) and pass the ownership of results to the caller. More...
 
virtual
QgsLabelingEngineInterface
clone ()
 called when passing engine among map renderers More...
 
void drawLabelCandidateRect (pal::LabelPosition *lp, QPainter *painter, const QgsMapToPixel *xform)
 
virtual void drawLabel (pal::LabelPosition *label, QgsRenderContext &context, QgsPalLayerSettings &tmpLyr, DrawLabelType drawType, double dpiRatio=1.0)
 drawLabel More...
 
void loadEngineSettings ()
 load/save engine settings to project file More...
 
void saveEngineSettings ()
 
void clearEngineSettings ()
 
Q_DECL_DEPRECATED bool isStoredWithProject () const
 
Q_DECL_DEPRECATED void setStoredWithProject (bool store)
 
- Public Member Functions inherited from QgsLabelingEngineInterface
virtual ~QgsLabelingEngineInterface ()
 

Static Public Member Functions

static bool staticWillUseLayer (QgsVectorLayer *layer)
 called to find out whether the layer is used for labeling More...
 
static bool staticWillUseLayer (const QString &layerID)
 
static void drawLabelBuffer (QgsRenderContext &context, QgsLabelComponent component, const QgsPalLayerSettings &tmpLyr)
 
static void drawLabelBackground (QgsRenderContext &context, QgsLabelComponent component, const QgsPalLayerSettings &tmpLyr)
 
static void drawLabelShadow (QgsRenderContext &context, QgsLabelComponent component, const QgsPalLayerSettings &tmpLyr)
 

Protected Member Functions

void dataDefinedTextStyle (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues)
 
void dataDefinedTextFormatting (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues)
 
void dataDefinedTextBuffer (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues)
 
void dataDefinedShapeBackground (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues)
 
void dataDefinedDropShadow (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues)
 
void deleteTemporaryData ()
 

Protected Attributes

QHash< QString,
QgsPalLayerSettings
mActiveLayers
 
QHash< QString,
QgsDiagramLayerSettings
mActiveDiagramLayers
 
QgsPalLayerSettings mInvalidLayerSettings
 
const QgsMapSettingsmMapSettings
 
int mCandPoint
 
int mCandLine
 
int mCandPolygon
 
Search mSearch
 
pal::Pal * mPal
 
QList< QgsLabelCandidatemCandidates
 
bool mShowingCandidates
 
bool mShowingAllLabels
 
bool mShowingShadowRects
 
bool mShowingPartialsLabels
 
bool mDrawOutlineLabels
 
QgsLabelingResultsmResults
 

Detailed Description

Definition at line 705 of file qgspallabeling.h.

Member Enumeration Documentation

Enumerator
LabelText 
LabelBuffer 
LabelShape 
LabelSVG 
LabelShadow 

Definition at line 708 of file qgspallabeling.h.

Enumerator
Chain 
Popmusic_Tabu 
Popmusic_Chain 
Popmusic_Tabu_Chain 
Falp 

Definition at line 725 of file qgspallabeling.h.

Constructor & Destructor Documentation

QgsPalLabeling::QgsPalLabeling ( )
QgsPalLabeling::~QgsPalLabeling ( )

Definition at line 3199 of file qgspallabeling.cpp.

References clearActiveLayers(), exit(), and mResults.

Member Function Documentation

int QgsPalLabeling::addDiagramLayer ( QgsVectorLayer layer,
const QgsDiagramLayerSettings s 
)
virtual
const QList<QgsLabelCandidate>& QgsPalLabeling::candidates ( )
inline

Definition at line 732 of file qgspallabeling.h.

void QgsPalLabeling::clearActiveLayer ( const QString &  layerID)
virtual

clears data defined objects from PAL layer settings for a registered layer

Note
: this method was added in version 1.9

Implements QgsLabelingEngineInterface.

Definition at line 3245 of file qgspallabeling.cpp.

References QgsPalLayerSettings::dataDefinedProperties, and mActiveLayers.

Referenced by clearActiveLayers().

void QgsPalLabeling::clearActiveLayers ( )
virtual

clears all PAL layer settings for registered layers

Note
: this method was added in version 1.9

Implements QgsLabelingEngineInterface.

Definition at line 3235 of file qgspallabeling.cpp.

References clearActiveLayer(), and mActiveLayers.

Referenced by init(), and ~QgsPalLabeling().

void QgsPalLabeling::clearEngineSettings ( )

Definition at line 5056 of file qgspallabeling.cpp.

References QgsProject::instance(), and QgsProject::removeEntry().

QgsLabelingEngineInterface * QgsPalLabeling::clone ( )
virtual

called when passing engine among map renderers

Implements QgsLabelingEngineInterface.

Definition at line 5069 of file qgspallabeling.cpp.

References mDrawOutlineLabels, mShowingAllLabels, mShowingCandidates, mShowingPartialsLabels, mShowingShadowRects, and QgsPalLabeling().

void QgsPalLabeling::dataDefinedDropShadow ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &  ddValues 
)
protected
void QgsPalLabeling::dataDefinedShapeBackground ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &  ddValues 
)
protected

Definition at line 3816 of file qgspallabeling.cpp.

References QgsPalLayerSettings::ShapeBlendMode, QgsPalLayerSettings::shapeBlendMode, QgsPalLayerSettings::ShapeBorderColor, QgsPalLayerSettings::shapeBorderColor, QgsPalLayerSettings::ShapeBorderWidth, QgsPalLayerSettings::shapeBorderWidth, QgsPalLayerSettings::ShapeBorderWidthUnits, QgsPalLayerSettings::shapeBorderWidthUnits, QgsPalLayerSettings::ShapeDraw, QgsPalLayerSettings::shapeDraw, QgsPalLayerSettings::ShapeFillColor, QgsPalLayerSettings::shapeFillColor, QgsPalLayerSettings::ShapeJoinStyle, QgsPalLayerSettings::shapeJoinStyle, QgsPalLayerSettings::ShapeKind, QgsPalLayerSettings::ShapeOffset, QgsPalLayerSettings::shapeOffset, QgsPalLayerSettings::ShapeOffsetUnits, QgsPalLayerSettings::shapeOffsetUnits, QgsPalLayerSettings::ShapeRadii, QgsPalLayerSettings::shapeRadii, QgsPalLayerSettings::ShapeRadiiUnits, QgsPalLayerSettings::shapeRadiiUnits, QgsPalLayerSettings::ShapeRotation, QgsPalLayerSettings::shapeRotation, QgsPalLayerSettings::ShapeRotationType, QgsPalLayerSettings::shapeRotationType, QgsPalLayerSettings::shapeSize, QgsPalLayerSettings::ShapeSizeType, QgsPalLayerSettings::shapeSizeType, QgsPalLayerSettings::ShapeSizeUnits, QgsPalLayerSettings::shapeSizeUnits, QgsPalLayerSettings::ShapeSizeX, QgsPalLayerSettings::ShapeSizeY, QgsPalLayerSettings::ShapeSVGFile, QgsPalLayerSettings::shapeSVGFile, QgsPalLayerSettings::ShapeTransparency, QgsPalLayerSettings::shapeTransparency, and QgsPalLayerSettings::shapeType.

Referenced by drawLabeling().

void QgsPalLabeling::dataDefinedTextBuffer ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &  ddValues 
)
protected
void QgsPalLabeling::dataDefinedTextFormatting ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &  ddValues 
)
protected
void QgsPalLabeling::dataDefinedTextStyle ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &  ddValues 
)
protected
void QgsPalLabeling::deleteTemporaryData ( )
protected
void QgsPalLabeling::drawLabel ( pal::LabelPosition *  label,
QgsRenderContext context,
QgsPalLayerSettings tmpLyr,
DrawLabelType  drawType,
double  dpiRatio = 1.0 
)
virtual

drawLabel

Note
not available in python bindings

Definition at line 4299 of file qgspallabeling.cpp.

References _fixQPictureDPI(), QgsPalLayerSettings::addDirectionSymbol, MathUtils::angle(), QgsPalLayerSettings::blendMode, QgsLabelComponent::dpiRatio(), drawLabelBackground(), drawLabelBuffer(), drawLabelShadow(), LabelBuffer, LabelShape, LabelText, QgsPalLayerSettings::leftDirectionSymbol, QgsPalLayerSettings::Line, M_PI, QgsRenderContext::mapToPixel(), mDrawOutlineLabels, QgsPalLayerSettings::MultiCenter, QgsPalLayerSettings::MultiLeft, QgsPalLayerSettings::multilineAlign, QgsPalLayerSettings::multilineHeight, QgsRenderContext::painter(), QgsPalLayerSettings::placeDirectionSymbol, QgsPalLayerSettings::placement, QgsPalLayerSettings::rasterCompressFactor, QgsPalLayerSettings::reverseDirectionSymbol, QgsPalLayerSettings::rightDirectionSymbol, QgsLabelComponent::rotation(), QgsLabelComponent::setCenter(), QgsLabelComponent::setDpiRatio(), QgsLabelComponent::setOffset(), QgsLabelComponent::setOrigin(), QgsLabelComponent::setPicture(), QgsLabelComponent::setPictureBuffer(), QgsLabelComponent::setRotation(), QgsLabelComponent::setRotationOffset(), QgsLabelComponent::setSize(), QgsLabelComponent::setText(), QgsPoint::setX(), QgsPoint::setY(), QgsPalLayerSettings::shadowDraw, QgsPalLayerSettings::ShadowText, QgsPalLayerSettings::shadowUnder, QgsPalLayerSettings::SymbolAbove, QgsPalLayerSettings::SymbolBelow, QgsLabelComponent::text(), QgsPalLayerSettings::textColor, QgsPalLayerSettings::textFont, QgsMapToPixel::transform(), QgsRenderContext::useAdvancedEffects(), QgsPalLayerSettings::wrapChar, QgsPoint::x(), and QgsPoint::y().

Referenced by drawLabeling().

void QgsPalLabeling::drawLabelBackground ( QgsRenderContext context,
QgsLabelComponent  component,
const QgsPalLayerSettings tmpLyr 
)
static

Definition at line 4573 of file qgspallabeling.cpp.

References _fixQPictureDPI(), QgsLabelComponent::center(), QgsMapUnitScale::computeMapUnitsPerPixel(), QgsSvgMarkerSymbolLayerV2::create(), QgsLabelComponent::dpiRatio(), drawLabelShadow(), QgsSymbolLayerV2Utils::encodeOutputUnit(), M_PI, QgsRenderContext::mapToPixel(), QgsSymbolV2::MapUnit, QgsPalLayerSettings::MapUnits, QgsSymbolV2::Mixed, QgsSymbolV2::MM, QgsPalLayerSettings::MM, QgsRenderContext::painter(), QgsPalLayerSettings::Percent, QgsPalLayerSettings::rasterCompressFactor, QgsSvgMarkerSymbolLayerV2::renderPoint(), QgsLabelComponent::rotation(), QgsPalLayerSettings::RotationFixed, QgsPalLayerSettings::RotationOffset, QgsLabelComponent::rotationOffset(), QgsRenderContext::scaleFactor(), QgsPalLayerSettings::scaleToPixelContext(), QgsRenderContext::setMapToPixel(), QgsLabelComponent::setOffset(), QgsRenderContext::setPainter(), QgsLabelComponent::setPicture(), QgsLabelComponent::setPictureBuffer(), QgsLabelComponent::setRotation(), QgsLabelComponent::setRotationOffset(), QgsRenderContext::setScaleFactor(), QgsLabelComponent::setSize(), QgsPalLayerSettings::shadowColor, QgsPalLayerSettings::shadowDraw, QgsPalLayerSettings::ShadowShape, QgsPalLayerSettings::shadowUnder, QgsPalLayerSettings::shapeBlendMode, QgsPalLayerSettings::shapeBorderColor, QgsPalLayerSettings::shapeBorderWidth, QgsPalLayerSettings::shapeBorderWidthMapUnitScale, QgsPalLayerSettings::shapeBorderWidthUnits, QgsPalLayerSettings::ShapeCircle, QgsPalLayerSettings::ShapeEllipse, QgsPalLayerSettings::shapeFillColor, QgsPalLayerSettings::shapeJoinStyle, QgsPalLayerSettings::shapeOffset, QgsPalLayerSettings::shapeOffsetMapUnitScale, QgsPalLayerSettings::shapeOffsetUnits, QgsPalLayerSettings::shapeRadii, QgsPalLayerSettings::shapeRadiiMapUnitScale, QgsPalLayerSettings::shapeRadiiUnits, QgsPalLayerSettings::ShapeRectangle, QgsPalLayerSettings::shapeRotation, QgsPalLayerSettings::shapeRotationType, QgsPalLayerSettings::shapeSize, QgsPalLayerSettings::shapeSizeMapUnitScale, QgsPalLayerSettings::shapeSizeType, QgsPalLayerSettings::shapeSizeUnits, QgsPalLayerSettings::ShapeSquare, QgsPalLayerSettings::ShapeSVG, QgsPalLayerSettings::shapeSVGFile, QgsPalLayerSettings::shapeTransparency, QgsPalLayerSettings::shapeType, QgsLabelComponent::size(), QgsPalLayerSettings::SizeBuffer, QgsPalLayerSettings::SizeFixed, QgsSymbolLayerV2Utils::symbolNameToPath(), QgsRenderContext::useAdvancedEffects(), QgsPoint::x(), and QgsPoint::y().

Referenced by drawLabel().

void QgsPalLabeling::drawLabelBuffer ( QgsRenderContext context,
QgsLabelComponent  component,
const QgsPalLayerSettings tmpLyr 
)
static
void QgsPalLabeling::drawLabelCandidateRect ( pal::LabelPosition *  lp,
QPainter *  painter,
const QgsMapToPixel xform 
)
Note
not available in python bindings

Definition at line 4278 of file qgspallabeling.cpp.

References M_PI, mCandidates, QgsMapToPixel::transform(), QgsPoint::x(), and QgsPoint::y().

Referenced by drawLabeling().

void QgsPalLabeling::drawLabeling ( QgsRenderContext context)
virtual

called when the map is drawn and labels should be placed

Implements QgsLabelingEngineInterface.

Definition at line 4000 of file qgspallabeling.cpp.

References _palIsCancelled(), QgsPalLayerSettings::bufferDraw, dataDefinedDropShadow(), dataDefinedShapeBackground(), dataDefinedTextBuffer(), dataDefinedTextFormatting(), dataDefinedTextStyle(), QgsPalGeometry::dataDefinedValues(), QgsPalGeometry::definedFont(), deleteTemporaryData(), drawLabel(), drawLabelCandidateRect(), QgsRenderContext::extent(), QgsPalGeometry::feature(), QgsLabelSearchTree::insertLabel(), QgsPalGeometry::isDiagram(), QgsPalGeometry::isPinned(), LabelBuffer, LabelShape, LabelText, layer(), mActiveDiagramLayers, QgsMapSettings::mapToPixel(), mCandidates, QgsLabelingResults::mLabelSearchTree, mMapSettings, mPal, mResults, mShowingAllLabels, mShowingCandidates, mShowingShadowRects, QgsRenderContext::painter(), QgsDebugMsgLevel, QgsRenderContext::renderingStopped(), QgsMapSettings::scale(), QgsFeature::setFields(), QgsPalLayerSettings::ShadowBuffer, QgsPalLayerSettings::shadowDraw, QgsPalLayerSettings::ShadowLowest, QgsPalLayerSettings::ShadowShape, QgsPalLayerSettings::ShadowText, QgsPalLayerSettings::shadowUnder, QgsPalLayerSettings::shapeDraw, QgsPalLayerSettings::showingShadowRects, QgsPalGeometry::strId(), QgsPalLayerSettings::textFont, QgsMapToPixel::transform(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().

Referenced by QgsMapRendererJob::drawNewLabeling().

void QgsPalLabeling::drawLabelShadow ( QgsRenderContext context,
QgsLabelComponent  component,
const QgsPalLayerSettings tmpLyr 
)
static
void QgsPalLabeling::exit ( )
virtual

called when we're done with rendering

Implements QgsLabelingEngineInterface.

Definition at line 3661 of file qgspallabeling.cpp.

References mMapSettings, and mPal.

Referenced by QgsMapRendererJob::drawNewLabeling(), and ~QgsPalLabeling().

void QgsPalLabeling::init ( QgsMapRenderer mr)
virtual

called when we're going to start with rendering

Deprecated:
since 2.4 - use override with QgsMapSettings

Implements QgsLabelingEngineInterface.

Definition at line 3623 of file qgspallabeling.cpp.

References QgsMapRenderer::mapSettings().

Referenced by QgsMapRendererParallelJob::start().

void QgsPalLabeling::init ( const QgsMapSettings mapSettings)
virtual
bool QgsPalLabeling::isDrawingOutlineLabels ( ) const
inline
Note
added in 2.4

Definition at line 744 of file qgspallabeling.h.

bool QgsPalLabeling::isShowingAllLabels ( ) const
inline

Definition at line 737 of file qgspallabeling.h.

bool QgsPalLabeling::isShowingCandidates ( ) const
inline

Definition at line 730 of file qgspallabeling.h.

bool QgsPalLabeling::isShowingPartialsLabels ( ) const
inline

Definition at line 740 of file qgspallabeling.h.

bool QgsPalLabeling::isShowingShadowRectangles ( ) const
inline

Definition at line 734 of file qgspallabeling.h.

Q_DECL_DEPRECATED bool QgsPalLabeling::isStoredWithProject ( ) const
inline
Deprecated:
since 2.4 - settings are always stored in project

Definition at line 818 of file qgspallabeling.h.

QList< QgsLabelPosition > QgsPalLabeling::labelsAtPosition ( const QgsPoint p)
virtual

return infos about labels at a given (map) position

Deprecated:
since 2.4 - use takeResults() and methods of QgsLabelingResults

Implements QgsLabelingEngineInterface.

Definition at line 4232 of file qgspallabeling.cpp.

References QgsLabelingResults::labelsAtPosition(), and mResults.

QList< QgsLabelPosition > QgsPalLabeling::labelsWithinRect ( const QgsRectangle r)
virtual

return infos about labels within a given (map) rectangle

Deprecated:
since 2.4 - use takeResults() and methods of QgsLabelingResults

Implements QgsLabelingEngineInterface.

Definition at line 4237 of file qgspallabeling.cpp.

References QgsLabelingResults::labelsWithinRect(), and mResults.

QgsPalLayerSettings & QgsPalLabeling::layer ( const QString &  layerName)
virtual

returns PAL layer settings for a registered layer

Note
: this method was added in version 1.9

Implements QgsLabelingEngineInterface.

Definition at line 3668 of file qgspallabeling.cpp.

References mActiveLayers, and mInvalidLayerSettings.

Referenced by drawLabeling(), and staticWillUseLayer().

void QgsPalLabeling::loadEngineSettings ( )
void QgsPalLabeling::numCandidatePositions ( int &  candPoint,
int &  candLine,
int &  candPolygon 
)

Definition at line 4254 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

int QgsPalLabeling::prepareLayer ( QgsVectorLayer layer,
QStringList &  attrNames,
QgsRenderContext ctx 
)
virtual

hook called when drawing layer before issuing select()

Implements QgsLabelingEngineInterface.

Definition at line 3259 of file qgspallabeling.cpp.

References _decodeUnits(), QgsPalLayerSettings::AroundPoint, QgsPalLayerSettings::centroidInside, QgsMapUnitScale::computeMapUnitsPerPixel(), QgsMapLayer::crs(), QgsPalLayerSettings::ct, QgsPalLayerSettings::Curved, QgsPalLayerSettings::dataDefinedEvaluate(), QgsPalLayerSettings::dataDefinedProperties, QgsMapSettings::destinationCrs(), QgsPalLayerSettings::displayAll, QgsExpression::evalErrorString(), QgsPalLayerSettings::extentGeom, QgsPalLayerSettings::fieldIndex, QgsPalLayerSettings::fieldName, QgsVectorLayer::fieldNameIndex(), QgsPalLayerSettings::Free, QgsGeometry::fromRect(), QgsPalLayerSettings::getLabelExpression(), QgsMapSettings::hasCrsTransformEnabled(), QgsExpression::hasEvalError(), QgsPalLayerSettings::Horizontal, QgsMapLayer::id(), QgsDataDefined::isActive(), QgsPalLayerSettings::isExpression, QgsPalLayerSettings::labelPerPart, QgsPalLayerSettings::Line, mActiveLayers, QgsMapSettings::mapToPixel(), QgsPalLayerSettings::MapUnits, QgsPalLayerSettings::mCurFields, QgsPalLayerSettings::mergeLines, QgsPalLayerSettings::mFeatsSendingToPal, mMapSettings, mPal, QgsPalLayerSettings::obstacle, QgsPalLayerSettings::OverPoint, QgsPalLayerSettings::palLayer, QgsVectorLayer::pendingFields(), QgsPalLayerSettings::placement, QgsPalLayerSettings::placementFlags, QgsExpression::prepare(), QgsPalLayerSettings::priority, QgsPalLayerSettings::ptOne, QgsPalLayerSettings::ptZero, QgsDebugMsgLevel, QgsPalLayerSettings::rasterCompressFactor, QgsRenderContext::rasterScaleFactor(), QgsPalLayerSettings::readFromLayer(), QgsDataDefined::referencedColumns(), QgsExpression::referencedColumns(), QgsRenderContext::rendererScale(), QgsPalLayerSettings::RepeatDistance, QgsPalLayerSettings::repeatDistance, QgsPalLayerSettings::repeatDistanceMapUnitScale, QgsPalLayerSettings::RepeatDistanceUnit, QgsPalLayerSettings::repeatDistanceUnit, QgsRenderContext::scaleFactor(), QgsDataDefined::setExpressionParams(), QgsPalLayerSettings::ShowAll, QgsPalLayerSettings::ShowDefined, QgsMapToPixel::toMapCoordinates(), QgsPalLayerSettings::Upright, QgsPalLayerSettings::upsidedownLabels, QgsPalLayerSettings::vectorScaleFactor, QgsMapSettings::visibleExtent(), willUseLayer(), and QgsPalLayerSettings::xform.

void QgsPalLabeling::registerDiagramFeature ( const QString &  layerID,
QgsFeature feat,
const QgsRenderContext context = QgsRenderContext() 
)
virtual
void QgsPalLabeling::registerFeature ( const QString &  layerID,
QgsFeature feat,
const QgsRenderContext context = QgsRenderContext() 
)
virtual

hook called when drawing for every feature in a layer

Implements QgsLabelingEngineInterface.

Definition at line 3523 of file qgspallabeling.cpp.

References mActiveLayers, and QgsPalLayerSettings::registerFeature().

void QgsPalLabeling::saveEngineSettings ( )
QgsPalLabeling::Search QgsPalLabeling::searchMethod ( ) const

Definition at line 4273 of file qgspallabeling.cpp.

References mSearch.

void QgsPalLabeling::setDrawingOutlineLabels ( bool  outline)
inline

Definition at line 745 of file qgspallabeling.h.

References outline.

void QgsPalLabeling::setNumCandidatePositions ( int  candPoint,
int  candLine,
int  candPolygon 
)

Definition at line 4261 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

void QgsPalLabeling::setSearchMethod ( QgsPalLabeling::Search  s)

Definition at line 4268 of file qgspallabeling.cpp.

References mSearch.

void QgsPalLabeling::setShowingAllLabels ( bool  showing)
inline

Definition at line 738 of file qgspallabeling.h.

void QgsPalLabeling::setShowingCandidates ( bool  showing)
inline

Definition at line 731 of file qgspallabeling.h.

void QgsPalLabeling::setShowingPartialsLabels ( bool  showing)
inline

Definition at line 741 of file qgspallabeling.h.

void QgsPalLabeling::setShowingShadowRectangles ( bool  showing)
inline

Definition at line 735 of file qgspallabeling.h.

Q_DECL_DEPRECATED void QgsPalLabeling::setStoredWithProject ( bool  store)
inline
Deprecated:
since 2.4 - settings are always stored in project

Definition at line 820 of file qgspallabeling.h.

bool QgsPalLabeling::staticWillUseLayer ( QgsVectorLayer layer)
static

called to find out whether the layer is used for labeling

Note
added in 2.4

Definition at line 3224 of file qgspallabeling.cpp.

References QgsMapLayer::customProperty().

Referenced by QgsComposerMap::containsAdvancedEffects(), registerDiagramFeature(), staticWillUseLayer(), and willUseLayer().

bool QgsPalLabeling::staticWillUseLayer ( const QString &  layerID)
static
QgsLabelingResults * QgsPalLabeling::takeResults ( )

Return pointer to recently computed results (in drawLabeling()) and pass the ownership of results to the caller.

Note
added in 2.4

Definition at line 4242 of file qgspallabeling.cpp.

References mResults.

Referenced by QgsMapRendererParallelJob::takeLabelingResults(), and QgsMapRendererCustomPainterJob::takeLabelingResults().

bool QgsPalLabeling::willUseLayer ( QgsVectorLayer layer)
virtual

called to find out whether the layer is used for labeling

Implements QgsLabelingEngineInterface.

Definition at line 3210 of file qgspallabeling.cpp.

References staticWillUseLayer().

Referenced by QgsMapRendererJob::prepareJobs(), and prepareLayer().

Member Data Documentation

QHash<QString, QgsDiagramLayerSettings> QgsPalLabeling::mActiveDiagramLayers
protected
QHash<QString, QgsPalLayerSettings> QgsPalLabeling::mActiveLayers
protected
QList<QgsLabelCandidate> QgsPalLabeling::mCandidates
protected

Definition at line 858 of file qgspallabeling.h.

Referenced by drawLabelCandidateRect(), and drawLabeling().

int QgsPalLabeling::mCandLine
protected
int QgsPalLabeling::mCandPoint
protected
int QgsPalLabeling::mCandPolygon
protected
bool QgsPalLabeling::mDrawOutlineLabels
protected
QgsPalLayerSettings QgsPalLabeling::mInvalidLayerSettings
protected

Definition at line 849 of file qgspallabeling.h.

Referenced by layer().

const QgsMapSettings* QgsPalLabeling::mMapSettings
protected

Definition at line 851 of file qgspallabeling.h.

Referenced by addDiagramLayer(), drawLabeling(), exit(), init(), and prepareLayer().

pal::Pal* QgsPalLabeling::mPal
protected

Definition at line 855 of file qgspallabeling.h.

Referenced by addDiagramLayer(), drawLabeling(), exit(), init(), and prepareLayer().

QgsLabelingResults* QgsPalLabeling::mResults
protected
Search QgsPalLabeling::mSearch
protected
bool QgsPalLabeling::mShowingAllLabels
protected
bool QgsPalLabeling::mShowingCandidates
protected
bool QgsPalLabeling::mShowingPartialsLabels
protected

Definition at line 862 of file qgspallabeling.h.

Referenced by clone(), init(), loadEngineSettings(), QgsPalLabeling(), and saveEngineSettings().

bool QgsPalLabeling::mShowingShadowRects
protected

The documentation for this class was generated from the following files: