QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsinterpolator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsinterpolator.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 QGSINTERPOLATOR_H
19 #define QGSINTERPOLATOR_H
20 
21 #include <QVector>
22 
23 class QgsVectorLayer;
24 class QgsGeometry;
25 
26 struct ANALYSIS_EXPORT vertexData
27 {
28  double x;
29  double y;
30  double z;
31 };
32 
36 class ANALYSIS_EXPORT QgsInterpolator
37 {
38  public:
40  enum InputType
41  {
44  BREAK_LINES
45  };
46 
48  struct LayerData
49  {
54  };
55 
56  QgsInterpolator( const QList<LayerData>& layerData );
57 
58  virtual ~QgsInterpolator();
59 
65  virtual int interpolatePoint( double x, double y, double& result ) = 0;
66 
67  protected:
71  int cacheBaseData();
72 
73  QVector<vertexData> mCachedBaseData;
74 
77 
78  //Information about the input vector layers and the attributes (or z-values) that are used for interpolation
79  QList<LayerData> mLayerData;
80 
81  private:
82  QgsInterpolator(); //forbidden
88  int addVerticesToCache( QgsGeometry* geom, bool zCoord, double attributeValue );
89 
90 
91 };
92 
93 #endif