#include <qgsinterpolator.h>

Public Types | |
| enum | InputType { POINTS, STRUCTURE_LINES, BREAK_LINES } |
| Describes the type of input data. More... | |
Public Member Functions | |
| QgsInterpolator (const QList< LayerData > &layerData) | |
| virtual | ~QgsInterpolator () |
| virtual int | interpolatePoint (double x, double y, double &result)=0 |
| Calculates interpolation value for map coordinates x, y. | |
| void | enableAttributeValueInterpolation (int attribute) |
| Use a vector attribute as interpolation value. | |
Protected Member Functions | |
| int | cacheBaseData () |
| Caches the vertex and value data from the provider. | |
Protected Attributes | |
| QVector< vertexData > | mCachedBaseData |
| bool | mDataIsCached |
| Flag that tells if the cache already has been filled. | |
| QList< LayerData > | mLayerData |
Private Member Functions | |
| QgsInterpolator () | |
| int | addVerticesToCache (QgsGeometry *geom, bool zCoord, double attributeValue) |
| Helper method that adds the vertices of a geometry to the mCachedBaseData. | |
Classes | |
| struct | LayerData |
| A layer together with the information about interpolation attribute / z-coordinate interpolation and the type (point, structure line, breakline). More... | |
Interpolators take the vertices of a vector layer as base data. The z-Value can be an attribute or the z-coordinates in case of 25D types
Definition at line 36 of file qgsinterpolator.h.
| QgsInterpolator::QgsInterpolator | ( | const QList< LayerData > & | layerData | ) |
Definition at line 31 of file qgsinterpolator.cpp.
| QgsInterpolator::~QgsInterpolator | ( | ) | [virtual] |
Definition at line 41 of file qgsinterpolator.cpp.
| QgsInterpolator::QgsInterpolator | ( | ) | [private] |
Definition at line 36 of file qgsinterpolator.cpp.
| virtual int QgsInterpolator::interpolatePoint | ( | double | x, | |
| double | y, | |||
| double & | result | |||
| ) | [pure virtual] |
Calculates interpolation value for map coordinates x, y.
| x | x-coordinate (in map units) | |
| y | y-coordinate (in map units) | |
| result | out: interpolation result |
Implemented in QgsIDWInterpolator, and QgsTINInterpolator.
Referenced by QgsGridFileWriter::writeFile().
| void QgsInterpolator::enableAttributeValueInterpolation | ( | int | attribute | ) |
Use a vector attribute as interpolation value.
| int QgsInterpolator::cacheBaseData | ( | ) | [protected] |
Caches the vertex and value data from the provider.
All the vertex data will be held in virtual memory
Definition at line 46 of file qgsinterpolator.cpp.
References addVerticesToCache(), QgsFeature::attributeMap(), QgsFeature::geometry(), mCachedBaseData, mLayerData, QgsVectorDataProvider::nextFeature(), and QgsVectorDataProvider::select().
Referenced by QgsIDWInterpolator::interpolatePoint().
| int QgsInterpolator::addVerticesToCache | ( | QgsGeometry * | geom, | |
| bool | zCoord, | |||
| double | attributeValue | |||
| ) | [private] |
Helper method that adds the vertices of a geometry to the mCachedBaseData.
| geom | the geometry | |
| zCoord | true if the z-coordinate of the geometry is to be interpolated | |
| attributeValue | the attribute value for interpolation (if not interpolated from z-coordinate) |
Definition at line 111 of file qgsinterpolator.cpp.
References QgsGeometry::asWkb(), mCachedBaseData, mDataIsCached, QGis::WKBLineString, QGis::WKBLineString25D, QGis::WKBMultiLineString, QGis::WKBMultiLineString25D, QGis::WKBMultiPoint, QGis::WKBMultiPoint25D, QGis::WKBMultiPolygon, QGis::WKBMultiPolygon25D, QGis::WKBPoint, QGis::WKBPoint25D, QGis::WKBPolygon, QGis::WKBPolygon25D, QgsGeometry::wkbType(), vertexData::x, vertexData::y, and vertexData::z.
Referenced by cacheBaseData().
QVector<vertexData> QgsInterpolator::mCachedBaseData [protected] |
Definition at line 76 of file qgsinterpolator.h.
Referenced by addVerticesToCache(), cacheBaseData(), and QgsIDWInterpolator::interpolatePoint().
bool QgsInterpolator::mDataIsCached [protected] |
Flag that tells if the cache already has been filled.
Definition at line 79 of file qgsinterpolator.h.
Referenced by addVerticesToCache(), and QgsIDWInterpolator::interpolatePoint().
QList<LayerData> QgsInterpolator::mLayerData [protected] |
Definition at line 82 of file qgsinterpolator.h.
Referenced by cacheBaseData(), and QgsTINInterpolator::initialize().
1.5.6