Skip to content

Commit d3b9c98

Browse files
committed
Rename pointFromPointXY to fromPointXY
1 parent 5d921cc commit d3b9c98

10 files changed

+27
-27
lines changed

python/gui/qgsmaptoolcapture.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ convenient method to clean members
102102

103103
int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint );
104104

105-
QgsPoint pointFromPointXY( const QgsPointXY &point ) const;
105+
QgsPoint fromPointXY( const QgsPointXY &point ) const;
106106
%Docstring
107107
Creates a QgsPoint with ZM support if necessary (according to the
108108
WkbType of the current layer) from a QgsPointXY.

src/app/qgsmaptoolcircle2points.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ QgsMapToolCircle2Points::QgsMapToolCircle2Points( QgsMapToolCapture *parentTool,
2828

2929
void QgsMapToolCircle2Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
3030
{
31-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
31+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
3232

3333
if ( e->button() == Qt::LeftButton )
3434
{
@@ -52,7 +52,7 @@ void QgsMapToolCircle2Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
5252

5353
void QgsMapToolCircle2Points::cadCanvasMoveEvent( QgsMapMouseEvent *e )
5454
{
55-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
55+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
5656
if ( mTempRubberBand )
5757
{
5858
mCircle = QgsCircle().from2Points( mPoints.at( 0 ), mapPoint );

src/app/qgsmaptoolcircle2tangentspoint.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ QgsMapToolCircle2TangentsPoint::~QgsMapToolCircle2TangentsPoint()
4343
void QgsMapToolCircle2TangentsPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
4444
{
4545

46-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
46+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
4747
EdgesOnlyFilter filter;
4848
QgsPointLocator::Match match = mCanvas->snappingUtils()->snapToMap( mapPoint, &filter );
4949

@@ -56,8 +56,8 @@ void QgsMapToolCircle2TangentsPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e
5656
if ( match.isValid() )
5757
{
5858
match.edgePoints( p1, p2 );
59-
mPoints.append( pointFromPointXY( p1 ) );
60-
mPoints.append( pointFromPointXY( p2 ) );
59+
mPoints.append( fromPointXY( p1 ) );
60+
mPoints.append( fromPointXY( p2 ) );
6161
}
6262
}
6363
if ( mPoints.size() == 4 )
@@ -100,7 +100,7 @@ void QgsMapToolCircle2TangentsPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e
100100

101101
void QgsMapToolCircle2TangentsPoint::cadCanvasMoveEvent( QgsMapMouseEvent *e )
102102
{
103-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
103+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
104104
EdgesOnlyFilter filter;
105105
QgsPointLocator::Match match = mCanvas->snappingUtils()->snapToMap( mapPoint, &filter );
106106

@@ -123,8 +123,8 @@ void QgsMapToolCircle2TangentsPoint::cadCanvasMoveEvent( QgsMapMouseEvent *e )
123123
match.edgePoints( p1, p2 );
124124
std::unique_ptr<QgsLineString> line( new QgsLineString() );
125125

126-
line->addVertex( pointFromPointXY( p1 ) );
127-
line->addVertex( pointFromPointXY( p2 ) );
126+
line->addVertex( fromPointXY( p1 ) );
127+
line->addVertex( fromPointXY( p2 ) );
128128

129129
mTempRubberBand->setGeometry( line.release() );
130130
mTempRubberBand->show();

src/app/qgsmaptoolcircle3points.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QgsMapToolCircle3Points::QgsMapToolCircle3Points( QgsMapToolCapture *parentTool,
2929

3030
void QgsMapToolCircle3Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
3131
{
32-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
32+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
3333

3434
if ( e->button() == Qt::LeftButton )
3535
{
@@ -53,7 +53,7 @@ void QgsMapToolCircle3Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
5353

5454
void QgsMapToolCircle3Points::cadCanvasMoveEvent( QgsMapMouseEvent *e )
5555
{
56-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
56+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
5757

5858
if ( mTempRubberBand )
5959
{

src/app/qgsmaptoolcircle3tangents.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ QgsMapToolCircle3Tangents::QgsMapToolCircle3Tangents( QgsMapToolCapture *parentT
3232

3333
void QgsMapToolCircle3Tangents::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
3434
{
35-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
35+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
3636
EdgesOnlyFilter filter;
3737
QgsPointLocator::Match match = mCanvas->snappingUtils()->snapToMap( mapPoint, &filter );
3838

@@ -43,17 +43,17 @@ void QgsMapToolCircle3Tangents::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
4343
if ( match.isValid() && ( mPoints.size() <= 2 * 2 ) )
4444
{
4545
match.edgePoints( p1, p2 );
46-
mPoints.append( pointFromPointXY( p1 ) );
47-
mPoints.append( pointFromPointXY( p2 ) );
46+
mPoints.append( fromPointXY( p1 ) );
47+
mPoints.append( fromPointXY( p2 ) );
4848
}
4949
}
5050
else if ( e->button() == Qt::RightButton )
5151
{
5252
if ( match.isValid() && ( mPoints.size() == 4 ) )
5353
{
5454
match.edgePoints( p1, p2 );
55-
mPoints.append( pointFromPointXY( p1 ) );
56-
mPoints.append( pointFromPointXY( p2 ) );
55+
mPoints.append( fromPointXY( p1 ) );
56+
mPoints.append( fromPointXY( p2 ) );
5757
mCircle = QgsCircle().from3Tangents( mPoints.at( 0 ), mPoints.at( 1 ), mPoints.at( 2 ), mPoints.at( 3 ), mPoints.at( 4 ), mPoints.at( 5 ) );
5858
if ( mCircle.isEmpty() )
5959
{
@@ -73,7 +73,7 @@ void QgsMapToolCircle3Tangents::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
7373

7474
void QgsMapToolCircle3Tangents::cadCanvasMoveEvent( QgsMapMouseEvent *e )
7575
{
76-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
76+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
7777
EdgesOnlyFilter filter;
7878
QgsPointLocator::Match match = mCanvas->snappingUtils()->snapToMap( mapPoint, &filter );
7979

@@ -94,8 +94,8 @@ void QgsMapToolCircle3Tangents::cadCanvasMoveEvent( QgsMapMouseEvent *e )
9494
match.edgePoints( p1, p2 );
9595
std::unique_ptr<QgsLineString> line( new QgsLineString() );
9696

97-
line->addVertex( pointFromPointXY( p1 ) );
98-
line->addVertex( pointFromPointXY( p2 ) );
97+
line->addVertex( fromPointXY( p1 ) );
98+
line->addVertex( fromPointXY( p2 ) );
9999

100100
mTempRubberBand->setGeometry( line.release() );
101101
mTempRubberBand->show();

src/app/qgsmaptoolcirclecenterpoint.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QgsMapToolCircleCenterPoint::QgsMapToolCircleCenterPoint( QgsMapToolCapture *par
2929

3030
void QgsMapToolCircleCenterPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
3131
{
32-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
32+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
3333

3434
if ( e->button() == Qt::LeftButton )
3535
{
@@ -54,7 +54,7 @@ void QgsMapToolCircleCenterPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
5454

5555
void QgsMapToolCircleCenterPoint::cadCanvasMoveEvent( QgsMapMouseEvent *e )
5656
{
57-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
57+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
5858
if ( mTempRubberBand )
5959
{
6060
mCircle = QgsCircle().fromCenterPoint( mPoints.at( 0 ), mapPoint );

src/app/qgsmaptoolcircularstringcurvepoint.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QgsMapToolCircularStringCurvePoint::QgsMapToolCircularStringCurvePoint( QgsMapTo
2929

3030
void QgsMapToolCircularStringCurvePoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
3131
{
32-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
32+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
3333

3434
if ( e->button() == Qt::LeftButton )
3535
{

src/app/qgsmaptoolcircularstringradius.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void QgsMapToolCircularStringRadius::deactivate()
4343

4444
void QgsMapToolCircularStringRadius::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
4545
{
46-
QgsPoint mapPoint = pointFromPointXY( e->mapPoint() );
46+
QgsPoint mapPoint = fromPointXY( e->mapPoint() );
4747

4848
if ( e->button() == Qt::LeftButton )
4949
{
@@ -55,7 +55,7 @@ void QgsMapToolCircularStringRadius::cadCanvasReleaseEvent( QgsMapMouseEvent *e
5555
{
5656
if ( mPoints.size() % 2 )
5757
{
58-
mTemporaryEndPoint = pointFromPointXY( mapPoint );
58+
mTemporaryEndPoint = fromPointXY( mapPoint );
5959

6060
//initial radius is distance( tempPoint - mPoints.last ) / 2.0
6161
double minRadius = std::sqrt( QgsGeometryUtils::sqrDistance2D( mPoints.last(), mTemporaryEndPoint ) ) / 2.0;
@@ -136,7 +136,7 @@ void QgsMapToolCircularStringRadius::recalculateTempRubberBand( const QgsPointXY
136136
else
137137
{
138138
rubberBandPoints.append( mPoints.last() );
139-
rubberBandPoints.append( pointFromPointXY( mousePosition ) );
139+
rubberBandPoints.append( fromPointXY( mousePosition ) );
140140
}
141141
QgsCircularString *cString = new QgsCircularString();
142142
cString->setPoints( rubberBandPoints );

src/gui/qgsmaptoolcapture.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ void QgsMapToolCapture::setPoints( const QVector<QgsPointXY> &pointList )
768768
mSnappingMatches.append( QgsPointLocator::Match() );
769769
}
770770

771-
QgsPoint QgsMapToolCapture::pointFromPointXY( const QgsPointXY &point ) const
771+
QgsPoint QgsMapToolCapture::fromPointXY( const QgsPointXY &point ) const
772772
{
773773
QgsPoint newPoint( QgsWkbTypes::Point, point.x(), point.y() );
774774

src/gui/qgsmaptoolcapture.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
157157
*
158158
* \since QGIS 3.0
159159
*/
160-
QgsPoint pointFromPointXY( const QgsPointXY &point ) const;
160+
QgsPoint fromPointXY( const QgsPointXY &point ) const;
161161

162162
/**
163163
* Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates)

0 commit comments

Comments
 (0)