QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | List of all members
QgsSnapper Class Reference

A class that allows advanced snapping operations on a set of vector layers. More...

#include <qgssnapper.h>


struct  SnapLayer

Public Types

enum  SnappingType { SnapToVertex, SnapToSegment, SnapToVertexAndSegment }
 Snap to vertex, to segment or both. More...
enum  SnappingMode { SnapWithOneResult, SnapWithResultsForSamePosition, SnapWithResultsWithinTolerances }

Public Member Functions

Q_DECL_DEPRECATED QgsSnapper (QgsMapRenderer *mapRender)
 @ deprecated since 2.4 - use constructor with QgsMapSettings
 QgsSnapper (const QgsMapSettings &mapSettings)
 ~QgsSnapper ()
int snapPoint (const QPoint &startPoint, QList< QgsSnappingResult > &snappingResult, const QList< QgsPoint > &excludePoints=QList< QgsPoint >())
 Does the snapping operation.
void setSnapLayers (const QList< QgsSnapper::SnapLayer > &snapLayers)
void setSnapMode (QgsSnapper::SnappingMode snapMode)

Detailed Description

A class that allows advanced snapping operations on a set of vector layers.

Member Enumeration Documentation


Only one snapping result is returned.


Several snapping results which have the same position are returned.

This is useful for topological editing


All results within the given layer tolerances are returned.

Snap to vertex, to segment or both.


Constructor & Destructor Documentation

QgsSnapper::QgsSnapper ( QgsMapRenderer mapRender)

@ deprecated since 2.4 - use constructor with QgsMapSettings

QgsSnapper::QgsSnapper ( const QgsMapSettings mapSettings)
QgsSnapper::~QgsSnapper ( )

Member Function Documentation

void QgsSnapper::setSnapLayers ( const QList< QgsSnapper::SnapLayer > &  snapLayers)
void QgsSnapper::setSnapMode ( QgsSnapper::SnappingMode  snapMode)
int QgsSnapper::snapPoint ( const QPoint &  startPoint,
QList< QgsSnappingResult > &  snappingResult,
const QList< QgsPoint > &  excludePoints = QList<QgsPoint>() 

Does the snapping operation.

startPointthe start point for snapping (in pixel coordinates)
snappingResultthe list where the results are inserted (everything in map coordinate system)
excludePointsa 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 in case of success

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