QGIS API Documentation  2.5.0-Master
 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, const QgsMapSettings &mapSettings)
 Static function to get vertex tolerance value for a layer. More...
 
static Q_DECL_DEPRECATED double vertexSearchRadius (QgsMapLayer *layer, QgsMapRenderer *renderer)
 Static function to get vertex tolerance value for a layer. More...
 
static double defaultTolerance (QgsMapLayer *layer, const QgsMapSettings &mapSettings)
 Static function to get default tolerance value for a layer. More...
 
static Q_DECL_DEPRECATED double defaultTolerance (QgsMapLayer *layer, QgsMapRenderer *renderer)
 Static function to get default tolerance value for a layer. More...
 
static double toleranceInMapUnits (double tolerance, QgsMapLayer *layer, const QgsMapSettings &mapSettings, UnitType units=MapUnits)
 Static function to translate tolerance value into current map unit value. More...
 
static Q_DECL_DEPRECATED double toleranceInMapUnits (double tolerance, QgsMapLayer *layer, QgsMapRenderer *renderer, UnitType units=MapUnits)
 Static function to translate tolerance value into current map unit value. More...
 

Static Private Member Functions

static double computeMapUnitPerPixel (QgsMapLayer *layer, const QgsMapSettings &mapSettings)
 
static QgsPoint toLayerCoordinates (QgsMapLayer *layer, const QgsMapSettings &mapSettings, 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,
const QgsMapSettings mapSettings 
)
staticprivate
double QgsTolerance::defaultTolerance ( QgsMapLayer layer,
const QgsMapSettings mapSettings 
)
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 49 of file qgstolerance.cpp.

References toleranceInMapUnits().

Referenced by defaultTolerance(), and QgsMapCanvasSnapper::snapToBackgroundLayers().

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
Deprecated:
since 2.4 - use override with QgsMapSettings

Definition at line 58 of file qgstolerance.cpp.

References defaultTolerance(), and QgsMapRenderer::mapSettings().

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

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

Parameters
tolerancetolerance value to be translated
layerreference layer
mapSettingssettings of the map
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(), QgsMapCanvasSnapper::snapToBackgroundLayers(), toleranceInMapUnits(), and vertexSearchRadius().

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
Deprecated:
since 2.4 - use the override with QgsMapSettings

Definition at line 31 of file qgstolerance.cpp.

References QgsMapRenderer::mapSettings(), and toleranceInMapUnits().

double QgsTolerance::vertexSearchRadius ( QgsMapLayer layer,
const QgsMapSettings mapSettings 
)
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 36 of file qgstolerance.cpp.

References Pixels, and toleranceInMapUnits().

Referenced by QgsMapCanvasSnapper::snapToCurrentLayer(), 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
Deprecated:
since 2.4 - use override with QgsMapSettings

Definition at line 44 of file qgstolerance.cpp.

References QgsMapRenderer::mapSettings(), and vertexSearchRadius().


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