QGIS API Documentation  2.99.0-Master (f867b65)
qgstininterpolator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgstininterpolator.h
3  --------------------
4  begin : March 10, 2008
5  copyright : (C) 2008 by Marco Hugentobler
6  email : marco dot hugentobler at karto dot baug dot ethz dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSTININTERPOLATOR_H
19 #define QGSTININTERPOLATOR_H
20 
21 #include "qgsinterpolator.h"
22 #include <QString>
23 #include "qgis_analysis.h"
24 
25 class Triangulation;
27 class QgsFeature;
28 class QgsFeedback;
29 
32 class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
33 {
34  public:
35  //describes the type of interpolation
37  {
39  CloughTocher
40  };
41 
47  QgsTINInterpolator( const QList<QgsInterpolator::LayerData> &inputData, TINInterpolation interpolation = Linear, QgsFeedback *feedback = nullptr );
49 
55  int interpolatePoint( double x, double y, double &result ) override;
56 
57  void setExportTriangulationToFile( bool e ) {mExportTriangulationToFile = e;}
58  void setTriangulationFilePath( const QString &filepath ) {mTriangulationFilePath = filepath;}
59 
60  private:
61  Triangulation *mTriangulation = nullptr;
62  TriangleInterpolator *mTriangleInterpolator = nullptr;
63  bool mIsInitialized;
64  QgsFeedback *mFeedback = nullptr;
66  bool mExportTriangulationToFile;
68  QString mTriangulationFilePath;
70  TINInterpolation mInterpolation;
71 
73  void initialize();
74 
81  int insertData( QgsFeature *f, bool zCoord, int attr, InputType type );
82 };
83 
84 #endif
void setTriangulationFilePath(const QString &filepath)
Interface class for interpolations.
Interpolation in a triangular irregular network.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:61
Base class for feedback objects to be used for cancelation of something running in a worker thread...
Definition: qgsfeedback.h:43
InputType
Describes the type of input data.
This is an interface for interpolator classes for triangulations.
Interface for Triangulation classes.
Definition: Triangulation.h:30
virtual int interpolatePoint(double x, double y, double &result)=0
Calculates interpolation value for map coordinates x, y.
void setExportTriangulationToFile(bool e)