00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QGSINTERPOLATOR_H
00019 #define QGSINTERPOLATOR_H
00020
00021 #include <QVector>
00022
00023 class QgsVectorLayer;
00024 class QgsGeometry;
00025
00026 struct ANALYSIS_EXPORT vertexData
00027 {
00028 double x;
00029 double y;
00030 double z;
00031 };
00032
00036 class ANALYSIS_EXPORT QgsInterpolator
00037 {
00038 public:
00040 enum InputType
00041 {
00042 POINTS,
00043 STRUCTURE_LINES,
00044 BREAK_LINES
00045 };
00046
00048 struct LayerData
00049 {
00050 QgsVectorLayer* vectorLayer;
00051 bool zCoordInterpolation;
00052 int interpolationAttribute;
00053 InputType mInputType;
00054 };
00055
00056 QgsInterpolator( const QList<LayerData>& layerData );
00057
00058 virtual ~QgsInterpolator();
00059
00065 virtual int interpolatePoint( double x, double y, double& result ) = 0;
00066
00068 void enableAttributeValueInterpolation( int attribute );
00069
00070 protected:
00074 int cacheBaseData();
00075
00076 QVector<vertexData> mCachedBaseData;
00077
00079 bool mDataIsCached;
00080
00081
00082 QList<LayerData> mLayerData;
00083
00084 private:
00085 QgsInterpolator();
00091 int addVerticesToCache( QgsGeometry* geom, bool zCoord, double attributeValue );
00092
00093
00094 };
00095
00096 #endif