@@ -278,7 +278,7 @@ QgsVertexEditor::QgsVertexEditor(
278278 QgsSelectedFeature *selectedFeature,
279279 QgsMapCanvas *canvas )
280280 : mUpdatingTableSelection( false )
281- , mUpdatingNodeSelection ( false )
281+ , mUpdatingVertexSelection ( false )
282282{
283283 setWindowTitle ( tr ( " Vertex Editor" ) );
284284
@@ -287,8 +287,8 @@ QgsVertexEditor::QgsVertexEditor(
287287 mCanvas = canvas;
288288
289289 mTableView = new QTableView ( this );
290- mNodeModel = new QgsVertexEditorModel ( mLayer , mSelectedFeature , mCanvas , this );
291- mTableView ->setModel ( mNodeModel );
290+ mVertexModel = new QgsVertexEditorModel ( mLayer , mSelectedFeature , mCanvas , this );
291+ mTableView ->setModel ( mVertexModel );
292292
293293 mTableView ->setSelectionMode ( QTableWidget::ExtendedSelection );
294294 mTableView ->setSelectionBehavior ( QTableWidget::SelectRows );
@@ -301,12 +301,12 @@ QgsVertexEditor::QgsVertexEditor(
301301 setWidget ( mTableView );
302302
303303 connect ( mSelectedFeature , &QgsSelectedFeature::selectionChanged, this , &QgsVertexEditor::updateTableSelection );
304- connect ( mTableView ->selectionModel (), &QItemSelectionModel::selectionChanged, this , &QgsVertexEditor::updateNodeSelection );
304+ connect ( mTableView ->selectionModel (), &QItemSelectionModel::selectionChanged, this , &QgsVertexEditor::updateVertexSelection );
305305}
306306
307307void QgsVertexEditor::updateTableSelection ()
308308{
309- if ( mUpdatingNodeSelection )
309+ if ( mUpdatingVertexSelection )
310310 return ;
311311
312312 mUpdatingTableSelection = true ;
@@ -320,42 +320,42 @@ void QgsVertexEditor::updateTableSelection()
320320 {
321321 if ( firstSelectedRow < 0 )
322322 firstSelectedRow = i;
323- selection.select ( mNodeModel ->index ( i, 0 ), mNodeModel ->index ( i, mNodeModel ->columnCount () - 1 ) );
323+ selection.select ( mVertexModel ->index ( i, 0 ), mVertexModel ->index ( i, mVertexModel ->columnCount () - 1 ) );
324324 }
325325 }
326326 mTableView ->selectionModel ()->select ( selection, QItemSelectionModel::Select );
327327
328328 if ( firstSelectedRow >= 0 )
329- mTableView ->scrollTo ( mNodeModel ->index ( firstSelectedRow, 0 ), QAbstractItemView::PositionAtTop );
329+ mTableView ->scrollTo ( mVertexModel ->index ( firstSelectedRow, 0 ), QAbstractItemView::PositionAtTop );
330330
331331 mUpdatingTableSelection = false ;
332332}
333333
334- void QgsVertexEditor::updateNodeSelection ( const QItemSelection &selected, const QItemSelection & )
334+ void QgsVertexEditor::updateVertexSelection ( const QItemSelection &selected, const QItemSelection & )
335335{
336336 if ( mUpdatingTableSelection )
337337 return ;
338338
339- mUpdatingNodeSelection = true ;
339+ mUpdatingVertexSelection = true ;
340340
341341 mSelectedFeature ->deselectAllVertices ();
342342 Q_FOREACH ( const QModelIndex &index, mTableView ->selectionModel ()->selectedRows () )
343343 {
344- int nodeIdx = index.row ();
345- mSelectedFeature ->selectVertex ( nodeIdx );
344+ int vertexIdx = index.row ();
345+ mSelectedFeature ->selectVertex ( vertexIdx );
346346 }
347347
348- // ensure that newly selected node is visible in canvas
348+ // ensure that newly selected vertex is visible in canvas
349349 if ( !selected.indexes ().isEmpty () )
350350 {
351351 int newRow = selected.indexes ().first ().row ();
352- zoomToNode ( newRow );
352+ zoomToVertex ( newRow );
353353 }
354354
355- mUpdatingNodeSelection = false ;
355+ mUpdatingVertexSelection = false ;
356356}
357357
358- void QgsVertexEditor::zoomToNode ( int idx )
358+ void QgsVertexEditor::zoomToVertex ( int idx )
359359{
360360 double x = mSelectedFeature ->vertexMap ().at ( idx )->point ().x ();
361361 double y = mSelectedFeature ->vertexMap ().at ( idx )->point ().y ();
@@ -368,8 +368,8 @@ void QgsVertexEditor::zoomToNode( int idx )
368368 // close polygon
369369 ext.append ( ext.first () );
370370 QgsGeometry extGeom ( QgsGeometry::fromQPolygonF ( ext ) );
371- QgsGeometry nodeGeom ( QgsGeometry::fromPointXY ( tCenter ) );
372- if ( !nodeGeom .within ( extGeom ) )
371+ QgsGeometry vertexGeom ( QgsGeometry::fromPointXY ( tCenter ) );
372+ if ( !vertexGeom .within ( extGeom ) )
373373 {
374374 mCanvas ->setCenter ( tCenter );
375375 mCanvas ->refresh ();
0 commit comments