Skip to content

Commit

Permalink
Some bugfixes for interpolation plugin
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11214 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jul 30, 2009
1 parent df1caff commit 0269e82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/interpolation/DualEdgeTriangulation.cc
Expand Up @@ -77,7 +77,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
for ( i = 0;i < line->getSize();i++ )
{
line->goToNext();
actpoint = /*mDecorator->*/addPoint( line->getPoint() );
actpoint = mDecorator->addPoint( line->getPoint() );
if ( actpoint != -100 )
{
i++;
Expand All @@ -94,7 +94,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
for ( ;i < line->getSize();i++ )
{
line->goToNext();
currentpoint = /*mDecorator->*/addPoint( line->getPoint() );
currentpoint = mDecorator->addPoint( line->getPoint() );
if ( currentpoint != -100 && actpoint != -100 && currentpoint != actpoint )//-100 is the return value if the point could not be not inserted
{
insertForcedSegment( actpoint, currentpoint, breakline );
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/interpolation/DualEdgeTriangulation.h
Expand Up @@ -43,6 +43,7 @@ class DualEdgeTriangulation: public Triangulation
DualEdgeTriangulation();
DualEdgeTriangulation( int nop, Triangulation* decorator );
virtual ~DualEdgeTriangulation();
void setDecorator(Triangulation* d){mDecorator = d;}
/**Adds a line (e.g. a break-, structure- or an isoline) to the triangulation. The class takes ownership of the line object and its points*/
void addLine( Line3D* line, bool breakline );
/**Adds a point to the triangulation and returns the number of this point in case of success or -100 in case of failure*/
Expand Down Expand Up @@ -191,6 +192,10 @@ inline DualEdgeTriangulation::DualEdgeTriangulation( int nop, Triangulation* dec
{
mPointVector.reserve( nop );
mHalfEdge.reserve( nop );
if(!mDecorator)
{
mDecorator = this;
}
}

inline double DualEdgeTriangulation::getXMax() const
Expand Down
1 change: 1 addition & 0 deletions src/plugins/interpolation/qgsinterpolator.cpp
Expand Up @@ -359,5 +359,6 @@ int QgsInterpolator::addVerticesToCache( QgsGeometry* geom, bool zCoord, double
default:
break;
}
mDataIsCached = true;
return 0;
}

0 comments on commit 0269e82

Please sign in to comment.