Skip to content
Permalink
Browse files

QgsDistanceArea copy-construct is bad. Fix it.

  • Loading branch information
Sergey Yakushevs
Sergey Yakushevs committed May 26, 2011
1 parent 3d7a4ca commit 3dad741cc8bbb0455f799ce141aaf5eb9b8cd154
@@ -21,8 +21,8 @@
#include <qgsfeature.h>
#include <qgsgeometry.h>

QgsGraphBuilder::QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, const QgsDistanceArea &da, bool otfEnabled, double topologyTolerance ) :
QgsGraphBuilderInterface( crs, da, otfEnabled, topologyTolerance )
QgsGraphBuilder::QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, bool otfEnabled, double topologyTolerance, const QString& ellipsoidID ) :
QgsGraphBuilderInterface( crs, otfEnabled, topologyTolerance, ellipsoidID )
{
mGraph = new QgsGraph();
}
@@ -53,7 +53,7 @@ class ANALYSIS_EXPORT QgsGraphBuilder : public QgsGraphBuilderInterface
/**
* default constructor
*/
QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, const QgsDistanceArea& da, bool otfEnabled, double topologyTolerance = 0.0 );
QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, bool otfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" );

~QgsGraphBuilder();

@@ -37,14 +37,16 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
/**
* QgsGraphBuilderInterface constructor
* @param crs Coordinate reference system for new graph vertex
* @param da Object for edge measurement. Source CRS will be set to graph crs
* @param ctfEnabled enable coordinate transform from source graph CRS to CRS graph
* @param topologyTolerance sqrt distance between source point as one graph vertex
* @param ellipsoidID ellipsoid for edge measurement
*/
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem& crs, const QgsDistanceArea& da, bool ctfEnabled = true, double topologyTolerance = 0.0) :
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" ) :
mCrs( crs ), mCtfEnabled ( ctfEnabled ), mTopologyTolerance( topologyTolerance )
{
mDa.setSourceCrs( mCrs.srsid() );
mDa.setEllipsoid( ellipsoidID );
mDa.setProjectionsEnabled( ctfEnabled );
}

//! Destructor
@@ -238,10 +238,8 @@ bool RgShortestPathWidget::getPath( QgsGraph* shortestTree, QgsPoint& p1, QgsPoi
return false;
}

QgsDistanceArea da;
QgsGraphBuilder builder(
mPlugin->iface()->mapCanvas()->mapRenderer()->destinationCrs(),
da,
mPlugin->iface()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled(),
mPlugin->topologyToleranceFactor() );
{

0 comments on commit 3dad741

Please sign in to comment.
You can’t perform that action at this time.