Skip to content

Commit 1873866

Browse files
committed
Renamed one member and its funtcion, and undo last commit
1 parent edb2a7f commit 1873866

13 files changed

+30
-31
lines changed

python/core/qgsdistancearea.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class QgsDistanceArea
1414
~QgsDistanceArea();
1515

1616
//! sets whether coordinates must be projected to ellipsoid before measuring
17-
void setProjectionsEnabled(bool flag);
18-
void setEllipsoidalEnabled(bool flag) /Deprecated/;
17+
void setEllipsoidalMode(bool flag);
18+
void setProjectionsEnabled(bool flag) /Deprecated/;
1919

2020
//! returns projections enabled flag
2121
bool ellipsoidalEnabled();
@@ -70,6 +70,6 @@ class QgsDistanceArea
7070
static QString textUnit( double value, int decimals, QGis::UnitType u, bool isArea, bool keepBaseUnit = false );
7171

7272
//! Helper for conversion between physical units
73-
void convertMeasurement( double &measure, QGis::UnitType &measureUnits, QGis::displayUnits, bool isArea );
73+
void convertMeasurement( double &measure, QGis::UnitType &measureUnits, QGis::UnitType displayUnits, bool isArea );
7474

7575
};

src/analysis/network/qgsgraphbuilderintr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
4646
{
4747
mDa.setSourceCrs( mCrs.srsid() );
4848
mDa.setEllipsoid( ellipsoidID );
49-
mDa.setEllipsoidalEnabled( ctfEnabled );
49+
mDa.setEllipsoidalMode( ctfEnabled );
5050
}
5151

5252
//! Destructor

src/app/qgsmaptoolidentify.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
245245
QgsDistanceArea calc;
246246
if ( !featureList.count() == 0 )
247247
{
248-
calc.setEllipsoidalEnabled( mCanvas->hasCrsTransformEnabled() ); // project?
248+
calc.setEllipsoidalMode( mCanvas->hasCrsTransformEnabled() );
249249
calc.setEllipsoid( ellipsoid );
250250
calc.setSourceCrs( layer->crs().srsid() );
251251
}

src/app/qgsmaptoolmeasureangle.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void QgsMapToolMeasureAngle::configureDistanceArea()
183183
QString ellipsoidId = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
184184
mDa.setSourceCrs( mCanvas->mapRenderer()->destinationCrs().srsid() );
185185
mDa.setEllipsoid( ellipsoidId );
186-
mDa.setEllipsoidalEnabled( mResultDisplay->projectionEnabled() );
186+
mDa.setEllipsoidalMode( mResultDisplay->projectionEnabled() ); // FIXME (not when proj is turned off)
187187
}
188188

189189

src/app/qgsmeasuredialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,5 +410,5 @@ void QgsMeasureDialog::configureDistanceArea()
410410
mDa.setSourceCrs( mTool->canvas()->mapRenderer()->destinationCrs().srsid() );
411411
mDa.setEllipsoid( ellipsoidId );
412412
// Only use ellipsoidal calculation when project wide transformation is enabled.
413-
mDa.setEllipsoidalEnabled( mcbProjectionEnabled->isChecked() && mTool->canvas()->hasCrsTransformEnabled() );
413+
mDa.setEllipsoidalMode( mcbProjectionEnabled->isChecked() && mTool->canvas()->hasCrsTransformEnabled() );
414414
}

src/core/composer/qgscomposerscalebar.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ double QgsComposerScaleBar::mapDiagonal() const
188188
else
189189
{
190190
QgsDistanceArea da;
191-
da.setEllipsoidalEnabled( mComposerMap->mapRenderer()->hasCrsTransformEnabled() );
191+
da.setEllipsoidalMode( mComposerMap->mapRenderer()->hasCrsTransformEnabled() );
192192
da.setSourceCrs( mComposerMap->mapRenderer()->destinationCrs().srsid() );
193193
QSettings s;
194194
da.setEllipsoid( s.value( "/qgis/measure/ellipsoid", "WGS84" ).toString() );

src/core/qgsdistancearea.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
QgsDistanceArea::QgsDistanceArea()
4242
{
4343
// init with default settings
44-
mEllipsoidalEnabled = false;
44+
mEllipsoidalMode = false;
4545
mCoordTransform = new QgsCoordinateTransform;
4646
setSourceCrs( GEOCRS_ID ); // WGS 84
4747
setEllipsoid( "WGS84" );
@@ -53,9 +53,9 @@ QgsDistanceArea::~QgsDistanceArea()
5353
delete mCoordTransform;
5454
}
5555

56-
void QgsDistanceArea::setEllipsoidalEnabled( bool flag )
56+
void QgsDistanceArea::setEllipsoidalMode( bool flag )
5757
{
58-
mEllipsoidalEnabled = flag;
58+
mEllipsoidalMode = flag;
5959
}
6060

6161
void QgsDistanceArea::setSourceCrs( long srsid )
@@ -337,14 +337,14 @@ double QgsDistanceArea::measureLine( const QList<QgsPoint>& points )
337337

338338
try
339339
{
340-
if ( mEllipsoidalEnabled && ( mEllipsoid != "NONE" ) )
340+
if ( mEllipsoidalMode && ( mEllipsoid != "NONE" ) )
341341
p1 = mCoordTransform->transform( points[0] );
342342
else
343343
p1 = points[0];
344344

345345
for ( QList<QgsPoint>::const_iterator i = points.begin(); i != points.end(); ++i )
346346
{
347-
if ( mEllipsoidalEnabled && ( mEllipsoid != "NONE" ) )
347+
if ( mEllipsoidalMode && ( mEllipsoid != "NONE" ) )
348348
{
349349
p2 = mCoordTransform->transform( *i );
350350
total += computeDistanceBearing( p1, p2 );
@@ -378,7 +378,7 @@ double QgsDistanceArea::measureLine( const QgsPoint& p1, const QgsPoint& p2 )
378378
QgsPoint pp1 = p1, pp2 = p2;
379379

380380
QgsDebugMsg( QString( "Measuring from %1 to %2" ).arg( p1.toString( 4 ) ).arg( p2.toString( 4 ) ) );
381-
if ( mEllipsoidalEnabled && ( mEllipsoid != "NONE" ) )
381+
if ( mEllipsoidalMode && ( mEllipsoid != "NONE" ) )
382382
{
383383
QgsDebugMsg( QString( "Ellipsoidal calculations is enabled, using ellipsoid %1" ).arg( mEllipsoid ) );
384384
QgsDebugMsg( QString( "From proj4 : %1" ).arg( mCoordTransform->sourceCrs().toProj4() ) );
@@ -447,7 +447,7 @@ unsigned char* QgsDistanceArea::measurePolygon( unsigned char* feature, double*
447447

448448
pnt = QgsPoint( x, y );
449449

450-
if ( mEllipsoidalEnabled && ( mEllipsoid != "NONE" ) )
450+
if ( mEllipsoidalMode && ( mEllipsoid != "NONE" ) )
451451
{
452452
pnt = mCoordTransform->transform( pnt );
453453
}
@@ -499,7 +499,7 @@ double QgsDistanceArea::measurePolygon( const QList<QgsPoint>& points )
499499

500500
try
501501
{
502-
if ( mEllipsoidalEnabled && ( mEllipsoid != "NONE" ) )
502+
if ( mEllipsoidalMode && ( mEllipsoid != "NONE" ) )
503503
{
504504
QList<QgsPoint> pts;
505505
for ( QList<QgsPoint>::const_iterator i = points.begin(); i != points.end(); ++i )
@@ -527,7 +527,7 @@ double QgsDistanceArea::bearing( const QgsPoint& p1, const QgsPoint& p2 )
527527
QgsPoint pp1 = p1, pp2 = p2;
528528
double bearing;
529529

530-
if ( mEllipsoidalEnabled && ( mEllipsoid != "NONE" ) )
530+
if ( mEllipsoidalMode && ( mEllipsoid != "NONE" ) )
531531
{
532532
pp1 = mCoordTransform->transform( p1 );
533533
pp2 = mCoordTransform->transform( p2 );
@@ -689,7 +689,7 @@ double QgsDistanceArea::computePolygonArea( const QList<QgsPoint>& points )
689689
double area;
690690

691691
QgsDebugMsgLevel( "Ellipsoid: " + mEllipsoid, 3 );
692-
if (( ! mEllipsoidalEnabled ) || ( mEllipsoid == "NONE" ) )
692+
if (( ! mEllipsoidalMode ) || ( mEllipsoid == "NONE" ) )
693693
{
694694
return computePolygonFlatArea( points );
695695
}
@@ -886,7 +886,7 @@ void QgsDistanceArea::convertMeasurement( double &measure, QGis::UnitType &measu
886886

887887
if (( measureUnits == QGis::Degrees || measureUnits == QGis::Feet ) &&
888888
mEllipsoid != "NONE" &&
889-
mEllipsoidalEnabled )
889+
mEllipsoidalMode )
890890
{
891891
// Measuring on an ellipsoid returned meters. Force!
892892
measureUnits = QGis::Meters;

src/core/qgsdistancearea.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ class CORE_EXPORT QgsDistanceArea
4141
~QgsDistanceArea();
4242

4343
//! sets whether coordinates must be projected to ellipsoid before measuring
44-
void setEllipsoidalEnabled( bool flag );
45-
Q_DECL_DEPRECATED void QgsDistanceArea::setProjectionsEnabled( bool flag ) { setEllipsoidalEnabled( flag ); };
44+
void setEllipsoidalMode( bool flag );
45+
Q_DECL_DEPRECATED void setProjectionsEnabled( bool flag ) { setEllipsoidalMode( flag ); };
4646

4747
//! returns projections enabled flag
48-
bool ellipsoidalEnabled() { return mEllipsoidalEnabled; }
49-
Q_DECL_DEPRECATED bool hasCrsTransformEnabled() { return mEllipsoidalEnabled; }
48+
bool ellipsoidalEnabled() const { return mEllipsoidalMode; }
49+
Q_DECL_DEPRECATED bool hasCrsTransformEnabled() { return mEllipsoidalMode; }
5050

5151
//! sets source spatial reference system (by QGIS CRS)
5252
void setSourceCrs( long srsid );
@@ -139,7 +139,7 @@ class CORE_EXPORT QgsDistanceArea
139139
QgsCoordinateTransform* mCoordTransform;
140140

141141
//! indicates whether we will transform coordinates
142-
bool mEllipsoidalEnabled;
142+
bool mEllipsoidalMode;
143143

144144
//! id of the source spatial reference system
145145
long mSourceRefSys;

src/core/qgsexpression.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ bool QgsExpression::needsGeometry()
913913
void QgsExpression::initGeomCalculator()
914914
{
915915
mCalc = new QgsDistanceArea;
916-
mCalc->setEllipsoidalEnabled( false );
916+
mCalc->setEllipsoidalMode( false );
917917
QSettings settings;
918918
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
919919
mCalc->setEllipsoid( ellipsoid );

src/core/qgsmaprenderer.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ QgsMapRenderer::~QgsMapRenderer()
7373
delete mCachedTr;
7474
}
7575

76-
7776
QgsRectangle QgsMapRenderer::extent() const
7877
{
7978
return mExtent;
@@ -664,14 +663,14 @@ void QgsMapRenderer::setProjectionsEnabled( bool enabled )
664663
{
665664
mProjectionsEnabled = enabled;
666665
QgsDebugMsg( "Adjusting DistArea projection on/off" );
667-
mDistArea->setEllipsoidalEnabled( enabled );
666+
mDistArea->setEllipsoidalMode( enabled );
668667
updateFullExtent();
669668
mLastExtent.setMinimal();
670669
emit hasCrsTransformEnabled( enabled );
671670
}
672671
}
673672

674-
bool QgsMapRenderer::hasCrsTransformEnabled()
673+
bool QgsMapRenderer::hasCrsTransformEnabled() const
675674
{
676675
return mProjectionsEnabled;
677676
}

src/core/qgsmaprenderer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
184184
void setProjectionsEnabled( bool enabled );
185185

186186
//! returns true if projections are enabled for this layer set
187-
bool hasCrsTransformEnabled();
187+
bool hasCrsTransformEnabled() const;
188188

189189
/** sets destination coordinate reference system
190190
* @note deprecated by qgis 1.7

src/plugins/heatmap/heatmap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ float Heatmap::mapUnitsOf( float meters, QgsCoordinateReferenceSystem layerCrs )
307307
da.setEllipsoid( layerCrs.ellipsoidAcronym() );
308308
if ( da.geographic() )
309309
{
310-
da.setEllipsoidalEnabled( true );
310+
da.setEllipsoidalMode( true );
311311
}
312312
return meters / da.measureLine( QgsPoint( 0.0, 0.0 ), QgsPoint( 0.0, 1.0 ) );
313313
}

src/plugins/heatmap/heatmapgui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ float HeatmapGui::mapUnitsOf( float meters, QgsCoordinateReferenceSystem layerCr
336336
da.setEllipsoid( layerCrs.ellipsoidAcronym() );
337337
if ( da.geographic() )
338338
{
339-
da.setEllipsoidalEnabled( true );
339+
da.setEllipsoidalMode( true );
340340
}
341341
double unitDistance = da.measureLine( QgsPoint( 0.0, 0.0 ), QgsPoint( 0.0, 1.0 ) );
342342
QgsDebugMsg( QString( "Converted %1 meters to %2 mapunits" ).arg( meters ).arg( meters / unitDistance ) );

0 commit comments

Comments
 (0)