QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Static Public Member Functions | Static Private Member Functions | List of all members
QgsTolerance Class Reference

This is the class is providing tolerance value in map unit values. More...

#include <qgstolerance.h>

Public Types

enum  UnitType { MapUnits, Pixels }
 Type of unit of tolerance value from settings. More...

Static Public Member Functions

static double vertexSearchRadius (QgsMapLayer *layer, QgsMapRenderer *renderer)
 Static function to get vertex tolerance value for a layer.
static double defaultTolerance (QgsMapLayer *layer, QgsMapRenderer *renderer)
 Static function to get default tolerance value for a layer.
static double toleranceInMapUnits (double tolerance, QgsMapLayer *layer, QgsMapRenderer *renderer, UnitType units=MapUnits)
 Static function to translate tolerance value into current map unit value.

Static Private Member Functions

static double computeMapUnitPerPixel (QgsMapLayer *layer, QgsMapRenderer *renderer)
static QgsPoint toLayerCoordinates (QgsMapLayer *layer, QgsMapRenderer *renderer, const QPoint &point)

Detailed Description

This is the class is providing tolerance value in map unit values.

Note
This class has been added in version 1.1.

Definition at line 28 of file qgstolerance.h.

Member Enumeration Documentation

Type of unit of tolerance value from settings.

Enumerator:
MapUnits 

Map unit value.

Pixels 

Pixels unit of tolerance.

Definition at line 33 of file qgstolerance.h.

Member Function Documentation

double QgsTolerance::computeMapUnitPerPixel ( QgsMapLayer layer,
QgsMapRenderer renderer 
)
staticprivate
double QgsTolerance::defaultTolerance ( QgsMapLayer layer,
QgsMapRenderer renderer 
)
static

Static function to get default tolerance value for a layer.

The value is read from settings and transformed if necessary.

Returns
value of default tolerance in map units

Definition at line 41 of file qgstolerance.cpp.

References toleranceInMapUnits().

Referenced by QgsMapCanvasSnapper::snapToBackgroundLayers().

QgsPoint QgsTolerance::toLayerCoordinates ( QgsMapLayer layer,
QgsMapRenderer renderer,
const QPoint &  point 
)
staticprivate
double QgsTolerance::toleranceInMapUnits ( double  tolerance,
QgsMapLayer layer,
QgsMapRenderer renderer,
UnitType  units = MapUnits 
)
static

Static function to translate tolerance value into current map unit value.

Parameters
tolerancetolerance value to be translated
layerreference layer
rendererrenderer
unitstype of units to be translated
Returns
value of tolerance in map units

Definition at line 21 of file qgstolerance.cpp.

References computeMapUnitPerPixel(), and MapUnits.

Referenced by defaultTolerance(), QgsSnapper::snapPoint(), and vertexSearchRadius().

double QgsTolerance::vertexSearchRadius ( QgsMapLayer layer,
QgsMapRenderer renderer 
)
static

Static function to get vertex tolerance value for a layer.

The value is read from settings and transformed if necessary.

Returns
value of vertex tolerance in map units

Definition at line 32 of file qgstolerance.cpp.

References Pixels, and toleranceInMapUnits().

Referenced by QgsMapCanvasSnapper::snapToCurrentLayer().


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