QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
CloughTocherInterpolator.h
Go to the documentation of this file.
1 /***************************************************************************
2  CloughTocherInterpolator.h - description
3  -------------------
4  copyright : (C) 2004 by Marco Hugentobler
5  email : [email protected]
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef CLOUGHTOCHERINTERPOLATOR_H
18 #define CLOUGHTOCHERINTERPOLATOR_H
19 
20 #include "TriangleInterpolator.h"
21 #include "qgspoint.h"
22 #include "qgis_analysis.h"
23 
24 class NormVecDecorator;
25 
26 #define SIP_NO_FILE
27 
33 class ANALYSIS_EXPORT CloughTocherInterpolator : public TriangleInterpolator
34 {
35  protected:
37  NormVecDecorator *mTIN = nullptr;
39  double mEdgeTolerance = 0.00001;
41  QgsPoint point1 = QgsPoint( 0, 0, 0 );
43  QgsPoint point2 = QgsPoint( 0, 0, 0 );
45  QgsPoint point3 = QgsPoint( 0, 0, 0 );
47  QgsPoint cp1 = QgsPoint( 0, 0, 0 );
49  QgsPoint cp2 = QgsPoint( 0, 0, 0 );
51  QgsPoint cp3 = QgsPoint( 0, 0, 0 );
53  QgsPoint cp4 = QgsPoint( 0, 0, 0 );
55  QgsPoint cp5 = QgsPoint( 0, 0, 0 );
57  QgsPoint cp6 = QgsPoint( 0, 0, 0 );
59  QgsPoint cp7 = QgsPoint( 0, 0, 0 );
61  QgsPoint cp8 = QgsPoint( 0, 0, 0 );
63  QgsPoint cp9 = QgsPoint( 0, 0, 0 );
65  QgsPoint cp10 = QgsPoint( 0, 0, 0 );
67  QgsPoint cp11 = QgsPoint( 0, 0, 0 );
69  QgsPoint cp12 = QgsPoint( 0, 0, 0 );
71  QgsPoint cp13 = QgsPoint( 0, 0, 0 );
73  QgsPoint cp14 = QgsPoint( 0, 0, 0 );
75  QgsPoint cp15 = QgsPoint( 0, 0, 0 );
77  QgsPoint cp16 = QgsPoint( 0, 0, 0 );
79  double der1X = 0.0;
81  double der1Y = 0.0;
83  double der2X = 0.0;
85  double der2Y = 0.0;
87  double der3X = 0.0;
89  double der3Y = 0.0;
91  QgsPoint lpoint1 = QgsPoint( 0, 0, 0 );
93  QgsPoint lpoint2 = QgsPoint( 0, 0, 0 );
95  QgsPoint lpoint3 = QgsPoint( 0, 0, 0 );
97  void init( double x, double y );
99  double calcBernsteinPoly( int n, int i, int j, int k, double u, double v, double w );
100 
101  public:
103  CloughTocherInterpolator() = default;
104 
107 
109  bool calcNormVec( double x, double y, Vector3D *result SIP_OUT ) override;
110  bool calcPoint( double x, double y, QgsPoint &result SIP_OUT ) override;
111  virtual void setTriangulation( NormVecDecorator *tin );
112 };
113 
114 #endif
115 
116 
117 
Decorator class which adds the functionality of estimating normals at the data points.
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:33
This is an interface for interpolator classes for triangulations.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
virtual bool calcPoint(double x, double y, QgsPoint &result)=0
Performs a linear interpolation in a triangle and assigns the x-,y- and z-coordinates to point...
virtual bool calcNormVec(double x, double y, Vector3D *result)=0
Calculates the normal vector and assigns it to vec.
#define SIP_OUT
Definition: qgis_sip.h:58
This is an implementation of a Clough-Tocher interpolator based on a triangular tessellation.
double ANALYSIS_EXPORT calcBernsteinPoly(int n, int i, double t)
Calculates the value of a Bernstein polynomial.
Definition: MathUtils.cpp:101