Skip to content
Permalink
Browse files

Fix new method segnatures

  • Loading branch information
alisovenko committed Jan 9, 2017
1 parent eb1ab18 commit 3c84229bff21da781560817cafab65904df40098
@@ -508,7 +508,7 @@ bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
return d->geometry->insertVertex( id, QgsPointV2( x, y ) );
}

bool QgsGeometry::insertVertex( QgsPointV2& p, int beforeVertex )
bool QgsGeometry::insertVertex( const QgsPointV2& point, int beforeVertex )
{
if ( !d->geometry )
{
@@ -520,7 +520,7 @@ bool QgsGeometry::insertVertex( QgsPointV2& p, int beforeVertex )
{
detach( true );
//insert geometry instead of point
return static_cast< QgsGeometryCollection* >( d->geometry )->insertGeometry( new QgsPointV2( p ), beforeVertex );
return static_cast< QgsGeometryCollection* >( d->geometry )->insertGeometry( new QgsPointV2( point ), beforeVertex );
}

QgsVertexId id;
@@ -531,7 +531,7 @@ bool QgsGeometry::insertVertex( QgsPointV2& p, int beforeVertex )

detach( true );

return d->geometry->insertVertex( id, p );
return d->geometry->insertVertex( id, point );
}

QgsPoint QgsGeometry::vertexAt( int atVertex ) const
@@ -279,7 +279,7 @@ class CORE_EXPORT QgsGeometry
* these error conditions. (Or maybe we add another method to this
* object to help make the distinction?)
*/
bool insertVertex( QgsPointV2& p, int beforeVertex );
bool insertVertex( const QgsPointV2& point, int beforeVertex );

/** Moves the vertex at the given position number
* and item (first number is index 0)
@@ -1023,13 +1023,13 @@ bool QgsVectorLayer::insertVertex( double x, double y, QgsFeatureId atFeatureId,
}


bool QgsVectorLayer::insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex )
bool QgsVectorLayer::insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex )
{
if ( !mValid || !mEditBuffer || !mDataProvider )
return false;

QgsVectorLayerEditUtils utils( this );
bool result = utils.insertVertex( p, atFeatureId, beforeVertex );
bool result = utils.insertVertex( point, atFeatureId, beforeVertex );
if ( result )
updateExtents();
return result;
@@ -943,7 +943,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
*/
bool insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex );
bool insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex );

/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
@@ -56,7 +56,7 @@ bool QgsVectorLayerEditUtils::insertVertex( double x, double y, QgsFeatureId atF
return true;
}

bool QgsVectorLayerEditUtils::insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex )
bool QgsVectorLayerEditUtils::insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex )
{
if ( !L->hasGeometryType() )
return false;
@@ -72,7 +72,7 @@ bool QgsVectorLayerEditUtils::insertVertex( QgsPointV2& p, QgsFeatureId atFeatur
geometry = f.geometry();
}

geometry.insertVertex( p, beforeVertex );
geometry.insertVertex( point, beforeVertex );

L->editBuffer()->changeGeometry( atFeatureId, geometry );
return true;
@@ -45,7 +45,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
*/
bool insertVertex( QgsPointV2& p, QgsFeatureId atFeatureId, int beforeVertex );
bool insertVertex( const QgsPointV2& point, QgsFeatureId atFeatureId, int beforeVertex );

/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
@@ -34,7 +34,7 @@ QgsMapToolEdit::~QgsMapToolEdit()
}


double QgsMapToolEdit::defaultZValue()
double QgsMapToolEdit::defaultZValue() const
{
QSettings().value( QStringLiteral( "/qgis/digitizing/default_z_value" ), Qgis::DEFAULT_Z_COORDINATE ).toDouble();
}
@@ -41,7 +41,7 @@ class GUI_EXPORT QgsMapToolEdit: public QgsMapTool
* Return default Z value
* Use for set Z coordinate to new vertex for 2.5d geometries
*/
double defaultZValue();
double defaultZValue() const;

protected:

0 comments on commit 3c84229

Please sign in to comment.
You can’t perform that action at this time.