28 return tolerance * mapUnitsPerPixel;
39 double tolerance = settings.value(
"/qgis/digitizing/search_radius_vertex_edit", 10 ).toDouble();
52 double tolerance = settings.value(
"/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble();
const QgsMapSettings & mapSettings()
bridge to QgsMapSettings
Base class for all map layer types.
static double toleranceInMapUnits(double tolerance, QgsMapLayer *layer, const QgsMapSettings &mapSettings, UnitType units=MapUnits)
Static function to translate tolerance value into current map unit value.
UnitType
Type of unit of tolerance value from settings.
bool hasCrsTransformEnabled() const
returns true if projections are enabled for this layer set
const QgsMapToPixel & mapToPixel() const
A non GUI class for rendering a map layer set onto a QPainter.
QgsPoint mapToLayerCoordinates(QgsMapLayer *theLayer, QgsPoint point) const
transform point coordinates from output CRS to layer's CRS
double sqrDist(double x, double y) const
Returns the squared distance between this point and x,y.
The QgsMapSettings class contains configuration for rendering of the map.
Pixels unit of tolerance.
double mapUnitsPerPixel() const
Return the distance in geographical coordinates that equals to one pixel in the map.
static double defaultTolerance(QgsMapLayer *layer, const QgsMapSettings &mapSettings)
Static function to get default tolerance value for a layer.
A class to represent a point geometry.
QgsPoint toMapCoordinates(int x, int y) const
static QgsPoint toLayerCoordinates(QgsMapLayer *layer, const QgsMapSettings &mapSettings, const QPoint &point)
static double computeMapUnitPerPixel(QgsMapLayer *layer, const QgsMapSettings &mapSettings)
static double vertexSearchRadius(QgsMapLayer *layer, const QgsMapSettings &mapSettings)
Static function to get vertex tolerance value for a layer.