rename new QgsSnapper::snapPoint method to snapMapPoint and restore python name

of deprecated old version (fixes #12153)
This commit is contained in:
Juergen E. Fischer 2015-02-08 22:03:33 +01:00
parent 90cc725b3f
commit 0593ef6a26
7 changed files with 20 additions and 18 deletions

View File

@ -13,12 +13,11 @@ class QgsMapToPixel
public:
/* Constructor
* @param mapUnitsPerPixel Map units per pixel
* @param ymax Maximum y value of the map canvas
* @param height Map canvas height, in pixels
* @param ymin Minimum y value of the map canvas
* @param xmin Minimum x value of the map canvas
*/
QgsMapToPixel( double mapUnitsPerPixel = 0, double ymax = 0, double ymin = 0,
double xmin = 0 );
QgsMapToPixel( double mapUnitsPerPixel = 0, double height = 0, double ymin = 0, double xmin = 0 );
//! destructor
~QgsMapToPixel();
/*! Transform the point from map (world) coordinates to device coordinates
@ -50,6 +49,7 @@ class QgsMapToPixel
transform.
@note not available in python bindings
*/
// template <class T>
// void transformInPlace( QVector<double>& x, QVector<double>& y ) const;
QgsPoint toMapCoordinates( int x, int y ) const;
@ -127,8 +127,6 @@ class QgsMapToPixel
void setParameters( double mapUnitsPerPixel, double xc, double yc, int width, int height, double rotation );
//! String representation of the parameters used in the transform
QString showParameters();
QString showParameters() const;
};

View File

@ -70,11 +70,12 @@ class QgsSnapper
};
//!@ deprecated since 2.4 - use constructor with QgsMapSettings
QgsSnapper( QgsMapRenderer* mapRender ) /Deprecated/;
QgsSnapper( QgsMapRenderer *mapRender ) /Deprecated/;
explicit QgsSnapper( const QgsMapSettings& mapSettings );
~QgsSnapper();
/** Does the snapping operation
@param startPoint the start point for snapping (in pixel coordinates)
@param snappingResult the list where the results are inserted (everything in map coordinate system)
@ -82,14 +83,15 @@ class QgsSnapper
@return 0 in case of success
@deprecated
*/
int snapPoint( const QPoint& startPoint, QList<QgsSnappingResult>& snappingResult /Out/, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() ) /Deprecated,PyName=snapPointOld/;
int snapPoint( const QPoint &startPoint, QList<QgsSnappingResult> &snappingResult /Out/, const QList<QgsPoint> &excludePoints = QList<QgsPoint>() ) /Deprecated/;
/** Does the snapping operation
@param mapCoordPoint the start point for snapping (in map coordinates)
@param snappingResult the list where the results are inserted (everything in map coordinate system)
@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 snapPoint( const QgsPoint& mapCoordPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
int snapMapPoint( const QgsPoint &mapCoordPoint, QList<QgsSnappingResult> &snappingResult /Out/, const QList<QgsPoint> &excludePoints = QList<QgsPoint>() );
//setters
void setSnapLayers( const QList<QgsSnapper::SnapLayer>& snapLayers );

View File

@ -478,7 +478,6 @@ QgisApp *QgisApp::smInstance = 0;
// constructor starts here
QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent, Qt::WindowFlags fl )
: QMainWindow( parent, fl )
, mMousePrecisionDecimalPlaces( 0 )
#ifdef Q_OS_WIN
, mSkipNextContextMenuEvent( 0 )
#endif
@ -506,6 +505,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
, mLayerTreeCanvasBridge( 0 )
, mPreviousNonZoomMapTool( 0 )
, mSplash( splash )
, mMousePrecisionDecimalPlaces( 0 )
, mInternalClipboard( 0 )
, mShowProjectionTab( false )
, mPythonUtils( 0 )

View File

@ -41,7 +41,7 @@ class CORE_EXPORT QgsMapToPixel
* @param xmin Minimum x value of the map canvas
* @deprecated in 2.8, use version with all parameters
*/
QgsMapToPixel( double mapUnitsPerPixel, double height = 0, double ymin = 0, double xmin = 0 );
Q_DECL_DEPRECATED QgsMapToPixel( double mapUnitsPerPixel, double height = 0, double ymin = 0, double xmin = 0 );
/* Constructor
* @param mapUnitsPerPixel Map units per pixel

View File

@ -44,10 +44,10 @@ QgsSnapper::~QgsSnapper()
int QgsSnapper::snapPoint( const QPoint& startPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints )
{
QgsPoint mapCoordPoint = mMapSettings.mapToPixel().toMapCoordinates( startPoint.x(), startPoint.y() );
return snapPoint( mapCoordPoint, snappingResult, excludePoints );
return snapMapPoint( mapCoordPoint, snappingResult, excludePoints );
}
int QgsSnapper::snapPoint( const QgsPoint& mapCoordPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints )
int QgsSnapper::snapMapPoint( const QgsPoint& mapCoordPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints )
{
snappingResult.clear();

View File

@ -95,11 +95,12 @@ class CORE_EXPORT QgsSnapper
};
//!@ deprecated since 2.4 - use constructor with QgsMapSettings
Q_DECL_DEPRECATED QgsSnapper( QgsMapRenderer* mapRender );
Q_DECL_DEPRECATED QgsSnapper( QgsMapRenderer *mapRender );
explicit QgsSnapper( const QgsMapSettings& mapSettings );
~QgsSnapper();
/** Does the snapping operation
@param startPoint the start point for snapping (in pixel coordinates)
@param snappingResult the list where the results are inserted (everything in map coordinate system)
@ -107,14 +108,15 @@ class CORE_EXPORT QgsSnapper
@return 0 in case of success
@deprecated
*/
Q_DECL_DEPRECATED int snapPoint( const QPoint& startPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
Q_DECL_DEPRECATED int snapPoint( const QPoint &startPoint, QList<QgsSnappingResult> &snappingResult, const QList<QgsPoint> &excludePoints = QList<QgsPoint>() );
/** Does the snapping operation
@param mapCoordPoint the start point for snapping (in map coordinates)
@param snappingResult the list where the results are inserted (everything in map coordinate system)
@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 snapPoint( const QgsPoint& mapCoordPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
int snapMapPoint( const QgsPoint &mapCoordPoint, QList<QgsSnappingResult> &snappingResult, const QList<QgsPoint> &excludePoints = QList<QgsPoint>() );
//setters
void setSnapLayers( const QList<QgsSnapper::SnapLayer>& snapLayers );

View File

@ -108,7 +108,7 @@ int QgsMapCanvasSnapper::snapToCurrentLayer( const QPoint& p, QList<QgsSnappingR
snapLayers.append( snapLayer );
mSnapper->setSnapLayers( snapLayers );
if ( mSnapper->snapPoint( p, results, excludePoints ) != 0 )
if ( mSnapper->snapMapPoint( p, results, excludePoints ) != 0 )
return 4;
return 0;
@ -257,7 +257,7 @@ int QgsMapCanvasSnapper::snapToBackgroundLayers( const QgsPoint& point, QList<Qg
mSnapper->setSnapLayers( snapLayers );
if ( mSnapper->snapPoint( point, results, excludePoints ) != 0 )
if ( mSnapper->snapMapPoint( point, results, excludePoints ) != 0 )
return 4;
if ( intersectionSnapping != 1 )