mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
is2DClosed -> isClosed2D and fix a typo
This commit is contained in:
parent
7c23644bce
commit
17d1443ace
@ -61,10 +61,10 @@ Returns the end point of the curve.
|
||||
%Docstring
|
||||
Returns ``True`` if the curve is closed.
|
||||
|
||||
.. seealso:: :py:func:`is2DClosed`
|
||||
.. seealso:: :py:func:`isClosed2D`
|
||||
%End
|
||||
|
||||
virtual bool is2DClosed() const /HoldGIL/;
|
||||
virtual bool isClosed2D() const /HoldGIL/;
|
||||
%Docstring
|
||||
Returns true if the curve is closed.
|
||||
|
||||
|
@ -591,7 +591,7 @@ segment in the line.
|
||||
|
||||
virtual bool isClosed() const /HoldGIL/;
|
||||
|
||||
virtual bool is2DClosed() const /HoldGIL/;
|
||||
virtual bool isClosed2D() const /HoldGIL/;
|
||||
|
||||
virtual bool boundingBoxIntersects( const QgsRectangle &rectangle ) const /HoldGIL/;
|
||||
|
||||
|
@ -37,7 +37,7 @@ bool QgsCurve::operator!=( const QgsAbstractGeometry &other ) const
|
||||
return !operator==( other );
|
||||
}
|
||||
|
||||
bool QgsCurve::is2DClosed() const
|
||||
bool QgsCurve::isClosed2D() const
|
||||
{
|
||||
if ( numPoints() == 0 )
|
||||
return false;
|
||||
@ -51,7 +51,7 @@ bool QgsCurve::is2DClosed() const
|
||||
}
|
||||
bool QgsCurve::isClosed() const
|
||||
{
|
||||
bool closed = is2DClosed();
|
||||
bool closed = isClosed2D();
|
||||
if ( is3D() && closed )
|
||||
{
|
||||
QgsPoint start = startPoint();
|
||||
|
@ -67,7 +67,7 @@ class CORE_EXPORT QgsCurve: public QgsAbstractGeometry SIP_ABSTRACT
|
||||
/**
|
||||
* Returns TRUE if the curve is closed.
|
||||
*
|
||||
* \see is2DClosed()
|
||||
* \see isClosed2D()
|
||||
*/
|
||||
virtual bool isClosed() const SIP_HOLDGIL;
|
||||
|
||||
@ -80,7 +80,7 @@ class CORE_EXPORT QgsCurve: public QgsAbstractGeometry SIP_ABSTRACT
|
||||
*
|
||||
* \since QGIS 3.20
|
||||
*/
|
||||
virtual bool is2DClosed() const SIP_HOLDGIL;
|
||||
virtual bool isClosed2D() const SIP_HOLDGIL;
|
||||
|
||||
/**
|
||||
* Returns TRUE if the curve is a ring.
|
||||
|
@ -406,7 +406,7 @@ bool QgsLineString::removeDuplicateNodes( double epsilon, bool useZValues )
|
||||
return result;
|
||||
}
|
||||
|
||||
bool QgsLineString::is2DClosed() const
|
||||
bool QgsLineString::isClosed2D() const
|
||||
{
|
||||
if ( mX.empty() )
|
||||
return false;
|
||||
@ -417,7 +417,7 @@ bool QgsLineString::is2DClosed() const
|
||||
|
||||
bool QgsLineString::isClosed() const
|
||||
{
|
||||
bool closed = is2DClosed();
|
||||
bool closed = isClosed2D();
|
||||
|
||||
if ( is3D() && closed )
|
||||
closed &= qgsDoubleNear( mZ.first(), mZ.last() ) || ( std::isnan( mZ.first() ) && std::isnan( mZ.last() ) );
|
||||
|
@ -779,7 +779,7 @@ class CORE_EXPORT QgsLineString: public QgsCurve
|
||||
QgsLineString *snappedToGrid( double hSpacing, double vSpacing, double dSpacing = 0, double mSpacing = 0 ) const override SIP_FACTORY;
|
||||
bool removeDuplicateNodes( double epsilon = 4 * std::numeric_limits<double>::epsilon(), bool useZValues = false ) override;
|
||||
bool isClosed() const override SIP_HOLDGIL;
|
||||
bool is2DClosed() const override SIP_HOLDGIL;
|
||||
bool isClosed2D() const override SIP_HOLDGIL;
|
||||
bool boundingBoxIntersects( const QgsRectangle &rectangle ) const override SIP_HOLDGIL;
|
||||
|
||||
/**
|
||||
|
@ -102,7 +102,7 @@ void QgsGeometryValidator::validatePolyline( int i, const QgsLineString *line, b
|
||||
QgsPoint startPoint = line->startPoint();
|
||||
QgsPoint endPoint = line->endPoint();
|
||||
QString msg;
|
||||
if ( line->is3D() && line->is2DClosed() )
|
||||
if ( line->is3D() && line->isClosed2D() )
|
||||
{
|
||||
msg = QObject::tr( "ring %1 not closed, Z mismatch: %2 vs %3" ).arg( i ).arg( startPoint.z() ).arg( endPoint.z() );
|
||||
}
|
||||
|
@ -1805,13 +1805,13 @@ void TestQgsGeometry::circularString()
|
||||
|
||||
//isClosed
|
||||
QgsCircularString l11;
|
||||
QVERIFY( !l11.is2DClosed() );
|
||||
QVERIFY( !l11.isClosed2D() );
|
||||
QVERIFY( !l11.isClosed() );
|
||||
l11.setPoints( QgsPointSequence() << QgsPoint( 1, 2 )
|
||||
<< QgsPoint( 11, 2 )
|
||||
<< QgsPoint( 11, 22 )
|
||||
<< QgsPoint( 1, 22 ) );
|
||||
QVERIFY( !l11.is2DClosed() );
|
||||
QVERIFY( !l11.isClosed2D() );
|
||||
QVERIFY( !l11.isClosed() );
|
||||
QCOMPARE( l11.numPoints(), 4 );
|
||||
QCOMPARE( l11.area(), 0.0 );
|
||||
@ -1822,17 +1822,17 @@ void TestQgsGeometry::circularString()
|
||||
<< QgsPoint( QgsWkbTypes::PointM, 11, 2, 0, 4 )
|
||||
<< QgsPoint( QgsWkbTypes::PointM, 11, 22, 0, 5 )
|
||||
<< QgsPoint( QgsWkbTypes::PointM, 1, 2, 0, 6 ) );
|
||||
QVERIFY( l11.is2DClosed() );
|
||||
QVERIFY( l11.isClosed2D() );
|
||||
QVERIFY( l11.isClosed() );
|
||||
|
||||
// test with z
|
||||
l11.addZValue( 123.0 );
|
||||
QVERIFY( l11.is2DClosed() );
|
||||
QVERIFY( l11.isClosed2D() );
|
||||
QVERIFY( l11.isClosed() );
|
||||
QgsPoint pEnd = l11.endPoint();
|
||||
pEnd.setZ( 234.0 );
|
||||
l11.moveVertex( QgsVertexId( 0, 0, l11.numPoints() - 1 ), pEnd );
|
||||
QVERIFY( l11.is2DClosed() );
|
||||
QVERIFY( l11.isClosed2D() );
|
||||
QVERIFY( !l11.isClosed() );
|
||||
|
||||
//polygonf
|
||||
|
@ -262,7 +262,7 @@ class TestQgsGeometryValidator(unittest.TestCase):
|
||||
self.assertEqual(spy[0][0].where(), QgsPointXY(3, 3))
|
||||
self.assertEqual(spy[0][0].what(), 'ring 2 not closed')
|
||||
|
||||
# not closed but 2d close
|
||||
# not closed but 2d closed
|
||||
g = QgsGeometry.fromWkt("POLYGONZ((1 1 0, 1 2 1, 2 2 2, 2 1 3, 1 1 4))")
|
||||
|
||||
validator = QgsGeometryValidator(g)
|
||||
|
Loading…
x
Reference in New Issue
Block a user