QgsPalLayerSettings Class Reference

#include <qgspallabeling.h>

Collaboration diagram for QgsPalLayerSettings:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Placement {
  AroundPoint, OverPoint, Line, Curved,
  Horizontal, Free
}
enum  LinePlacementFlags { OnLine = 1, AboveLine = 2, BelowLine = 4, MapOrientation = 8 }
enum  DataDefinedProperties {
  Size = 0, Bold, Italic, Underline,
  Color, Strikeout, Family, BufferSize,
  BufferColor, PositionX, PositionY, Hali,
  Vali, LabelDistance, Rotation
}

Public Member Functions

 QgsPalLayerSettings ()
 QgsPalLayerSettings (const QgsPalLayerSettings &s)
 ~QgsPalLayerSettings ()
void calculateLabelSize (const QFontMetricsF *fm, QString text, double &labelX, double &labelY)
void registerFeature (QgsFeature &f, const QgsRenderContext &context)
void readFromLayer (QgsVectorLayer *layer)
void writeToLayer (QgsVectorLayer *layer)
void setDataDefinedProperty (DataDefinedProperties p, int attributeIndex)
 Set a property as data defined.
void removeDataDefinedProperty (DataDefinedProperties p)
 Set a property to static instead data defined.
int sizeToPixel (double size, const QgsRenderContext &c) const
 Calculates pixel size (considering output size should be in pixel or map units, scale factors and oversampling).

Public Attributes

QString fieldName
Placement placement
unsigned int placementFlags
QFont textFont
QColor textColor
bool enabled
int priority
bool obstacle
double dist
double vectorScaleFactor
double rasterCompressFactor
int scaleMin
int scaleMax
double bufferSize
QColor bufferColor
bool labelPerPart
bool mergeLines
bool multiLineLabels
double minFeatureSize
bool addDirectionSymbol
bool fontSizeInMapUnits
pal::Layer * palLayer
int fieldIndex
QFontMetricsF * fontMetrics
const QgsMapToPixelxform
const QgsCoordinateTransformct
QgsPoint ptZero
QgsPoint ptOne
QList< QgsPalGeometry * > geometries
QMap< DataDefinedProperties, int > dataDefinedProperties
 Stores field indices for data defined layer properties.

Private Member Functions

bool checkMinimumSizeMM (const QgsRenderContext &ct, QgsGeometry *geom, double minSize) const
 Checks if a feature is larger than a minimum size (in mm).


Detailed Description

Definition at line 51 of file qgspallabeling.h.


Member Enumeration Documentation

Enumerator:
AroundPoint 
OverPoint 
Line 
Curved 
Horizontal 
Free 

Definition at line 58 of file qgspallabeling.h.

Enumerator:
OnLine 
AboveLine 
BelowLine 
MapOrientation 

Definition at line 68 of file qgspallabeling.h.

Enumerator:
Size 
Bold 
Italic 
Underline 
Color 
Strikeout 
Family 
BufferSize 
BufferColor 
PositionX 
PositionY 
Hali 
Vali 
LabelDistance 
Rotation 

Definition at line 76 of file qgspallabeling.h.


Constructor & Destructor Documentation

QgsPalLayerSettings::QgsPalLayerSettings (  ) 

QgsPalLayerSettings::QgsPalLayerSettings ( const QgsPalLayerSettings s  ) 

QgsPalLayerSettings::~QgsPalLayerSettings (  ) 

Definition at line 170 of file qgspallabeling.cpp.

References ct, and fontMetrics.


Member Function Documentation

void QgsPalLayerSettings::calculateLabelSize ( const QFontMetricsF *  fm,
QString  text,
double &  labelX,
double &  labelY 
)

void QgsPalLayerSettings::registerFeature ( QgsFeature f,
const QgsRenderContext context 
)

void QgsPalLayerSettings::readFromLayer ( QgsVectorLayer layer  ) 

void QgsPalLayerSettings::writeToLayer ( QgsVectorLayer layer  ) 

void QgsPalLayerSettings::setDataDefinedProperty ( DataDefinedProperties  p,
int  attributeIndex 
)

Set a property as data defined.

Definition at line 321 of file qgspallabeling.cpp.

References dataDefinedProperties.

void QgsPalLayerSettings::removeDataDefinedProperty ( DataDefinedProperties  p  ) 

Set a property to static instead data defined.

Definition at line 326 of file qgspallabeling.cpp.

References dataDefinedProperties.

int QgsPalLayerSettings::sizeToPixel ( double  size,
const QgsRenderContext c 
) const

Calculates pixel size (considering output size should be in pixel or map units, scale factors and oversampling).

Parameters:
size size to convert
c rendercontext
Returns:
font pixel size

Definition at line 579 of file qgspallabeling.cpp.

References fontSizeInMapUnits, QgsRenderContext::mapToPixel(), QgsMapToPixel::mapUnitsPerPixel(), QgsRenderContext::rasterScaleFactor(), and QgsRenderContext::scaleFactor().

Referenced by QgsPalLabeling::drawLabeling(), QgsPalLabeling::prepareLayer(), and registerFeature().

bool QgsPalLayerSettings::checkMinimumSizeMM ( const QgsRenderContext ct,
QgsGeometry geom,
double  minSize 
) const [private]

Checks if a feature is larger than a minimum size (in mm).

Returns:
true if above size, false if below

Definition at line 331 of file qgspallabeling.cpp.

References QgsGeometry::area(), QgsGeometry::length(), QGis::Line, QgsRenderContext::mapToPixel(), QgsMapToPixel::mapUnitsPerPixel(), QGis::Point, QGis::Polygon, QgsRenderContext::scaleFactor(), and QgsGeometry::type().

Referenced by registerFeature().


Member Data Documentation

Definition at line 116 of file qgspallabeling.h.

Referenced by QgsPalLayerSettings(), readFromLayer(), sizeToPixel(), and writeToLayer().

Definition at line 138 of file qgspallabeling.h.

Referenced by QgsPalLabeling::prepareLayer(), and registerFeature().

Definition at line 139 of file qgspallabeling.h.

Referenced by QgsPalLabeling::drawLabeling(), and registerFeature().

Stores field indices for data defined layer properties.

Definition at line 142 of file qgspallabeling.h.

Referenced by QgsPalLabeling::prepareLayer(), QgsPalLayerSettings(), readFromLayer(), registerFeature(), removeDataDefinedProperty(), setDataDefinedProperty(), and writeToLayer().


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