mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-05 00:04:40 -05:00
fix build
This commit is contained in:
parent
aa99f89caf
commit
76654511f7
@ -190,7 +190,7 @@ Splits parts cut by the given line
|
||||
- QgsGeometry.SplitCannotSplitPoint
|
||||
%End
|
||||
|
||||
QgsGeometry::OperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false ) /Deprecated/;
|
||||
QgsGeometry::OperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) /Deprecated/;
|
||||
%Docstring
|
||||
Splits features cut by the given line
|
||||
|
||||
|
||||
@ -129,9 +129,9 @@ void QgsMapToolFillRing::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
|
||||
}
|
||||
|
||||
QgsLineString ext( pointList );
|
||||
QgsPolygon polygon;
|
||||
polygon.setExteriorRing( ext.clone() );
|
||||
g = QgsGeometry( qgis::make_unique< QgsPolygon >( polygon ) );
|
||||
std::unique_ptr< QgsPolygon > polygon;
|
||||
polygon->setExteriorRing( ext.clone() );
|
||||
g = QgsGeometry( std::move( polygon ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1155,6 +1155,7 @@ bool QgsVectorLayer::deleteSelectedFeatures( int *deletedCount )
|
||||
static const QgsPointSequence vectorPointXY2pointSequence( const QVector<QgsPointXY> &points )
|
||||
{
|
||||
QgsPointSequence pts;
|
||||
pts.reserve( points.size() );
|
||||
QVector<const QgsPointXY>::iterator it = points.constBegin();
|
||||
while ( it != points.constEnd() )
|
||||
{
|
||||
@ -1231,35 +1232,20 @@ QgsGeometry::OperationResult QgsVectorLayer::addRing( QgsCurve *ring, QgsFeature
|
||||
|
||||
QgsGeometry::OperationResult QgsVectorLayer::addPart( const QList<QgsPointXY> &points )
|
||||
{
|
||||
if ( !mValid || !mEditBuffer || !mDataProvider )
|
||||
return QgsGeometry::OperationResult::LayerNotEditable;
|
||||
|
||||
//number of selected features must be 1
|
||||
|
||||
if ( mSelectedFeatureIds.empty() )
|
||||
QgsPointSequence pts;
|
||||
pts.reserve( points.size() );
|
||||
for ( QList<QgsPointXY>::const_iterator it = points.constBegin(); it != points.constEnd() ; ++it )
|
||||
{
|
||||
QgsDebugMsgLevel( QStringLiteral( "Number of selected features < 1" ), 3 );
|
||||
return QgsGeometry::OperationResult::SelectionIsEmpty;
|
||||
pts.append( QgsPoint( *it ) );
|
||||
}
|
||||
else if ( mSelectedFeatureIds.size() > 1 )
|
||||
{
|
||||
QgsDebugMsgLevel( QStringLiteral( "Number of selected features > 1" ), 3 );
|
||||
return QgsGeometry::OperationResult::SelectionIsGreaterThanOne;
|
||||
}
|
||||
|
||||
QgsVectorLayerEditUtils utils( this );
|
||||
QgsGeometry::OperationResult result = utils.addPart( points, *mSelectedFeatureIds.constBegin() );
|
||||
|
||||
if ( result == QgsGeometry::OperationResult::Success )
|
||||
updateExtents();
|
||||
return result;
|
||||
return addPart( pts );
|
||||
}
|
||||
|
||||
QgsGeometry::OperationResult QgsVectorLayer::addPart( const QVector<QgsPointXY> &points )
|
||||
{
|
||||
|
||||
return addPart( vectorPointXY2pointSequence( points ) );
|
||||
}
|
||||
|
||||
QgsGeometry::OperationResult QgsVectorLayer::addPart( const QgsPointSequence &points )
|
||||
{
|
||||
if ( !mValid || !mEditBuffer || !mDataProvider )
|
||||
|
||||
@ -184,7 +184,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
|
||||
* 4 if there is a selection but no feature split
|
||||
* \deprecated in QGIS 3.12 - will be removed in QGIS 4.0. Use the variant which accepts QgsPoint objects instead of QgsPointXY.
|
||||
*/
|
||||
Q_DECL_DEPRECATED QgsGeometry::OperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
|
||||
Q_DECL_DEPRECATED QgsGeometry::OperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
|
||||
|
||||
/**
|
||||
* Splits features cut by the given line
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user