Skip to content
Permalink
Browse files

rename some arguments and variables

  • Loading branch information
3nids committed Jun 8, 2018
1 parent 6d1d149 commit 5cb86be6a2a42c039bf77cfee44d9f61e40c53c2
@@ -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
@@ -60,7 +60,7 @@ QgsSelectedFeature::~QgsSelectedFeature()

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

@@ -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
@@ -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;
@@ -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();
}

@@ -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()
@@ -148,7 +148,7 @@ void QgsSelectedFeature::geometryChanged( QgsFeatureId fid, const QgsGeometry &g
{
QgsDebugCall;

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

updateGeometry( &geom );
@@ -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 );
@@ -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 ) ) );
}
}

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

QgsVectorLayer *QgsSelectedFeature::vlayer()
QgsVectorLayer *QgsSelectedFeature::layer()
{
return mVlayer;
return mLayer;
}
@@ -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
@@ -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
@@ -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;

@@ -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()
@@ -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 ) )
@@ -1123,7 +1123,7 @@ void QgsVertexTool::deleteVertexEditorSelection()

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


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

0 comments on commit 5cb86be

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