QGIS API Documentation  2.99.0-Master (53aba61)
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 QgsFeatureSink;
26 class Triangulation;
28 class QgsFeature;
29 class QgsFeedback;
30 class QgsFields;
31 
34 class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
35 {
36  public:
37  //describes the type of interpolation
39  {
41  CloughTocher
42  };
43 
49  QgsTINInterpolator( const QList<QgsInterpolator::LayerData> &inputData, TINInterpolation interpolation = Linear, QgsFeedback *feedback = nullptr );
51 
57  int interpolatePoint( double x, double y, double &result ) override;
58 
66  static QgsFields triangulationFields();
67 
77  void setTriangulationSink( QgsFeatureSink *sink );
78 
79  private:
80  Triangulation *mTriangulation = nullptr;
81  TriangleInterpolator *mTriangleInterpolator = nullptr;
82  bool mIsInitialized;
83  QgsFeedback *mFeedback = nullptr;
84 
86  QgsFeatureSink *mTriangulationSink = nullptr;
88  TINInterpolation mInterpolation;
89 
91  void initialize();
92 
99  int insertData( QgsFeature *f, bool zCoord, int attr, InputType type );
100 };
101 
102 #endif
Interface class for interpolations.
Interpolation in a triangular irregular network.
An interface for objects which accept features via addFeature(s) methods.
Container of fields for a vector layer.
Definition: qgsfields.h:41
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:37
virtual int interpolatePoint(double x, double y, double &result)=0
Calculates interpolation value for map coordinates x, y.