QGIS API Documentation
2.2.0-Valmiera
|
#include <qgspallabeling.h>
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 () | |
QgsPalLayerSettings & | layer (const QString &layerName) |
returns PAL layer settings for a registered layer | |
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) |
virtual void | init (QgsMapRenderer *mr) |
called when we're going to start with rendering | |
virtual bool | willUseLayer (QgsVectorLayer *layer) |
called to find out whether the layer is used for labeling | |
virtual void | clearActiveLayers () |
clears all PAL layer settings for registered layers | |
virtual void | clearActiveLayer (QgsVectorLayer *layer) |
clears data defined objects from PAL layer settings for a registered layer | |
virtual int | prepareLayer (QgsVectorLayer *layer, QSet< int > &attrIndices, QgsRenderContext &ctx) |
hook called when drawing layer before issuing select() | |
virtual int | addDiagramLayer (QgsVectorLayer *layer, QgsDiagramLayerSettings *s) |
adds a diagram layer to the labeling engine | |
virtual void | registerFeature (QgsVectorLayer *layer, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext()) |
hook called when drawing for every feature in a layer | |
virtual void | registerDiagramFeature (QgsVectorLayer *layer, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext()) |
called for every diagram feature | |
virtual void | drawLabeling (QgsRenderContext &context) |
called when the map is drawn and labels should be placed | |
virtual void | exit () |
called when we're done with rendering | |
virtual QList< QgsLabelPosition > | labelsAtPosition (const QgsPoint &p) |
return infos about labels at a given (map) position | |
virtual QList< QgsLabelPosition > | labelsWithinRect (const QgsRectangle &r) |
return infos about labels within a given (map) rectangle | |
virtual QgsLabelingEngineInterface * | clone () |
called when passing engine among map renderers | |
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 | |
void | loadEngineSettings () |
load/save engine settings to project file | |
void | saveEngineSettings () |
void | clearEngineSettings () |
bool | isStoredWithProject () const |
void | setStoredWithProject (bool store) |
Public Member Functions inherited from QgsLabelingEngineInterface | |
virtual | ~QgsLabelingEngineInterface () |
Static Public Member Functions | |
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) |
Protected Attributes | |
QHash< QgsVectorLayer *, QgsPalLayerSettings > | mActiveLayers |
QHash< QgsVectorLayer *, QgsDiagramLayerSettings > | mActiveDiagramLayers |
QgsPalLayerSettings | mInvalidLayerSettings |
QgsMapRenderer * | mMapRenderer |
int | mCandPoint |
int | mCandLine |
int | mCandPolygon |
Search | mSearch |
pal::Pal * | mPal |
QList< QgsLabelCandidate > | mCandidates |
bool | mShowingCandidates |
bool | mShowingAllLabels |
bool | mSavedWithProject |
bool | mShowingShadowRects |
bool | mShowingPartialsLabels |
QgsLabelSearchTree * | mLabelSearchTree |
Definition at line 654 of file qgspallabeling.h.
Definition at line 657 of file qgspallabeling.h.
Definition at line 674 of file qgspallabeling.h.
QgsPalLabeling::QgsPalLabeling | ( | ) |
Definition at line 3039 of file qgspallabeling.cpp.
References Chain, Falp, mCandLine, mCandPoint, mCandPolygon, mLabelSearchTree, mSearch, mShowingAllLabels, mShowingCandidates, mShowingPartialsLabels, mShowingShadowRects, Popmusic_Chain, Popmusic_Tabu, and Popmusic_Tabu_Chain.
Referenced by clone().
QgsPalLabeling::~QgsPalLabeling | ( | ) |
Definition at line 3066 of file qgspallabeling.cpp.
References clearActiveLayers(), exit(), and mLabelSearchTree.
|
virtual |
adds a diagram layer to the labeling engine
Reimplemented from QgsLabelingEngineInterface.
Definition at line 3320 of file qgspallabeling.cpp.
References QgsCoordinateTransform::clone(), QgsMapRenderer::coordinateTransform(), QgsDiagramLayerSettings::ct, QgsMapRenderer::hasCrsTransformEnabled(), QgsMapLayer::id(), mActiveDiagramLayers, mMapRenderer, mPal, QgsDiagramLayerSettings::obstacle, QgsDiagramLayerSettings::palLayer, QgsDiagramLayerSettings::placement, QgsDiagramLayerSettings::placementFlags, QgsDiagramLayerSettings::priority, tr, QgsMapRenderer::transformation(), and QgsDiagramLayerSettings::xform.
|
inline |
Definition at line 681 of file qgspallabeling.h.
|
virtual |
clears data defined objects from PAL layer settings for a registered layer
Implements QgsLabelingEngineInterface.
Definition at line 3097 of file qgspallabeling.cpp.
References QgsPalLayerSettings::dataDefinedProperties, layer(), and mActiveLayers.
Referenced by clearActiveLayers().
|
virtual |
clears all PAL layer settings for registered layers
Implements QgsLabelingEngineInterface.
Definition at line 3087 of file qgspallabeling.cpp.
References clearActiveLayer(), and mActiveLayers.
Referenced by init(), and ~QgsPalLabeling().
void QgsPalLabeling::clearEngineSettings | ( | ) |
Definition at line 4852 of file qgspallabeling.cpp.
References QgsProject::instance(), mSavedWithProject, and QgsProject::removeEntry().
|
virtual |
called when passing engine among map renderers
Implements QgsLabelingEngineInterface.
Definition at line 4865 of file qgspallabeling.cpp.
References mShowingAllLabels, mShowingCandidates, mShowingPartialsLabels, mShowingShadowRects, and QgsPalLabeling().
|
protected |
Definition at line 3739 of file qgspallabeling.cpp.
References QgsPalLayerSettings::ShadowBlendMode, QgsPalLayerSettings::shadowBlendMode, QgsPalLayerSettings::ShadowColor, QgsPalLayerSettings::shadowColor, QgsPalLayerSettings::ShadowDraw, QgsPalLayerSettings::shadowDraw, QgsPalLayerSettings::ShadowOffsetAngle, QgsPalLayerSettings::shadowOffsetAngle, QgsPalLayerSettings::ShadowOffsetDist, QgsPalLayerSettings::shadowOffsetDist, QgsPalLayerSettings::ShadowOffsetUnits, QgsPalLayerSettings::shadowOffsetUnits, QgsPalLayerSettings::ShadowRadius, QgsPalLayerSettings::shadowRadius, QgsPalLayerSettings::ShadowRadiusUnits, QgsPalLayerSettings::shadowRadiusUnits, QgsPalLayerSettings::ShadowScale, QgsPalLayerSettings::shadowScale, QgsPalLayerSettings::ShadowTransparency, QgsPalLayerSettings::shadowTransparency, QgsPalLayerSettings::ShadowUnder, and QgsPalLayerSettings::shadowUnder.
Referenced by drawLabeling().
|
protected |
Definition at line 3628 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().
|
protected |
Definition at line 3571 of file qgspallabeling.cpp.
References QgsPalLayerSettings::BufferBlendMode, QgsPalLayerSettings::bufferBlendMode, QgsPalLayerSettings::BufferColor, QgsPalLayerSettings::bufferColor, QgsPalLayerSettings::BufferDraw, QgsPalLayerSettings::bufferDraw, QgsPalLayerSettings::BufferJoinStyle, QgsPalLayerSettings::bufferJoinStyle, QgsPalLayerSettings::BufferSize, QgsPalLayerSettings::bufferSize, QgsPalLayerSettings::bufferSizeInMapUnits, QgsPalLayerSettings::BufferTransp, QgsPalLayerSettings::bufferTransp, QgsPalLayerSettings::BufferUnit, and QgsPalLayerSettings::MapUnits.
Referenced by drawLabeling().
|
protected |
Definition at line 3518 of file qgspallabeling.cpp.
References QgsPalLayerSettings::addDirectionSymbol, QgsPalLayerSettings::DirSymbDraw, QgsPalLayerSettings::DirSymbLeft, QgsPalLayerSettings::DirSymbPlacement, QgsPalLayerSettings::DirSymbReverse, QgsPalLayerSettings::DirSymbRight, QgsPalLayerSettings::leftDirectionSymbol, QgsPalLayerSettings::multilineAlign, QgsPalLayerSettings::MultiLineAlignment, QgsPalLayerSettings::MultiLineHeight, QgsPalLayerSettings::multilineHeight, QgsPalLayerSettings::MultiLineWrapChar, QgsPalLayerSettings::placeDirectionSymbol, QgsPalLayerSettings::reverseDirectionSymbol, QgsPalLayerSettings::rightDirectionSymbol, and QgsPalLayerSettings::wrapChar.
Referenced by drawLabeling().
|
protected |
Definition at line 3493 of file qgspallabeling.cpp.
References QgsPalLayerSettings::blendMode, QgsPalLayerSettings::Color, QgsPalLayerSettings::FontBlendMode, QgsPalLayerSettings::FontTransp, QgsPalLayerSettings::textColor, and QgsPalLayerSettings::textTransp.
Referenced by drawLabeling().
|
virtual |
drawLabel
Definition at line 4108 of file qgspallabeling.cpp.
References QgsPalLayerSettings::addDirectionSymbol, MathUtils::angle(), QgsPalLayerSettings::blendMode, QgsLabelComponent::dpiRatio(), drawLabelBackground(), drawLabelBuffer(), drawLabelShadow(), LabelBuffer, LabelShape, LabelText, QgsPalLayerSettings::leftDirectionSymbol, QgsPalLayerSettings::Line, M_PI, QgsRenderContext::mapToPixel(), 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().
|
static |
Definition at line 4371 of file qgspallabeling.cpp.
References QgsLabelComponent::center(), QgsSvgMarkerSymbolLayerV2::create(), QgsLabelComponent::dpiRatio(), drawLabelShadow(), QgsSymbolLayerV2Utils::encodeOutputUnit(), M_PI, QgsRenderContext::mapToPixel(), QgsSymbolV2::MapUnit, QgsPalLayerSettings::MapUnits, QgsMapToPixel::mapUnitsPerPixel(), 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::shapeBorderWidthUnits, QgsPalLayerSettings::ShapeCircle, QgsPalLayerSettings::ShapeEllipse, QgsPalLayerSettings::shapeFillColor, QgsPalLayerSettings::shapeJoinStyle, QgsPalLayerSettings::shapeOffset, QgsPalLayerSettings::shapeOffsetUnits, QgsPalLayerSettings::shapeRadii, QgsPalLayerSettings::shapeRadiiUnits, QgsPalLayerSettings::ShapeRectangle, QgsPalLayerSettings::shapeRotation, QgsPalLayerSettings::shapeRotationType, QgsPalLayerSettings::shapeSize, 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().
|
static |
Definition at line 4317 of file qgspallabeling.cpp.
References QgsPalLayerSettings::bufferBlendMode, QgsPalLayerSettings::bufferColor, QgsPalLayerSettings::bufferJoinStyle, QgsPalLayerSettings::bufferNoFill, QgsPalLayerSettings::bufferSize, QgsPalLayerSettings::bufferSizeInMapUnits, QgsLabelComponent::dpiRatio(), drawLabelShadow(), QgsPalLayerSettings::MapUnits, QgsPalLayerSettings::MM, QgsRenderContext::painter(), QgsPalLayerSettings::scaleToPixelContext(), QgsLabelComponent::setOrigin(), QgsLabelComponent::setPicture(), QgsLabelComponent::setPictureBuffer(), QgsPalLayerSettings::ShadowBuffer, QgsPalLayerSettings::shadowDraw, QgsPalLayerSettings::shadowUnder, QgsLabelComponent::text(), QgsPalLayerSettings::textFont, and QgsRenderContext::useAdvancedEffects().
Referenced by drawLabel().
void QgsPalLabeling::drawLabelCandidateRect | ( | pal::LabelPosition * | lp, |
QPainter * | painter, | ||
const QgsMapToPixel * | xform | ||
) |
Definition at line 4087 of file qgspallabeling.cpp.
References M_PI, mCandidates, QgsMapToPixel::transform(), QgsPoint::x(), and QgsPoint::y().
Referenced by drawLabeling().
|
virtual |
called when the map is drawn and labels should be placed
Implements QgsLabelingEngineInterface.
Definition at line 3805 of file qgspallabeling.cpp.
References QgsPalLayerSettings::bufferDraw, QgsLabelSearchTree::clear(), QgsMapRenderer::coordinateTransform(), dataDefinedDropShadow(), dataDefinedShapeBackground(), dataDefinedTextBuffer(), dataDefinedTextFormatting(), dataDefinedTextStyle(), QgsPalGeometry::dataDefinedValues(), QgsPalGeometry::definedFont(), drawLabel(), drawLabelCandidateRect(), QgsRenderContext::extent(), QgsPalGeometry::feature(), QgsDiagramLayerSettings::geometries, QgsPalLayerSettings::geometries, QgsLabelSearchTree::insertLabel(), QgsPalGeometry::isDiagram(), QgsPalGeometry::isPinned(), LabelBuffer, LabelShape, LabelText, layer(), QgsPalLayerSettings::limitNumLabels, mActiveDiagramLayers, mActiveLayers, QgsPalLayerSettings::maxNumLabels, mCandidates, QgsPalLayerSettings::mFeatsSendingToPal, QgsPalLayerSettings::mFeaturesToLabel, mLabelSearchTree, mMapRenderer, mPal, mShowingAllLabels, mShowingCandidates, mShowingShadowRects, QgsRenderContext::painter(), QgsDebugMsgLevel, QgsMapRenderer::scale(), 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().
|
static |
Definition at line 4667 of file qgspallabeling.cpp.
References QgsSymbolLayerV2Utils::blurImageInPlace(), QgsLabelComponent::dpiRatio(), M_PI, QgsPalLayerSettings::MapUnits, QgsLabelComponent::offset(), QgsLabelComponent::origin(), QgsRenderContext::painter(), QgsLabelComponent::picture(), QgsLabelComponent::pictureBuffer(), QgsLabelComponent::rotation(), QgsLabelComponent::rotationOffset(), QgsPalLayerSettings::scaleToPixelContext(), QgsPalLayerSettings::shadowBlendMode, QgsPalLayerSettings::shadowColor, QgsPalLayerSettings::shadowOffsetAngle, QgsPalLayerSettings::shadowOffsetDist, QgsPalLayerSettings::shadowOffsetGlobal, QgsPalLayerSettings::shadowOffsetUnits, QgsPalLayerSettings::shadowRadius, QgsPalLayerSettings::shadowRadiusAlphaOnly, QgsPalLayerSettings::shadowRadiusUnits, QgsPalLayerSettings::shadowScale, QgsPalLayerSettings::shadowTransparency, QgsPalLayerSettings::showingShadowRects, QgsLabelComponent::size(), QgsRenderContext::useAdvancedEffects(), QgsLabelComponent::useOrigin(), QgsPalLayerSettings::vectorScaleFactor, QgsPoint::x(), and QgsPoint::y().
Referenced by drawLabel(), drawLabelBackground(), and drawLabelBuffer().
|
virtual |
called when we're done with rendering
Implements QgsLabelingEngineInterface.
Definition at line 3473 of file qgspallabeling.cpp.
References mMapRenderer, and mPal.
Referenced by ~QgsPalLabeling().
|
virtual |
called when we're going to start with rendering
Implements QgsLabelingEngineInterface.
Definition at line 3440 of file qgspallabeling.cpp.
References Chain, clearActiveLayers(), Falp, mActiveDiagramLayers, mCandLine, mCandPoint, mCandPolygon, mMapRenderer, mPal, mSearch, mShowingPartialsLabels, Popmusic_Chain, Popmusic_Tabu, and Popmusic_Tabu_Chain.
|
inline |
Definition at line 686 of file qgspallabeling.h.
|
inline |
Definition at line 679 of file qgspallabeling.h.
|
inline |
Definition at line 689 of file qgspallabeling.h.
|
inline |
Definition at line 683 of file qgspallabeling.h.
|
inline |
Definition at line 746 of file qgspallabeling.h.
|
virtual |
return infos about labels at a given (map) position
Implements QgsLabelingEngineInterface.
Definition at line 4027 of file qgspallabeling.cpp.
References QgsLabelSearchTree::label(), and mLabelSearchTree.
|
virtual |
return infos about labels within a given (map) rectangle
Implements QgsLabelingEngineInterface.
Definition at line 4045 of file qgspallabeling.cpp.
References QgsLabelSearchTree::labelsInRect(), and mLabelSearchTree.
|
virtual |
returns PAL layer settings for a registered layer
Implements QgsLabelingEngineInterface.
Definition at line 3480 of file qgspallabeling.cpp.
References mActiveLayers, and mInvalidLayerSettings.
Referenced by clearActiveLayer(), QgsComposerMap::containsAdvancedEffects(), drawLabeling(), prepareLayer(), and registerFeature().
void QgsPalLabeling::loadEngineSettings | ( | ) |
load/save engine settings to project file
Definition at line 4815 of file qgspallabeling.cpp.
References QgsProject::instance(), mCandLine, mCandPoint, mCandPolygon, mSavedWithProject, mSearch, mShowingAllLabels, mShowingCandidates, mShowingPartialsLabels, mShowingShadowRects, QgsProject::readBoolEntry(), and QgsProject::readNumEntry().
void QgsPalLabeling::numCandidatePositions | ( | int & | candPoint, |
int & | candLine, | ||
int & | candPolygon | ||
) |
Definition at line 4063 of file qgspallabeling.cpp.
References mCandLine, mCandPoint, and mCandPolygon.
|
virtual |
hook called when drawing layer before issuing select()
Implements QgsLabelingEngineInterface.
Definition at line 3111 of file qgspallabeling.cpp.
References QgsPalLayerSettings::AroundPoint, QgsCoordinateTransform::clone(), QgsMapRenderer::coordinateTransform(), QgsPalLayerSettings::ct, QgsPalLayerSettings::Curved, QgsPalLayerSettings::dataDefinedProperties, QgsPalLayerSettings::displayAll, QgsExpression::evalErrorString(), QgsMapRenderer::extent(), QgsPalLayerSettings::extentGeom, QgsPalLayerSettings::fieldIndex, QgsVectorLayer::fieldNameIndex(), QgsPalLayerSettings::Free, QgsGeometry::fromRect(), QgsPalLayerSettings::getLabelExpression(), QgsMapRenderer::hasCrsTransformEnabled(), QgsExpression::hasEvalError(), QgsPalLayerSettings::Horizontal, QgsMapLayer::id(), QgsDataDefined::isActive(), QgsPalLayerSettings::isExpression, QgsPalLayerSettings::labelPerPart, layer(), QgsPalLayerSettings::Line, mActiveLayers, QgsPalLayerSettings::mCurFields, QgsPalLayerSettings::mergeLines, QgsPalLayerSettings::mFeatsSendingToPal, mMapRenderer, 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(), QgsRenderContext::scaleFactor(), QgsDataDefined::setExpressionParams(), QgsPalLayerSettings::ShowAll, QgsPalLayerSettings::ShowDefined, QgsMapToPixel::toMapCoordinates(), tr, QgsMapRenderer::transformation(), QgsPalLayerSettings::Upright, QgsPalLayerSettings::upsidedownLabels, QgsPalLayerSettings::vectorScaleFactor, willUseLayer(), and QgsPalLayerSettings::xform.
|
virtual |
called for every diagram feature
Reimplemented from QgsLabelingEngineInterface.
Definition at line 3346 of file qgspallabeling.cpp.
References QgsGeometry::asGeos(), QgsFeature::attribute(), QgsFeature::attributes(), QgsFeature::fields(), QgsFeature::geometry(), QgsFeature::id(), mActiveDiagramLayers, QgsDebugMsgLevel, QgsPalGeometry::setDiagramAttributes(), QgsPalGeometry::setIsDiagram(), QgsDiagramRendererV2::sizeMapUnits(), QgsPalGeometry::strId(), QgsGeometry::transform(), QgsCoordinateTransform::transformInPlace(), willUseLayer(), and QgsPoint::x().
|
virtual |
hook called when drawing for every feature in a layer
Implements QgsLabelingEngineInterface.
Definition at line 3340 of file qgspallabeling.cpp.
References layer(), mActiveLayers, and QgsPalLayerSettings::registerFeature().
void QgsPalLabeling::saveEngineSettings | ( | ) |
Definition at line 4839 of file qgspallabeling.cpp.
References QgsProject::instance(), mCandLine, mCandPoint, mCandPolygon, mSavedWithProject, mSearch, mShowingAllLabels, mShowingCandidates, mShowingPartialsLabels, mShowingShadowRects, and QgsProject::writeEntry().
QgsPalLabeling::Search QgsPalLabeling::searchMethod | ( | ) | const |
Definition at line 4082 of file qgspallabeling.cpp.
References mSearch.
void QgsPalLabeling::setNumCandidatePositions | ( | int | candPoint, |
int | candLine, | ||
int | candPolygon | ||
) |
Definition at line 4070 of file qgspallabeling.cpp.
References mCandLine, mCandPoint, and mCandPolygon.
void QgsPalLabeling::setSearchMethod | ( | QgsPalLabeling::Search | s | ) |
Definition at line 4077 of file qgspallabeling.cpp.
References mSearch.
|
inline |
Definition at line 687 of file qgspallabeling.h.
|
inline |
Definition at line 680 of file qgspallabeling.h.
|
inline |
Definition at line 690 of file qgspallabeling.h.
|
inline |
Definition at line 684 of file qgspallabeling.h.
|
inline |
Definition at line 747 of file qgspallabeling.h.
|
virtual |
called to find out whether the layer is used for labeling
Implements QgsLabelingEngineInterface.
Definition at line 3077 of file qgspallabeling.cpp.
References QgsMapLayer::customProperty().
Referenced by QgsComposerMap::containsAdvancedEffects(), prepareLayer(), and registerDiagramFeature().
|
protected |
Definition at line 773 of file qgspallabeling.h.
Referenced by addDiagramLayer(), drawLabeling(), init(), and registerDiagramFeature().
|
protected |
Definition at line 771 of file qgspallabeling.h.
Referenced by clearActiveLayer(), clearActiveLayers(), drawLabeling(), layer(), prepareLayer(), and registerFeature().
|
protected |
Definition at line 783 of file qgspallabeling.h.
Referenced by drawLabelCandidateRect(), and drawLabeling().
|
protected |
Definition at line 777 of file qgspallabeling.h.
Referenced by init(), loadEngineSettings(), numCandidatePositions(), QgsPalLabeling(), saveEngineSettings(), and setNumCandidatePositions().
|
protected |
Definition at line 777 of file qgspallabeling.h.
Referenced by init(), loadEngineSettings(), numCandidatePositions(), QgsPalLabeling(), saveEngineSettings(), and setNumCandidatePositions().
|
protected |
Definition at line 777 of file qgspallabeling.h.
Referenced by init(), loadEngineSettings(), numCandidatePositions(), QgsPalLabeling(), saveEngineSettings(), and setNumCandidatePositions().
|
protected |
Definition at line 774 of file qgspallabeling.h.
Referenced by layer().
|
protected |
Definition at line 790 of file qgspallabeling.h.
Referenced by drawLabeling(), labelsAtPosition(), labelsWithinRect(), QgsPalLabeling(), and ~QgsPalLabeling().
|
protected |
Definition at line 776 of file qgspallabeling.h.
Referenced by addDiagramLayer(), drawLabeling(), exit(), init(), and prepareLayer().
|
protected |
Definition at line 780 of file qgspallabeling.h.
Referenced by addDiagramLayer(), drawLabeling(), exit(), init(), and prepareLayer().
|
protected |
Definition at line 786 of file qgspallabeling.h.
Referenced by clearEngineSettings(), loadEngineSettings(), and saveEngineSettings().
|
protected |
Definition at line 778 of file qgspallabeling.h.
Referenced by init(), loadEngineSettings(), QgsPalLabeling(), saveEngineSettings(), searchMethod(), and setSearchMethod().
|
protected |
Definition at line 785 of file qgspallabeling.h.
Referenced by clone(), drawLabeling(), loadEngineSettings(), QgsPalLabeling(), and saveEngineSettings().
|
protected |
Definition at line 784 of file qgspallabeling.h.
Referenced by clone(), drawLabeling(), loadEngineSettings(), QgsPalLabeling(), and saveEngineSettings().
|
protected |
Definition at line 788 of file qgspallabeling.h.
Referenced by clone(), init(), loadEngineSettings(), QgsPalLabeling(), and saveEngineSettings().
|
protected |
Definition at line 787 of file qgspallabeling.h.
Referenced by clone(), drawLabeling(), loadEngineSettings(), QgsPalLabeling(), and saveEngineSettings().