QGIS API Documentation
2.4.0-Chugiak
|
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) |
Private Member Functions | |
void | cleanResultList (QMultiMap< double, QgsSnappingResult > &list, const QList< QgsPoint > &excludeList) const |
Removes the snapping results that contains points in exclude list. More... | |
Private Attributes | |
const QgsMapSettings & | mMapSettings |
The map settings object contains information about the output coordinate system of the map and about the relationship between pixel space and map space. More... | |
QgsSnapper::SnappingMode | mSnapMode |
Snap mode to apply. More... | |
QList< QgsSnapper::SnapLayer > | mSnapLayers |
List of layers to which snapping is applied. More... | |
A class that allows advanced snapping operations on a set of vector layers.
Definition at line 62 of file qgssnapper.h.
Definition at line 74 of file qgssnapper.h.
Snap to vertex, to segment or both.
Enumerator | |
---|---|
SnapToVertex | |
SnapToSegment | |
SnapToVertexAndSegment |
Definition at line 66 of file qgssnapper.h.
QgsSnapper::QgsSnapper | ( | QgsMapRenderer * | mapRender | ) |
@ deprecated since 2.4 - use constructor with QgsMapSettings
Definition at line 28 of file qgssnapper.cpp.
|
explicit |
Definition at line 34 of file qgssnapper.cpp.
QgsSnapper::~QgsSnapper | ( | ) |
Definition at line 39 of file qgssnapper.cpp.
|
private |
Removes the snapping results that contains points in exclude list.
Definition at line 154 of file qgssnapper.cpp.
References QgsSnappingResult::snappedVertex, and QgsSnappingResult::snappedVertexNr.
Referenced by snapPoint().
void QgsSnapper::setSnapLayers | ( | const QList< QgsSnapper::SnapLayer > & | snapLayers | ) |
Definition at line 143 of file qgssnapper.cpp.
References mSnapLayers.
Referenced by QgsMapCanvasSnapper::snapToBackgroundLayers(), and QgsMapCanvasSnapper::snapToCurrentLayer().
void QgsSnapper::setSnapMode | ( | QgsSnapper::SnappingMode | snapMode | ) |
Definition at line 149 of file qgssnapper.cpp.
References mSnapMode.
Referenced by QgsMapCanvasSnapper::snapToBackgroundLayers(), and QgsMapCanvasSnapper::snapToCurrentLayer().
int QgsSnapper::snapPoint | ( | const QPoint & | startPoint, |
QList< QgsSnappingResult > & | snappingResult, | ||
const QList< QgsPoint > & | excludePoints = QList<QgsPoint>() |
||
) |
Does the snapping operation.
startPoint | the start point for snapping (in pixel coordinates) |
snappingResult | the list where the results are inserted (everything in map coordinate system) |
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 |
Definition at line 44 of file qgssnapper.cpp.
References QgsSnappingResult::afterVertex, QgsSnappingResult::beforeVertex, cleanResultList(), QgsMapSettings::layerToMapCoordinates(), QgsMapSettings::mapToLayerCoordinates(), QgsMapSettings::mapToPixel(), mMapSettings, mSnapLayers, mSnapMode, QgsSnappingResult::snappedVertex, SnapWithOneResult, SnapWithResultsForSamePosition, QgsPoint::sqrDist(), QgsTolerance::toleranceInMapUnits(), and QgsMapToPixel::toMapCoordinates().
Referenced by QgsMapCanvasSnapper::snapToBackgroundLayers(), and QgsMapCanvasSnapper::snapToCurrentLayer().
|
private |
The map settings object contains information about the output coordinate system of the map and about the relationship between pixel space and map space.
Definition at line 122 of file qgssnapper.h.
Referenced by snapPoint().
|
private |
List of layers to which snapping is applied.
Definition at line 126 of file qgssnapper.h.
Referenced by setSnapLayers(), and snapPoint().
|
private |
Snap mode to apply.
Definition at line 124 of file qgssnapper.h.
Referenced by setSnapMode(), and snapPoint().