Quantum GIS API Documentation  1.8
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
QgsPalLabeling Class Reference

#include <qgspallabeling.h>

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

List of all members.

Public Types

enum  Search {
  Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain,
  Falp
}

Public Member Functions

 QgsPalLabeling ()
 ~QgsPalLabeling ()
QgsPalLayerSettingslayer (const QString &layerName)
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 isShowingAllLabels () const
void setShowingAllLabels (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 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< QgsLabelPositionlabelsAtPosition (const QgsPoint &p)
 return infos about labels at a given (map) position
virtual
QgsLabelingEngineInterface
clone ()
 called when passing engine among map renderers
void drawLabelCandidateRect (pal::LabelPosition *lp, QPainter *painter, const QgsMapToPixel *xform)
void drawLabel (pal::LabelPosition *label, QPainter *painter, const QFont &f, const QColor &c, const QgsMapToPixel *xform, double bufferSize=-1, const QColor &bufferColor=QColor(255, 255, 255), bool drawBuffer=false)
 drawLabel

Static Public Member Functions

static void drawLabelBuffer (QPainter *p, QString text, const QFont &font, double size, QColor color)

Protected Member Functions

void initPal ()

Protected Attributes

QHash< QgsVectorLayer
*, QgsPalLayerSettings
mActiveLayers
QHash< QgsVectorLayer
*, QgsDiagramLayerSettings
mActiveDiagramLayers
QgsPalLayerSettings mInvalidLayerSettings
QgsMapRenderermMapRenderer
int mCandPoint
int mCandLine
int mCandPolygon
Search mSearch
pal::Pal * mPal
QList< QgsLabelCandidatemCandidates
bool mShowingCandidates
bool mShowingAllLabels
QgsLabelSearchTreemLabelSearchTree

Detailed Description

Definition at line 185 of file qgspallabeling.h.


Member Enumeration Documentation

Enumerator:
Chain 
Popmusic_Tabu 
Popmusic_Chain 
Popmusic_Tabu_Chain 
Falp 

Definition at line 196 of file qgspallabeling.h.


Constructor & Destructor Documentation

Definition at line 755 of file qgspallabeling.cpp.

References exit(), and mLabelSearchTree.


Member Function Documentation

const QList<QgsLabelCandidate>& QgsPalLabeling::candidates ( ) [inline]

Definition at line 203 of file qgspallabeling.h.

called when passing engine among map renderers

Implements QgsLabelingEngineInterface.

Definition at line 1400 of file qgspallabeling.cpp.

References mShowingAllLabels, mShowingCandidates, and QgsPalLabeling().

void QgsPalLabeling::drawLabel ( pal::LabelPosition *  label,
QPainter *  painter,
const QFont &  f,
const QColor &  c,
const QgsMapToPixel xform,
double  bufferSize = -1,
const QColor &  bufferColor = QColor( 255, 255, 255 ),
bool  drawBuffer = false 
)
void QgsPalLabeling::drawLabelBuffer ( QPainter *  p,
QString  text,
const QFont &  font,
double  size,
QColor  color 
) [static]

Definition at line 1389 of file qgspallabeling.cpp.

Referenced by drawLabel().

void QgsPalLabeling::drawLabelCandidateRect ( pal::LabelPosition *  lp,
QPainter *  painter,
const QgsMapToPixel xform 
)

Definition at line 1301 of file qgspallabeling.cpp.

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

Referenced by drawLabeling().

void QgsPalLabeling::drawLabeling ( QgsRenderContext context) [virtual]
void QgsPalLabeling::exit ( ) [virtual]

called when we're done with rendering

Implements QgsLabelingEngineInterface.

Definition at line 1030 of file qgspallabeling.cpp.

References mMapRenderer, and mPal.

Referenced by ~QgsPalLabeling().

void QgsPalLabeling::init ( QgsMapRenderer mr) [virtual]

called when we're going to start with rendering

Implements QgsLabelingEngineInterface.

Definition at line 999 of file qgspallabeling.cpp.

References Chain, Falp, mActiveDiagramLayers, mActiveLayers, mCandLine, mCandPoint, mCandPolygon, mMapRenderer, mPal, mSearch, Popmusic_Chain, Popmusic_Tabu, and Popmusic_Tabu_Chain.

void QgsPalLabeling::initPal ( ) [protected]
bool QgsPalLabeling::isShowingAllLabels ( ) const [inline]

Definition at line 205 of file qgspallabeling.h.

bool QgsPalLabeling::isShowingCandidates ( ) const [inline]

Definition at line 201 of file qgspallabeling.h.

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

return infos about labels at a given (map) position

Implements QgsLabelingEngineInterface.

Definition at line 1259 of file qgspallabeling.cpp.

References QgsLabelSearchTree::label(), and mLabelSearchTree.

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

Definition at line 1037 of file qgspallabeling.cpp.

References mActiveLayers, and mInvalidLayerSettings.

Referenced by drawLabel(), drawLabeling(), prepareLayer(), and registerFeature().

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

Definition at line 1277 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

int QgsPalLabeling::prepareLayer ( QgsVectorLayer layer,
QSet< int > &  attrIndices,
QgsRenderContext ctx 
) [virtual]

hook called when drawing layer before issuing select()

Implements QgsLabelingEngineInterface.

Definition at line 771 of file qgspallabeling.cpp.

References QgsPalLayerSettings::AroundPoint, QgsMapRenderer::coordinateTransform(), QgsMapLayer::crs(), QgsPalLayerSettings::ct, QgsPalLayerSettings::Curved, QgsPalLayerSettings::dataDefinedProperties, QgsMapRenderer::destinationCrs(), QgsPalLayerSettings::enabled, QgsMapRenderer::extent(), QgsPalLayerSettings::extentGeom, QgsPalLayerSettings::fieldIndex, QgsPalLayerSettings::fieldName, QgsVectorLayer::fieldNameIndex(), QgsPalLayerSettings::fontMetrics, QgsPalLayerSettings::Free, QgsGeometry::fromRect(), QgsMapRenderer::hasCrsTransformEnabled(), QgsPalLayerSettings::Horizontal, QgsMapLayer::id(), QgsPalLayerSettings::isExpression, QgsPalLayerSettings::labelPerPart, layer(), QgsPalLayerSettings::Line, mActiveLayers, QgsPalLayerSettings::mergeLines, mMapRenderer, mPal, QgsPalLayerSettings::obstacle, QgsPalLayerSettings::OverPoint, QgsPalLayerSettings::palLayer, QgsPalLayerSettings::placement, QgsPalLayerSettings::placementFlags, QgsPalLayerSettings::priority, QgsPalLayerSettings::ptOne, QgsPalLayerSettings::ptZero, QgsDebugMsg, QgsPalLayerSettings::rasterCompressFactor, QgsRenderContext::rasterScaleFactor(), QgsPalLayerSettings::readFromLayer(), QgsExpression::referencedColumns(), QgsRenderContext::scaleFactor(), QgsPalLayerSettings::scaleMax, QgsPalLayerSettings::scaleMin, QgsPalLayerSettings::sizeToPixel(), QgsPalLayerSettings::textFont, QgsMapToPixel::toMapCoordinates(), QgsPalLayerSettings::vectorScaleFactor, and QgsPalLayerSettings::xform.

void QgsPalLabeling::registerDiagramFeature ( QgsVectorLayer layer,
QgsFeature feat,
const QgsRenderContext context = QgsRenderContext() 
) [virtual]
void QgsPalLabeling::registerFeature ( QgsVectorLayer layer,
QgsFeature feat,
const QgsRenderContext context = QgsRenderContext() 
) [virtual]

hook called when drawing for every feature in a layer

Implements QgsLabelingEngineInterface.

Definition at line 894 of file qgspallabeling.cpp.

References layer(), mActiveLayers, and QgsPalLayerSettings::registerFeature().

Definition at line 1296 of file qgspallabeling.cpp.

References mSearch.

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

Definition at line 1284 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

Definition at line 1291 of file qgspallabeling.cpp.

References mSearch.

void QgsPalLabeling::setShowingAllLabels ( bool  showing) [inline]

Definition at line 206 of file qgspallabeling.h.

void QgsPalLabeling::setShowingCandidates ( bool  showing) [inline]

Definition at line 202 of file qgspallabeling.h.

bool QgsPalLabeling::willUseLayer ( QgsVectorLayer layer) [virtual]

called to find out whether the layer is used for labeling

Implements QgsLabelingEngineInterface.

Definition at line 764 of file qgspallabeling.cpp.

References QgsPalLayerSettings::enabled, and QgsPalLayerSettings::readFromLayer().

Referenced by registerDiagramFeature().


Member Data Documentation

Definition at line 245 of file qgspallabeling.h.

Referenced by addDiagramLayer(), drawLabeling(), init(), and registerDiagramFeature().

Definition at line 243 of file qgspallabeling.h.

Referenced by drawLabeling(), init(), layer(), prepareLayer(), and registerFeature().

Definition at line 255 of file qgspallabeling.h.

Referenced by drawLabelCandidateRect(), and drawLabeling().

int QgsPalLabeling::mCandLine [protected]
int QgsPalLabeling::mCandPoint [protected]

Definition at line 246 of file qgspallabeling.h.

Referenced by layer().

Definition at line 260 of file qgspallabeling.h.

Referenced by drawLabeling(), labelsAtPosition(), QgsPalLabeling(), and ~QgsPalLabeling().

Definition at line 248 of file qgspallabeling.h.

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

pal::Pal* QgsPalLabeling::mPal [protected]

Definition at line 252 of file qgspallabeling.h.

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

Definition at line 250 of file qgspallabeling.h.

Referenced by init(), QgsPalLabeling(), searchMethod(), and setSearchMethod().

Definition at line 258 of file qgspallabeling.h.

Referenced by clone(), drawLabeling(), and QgsPalLabeling().

Definition at line 256 of file qgspallabeling.h.

Referenced by clone(), drawLabeling(), and QgsPalLabeling().


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