QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgstolerance.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstolerance.h - wrapper for tolerance handling
3 ----------------------
4 begin : March 2009
5 copyright : (C) 2009 by Richard Kostecky
6 email : csf.kostej at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSTOLERANCE_H
17#define QGSTOLERANCE_H
18
19#include <QObject>
20
21#include "qgis_core.h"
22#include "qgis.h"
23
24class QgsMapSettings;
25class QgsMapLayer;
26class QgsPointXY;
27
32class CORE_EXPORT QgsTolerance
33{
34 Q_GADGET
35 public:
36
42 static double vertexSearchRadius( const QgsMapSettings &mapSettings );
43
49 static double vertexSearchRadius( QgsMapLayer *layer, const QgsMapSettings &mapSettings );
50
56 static double defaultTolerance( QgsMapLayer *layer, const QgsMapSettings &mapSettings );
57
66 static double toleranceInProjectUnits( double tolerance, QgsMapLayer *layer, const QgsMapSettings &mapSettings, Qgis::MapToolUnit units );
67
76 static double toleranceInMapUnits( double tolerance, QgsMapLayer *layer, const QgsMapSettings &mapSettings, Qgis::MapToolUnit units = Qgis::MapToolUnit::Layer );
77
78 private:
79 static double computeMapUnitPerPixel( QgsMapLayer *layer, const QgsMapSettings &mapSettings );
80 static QgsPointXY toLayerCoordinates( QgsMapLayer *layer, const QgsMapSettings &mapSettings, QPoint point );
81
82};
83
84#endif
MapToolUnit
Type of unit of tolerance value from settings.
Definition qgis.h:4645
@ Layer
Layer unit value.
Base class for all map layer types.
Definition qgsmaplayer.h:76
The QgsMapSettings class contains configuration for rendering of the map.
A class to represent a 2D point.
Definition qgspointxy.h:60
This is the class is providing tolerance value in map unit values.