Skip to content
Permalink
Browse files

Remove redundant interpolation classes

  • Loading branch information
nyalldawson committed Nov 3, 2017
1 parent bee2a1a commit e94733f22c48c040d15557417d54987dadac19ea

This file was deleted.

This file was deleted.

@@ -10,11 +10,9 @@ SET(QGIS_ANALYSIS_SRCS
interpolation/CloughTocherInterpolator.cpp
interpolation/DualEdgeTriangulation.cpp
interpolation/HalfEdge.cpp
interpolation/Line3D.cpp
interpolation/LinTriangleInterpolator.cpp
interpolation/MathUtils.cpp
interpolation/NormVecDecorator.cpp
interpolation/Node.cpp
interpolation/ParametricLine.cpp
interpolation/TriangleInterpolator.cpp
interpolation/Triangulation.cpp
@@ -217,13 +215,11 @@ SET(QGIS_ANALYSIS_HDRS
interpolation/Vector3D.h
interpolation/DualEdgeTriangulation.h
interpolation/MathUtils.h
interpolation/Node.h
interpolation/TriDecorator.h
interpolation/Triangulation.h
interpolation/HalfEdge.h
interpolation/LinTriangleInterpolator.h
interpolation/NormVecDecorator.h
interpolation/Line3D.h

network/qgsgraph.h
network/qgsgraphbuilderinterface.h
@@ -17,7 +17,6 @@

#include "DualEdgeTriangulation.h"
#include <map>
#include "Line3D.h"
#include "MathUtils.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
@@ -67,47 +66,36 @@ void DualEdgeTriangulation::performConsistencyTest()
QgsDebugMsg( "consistency test finished" );
}

void DualEdgeTriangulation::addLine( Line3D *line, QgsInterpolator::SourceType lineType )
void DualEdgeTriangulation::addLine( const QVector<QgsPoint> &points, QgsInterpolator::SourceType lineType )
{
int actpoint = -10;//number of the last point, which has been inserted from the line
int currentpoint = -10;//number of the point, which is currently inserted from the line
if ( line )
{
//first, find the first point
unsigned int i;
line->goToBegin();

for ( i = 0; i < line->getSize(); i++ )
int i = 0;
for ( const QgsPoint &point : points )
{
actpoint = mDecorator->addPoint( point );
i++;
if ( actpoint != -100 )
{
line->goToNext();
// Use copy ctor since line can be deleted as well as its
// associated Node and QgsPoint
actpoint = mDecorator->addPoint( QgsPoint( *line->getPoint() ) );
if ( actpoint != -100 )
{
i++;
break;
}
break;
}
}

if ( actpoint == -100 )//no point of the line could be inserted
{
delete line;
return;
}
if ( actpoint == -100 )//no point of the line could be inserted
{
return;
}

for ( ; i < line->getSize(); i++ )
for ( ; i < points.size(); ++i )
{
currentpoint = mDecorator->addPoint( points.at( i ) );
if ( currentpoint != -100 && actpoint != -100 && currentpoint != actpoint )//-100 is the return value if the point could not be not inserted
{
line->goToNext();
currentpoint = mDecorator->addPoint( QgsPoint( *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, lineType );
}
actpoint = currentpoint;
insertForcedSegment( actpoint, currentpoint, lineType );
}
actpoint = currentpoint;
}
delete line;
}

int DualEdgeTriangulation::addPoint( const QgsPoint &p )
@@ -47,7 +47,7 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
DualEdgeTriangulation( int nop, Triangulation *decorator );
virtual ~DualEdgeTriangulation();
void setDecorator( Triangulation *d ) {mDecorator = d;}
void addLine( Line3D *line SIP_TRANSFER, QgsInterpolator::SourceType lineType ) override;
void addLine( const QVector< QgsPoint > &points, QgsInterpolator::SourceType lineType ) override;
int addPoint( const QgsPoint &p ) override;
//! Performs a consistency check, remove this later
virtual void performConsistencyTest() override;

This file was deleted.

0 comments on commit e94733f

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