Skip to content

Commit

Permalink
rename some arguments and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jun 12, 2018
1 parent 6d1d149 commit 5cb86be
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions python/core/auto_generated/geometry/qgsrectangle.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ Returns true when rectangle contains a point.

void combineExtentWith( const QgsRectangle &rect );
%Docstring
Expands the rectangle so that its covers both the original rectangle and the given rectangle.
Expands the rectangle so that it covers both the original rectangle and the given rectangle.
%End

void combineExtentWith( double x, double y );
%Docstring
Expands the rectangle so that its covers both the original rectangle and the given point.
Expands the rectangle so that it covers both the original rectangle and the given point.
%End

void combineExtentWith( const QgsPointXY &point );
%Docstring
Expands the rectangle so that its covers both the original rectangle and the given point.
Expands the rectangle so that it covers both the original rectangle and the given point.

.. versionadded:: 3.2
%End
Expand Down
30 changes: 15 additions & 15 deletions src/app/vertextool/qgsselectedfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ QgsSelectedFeature::~QgsSelectedFeature()

void QgsSelectedFeature::currentLayerChanged( QgsMapLayer *layer )
{
if ( layer == mVlayer )
if ( layer == mLayer )
deleteLater();
}

Expand All @@ -71,7 +71,7 @@ void QgsSelectedFeature::updateGeometry( const QgsGeometry *geom )
if ( !geom )
{
QgsFeature f;
mVlayer->getFeatures( QgsFeatureRequest().setFilterFid( mFeatureId ) ).nextFeature( f );
mLayer->getFeatures( QgsFeatureRequest().setFilterFid( mFeatureId ) ).nextFeature( f );
if ( f.hasGeometry() )
mGeometry = new QgsGeometry( f.geometry() );
else
Expand All @@ -83,10 +83,10 @@ void QgsSelectedFeature::updateGeometry( const QgsGeometry *geom )
}
}

void QgsSelectedFeature::setSelectedFeature( QgsFeatureId featureId, QgsVectorLayer *vlayer, QgsMapCanvas *canvas )
void QgsSelectedFeature::setSelectedFeature( QgsFeatureId featureId, QgsVectorLayer *layer, QgsMapCanvas *canvas )
{
mFeatureId = featureId;
mVlayer = vlayer;
mLayer = layer;
mCanvas = canvas;

delete mGeometry;
Expand All @@ -96,24 +96,24 @@ void QgsSelectedFeature::setSelectedFeature( QgsFeatureId featureId, QgsVectorLa
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsSelectedFeature::currentLayerChanged );

// feature was deleted
connect( mVlayer, &QgsVectorLayer::featureDeleted, this, &QgsSelectedFeature::featureDeleted );
connect( mLayer, &QgsVectorLayer::featureDeleted, this, &QgsSelectedFeature::featureDeleted );

// rolling back
connect( mVlayer, &QgsVectorLayer::beforeRollBack, this, &QgsSelectedFeature::beforeRollBack );
connect( mLayer, &QgsVectorLayer::beforeRollBack, this, &QgsSelectedFeature::beforeRollBack );

// projection or extents changed
connect( canvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );
connect( canvas, &QgsMapCanvas::extentsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );

// geometry was changed
connect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );

replaceVertexMap();
}

void QgsSelectedFeature::beforeRollBack()
{
disconnect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
disconnect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
deleteVertexMap();
}

Expand All @@ -122,15 +122,15 @@ void QgsSelectedFeature::beginGeometryChange()
Q_ASSERT( !mChangingGeometry );
mChangingGeometry = true;

disconnect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
disconnect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
}

void QgsSelectedFeature::endGeometryChange()
{
Q_ASSERT( mChangingGeometry );
mChangingGeometry = false;

connect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
}

void QgsSelectedFeature::canvasLayersChanged()
Expand All @@ -148,7 +148,7 @@ void QgsSelectedFeature::geometryChanged( QgsFeatureId fid, const QgsGeometry &g
{
QgsDebugCall;

if ( !mVlayer || fid != mFeatureId )
if ( !mLayer || fid != mFeatureId )
return;

updateGeometry( &geom );
Expand Down Expand Up @@ -205,7 +205,7 @@ void QgsSelectedFeature::addError( QgsGeometry::Error e )
if ( e.hasWhere() )
{
QgsVertexMarker *marker = new QgsVertexMarker( mCanvas );
marker->setCenter( mCanvas->mapSettings().layerToMapCoordinates( mVlayer, e.where() ) );
marker->setCenter( mCanvas->mapSettings().layerToMapCoordinates( mLayer, e.where() ) );
marker->setIconType( QgsVertexMarker::ICON_X );
marker->setColor( Qt::green );
marker->setZValue( marker->zValue() + 1 );
Expand Down Expand Up @@ -284,7 +284,7 @@ void QgsSelectedFeature::createVertexMap()
QgsPoint pt;
while ( geom->nextVertex( vertexId, pt ) )
{
mVertexMap.append( new QgsVertexEntry( mCanvas, mVlayer, pt, vertexId, tr( "ring %1, vertex %2" ).arg( vertexId.ring ).arg( vertexId.vertex ) ) );
mVertexMap.append( new QgsVertexEntry( mCanvas, mLayer, pt, vertexId, tr( "ring %1, vertex %2" ).arg( vertexId.ring ).arg( vertexId.vertex ) ) );
}
}

Expand Down Expand Up @@ -363,7 +363,7 @@ QList<QgsVertexEntry *> &QgsSelectedFeature::vertexMap()
return mVertexMap;
}

QgsVectorLayer *QgsSelectedFeature::vlayer()
QgsVectorLayer *QgsSelectedFeature::layer()
{
return mVlayer;
return mLayer;
}
6 changes: 3 additions & 3 deletions src/app/vertextool/qgsselectedfeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class QgsSelectedFeature: public QObject
* \param vlayer vector layer in which feature is selected
* \param canvas mapCanvas on which we are working
*/
void setSelectedFeature( QgsFeatureId featureId, QgsVectorLayer *vlayer, QgsMapCanvas *canvas );
void setSelectedFeature( QgsFeatureId featureId, QgsVectorLayer *layer, QgsMapCanvas *canvas );

/**
* Function to select vertex with number
Expand Down Expand Up @@ -111,7 +111,7 @@ class QgsSelectedFeature: public QObject
* Gets the layer of the selected feature
* \returns used vector layer
*/
QgsVectorLayer *vlayer();
QgsVectorLayer *layer();

/**
* Getter for the current geometry
Expand Down Expand Up @@ -193,7 +193,7 @@ class QgsSelectedFeature: public QObject
QgsGeometry *mGeometry = nullptr;
bool mFeatureSelected;
bool mChangingGeometry;
QgsVectorLayer *mVlayer = nullptr;
QgsVectorLayer *mLayer = nullptr;
QList<QgsVertexEntry *> mVertexMap;
QgsMapCanvas *mCanvas = nullptr;

Expand Down
6 changes: 3 additions & 3 deletions src/app/vertextool/qgsvertextool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ void QgsVertexTool::showVertexEditor() //#spellok
mVertexEditor->updateEditor( m.layer(), mSelectedFeature.get() );
}

connect( mSelectedFeature.get()->vlayer(), &QgsVectorLayer::featureDeleted, this, &QgsVertexTool::cleanEditor );
connect( mSelectedFeature.get()->layer(), &QgsVectorLayer::featureDeleted, this, &QgsVertexTool::cleanEditor );
}

void QgsVertexTool::cleanupVertexEditor()
Expand Down Expand Up @@ -1095,7 +1095,7 @@ void QgsVertexTool::deleteVertexEditorSelection()
// make a list of selected vertices
QList<Vertex> vertices;
QList<QgsVertexEntry *> &selFeatureVertices = mSelectedFeature->vertexMap();
QgsVectorLayer *layer = mSelectedFeature->vlayer();
QgsVectorLayer *layer = mSelectedFeature->layer();
QgsFeatureId fid = mSelectedFeature->featureId();
QgsGeometry geometry = cachedGeometry( layer, fid );
for ( QgsVertexEntry *vertex : qgis::as_const( selFeatureVertices ) )
Expand Down Expand Up @@ -1123,7 +1123,7 @@ void QgsVertexTool::deleteVertexEditorSelection()

_safeSelectVertex( *mSelectedFeature, nextVertexToSelect );
}
mSelectedFeature->vlayer()->triggerRepaint();
mSelectedFeature->layer()->triggerRepaint();
}


Expand Down
6 changes: 3 additions & 3 deletions src/core/geometry/qgsrectangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ class CORE_EXPORT QgsRectangle
bool contains( const QgsPointXY &p ) const;

/**
* Expands the rectangle so that its covers both the original rectangle and the given rectangle.
* Expands the rectangle so that it covers both the original rectangle and the given rectangle.
*/
void combineExtentWith( const QgsRectangle &rect );

/**
* Expands the rectangle so that its covers both the original rectangle and the given point.
* Expands the rectangle so that it covers both the original rectangle and the given point.
*/
void combineExtentWith( double x, double y );

/**
* Expands the rectangle so that its covers both the original rectangle and the given point.
* Expands the rectangle so that it covers both the original rectangle and the given point.
* \since QGIS 3.2
*/
void combineExtentWith( const QgsPointXY &point );
Expand Down

0 comments on commit 5cb86be

Please sign in to comment.