mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
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)
This commit is contained in:
parent
275158aa30
commit
cdef0764b5
@ -32,13 +32,6 @@ General purpose distance and area calculator.
|
||||
Constructor
|
||||
%End
|
||||
|
||||
QgsDistanceArea( const QgsDistanceArea &origDA );
|
||||
%Docstring
|
||||
Copy constructor
|
||||
%End
|
||||
|
||||
// QgsDistanceArea &operator=( const QgsDistanceArea &origDA );
|
||||
|
||||
void setEllipsoidalMode( bool flag );
|
||||
%Docstring
|
||||
Sets whether coordinates must be projected to ellipsoid before measuring
|
||||
|
@ -55,40 +55,6 @@ QgsDistanceArea::QgsDistanceArea()
|
||||
setEllipsoid( GEO_NONE );
|
||||
}
|
||||
|
||||
|
||||
QgsDistanceArea::QgsDistanceArea( const QgsDistanceArea &origDA )
|
||||
{
|
||||
_copy( origDA );
|
||||
}
|
||||
|
||||
QgsDistanceArea &QgsDistanceArea::operator=( const QgsDistanceArea &origDA )
|
||||
{
|
||||
if ( this == & origDA )
|
||||
{
|
||||
// Do not copy unto self
|
||||
return *this;
|
||||
}
|
||||
_copy( origDA );
|
||||
return *this;
|
||||
}
|
||||
|
||||
//! Copy helper. Avoid Sqlite3 accesses.
|
||||
void QgsDistanceArea::_copy( const QgsDistanceArea &origDA )
|
||||
{
|
||||
mEllipsoidalMode = origDA.mEllipsoidalMode;
|
||||
mEllipsoid = origDA.mEllipsoid;
|
||||
mSemiMajor = origDA.mSemiMajor;
|
||||
mSemiMinor = origDA.mSemiMinor;
|
||||
mInvFlattening = origDA.mInvFlattening;
|
||||
if ( ( mSemiMajor > 0 ) && ( mSemiMinor > 0 ) )
|
||||
{
|
||||
// Some calculations and trig. Should not be TOO time consuming.
|
||||
// Alternatively we could copy the temp vars?
|
||||
computeAreaInit();
|
||||
}
|
||||
mCoordTransform = origDA.mCoordTransform;
|
||||
}
|
||||
|
||||
void QgsDistanceArea::setEllipsoidalMode( bool flag )
|
||||
{
|
||||
mEllipsoidalMode = flag;
|
||||
|
@ -42,12 +42,6 @@ class CORE_EXPORT QgsDistanceArea
|
||||
//! Constructor
|
||||
QgsDistanceArea();
|
||||
|
||||
//! Copy constructor
|
||||
QgsDistanceArea( const QgsDistanceArea &origDA );
|
||||
|
||||
//! Assignment operator
|
||||
QgsDistanceArea &operator=( const QgsDistanceArea &origDA );
|
||||
|
||||
/** Sets whether coordinates must be projected to ellipsoid before measuring
|
||||
* \note for calculations to use the ellipsoid, both the ellipsoid mode must be true
|
||||
* and an ellipse must be set
|
||||
@ -340,9 +334,6 @@ class CORE_EXPORT QgsDistanceArea
|
||||
Length
|
||||
};
|
||||
|
||||
//! Copy helper
|
||||
void _copy( const QgsDistanceArea &origDA );
|
||||
|
||||
//! used for transforming coordinates from source CRS to ellipsoid's coordinates
|
||||
QgsCoordinateTransform mCoordTransform;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user