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 char *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 void registerFeature (QgsVectorLayer *layer, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext())
 hook called when drawing for every feature in a layer
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
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
QgsPalLayerSettings mInvalidLayerSettings
QgsMapRenderermMapRenderer
int mCandPoint
int mCandLine
int mCandPolygon
Search mSearch
pal::Pal * mPal
QList< QgsLabelCandidatemCandidates
bool mShowingCandidates
bool mShowingAllLabels


Detailed Description

Definition at line 165 of file qgspallabeling.h.


Member Enumeration Documentation

Enumerator:
Chain 
Popmusic_Tabu 
Popmusic_Chain 
Popmusic_Tabu_Chain 
Falp 

Definition at line 176 of file qgspallabeling.h.


Constructor & Destructor Documentation

QgsPalLabeling::QgsPalLabeling (  ) 

QgsPalLabeling::~QgsPalLabeling (  ) 

Definition at line 621 of file qgspallabeling.cpp.

References exit().


Member Function Documentation

QgsPalLayerSettings & QgsPalLabeling::layer ( const char *  layerName  ) 

Definition at line 764 of file qgspallabeling.cpp.

References mActiveLayers, mInvalidLayerSettings, and QgsPalLayerSettings::palLayer.

Referenced by drawLabel(), and drawLabeling().

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

Definition at line 939 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

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

Definition at line 946 of file qgspallabeling.cpp.

References mCandLine, mCandPoint, and mCandPolygon.

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

Definition at line 953 of file qgspallabeling.cpp.

References mSearch.

QgsPalLabeling::Search QgsPalLabeling::searchMethod (  )  const

Definition at line 958 of file qgspallabeling.cpp.

References mSearch.

bool QgsPalLabeling::isShowingCandidates (  )  const [inline]

Definition at line 181 of file qgspallabeling.h.

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

Definition at line 182 of file qgspallabeling.h.

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

Definition at line 183 of file qgspallabeling.h.

bool QgsPalLabeling::isShowingAllLabels (  )  const [inline]

Definition at line 185 of file qgspallabeling.h.

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

Definition at line 186 of file qgspallabeling.h.

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

called when we're going to start with rendering

Implements QgsLabelingEngineInterface.

Definition at line 729 of file qgspallabeling.cpp.

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

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

called to find out whether the layer is used for labeling

Implements QgsLabelingEngineInterface.

Definition at line 628 of file qgspallabeling.cpp.

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

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

References mActiveLayers, and QgsPalLayerSettings::registerFeature().

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

void QgsPalLabeling::exit (  )  [virtual]

called when we're done with rendering

Implements QgsLabelingEngineInterface.

Definition at line 757 of file qgspallabeling.cpp.

References mMapRenderer, and mPal.

Referenced by ~QgsPalLabeling().

QgsLabelingEngineInterface * QgsPalLabeling::clone (  )  [virtual]

called when passing engine among map renderers

Implements QgsLabelingEngineInterface.

Definition at line 1075 of file qgspallabeling.cpp.

References mShowingAllLabels, mShowingCandidates, and QgsPalLabeling().

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

Definition at line 963 of file qgspallabeling.cpp.

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

Referenced by drawLabeling().

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 1056 of file qgspallabeling.cpp.

Referenced by drawLabel().

void QgsPalLabeling::initPal (  )  [protected]


Member Data Documentation

Definition at line 218 of file qgspallabeling.h.

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

Definition at line 219 of file qgspallabeling.h.

Referenced by layer().

Definition at line 221 of file qgspallabeling.h.

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

int QgsPalLabeling::mCandPoint [protected]

int QgsPalLabeling::mCandLine [protected]

Definition at line 223 of file qgspallabeling.h.

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

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

Definition at line 225 of file qgspallabeling.h.

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

Definition at line 228 of file qgspallabeling.h.

Referenced by drawLabelCandidateRect(), and drawLabeling().

Definition at line 229 of file qgspallabeling.h.

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

Definition at line 231 of file qgspallabeling.h.

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


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

Generated on Sat Feb 4 19:17:43 2012 for Quantum GIS API Documentation by  doxygen 1.5.6