You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This class reads the snapping properties from the current project and
4
+
* configures a QgsSnapper to perform the snapping.
5
+
* Snapping can be done to the active layer (usefull for selecting a vertex to
6
+
* manipulate) or to background layers
7
+
*/
8
+
class QgsMapCanvasSnapper
9
+
{
10
+
%TypeHeaderCode
11
+
#include <qgsmapcanvassnapper.h>
12
+
%End
13
+
public:
14
+
/**Constructor
15
+
@param canvas the map canvas to snap to*/
16
+
QgsMapCanvasSnapper( QgsMapCanvas* canvas );
17
+
18
+
QgsMapCanvasSnapper();
19
+
20
+
~QgsMapCanvasSnapper();
21
+
22
+
/**Does a snap to the current layer. Uses snap mode
23
+
QgsSnapper::SnapWithResultsForSamePosition if topological editing is enabled
24
+
and QgsSnapper::SnapWithOneResult_BY_SEGMENT if not. As this method is usually used to
25
+
find vertices/segments for editing operations, it uses the search radius for vertex
26
+
editing from the qgis options.
27
+
@param p start point of the snap (in pixel coordinates)
28
+
@param results list to which the results are appended
29
+
@param snap_to snap to vertex or to segment
30
+
@param snappingTol snapping tolerance. -1 means that the search radius for vertex edits is taken
31
+
@param excludePoints a list with (map coordinate) points that should be excluded in the snapping result. Useful e.g. for vertex moves where a vertex should not be snapped to its original position*/
/**Snaps to the background layers. This method is usefull to align the features of the
34
+
edited layers to those of other layers (as described in the project properties).
35
+
Uses snap mode QgsSnapper::SnapWithOneResult. Therefore, only the
36
+
closest result is returned.
37
+
@param p start point of the snap (in pixel coordinates)
38
+
@param result snapped point
39
+
@param excludePoints a list with (map coordinate) points that should be excluded in the snapping result. Useful e.g. for vertex moves where a vertex should not be snapped to its original position
0 commit comments