Skip to content
Permalink
Browse files

use addZValue()

  • Loading branch information
vcloarec committed Dec 19, 2020
1 parent b5d7abc commit 30510e4df567e97aa7856ed7f29b52f4d183a0bd
Showing with 9 additions and 23 deletions.
  1. +9 −23 src/analysis/interpolation/qgstininterpolator.cpp
@@ -289,41 +289,27 @@ int QgsTinInterpolator::insertData( const QgsFeature &f, QgsInterpolator::ValueS

QgsPointSequence linePoints;
curve->points( linePoints );
for ( int i = 0; i < linePoints.size(); ++i )
for ( QgsPoint &point : linePoints )
{
QgsPoint &point = linePoints[i];
switch ( source )
{
case ValueAttribute:
{
QgsPoint newPoint = point;
if ( point.is3D() )
newPoint = point;
point.setZ( attributeValue );
else
newPoint = QgsPoint( point.x(), point.y(), 0 );

newPoint.setZ( attributeValue );

linePoints[i] = newPoint;
}
break;

case ValueZ:
point.addZValue( attributeValue );
break;

case ValueM:
{
QgsPoint newPoint = point;
if ( point.is3D() )
newPoint = point;
point.setZ( point.m() );
else
newPoint = QgsPoint( point.x(), point.y(), 0 );

newPoint.setZ( point.m() );
point.addZValue( point.m() );
break;

linePoints[i] = newPoint;
}
break;
break;
case ValueZ:
break;
}
}
mTriangulation->addLine( linePoints, type );

0 comments on commit 30510e4

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