Quantum GIS API Documentation  1.7.4
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 171 of file qgspallabeling.h.


Member Enumeration Documentation

Enumerator:
Chain 
Popmusic_Tabu 
Popmusic_Chain 
Popmusic_Tabu_Chain 
Falp 

Definition at line 182 of file qgspallabeling.h.


Constructor & Destructor Documentation

Definition at line 662 of file qgspallabeling.cpp.

References exit(), and mLabelSearchTree.


Member Function Documentation

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

Definition at line 189 of file qgspallabeling.h.

called when passing engine among map renderers

Implements QgsLabelingEngineInterface.

Definition at line 1288 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 1277 of file qgspallabeling.cpp.

Referenced by drawLabel().

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

Definition at line 1184 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 914 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 883 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 191 of file qgspallabeling.h.

bool QgsPalLabeling::isShowingCandidates ( ) const [inline]

Definition at line 187 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 1142 of file qgspallabeling.cpp.

References QgsLabelSearchTree::label(), and mLabelSearchTree.

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

Definition at line 921 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 1160 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

int QgsPalLabeling::prepareLayer ( QgsVectorLayer layer,
QSet< int > &  attrIndices,
QgsRenderContext ctx 
) [virtual]
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 779 of file qgspallabeling.cpp.

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

Definition at line 1179 of file qgspallabeling.cpp.

References mSearch.

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

Definition at line 1167 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

Definition at line 1174 of file qgspallabeling.cpp.

References mSearch.

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

Definition at line 192 of file qgspallabeling.h.

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

Definition at line 188 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 671 of file qgspallabeling.cpp.

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

Referenced by registerDiagramFeature().


Member Data Documentation

Definition at line 231 of file qgspallabeling.h.

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

Definition at line 229 of file qgspallabeling.h.

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

Definition at line 241 of file qgspallabeling.h.

Referenced by drawLabelCandidateRect(), and drawLabeling().

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

Definition at line 232 of file qgspallabeling.h.

Referenced by layer().

Definition at line 246 of file qgspallabeling.h.

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

Definition at line 234 of file qgspallabeling.h.

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

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

Definition at line 238 of file qgspallabeling.h.

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

Definition at line 236 of file qgspallabeling.h.

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

Definition at line 244 of file qgspallabeling.h.

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

Definition at line 242 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