QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
QgsTINInterpolator Class Reference

Interpolation in a triangular irregular network. More...

#include <qgstininterpolator.h>

Inheritance diagram for QgsTINInterpolator:
Inheritance graph
[legend]
Collaboration diagram for QgsTINInterpolator:
Collaboration graph
[legend]

Public Types

enum  TIN_INTERPOLATION { Linear, CloughTocher }
 
- Public Types inherited from QgsInterpolator
enum  InputType { POINTS, STRUCTURE_LINES, BREAK_LINES }
 Describes the type of input data. More...
 

Public Member Functions

 QgsTINInterpolator (const QList< LayerData > &inputData, TIN_INTERPOLATION interpolation=Linear, bool showProgressDialog=false)
 
 ~QgsTINInterpolator ()
 
int interpolatePoint (double x, double y, double &result)
 Calculates interpolation value for map coordinates x, y. More...
 
void setExportTriangulationToFile (bool e)
 
void setTriangulationFilePath (const QString &filepath)
 
- Public Member Functions inherited from QgsInterpolator
 QgsInterpolator (const QList< LayerData > &layerData)
 
virtual ~QgsInterpolator ()
 
const QList< LayerData > & layerData () const
 

Private Member Functions

void initialize ()
 Create dual edge triangulation. More...
 
int insertData (QgsFeature *f, bool zCoord, int attr, InputType type)
 Inserts the vertices of a feature into the triangulation. More...
 

Private Attributes

TriangulationmTriangulation
 
TriangleInterpolatormTriangleInterpolator
 
bool mIsInitialized
 
bool mShowProgressDialog
 
bool mExportTriangulationToFile
 If true: export triangulation to shapefile after initialisation. More...
 
QString mTriangulationFilePath
 File path to export the triangulation. More...
 
TIN_INTERPOLATION mInterpolation
 Type of interpolation. More...
 

Additional Inherited Members

- Protected Member Functions inherited from QgsInterpolator
int cacheBaseData ()
 Caches the vertex and value data from the provider. More...
 
- Protected Attributes inherited from QgsInterpolator
QVector< vertexDatamCachedBaseData
 
bool mDataIsCached
 Flag that tells if the cache already has been filled. More...
 
QList< LayerDatamLayerData
 

Detailed Description

Interpolation in a triangular irregular network.

Definition at line 29 of file qgstininterpolator.h.

Member Enumeration Documentation

Enumerator
Linear 
CloughTocher 

Definition at line 33 of file qgstininterpolator.h.

Constructor & Destructor Documentation

QgsTINInterpolator::QgsTINInterpolator ( const QList< LayerData > &  inputData,
TIN_INTERPOLATION  interpolation = Linear,
bool  showProgressDialog = false 
)

Definition at line 29 of file qgstininterpolator.cpp.

QgsTINInterpolator::~QgsTINInterpolator ( )

Definition at line 40 of file qgstininterpolator.cpp.

References mTriangleInterpolator, and mTriangulation.

Member Function Documentation

void QgsTINInterpolator::initialize ( )
private
int QgsTINInterpolator::insertData ( QgsFeature f,
bool  zCoord,
int  attr,
InputType  type 
)
private

Inserts the vertices of a feature into the triangulation.

Parameters
fthe feature
zCoordtrue if the z coordinate is the interpolation attribute
attrinterpolation attribute index (if zCoord is false)
typepoint/structure line, break line
Returns
0 in case of success, -1 if the feature could not be inserted because of numerical problems

Definition at line 168 of file qgstininterpolator.cpp.

References Triangulation::addLine(), Triangulation::addPoint(), QgsGeometry::asWkb(), QgsFeature::attribute(), QgsInterpolator::BREAK_LINES, QgsFeature::geometry(), index, Line3D::insertPoint(), mTriangulation, QgsInterpolator::POINTS, QGis::WKBLineString, QGis::WKBLineString25D, QGis::WKBMultiLineString, QGis::WKBMultiLineString25D, QGis::WKBMultiPoint, QGis::WKBMultiPoint25D, QGis::WKBMultiPolygon, QGis::WKBMultiPolygon25D, QGis::WKBPoint, QGis::WKBPoint25D, QGis::WKBPolygon, QGis::WKBPolygon25D, and QgsGeometry::wkbType().

Referenced by initialize().

int QgsTINInterpolator::interpolatePoint ( double  x,
double  y,
double &  result 
)
virtual

Calculates interpolation value for map coordinates x, y.

Parameters
xx-coordinate (in map units)
yy-coordinate (in map units)
resultout: interpolation result
Returns
0 in case of success

Implements QgsInterpolator.

Definition at line 46 of file qgstininterpolator.cpp.

References TriangleInterpolator::calcPoint(), Point3D::getZ(), initialize(), mIsInitialized, and mTriangleInterpolator.

void QgsTINInterpolator::setExportTriangulationToFile ( bool  e)
inline

Definition at line 48 of file qgstininterpolator.h.

void QgsTINInterpolator::setTriangulationFilePath ( const QString &  filepath)
inline

Definition at line 49 of file qgstininterpolator.h.

Member Data Documentation

bool QgsTINInterpolator::mExportTriangulationToFile
private

If true: export triangulation to shapefile after initialisation.

Definition at line 57 of file qgstininterpolator.h.

Referenced by initialize().

TIN_INTERPOLATION QgsTINInterpolator::mInterpolation
private

Type of interpolation.

Definition at line 61 of file qgstininterpolator.h.

Referenced by initialize().

bool QgsTINInterpolator::mIsInitialized
private

Definition at line 54 of file qgstininterpolator.h.

Referenced by initialize(), and interpolatePoint().

bool QgsTINInterpolator::mShowProgressDialog
private

Definition at line 55 of file qgstininterpolator.h.

Referenced by initialize().

TriangleInterpolator* QgsTINInterpolator::mTriangleInterpolator
private

Definition at line 53 of file qgstininterpolator.h.

Referenced by initialize(), interpolatePoint(), and ~QgsTINInterpolator().

Triangulation* QgsTINInterpolator::mTriangulation
private

Definition at line 52 of file qgstininterpolator.h.

Referenced by initialize(), insertData(), and ~QgsTINInterpolator().

QString QgsTINInterpolator::mTriangulationFilePath
private

File path to export the triangulation.

Definition at line 59 of file qgstininterpolator.h.

Referenced by initialize().


The documentation for this class was generated from the following files: