mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
rename some arguments and variables
This commit is contained in:
parent
6d1d1498f7
commit
5cb86be6a2
@ -229,17 +229,17 @@ Returns true when rectangle contains a point.
|
|||||||
|
|
||||||
void combineExtentWith( const QgsRectangle &rect );
|
void combineExtentWith( const QgsRectangle &rect );
|
||||||
%Docstring
|
%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
|
%End
|
||||||
|
|
||||||
void combineExtentWith( double x, double y );
|
void combineExtentWith( double x, double y );
|
||||||
%Docstring
|
%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
|
%End
|
||||||
|
|
||||||
void combineExtentWith( const QgsPointXY &point );
|
void combineExtentWith( const QgsPointXY &point );
|
||||||
%Docstring
|
%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
|
.. versionadded:: 3.2
|
||||||
%End
|
%End
|
||||||
|
@ -60,7 +60,7 @@ QgsSelectedFeature::~QgsSelectedFeature()
|
|||||||
|
|
||||||
void QgsSelectedFeature::currentLayerChanged( QgsMapLayer *layer )
|
void QgsSelectedFeature::currentLayerChanged( QgsMapLayer *layer )
|
||||||
{
|
{
|
||||||
if ( layer == mVlayer )
|
if ( layer == mLayer )
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ void QgsSelectedFeature::updateGeometry( const QgsGeometry *geom )
|
|||||||
if ( !geom )
|
if ( !geom )
|
||||||
{
|
{
|
||||||
QgsFeature f;
|
QgsFeature f;
|
||||||
mVlayer->getFeatures( QgsFeatureRequest().setFilterFid( mFeatureId ) ).nextFeature( f );
|
mLayer->getFeatures( QgsFeatureRequest().setFilterFid( mFeatureId ) ).nextFeature( f );
|
||||||
if ( f.hasGeometry() )
|
if ( f.hasGeometry() )
|
||||||
mGeometry = new QgsGeometry( f.geometry() );
|
mGeometry = new QgsGeometry( f.geometry() );
|
||||||
else
|
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;
|
mFeatureId = featureId;
|
||||||
mVlayer = vlayer;
|
mLayer = layer;
|
||||||
mCanvas = canvas;
|
mCanvas = canvas;
|
||||||
|
|
||||||
delete mGeometry;
|
delete mGeometry;
|
||||||
@ -96,24 +96,24 @@ void QgsSelectedFeature::setSelectedFeature( QgsFeatureId featureId, QgsVectorLa
|
|||||||
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsSelectedFeature::currentLayerChanged );
|
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsSelectedFeature::currentLayerChanged );
|
||||||
|
|
||||||
// feature was deleted
|
// feature was deleted
|
||||||
connect( mVlayer, &QgsVectorLayer::featureDeleted, this, &QgsSelectedFeature::featureDeleted );
|
connect( mLayer, &QgsVectorLayer::featureDeleted, this, &QgsSelectedFeature::featureDeleted );
|
||||||
|
|
||||||
// rolling back
|
// rolling back
|
||||||
connect( mVlayer, &QgsVectorLayer::beforeRollBack, this, &QgsSelectedFeature::beforeRollBack );
|
connect( mLayer, &QgsVectorLayer::beforeRollBack, this, &QgsSelectedFeature::beforeRollBack );
|
||||||
|
|
||||||
// projection or extents changed
|
// projection or extents changed
|
||||||
connect( canvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );
|
connect( canvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );
|
||||||
connect( canvas, &QgsMapCanvas::extentsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );
|
connect( canvas, &QgsMapCanvas::extentsChanged, this, &QgsSelectedFeature::updateVertexMarkersPosition );
|
||||||
|
|
||||||
// geometry was changed
|
// geometry was changed
|
||||||
connect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
||||||
|
|
||||||
replaceVertexMap();
|
replaceVertexMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsSelectedFeature::beforeRollBack()
|
void QgsSelectedFeature::beforeRollBack()
|
||||||
{
|
{
|
||||||
disconnect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
disconnect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
||||||
deleteVertexMap();
|
deleteVertexMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ void QgsSelectedFeature::beginGeometryChange()
|
|||||||
Q_ASSERT( !mChangingGeometry );
|
Q_ASSERT( !mChangingGeometry );
|
||||||
mChangingGeometry = true;
|
mChangingGeometry = true;
|
||||||
|
|
||||||
disconnect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
disconnect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsSelectedFeature::endGeometryChange()
|
void QgsSelectedFeature::endGeometryChange()
|
||||||
@ -130,7 +130,7 @@ void QgsSelectedFeature::endGeometryChange()
|
|||||||
Q_ASSERT( mChangingGeometry );
|
Q_ASSERT( mChangingGeometry );
|
||||||
mChangingGeometry = false;
|
mChangingGeometry = false;
|
||||||
|
|
||||||
connect( mVlayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsSelectedFeature::geometryChanged );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsSelectedFeature::canvasLayersChanged()
|
void QgsSelectedFeature::canvasLayersChanged()
|
||||||
@ -148,7 +148,7 @@ void QgsSelectedFeature::geometryChanged( QgsFeatureId fid, const QgsGeometry &g
|
|||||||
{
|
{
|
||||||
QgsDebugCall;
|
QgsDebugCall;
|
||||||
|
|
||||||
if ( !mVlayer || fid != mFeatureId )
|
if ( !mLayer || fid != mFeatureId )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateGeometry( &geom );
|
updateGeometry( &geom );
|
||||||
@ -205,7 +205,7 @@ void QgsSelectedFeature::addError( QgsGeometry::Error e )
|
|||||||
if ( e.hasWhere() )
|
if ( e.hasWhere() )
|
||||||
{
|
{
|
||||||
QgsVertexMarker *marker = new QgsVertexMarker( mCanvas );
|
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->setIconType( QgsVertexMarker::ICON_X );
|
||||||
marker->setColor( Qt::green );
|
marker->setColor( Qt::green );
|
||||||
marker->setZValue( marker->zValue() + 1 );
|
marker->setZValue( marker->zValue() + 1 );
|
||||||
@ -284,7 +284,7 @@ void QgsSelectedFeature::createVertexMap()
|
|||||||
QgsPoint pt;
|
QgsPoint pt;
|
||||||
while ( geom->nextVertex( vertexId, 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;
|
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 vlayer vector layer in which feature is selected
|
||||||
* \param canvas mapCanvas on which we are working
|
* \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
|
* Function to select vertex with number
|
||||||
@ -111,7 +111,7 @@ class QgsSelectedFeature: public QObject
|
|||||||
* Gets the layer of the selected feature
|
* Gets the layer of the selected feature
|
||||||
* \returns used vector layer
|
* \returns used vector layer
|
||||||
*/
|
*/
|
||||||
QgsVectorLayer *vlayer();
|
QgsVectorLayer *layer();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for the current geometry
|
* Getter for the current geometry
|
||||||
@ -193,7 +193,7 @@ class QgsSelectedFeature: public QObject
|
|||||||
QgsGeometry *mGeometry = nullptr;
|
QgsGeometry *mGeometry = nullptr;
|
||||||
bool mFeatureSelected;
|
bool mFeatureSelected;
|
||||||
bool mChangingGeometry;
|
bool mChangingGeometry;
|
||||||
QgsVectorLayer *mVlayer = nullptr;
|
QgsVectorLayer *mLayer = nullptr;
|
||||||
QList<QgsVertexEntry *> mVertexMap;
|
QList<QgsVertexEntry *> mVertexMap;
|
||||||
QgsMapCanvas *mCanvas = nullptr;
|
QgsMapCanvas *mCanvas = nullptr;
|
||||||
|
|
||||||
|
@ -1055,7 +1055,7 @@ void QgsVertexTool::showVertexEditor() //#spellok
|
|||||||
mVertexEditor->updateEditor( m.layer(), mSelectedFeature.get() );
|
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()
|
void QgsVertexTool::cleanupVertexEditor()
|
||||||
@ -1095,7 +1095,7 @@ void QgsVertexTool::deleteVertexEditorSelection()
|
|||||||
// make a list of selected vertices
|
// make a list of selected vertices
|
||||||
QList<Vertex> vertices;
|
QList<Vertex> vertices;
|
||||||
QList<QgsVertexEntry *> &selFeatureVertices = mSelectedFeature->vertexMap();
|
QList<QgsVertexEntry *> &selFeatureVertices = mSelectedFeature->vertexMap();
|
||||||
QgsVectorLayer *layer = mSelectedFeature->vlayer();
|
QgsVectorLayer *layer = mSelectedFeature->layer();
|
||||||
QgsFeatureId fid = mSelectedFeature->featureId();
|
QgsFeatureId fid = mSelectedFeature->featureId();
|
||||||
QgsGeometry geometry = cachedGeometry( layer, fid );
|
QgsGeometry geometry = cachedGeometry( layer, fid );
|
||||||
for ( QgsVertexEntry *vertex : qgis::as_const( selFeatureVertices ) )
|
for ( QgsVertexEntry *vertex : qgis::as_const( selFeatureVertices ) )
|
||||||
@ -1123,7 +1123,7 @@ void QgsVertexTool::deleteVertexEditorSelection()
|
|||||||
|
|
||||||
_safeSelectVertex( *mSelectedFeature, nextVertexToSelect );
|
_safeSelectVertex( *mSelectedFeature, nextVertexToSelect );
|
||||||
}
|
}
|
||||||
mSelectedFeature->vlayer()->triggerRepaint();
|
mSelectedFeature->layer()->triggerRepaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,17 +219,17 @@ class CORE_EXPORT QgsRectangle
|
|||||||
bool contains( const QgsPointXY &p ) const;
|
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 );
|
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 );
|
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
|
* \since QGIS 3.2
|
||||||
*/
|
*/
|
||||||
void combineExtentWith( const QgsPointXY &point );
|
void combineExtentWith( const QgsPointXY &point );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user