-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- QgsSnapper: use one list of QgsSnapper::SnapLayer structs rather th…
…an three separate lists - PyQGIS: finished QgsSnapper binding, added QgsMapCanvasSnapper git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9657 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
wonder
committed
Nov 17, 2008
1 parent
977ada1
commit 08fdf7a
Showing
6 changed files
with
104 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
/** \ingroup gui | ||
* This class reads the snapping properties from the current project and | ||
* configures a QgsSnapper to perform the snapping. | ||
* Snapping can be done to the active layer (usefull for selecting a vertex to | ||
* manipulate) or to background layers | ||
*/ | ||
class QgsMapCanvasSnapper | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsmapcanvassnapper.h> | ||
%End | ||
public: | ||
/**Constructor | ||
@param canvas the map canvas to snap to*/ | ||
QgsMapCanvasSnapper( QgsMapCanvas* canvas ); | ||
|
||
QgsMapCanvasSnapper(); | ||
|
||
~QgsMapCanvasSnapper(); | ||
|
||
/**Does a snap to the current layer. Uses snap mode | ||
QgsSnapper::SnapWithResultsForSamePosition if topological editing is enabled | ||
and QgsSnapper::SnapWithOneResult_BY_SEGMENT if not. As this method is usually used to | ||
find vertices/segments for editing operations, it uses the search radius for vertex | ||
editing from the qgis options. | ||
@param p start point of the snap (in pixel coordinates) | ||
@param results list to which the results are appended | ||
@param snap_to snap to vertex or to segment | ||
@param snappingTol snapping tolerance. -1 means that the search radius for vertex edits is taken | ||
@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*/ | ||
int snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SnappingType snap_to, double snappingTol = -1, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() ); | ||
/**Snaps to the background layers. This method is usefull to align the features of the | ||
edited layers to those of other layers (as described in the project properties). | ||
Uses snap mode QgsSnapper::SnapWithOneResult. Therefore, only the | ||
closest result is returned. | ||
@param p start point of the snap (in pixel coordinates) | ||
@param result snapped point | ||
@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 | ||
@return 0 in case of success*/ | ||
int snapToBackgroundLayers( const QPoint& p, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() ); | ||
|
||
void setMapCanvas( QgsMapCanvas* canvas ); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters