28 return tolerance * mapUnitsPerPixel;
35 double tolerance = settings.value(
"/qgis/digitizing/search_radius_vertex_edit", 10 ).toDouble();
44 double tolerance = settings.value(
"/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble();
const QgsMapToPixel * coordinateTransform()
static double defaultTolerance(QgsMapLayer *layer, QgsMapRenderer *renderer)
Static function to get default tolerance value for a layer.
Base class for all map layer types.
static double vertexSearchRadius(QgsMapLayer *layer, QgsMapRenderer *renderer)
Static function to get vertex tolerance value for a layer.
UnitType
Type of unit of tolerance value from settings.
A non GUI class for rendering a map layer set onto a QPainter.
QgsPoint mapToLayerCoordinates(QgsMapLayer *theLayer, QgsPoint point)
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.
static double computeMapUnitPerPixel(QgsMapLayer *layer, QgsMapRenderer *renderer)
static double toleranceInMapUnits(double tolerance, QgsMapLayer *layer, QgsMapRenderer *renderer, UnitType units=MapUnits)
Static function to translate tolerance value into current map unit value.
Pixels unit of tolerance.
bool hasCrsTransformEnabled() const
returns true if projections are enabled for this layer set
double mapUnitsPerPixel() const
static QgsPoint toLayerCoordinates(QgsMapLayer *layer, QgsMapRenderer *renderer, const QPoint &point)
A class to represent a point geometry.
QgsPoint toMapCoordinates(int x, int y) const