Quantum GIS API Documentation  1.7.4
Public Types | Public Member Functions | Public Attributes | Private Member Functions
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
bool distInMapUnits
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 56 of file qgspallabeling.h.


Member Enumeration Documentation

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

Definition at line 81 of file qgspallabeling.h.

Enumerator:
OnLine 
AboveLine 
BelowLine 
MapOrientation 

Definition at line 73 of file qgspallabeling.h.

Enumerator:
AroundPoint 
OverPoint 
Line 
Curved 
Horizontal 
Free 

Definition at line 63 of file qgspallabeling.h.


Constructor & Destructor Documentation

Definition at line 184 of file qgspallabeling.cpp.

References ct, and fontMetrics.


Member Function Documentation

void QgsPalLayerSettings::calculateLabelSize ( const QFontMetricsF *  fm,
QString  text,
double &  labelX,
double &  labelY 
)
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 351 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().

Set a property to static instead data defined.

Definition at line 346 of file qgspallabeling.cpp.

References dataDefinedProperties.

Set a property as data defined.

Definition at line 341 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:
sizesize to convert
crendercontext
Returns:
font pixel size

Definition at line 618 of file qgspallabeling.cpp.

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

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


Member Data Documentation

Stores field indices for data defined layer properties.

Definition at line 148 of file qgspallabeling.h.

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

Definition at line 140 of file qgspallabeling.h.

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

Definition at line 121 of file qgspallabeling.h.

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

Definition at line 145 of file qgspallabeling.h.

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

Definition at line 139 of file qgspallabeling.h.

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

Definition at line 144 of file qgspallabeling.h.

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


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