Skip to content
Permalink
Browse files
Followup 59a0e2
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent 59a0e2f commit dc697d0590c4bff28ed232eb6341e5420c52ed14
Showing with 14 additions and 18 deletions.
  1. +13 −17 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  2. +1 −1 src/plugins/georeferencer/qgsgeorefplugingui.h
@@ -493,24 +493,24 @@ void QgsGeorefPluginGui::linkGeorefToQGis( bool link )

// GCPs slots
void QgsGeorefPluginGui::addPoint( const QgsPoint& pixelCoords, const QgsPoint& mapCoords,
bool enable, bool refreshCanvas/*, bool verbose*/ )
bool enable, bool finalize )
{
QgsGeorefDataPoint* pnt = new QgsGeorefDataPoint( mCanvas, mIface->mapCanvas(),
pixelCoords, mapCoords, enable );
mPoints.append( pnt );
mGCPsDirty = true;
mGCPListWidget->setGCPList( &mPoints );
if ( refreshCanvas )
if ( finalize )
{
mGCPListWidget->setGCPList( &mPoints );
mCanvas->refresh();
mIface->mapCanvas()->refresh();
}

connect( mCanvas, SIGNAL( extentsChanged() ), pnt, SLOT( updateCoords() ) );
updateGeorefTransform();

// if (verbose)
// logRequaredGCPs();
connect( mCanvas, &QgsMapCanvas::extentsChanged, pnt, &QgsGeorefDataPoint::updateCoords );
if ( finalize )
{
updateGeorefTransform();
}
}

void QgsGeorefPluginGui::deleteDataPoint( QPoint coords )
@@ -588,8 +588,9 @@ void QgsGeorefPluginGui::showCoordDialog( const QgsPoint &pixelCoords )
if ( mLayer && !mMapCoordsDialog )
{
mMapCoordsDialog = new QgsMapCoordsDialog( mIface->mapCanvas(), pixelCoords, this );
connect( mMapCoordsDialog, SIGNAL( pointAdded( const QgsPoint &, const QgsPoint & ) ),
this, SLOT( addPoint( const QgsPoint &, const QgsPoint & ) ) );
connect( mMapCoordsDialog, &QgsMapCoordsDialog::pointAdded,
[this]( const QgsPoint &a, const QgsPoint & b ) { this->addPoint( a, b ); }
);
mMapCoordsDialog->show();
}
}
@@ -1258,18 +1259,13 @@ bool QgsGeorefPluginGui::loadGCPs( /*bool verbose*/ )

QgsPoint mapCoords( ls.at( 0 ).toDouble(), ls.at( 1 ).toDouble() ); // map x,y
QgsPoint pixelCoords( ls.at( 2 ).toDouble(), ls.at( 3 ).toDouble() ); // pixel x,y
QgsGeorefDataPoint* pnt;
if ( ls.count() == 5 )
{
bool enable = ls.at( 4 ).toInt();
pnt = new QgsGeorefDataPoint( mCanvas, mIface->mapCanvas(), pixelCoords, mapCoords, enable );
addPoint( pixelCoords, mapCoords, enable, false );
}
else
pnt = new QgsGeorefDataPoint( mCanvas, mIface->mapCanvas(), pixelCoords, mapCoords, true );

mPoints.append( pnt );
connect( mCanvas, SIGNAL( extentsChanged() ), pnt, SLOT( updateCoords() ) );
mGCPsDirty = true;
addPoint( pixelCoords, mapCoords, true, false );

++i;
}
@@ -83,7 +83,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas

// gcps
void addPoint( const QgsPoint& pixelCoords, const QgsPoint& mapCoords,
bool enable = true, bool refreshCanvas = true/*, bool verbose = true*/ );
bool enable = true, bool finalize = true );
void deleteDataPoint( QPoint pixelCoords );
void deleteDataPoint( int index );
void showCoordDialog( const QgsPoint &pixelCoords );

0 comments on commit dc697d0

Please sign in to comment.