Skip to content

Commit

Permalink
QgsDistanceArea copy-construct is bad. Fix it.
Browse files Browse the repository at this point in the history
  • Loading branch information
stopa85milk committed May 26, 2011
1 parent 3d7a4ca commit 3dad741
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/analysis/network/qgsgraphbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraphbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 4 additions & 2 deletions src/analysis/network/qgsgraphbuilderintr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/roadgraph/shortestpathwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
{
Expand Down

0 comments on commit 3dad741

Please sign in to comment.