Skip to content

Commit 95cff79

Browse files
lbartolettinyalldawson
authored andcommittedApr 29, 2021
replace setMValueFromPoints by transferFirstMValuteToPoint
1 parent 4231134 commit 95cff79

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed
 

‎python/core/auto_generated/geometry/qgsgeometryutils.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ A Z dimension is added to ``point`` if one of the point in the list
763763
.. versionadded:: 3.0
764764
%End
765765

766-
static bool setMValueFromPoints( const QgsPointSequence &points, QgsPoint &point );
766+
static bool transferFirstMValueToPoint( const QgsPointSequence &points, QgsPoint &point );
767767
%Docstring
768768
A M dimension is added to ``point`` if one of the points in the list
769769
``points`` contains an M value. Moreover, the M value of ``point`` is

‎src/core/geometry/qgsgeometryutils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ bool QgsGeometryUtils::lineIntersection( const QgsPoint &p1, QgsVector v1, const
255255
// z support for intersection point
256256
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << p1 << p2, intersection );
257257
// m support for intersection point
258-
QgsGeometryUtils::setMValueFromPoints( QgsPointSequence() << p1 << p2, intersection );
258+
QgsGeometryUtils::transferFirstMValueToPoint( QgsPointSequence() << p1 << p2, intersection );
259259

260260
return true;
261261
}
@@ -857,7 +857,7 @@ bool QgsGeometryUtils::segmentMidPoint( const QgsPoint &p1, const QgsPoint &p2,
857857
// add z support if necessary
858858
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << p1 << p2, result );
859859
// add m support if necessary
860-
QgsGeometryUtils::setMValueFromPoints( QgsPointSequence() << p1 << p2, result );
860+
QgsGeometryUtils::transferFirstMValueToPoint( QgsPointSequence() << p1 << p2, result );
861861

862862
return true;
863863
}
@@ -1810,7 +1810,7 @@ void QgsGeometryUtils::weightedPointInTriangle( const double aX, const double aY
18101810
pointY = rBy + rCy + aY;
18111811
}
18121812

1813-
bool QgsGeometryUtils::setMValueFromPoints( const QgsPointSequence &points, QgsPoint &point )
1813+
bool QgsGeometryUtils::transferFirstMValueToPoint( const QgsPointSequence &points, QgsPoint &point )
18141814
{
18151815
bool rc = false;
18161816

‎src/core/geometry/qgsgeometryutils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ class CORE_EXPORT QgsGeometryUtils
797797
*
798798
* \since QGIS 3.20
799799
*/
800-
static bool setMValueFromPoints( const QgsPointSequence &points, QgsPoint &point );
800+
static bool transferFirstMValueToPoint( const QgsPointSequence &points, QgsPoint &point );
801801

802802
/**
803803
* Returns the point (\a pointX, \a pointY) forming the bisector from segment (\a aX \a aY) (\a bX \a bY)

‎tests/src/core/testqgsgeometryutils.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class TestQgsGeometryUtils: public QObject
8686
void testPerpendicularOffsetPoint();
8787
void testClosestSideOfRectangle();
8888
void setZValueFromPoints();
89-
void setMValueFromPoints();
89+
void transferFirstMValueToPoint();
9090
};
9191

9292

@@ -1637,34 +1637,34 @@ void TestQgsGeometryUtils::setZValueFromPoints()
16371637
QCOMPARE( pointM.z(), 4.0 );
16381638
}
16391639

1640-
void TestQgsGeometryUtils::setMValueFromPoints()
1640+
void TestQgsGeometryUtils::transferFirstMValueToPoint()
16411641
{
16421642
QgsPoint point( 1, 2 );
16431643

16441644
// Type: Point
1645-
bool ret = QgsGeometryUtils::setMValueFromPoints( QgsPointSequence() << QgsPoint( 0, 2 ), point );
1645+
bool ret = QgsGeometryUtils::transferFirstMValueToPoint( QgsPointSequence() << QgsPoint( 0, 2 ), point );
16461646
QCOMPARE( ret, false );
16471647

16481648
// Type: PointZ
1649-
ret = QgsGeometryUtils::setMValueFromPoints( QgsPointSequence() << QgsPoint( 0, 2, 4 ), point );
1649+
ret = QgsGeometryUtils::transferFirstMValueToPoint( QgsPointSequence() << QgsPoint( 0, 2, 4 ), point );
16501650
QCOMPARE( ret, false );
16511651

16521652
// Type: PointM
1653-
ret = QgsGeometryUtils::setMValueFromPoints( QgsPointSequence() << QgsPoint( QgsWkbTypes::PointM, 0, 2, 0, 4 ), point );
1653+
ret = QgsGeometryUtils::transferFirstMValueToPoint( QgsPointSequence() << QgsPoint( QgsWkbTypes::PointM, 0, 2, 0, 4 ), point );
16541654
QCOMPARE( ret, true );
16551655
QCOMPARE( point.wkbType(), QgsWkbTypes::PointM );
16561656
QCOMPARE( point.m(), 4.0 );
16571657

16581658
// Type: PointM
1659-
ret = QgsGeometryUtils::setMValueFromPoints( QgsPointSequence() << QgsPoint( QgsWkbTypes::PointM, 0, 2, 0, 5 ), point );
1659+
ret = QgsGeometryUtils::transferFirstMValueToPoint( QgsPointSequence() << QgsPoint( QgsWkbTypes::PointM, 0, 2, 0, 5 ), point );
16601660
QCOMPARE( ret, true );
16611661
QCOMPARE( point.wkbType(), QgsWkbTypes::PointM );
16621662
QCOMPARE( point.m(), 5.0 ); // now point.z == 5. Shouldn't the current M be left if the point is already of type PointM?
16631663

16641664
// Add M to a PointZ
16651665
QgsPoint pointZ( 1, 2, 4 );
16661666
// Type: PointM
1667-
ret = QgsGeometryUtils::setMValueFromPoints( QgsPointSequence() << QgsPoint( QgsWkbTypes::PointM, 0, 2, 0, 5 ), pointZ );
1667+
ret = QgsGeometryUtils::transferFirstMValueToPoint( QgsPointSequence() << QgsPoint( QgsWkbTypes::PointM, 0, 2, 0, 5 ), pointZ );
16681668
QCOMPARE( ret, true );
16691669
QCOMPARE( pointZ.wkbType(), QgsWkbTypes::PointZM );
16701670
QCOMPARE( pointZ.m(), 5.0 );

0 commit comments

Comments
 (0)
Please sign in to comment.