Skip to content

Commit c2cef74

Browse files
committedApr 17, 2023
Cleanup and clarify use of QgsGeorefDataPoint copy constructor
1 parent dc44813 commit c2cef74

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

‎src/app/georeferencer/qgsgeorefdatapoint.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@ QgsGeorefDataPoint::QgsGeorefDataPoint( QgsMapCanvas *srcCanvas, QgsMapCanvas *d
3535
mGCPDestinationItem->show();
3636
}
3737

38+
// NOTE: copy constructor is only used to copy data points for the QgsResidualPlotItem layout item.
39+
// Accordingly only some members are copied. Ideally things like the id and residual could be moved
40+
// to another class (QgsGcpPoint?) so that QgsGeorefDataPoint can become a canvas associated GUI only
41+
// class.
3842
QgsGeorefDataPoint::QgsGeorefDataPoint( const QgsGeorefDataPoint &p )
3943
: QObject( nullptr )
44+
, mSrcCanvas( p.mSrcCanvas )
45+
, mDstCanvas( p.mDstCanvas )
46+
, mGCPSourceItem( nullptr )
47+
, mGCPDestinationItem( nullptr )
4048
, mGcpPoint( p.mGcpPoint )
49+
, mId( p.id() )
50+
, mResidual( p.residual() )
4151
{
42-
// we share item representation on canvas between all points
43-
// mGCPSourceItem = new QgsGCPCanvasItem(p.srcCanvas(), p.pixelCoords(), p.mapCoords(), p.isEnabled());
44-
// mGCPDestinationItem = new QgsGCPCanvasItem(p.dstCanvas(), p.pixelCoords(), p.mapCoords(), p.isEnabled());
45-
mResidual = p.residual();
46-
mId = p.id();
4752
}
4853

4954
QgsGeorefDataPoint::~QgsGeorefDataPoint()

0 commit comments

Comments
 (0)
Please sign in to comment.