QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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>

Classes

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 More...
 
 QgsSnapper (const QgsMapSettings &mapSettings)
 
 ~QgsSnapper ()
 
int snapPoint (const QPoint &startPoint, QList< QgsSnappingResult > &snappingResult, const QList< QgsPoint > &excludePoints=QList< QgsPoint >())
 Does the snapping operation. More...
 
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

Enumerator
SnapWithOneResult 

Only one snapping result is returned.

SnapWithResultsForSamePosition 

Several snapping results which have the same position are returned.

This is useful for topological editing

SnapWithResultsWithinTolerances 

All results within the given layer tolerances are returned.

Snap to vertex, to segment or both.

Enumerator
SnapToVertex 
SnapToSegment 
SnapToVertexAndSegment 

Constructor & Destructor Documentation

QgsSnapper::QgsSnapper ( QgsMapRenderer mapRender)

@ deprecated since 2.4 - use constructor with QgsMapSettings

QgsSnapper::QgsSnapper ( const QgsMapSettings mapSettings)
explicit
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.

Parameters
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
Returns
0 in case of success

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