QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Types | Static Public 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, LayerUnits = MapUnits, Pixels, ProjectUnits }
 Type of unit of tolerance value from settings. More...
 

Static Public Member Functions

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=LayerUnits)
 Static function to translate tolerance value into layer units. More...
 
static Q_DECL_DEPRECATED double toleranceInMapUnits (double tolerance, QgsMapLayer *layer, QgsMapRenderer *renderer, UnitType units=LayerUnits)
 Static function to translate tolerance value into layer units. More...
 
static double toleranceInProjectUnits (double tolerance, QgsMapLayer *layer, const QgsMapSettings &mapSettings, QgsTolerance::UnitType units)
 Static function to translate tolerance value into map units. More...
 
static double vertexSearchRadius (const QgsMapSettings &mapSettings)
 Static function to get vertex tolerance value. More...
 
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...
 

Detailed Description

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

Definition at line 26 of file qgstolerance.h.

Member Enumeration Documentation

◆ UnitType

Type of unit of tolerance value from settings.

MapUnits is slightly confusing, because it actually refers to layer units (historically). For map (project) units, use ProjectUnits. Try to avoid using MapUnits value and use LayerUnits instead.

Enumerator
MapUnits 

Layer unit value.

Note
deprecated: use LayerUnits
LayerUnits 

Layer unit value.

Pixels 

Pixels unit of tolerance.

ProjectUnits 

Map (project) units.

Added in 2.8

Definition at line 33 of file qgstolerance.h.

Member Function Documentation

◆ defaultTolerance() [1/2]

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 layer units

Definition at line 98 of file qgstolerance.cpp.

◆ defaultTolerance() [2/2]

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

Definition at line 107 of file qgstolerance.cpp.

◆ toleranceInMapUnits() [1/2]

double QgsTolerance::toleranceInMapUnits ( double  tolerance,
QgsMapLayer layer,
const QgsMapSettings mapSettings,
QgsTolerance::UnitType  units = LayerUnits 
)
static

Static function to translate tolerance value into layer units.

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

Definition at line 51 of file qgstolerance.cpp.

◆ toleranceInMapUnits() [2/2]

double QgsTolerance::toleranceInMapUnits ( double  tolerance,
QgsMapLayer layer,
QgsMapRenderer renderer,
UnitType  units = LayerUnits 
)
static

Static function to translate tolerance value into layer units.

Parameters
tolerancetolerance value to be translated
layerreference layer
rendererrenderer
unitstype of units to be translated
Returns
value of tolerance in layer units
Deprecated:
since 2.4 - use the override with QgsMapSettings

Definition at line 70 of file qgstolerance.cpp.

◆ toleranceInProjectUnits()

double QgsTolerance::toleranceInProjectUnits ( double  tolerance,
QgsMapLayer layer,
const QgsMapSettings mapSettings,
QgsTolerance::UnitType  units 
)
static

Static function to translate tolerance value into map units.

Parameters
tolerancetolerance value to be translated
layersource layer necessary in case tolerance is in layer units
mapSettingssettings of the map
unitstype of units to be translated
Returns
value of tolerance in map units
Note
added in 2.8

Definition at line 36 of file qgstolerance.cpp.

◆ vertexSearchRadius() [1/3]

double QgsTolerance::vertexSearchRadius ( const QgsMapSettings mapSettings)
static

Static function to get vertex tolerance value.

The value is read from settings and transformed if necessary.

Returns
value of vertex tolerance in map units (not layer units)
Note
added in 2.8

Definition at line 75 of file qgstolerance.cpp.

◆ vertexSearchRadius() [2/3]

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 layer units

Definition at line 85 of file qgstolerance.cpp.

◆ vertexSearchRadius() [3/3]

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

Definition at line 93 of file qgstolerance.cpp.


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