QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Go to the documentation of this file.
1 /***************************************************************************
2  CloughTocherInterpolator.h - description
3  -------------------
4  copyright : (C) 2004 by Marco Hugentobler
5  email : mhugent@geo.unizh.ch
6  ***************************************************************************/
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  ***************************************************************************/
20 #include "NormVecDecorator.h"
21 #include "TriangleInterpolator.h"
22 #include "Point3D.h"
23 #include "Vector3D.h"
24 #include "MathUtils.h"
25 #include "Bezier3D.h"
28 class ANALYSIS_EXPORT CloughTocherInterpolator : public TriangleInterpolator
29 {
30  protected:
58  double der1X;
60  double der1Y;
62  double der2X;
64  double der2Y;
66  double der3X;
68  double der3Y;
76  void init( double x, double y );
78  double calcBernsteinPoly( int n, int i, int j, int k, double u, double v, double w );
80  public:
86  virtual ~CloughTocherInterpolator();
88  virtual bool calcNormVec( double x, double y, Vector3D* result );
90  virtual bool calcPoint( double x, double y, Point3D* result );
91  virtual void setTriangulation( NormVecDecorator* tin );
92 };
95 inline CloughTocherInterpolator::CloughTocherInterpolator() : mTIN( 0 ), mEdgeTolerance( 0.00001 )
96 {
98 }
100 inline CloughTocherInterpolator::CloughTocherInterpolator( NormVecDecorator* tin ) : mTIN( tin ), mEdgeTolerance( 0.00001 )
101 {
103 }
106 {
107  //nothing to do
108 }
111 {
112  mTIN = tin;
113 }
115 #endif
Decorator class which adds the functionality of estimating normals at the data points.
Definition: NormVecDecorator.h:27
Point3D cp11
Definition: CloughTocherInterpolator.h:51
Point3D cp16
Definition: CloughTocherInterpolator.h:56
Point3D cp5
Definition: CloughTocherInterpolator.h:45
Point3D cp12
Definition: CloughTocherInterpolator.h:52
double der2Y
derivative in y-direction at point2
Definition: CloughTocherInterpolator.h:64
Point3D cp9
Definition: CloughTocherInterpolator.h:49
Point3D cp2
Definition: CloughTocherInterpolator.h:42
virtual void setTriangulation(NormVecDecorator *tin)
Definition: CloughTocherInterpolator.h:110
Point3D cp7
Definition: CloughTocherInterpolator.h:47
Point3D cp15
Definition: CloughTocherInterpolator.h:55
Point3D point3
third point of the triangle in x-,y-,z-coordinates
Definition: CloughTocherInterpolator.h:40
double der3X
derivative in x-direction at point3
Definition: CloughTocherInterpolator.h:66
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:23
Point3D lpoint2
stores point2 of the last run
Definition: CloughTocherInterpolator.h:72
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:22
Point3D point1
first point of the triangle in x-,y-,z-coordinates
Definition: CloughTocherInterpolator.h:36
This is an interface for interpolator classes for triangulations.
Definition: TriangleInterpolator.h:24
double der1X
derivative in x-direction at point1
Definition: CloughTocherInterpolator.h:58
standard constructor
Definition: CloughTocherInterpolator.h:95
Point3D cp1
Definition: CloughTocherInterpolator.h:41
Point3D cp4
Definition: CloughTocherInterpolator.h:44
virtual ~CloughTocherInterpolator()
Definition: CloughTocherInterpolator.h:105
double der3Y
derivative in y-direction at point3
Definition: CloughTocherInterpolator.h:68
Point3D cp10
Definition: CloughTocherInterpolator.h:50
virtual bool calcNormVec(double x, double y, Vector3D *result)=0
Calculates the normal vector and assigns it to vec.
Point3D point2
second point of the triangle in x-,y-,z-coordinates
Definition: CloughTocherInterpolator.h:38
This is an implementation of a Clough-Tocher interpolator based on a triangular tessellation.
Definition: CloughTocherInterpolator.h:28
virtual bool calcPoint(double x, double y, Point3D *result)=0
Performs a linear interpolation in a triangle and assigns the x-,y- and z-coordinates to point...
Point3D lpoint1
stores point1 of the last run
Definition: CloughTocherInterpolator.h:70
double ANALYSIS_EXPORT calcBernsteinPoly(int n, int i, double t)
calculates the value of a Bernstein polynomial
double der1Y
derivative in y-direction at point1
Definition: CloughTocherInterpolator.h:60
Point3D cp8
Definition: CloughTocherInterpolator.h:48
double mEdgeTolerance
Tolerance of the barycentric coordinates at the borders of the triangles (to prevent errors because o...
Definition: CloughTocherInterpolator.h:34
double der2X
derivative in x-direction at point2
Definition: CloughTocherInterpolator.h:62
Point3D cp6
Definition: CloughTocherInterpolator.h:46
Point3D cp3
Definition: CloughTocherInterpolator.h:43
Point3D cp13
Definition: CloughTocherInterpolator.h:53
Point3D cp14
Definition: CloughTocherInterpolator.h:54
Point3D lpoint3
stores point3 of the last run
Definition: CloughTocherInterpolator.h:74
NormVecDecorator * mTIN
association with a triangulation object
Definition: CloughTocherInterpolator.h:32