Skip to content

Commit 0269e82

Browse files
author
mhugent
committed
Some bugfixes for interpolation plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11214 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent df1caff commit 0269e82

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/plugins/interpolation/DualEdgeTriangulation.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
7777
for ( i = 0;i < line->getSize();i++ )
7878
{
7979
line->goToNext();
80-
actpoint = /*mDecorator->*/addPoint( line->getPoint() );
80+
actpoint = mDecorator->addPoint( line->getPoint() );
8181
if ( actpoint != -100 )
8282
{
8383
i++;
@@ -94,7 +94,7 @@ void DualEdgeTriangulation::addLine( Line3D* line, bool breakline )
9494
for ( ;i < line->getSize();i++ )
9595
{
9696
line->goToNext();
97-
currentpoint = /*mDecorator->*/addPoint( line->getPoint() );
97+
currentpoint = mDecorator->addPoint( line->getPoint() );
9898
if ( currentpoint != -100 && actpoint != -100 && currentpoint != actpoint )//-100 is the return value if the point could not be not inserted
9999
{
100100
insertForcedSegment( actpoint, currentpoint, breakline );

src/plugins/interpolation/DualEdgeTriangulation.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class DualEdgeTriangulation: public Triangulation
4343
DualEdgeTriangulation();
4444
DualEdgeTriangulation( int nop, Triangulation* decorator );
4545
virtual ~DualEdgeTriangulation();
46+
void setDecorator(Triangulation* d){mDecorator = d;}
4647
/**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*/
4748
void addLine( Line3D* line, bool breakline );
4849
/**Adds a point to the triangulation and returns the number of this point in case of success or -100 in case of failure*/
@@ -191,6 +192,10 @@ inline DualEdgeTriangulation::DualEdgeTriangulation( int nop, Triangulation* dec
191192
{
192193
mPointVector.reserve( nop );
193194
mHalfEdge.reserve( nop );
195+
if(!mDecorator)
196+
{
197+
mDecorator = this;
198+
}
194199
}
195200

196201
inline double DualEdgeTriangulation::getXMax() const

src/plugins/interpolation/qgsinterpolator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,5 +359,6 @@ int QgsInterpolator::addVerticesToCache( QgsGeometry* geom, bool zCoord, double
359359
default:
360360
break;
361361
}
362+
mDataIsCached = true;
362363
return 0;
363364
}

0 commit comments

Comments
 (0)