fix build

This commit is contained in:
lbartoletti 2019-10-01 10:44:54 +02:00 committed by Nyall Dawson
parent aa99f89caf
commit 76654511f7
4 changed files with 12 additions and 26 deletions

View File

@ -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

View File

@ -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
{

View File

@ -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 )

View File

@ -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