Skip to content

Commit cdef076

Browse files
committedApr 17, 2017
Use default copy constructors and assignment operators for QgsDistanceArea
There's no complex member variables here - the default implementations should be fine (actually faster, since they won't require recalculation of the derived parameters)
1 parent 275158a commit cdef076

File tree

3 files changed

+0
-50
lines changed

3 files changed

+0
-50
lines changed
 

‎python/core/qgsdistancearea.sip

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ General purpose distance and area calculator.
3232
Constructor
3333
%End
3434

35-
QgsDistanceArea( const QgsDistanceArea &origDA );
36-
%Docstring
37-
Copy constructor
38-
%End
39-
40-
// QgsDistanceArea &operator=( const QgsDistanceArea &origDA );
41-
4235
void setEllipsoidalMode( bool flag );
4336
%Docstring
4437
Sets whether coordinates must be projected to ellipsoid before measuring

‎src/core/qgsdistancearea.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,40 +55,6 @@ QgsDistanceArea::QgsDistanceArea()
5555
setEllipsoid( GEO_NONE );
5656
}
5757

58-
59-
QgsDistanceArea::QgsDistanceArea( const QgsDistanceArea &origDA )
60-
{
61-
_copy( origDA );
62-
}
63-
64-
QgsDistanceArea &QgsDistanceArea::operator=( const QgsDistanceArea &origDA )
65-
{
66-
if ( this == & origDA )
67-
{
68-
// Do not copy unto self
69-
return *this;
70-
}
71-
_copy( origDA );
72-
return *this;
73-
}
74-
75-
//! Copy helper. Avoid Sqlite3 accesses.
76-
void QgsDistanceArea::_copy( const QgsDistanceArea &origDA )
77-
{
78-
mEllipsoidalMode = origDA.mEllipsoidalMode;
79-
mEllipsoid = origDA.mEllipsoid;
80-
mSemiMajor = origDA.mSemiMajor;
81-
mSemiMinor = origDA.mSemiMinor;
82-
mInvFlattening = origDA.mInvFlattening;
83-
if ( ( mSemiMajor > 0 ) && ( mSemiMinor > 0 ) )
84-
{
85-
// Some calculations and trig. Should not be TOO time consuming.
86-
// Alternatively we could copy the temp vars?
87-
computeAreaInit();
88-
}
89-
mCoordTransform = origDA.mCoordTransform;
90-
}
91-
9258
void QgsDistanceArea::setEllipsoidalMode( bool flag )
9359
{
9460
mEllipsoidalMode = flag;

‎src/core/qgsdistancearea.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ class CORE_EXPORT QgsDistanceArea
4242
//! Constructor
4343
QgsDistanceArea();
4444

45-
//! Copy constructor
46-
QgsDistanceArea( const QgsDistanceArea &origDA );
47-
48-
//! Assignment operator
49-
QgsDistanceArea &operator=( const QgsDistanceArea &origDA );
50-
5145
/** Sets whether coordinates must be projected to ellipsoid before measuring
5246
* \note for calculations to use the ellipsoid, both the ellipsoid mode must be true
5347
* and an ellipse must be set
@@ -340,9 +334,6 @@ class CORE_EXPORT QgsDistanceArea
340334
Length
341335
};
342336

343-
//! Copy helper
344-
void _copy( const QgsDistanceArea &origDA );
345-
346337
//! used for transforming coordinates from source CRS to ellipsoid's coordinates
347338
QgsCoordinateTransform mCoordTransform;
348339

0 commit comments

Comments
 (0)