Skip to content

Commit

Permalink
Cleanup and clarify use of QgsGeorefDataPoint copy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 17, 2023
1 parent dc44813 commit c2cef74
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/app/georeferencer/qgsgeorefdatapoint.cpp
Expand Up @@ -35,15 +35,20 @@ QgsGeorefDataPoint::QgsGeorefDataPoint( QgsMapCanvas *srcCanvas, QgsMapCanvas *d
mGCPDestinationItem->show();
}

// NOTE: copy constructor is only used to copy data points for the QgsResidualPlotItem layout item.
// Accordingly only some members are copied. Ideally things like the id and residual could be moved
// to another class (QgsGcpPoint?) so that QgsGeorefDataPoint can become a canvas associated GUI only
// class.
QgsGeorefDataPoint::QgsGeorefDataPoint( const QgsGeorefDataPoint &p )
: QObject( nullptr )
, mSrcCanvas( p.mSrcCanvas )
, mDstCanvas( p.mDstCanvas )
, mGCPSourceItem( nullptr )
, mGCPDestinationItem( nullptr )
, mGcpPoint( p.mGcpPoint )
, mId( p.id() )
, mResidual( p.residual() )
{
// we share item representation on canvas between all points
// mGCPSourceItem = new QgsGCPCanvasItem(p.srcCanvas(), p.pixelCoords(), p.mapCoords(), p.isEnabled());
// mGCPDestinationItem = new QgsGCPCanvasItem(p.dstCanvas(), p.pixelCoords(), p.mapCoords(), p.isEnabled());
mResidual = p.residual();
mId = p.id();
}

QgsGeorefDataPoint::~QgsGeorefDataPoint()
Expand Down

0 comments on commit c2cef74

Please sign in to comment.