QGIS API Documentation  2.99.0-Master (9fdd060)
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 
35 class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
36 {
37  public:
38  //describes the type of interpolation
40  {
42  CloughTocher
43  };
44 
50  QgsTINInterpolator( const QList<QgsInterpolator::LayerData> &inputData, TINInterpolation interpolation = Linear, QgsFeedback *feedback = nullptr );
52 
59  int interpolatePoint( double x, double y, double &result ) override;
60 
68  static QgsFields triangulationFields();
69 
79  void setTriangulationSink( QgsFeatureSink *sink );
80 
81  private:
82  Triangulation *mTriangulation = nullptr;
83  TriangleInterpolator *mTriangleInterpolator = nullptr;
84  bool mIsInitialized;
85  QgsFeedback *mFeedback = nullptr;
86 
88  QgsFeatureSink *mTriangulationSink = nullptr;
90  TINInterpolation mInterpolation;
91 
93  void initialize();
94 
102  int insertData( QgsFeature *f, bool zCoord, int attr, InputType type );
103 };
104 
105 #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:42
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:62
Base class for feedback objects to be used for cancelation of something running in a worker thread...
Definition: qgsfeedback.h:44
InputType
Describes the type of input data.
This is an interface for interpolator classes for triangulations.
Interface for Triangulation classes.
Definition: Triangulation.h:38
virtual int interpolatePoint(double x, double y, double &result)=0
Calculates interpolation value for map coordinates x, y.