Quantum GIS API Documentation
1.8
|
00001 /*************************************************************************** 00002 qgsinterpolator.h 00003 ------------------------ 00004 begin : March 10, 2008 00005 copyright : (C) 2008 by Marco Hugentobler 00006 email : marco dot hugentobler at karto dot baug dot ethz dot ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 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 //Information about the input vector layers and the attributes (or z-values) that are used for interpolation 00082 QList<LayerData> mLayerData; 00083 00084 private: 00085 QgsInterpolator(); //forbidden 00091 int addVerticesToCache( QgsGeometry* geom, bool zCoord, double attributeValue ); 00092 00093 00094 }; 00095 00096 #endif