Quantum GIS API Documentation  1.8
src/analysis/interpolation/qgstininterpolator.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                               qgstininterpolator.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 QGSTININTERPOLATOR_H
00019 #define QGSTININTERPOLATOR_H
00020 
00021 #include "qgsinterpolator.h"
00022 #include <QString>
00023 
00024 class Triangulation;
00025 class TriangleInterpolator;
00026 class QgsFeature;
00027 
00029 class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
00030 {
00031   public:
00032     //describes the type of interpolation
00033     enum TIN_INTERPOLATION
00034     {
00035       Linear,
00036       CloughTocher
00037     };
00038     QgsTINInterpolator( const QList<LayerData>& inputData, TIN_INTERPOLATION interpolation = Linear, bool showProgressDialog = false );
00039     ~QgsTINInterpolator();
00040 
00046     int interpolatePoint( double x, double y, double& result );
00047 
00048     void setExportTriangulationToFile( bool e ) {mExportTriangulationToFile = e;}
00049     void setTriangulationFilePath( const QString& filepath ) {mTriangulationFilePath = filepath;}
00050 
00051   private:
00052     Triangulation* mTriangulation;
00053     TriangleInterpolator* mTriangleInterpolator;
00054     bool mIsInitialized;
00055     bool mShowProgressDialog;
00057     bool mExportTriangulationToFile;
00059     QString mTriangulationFilePath;
00061     TIN_INTERPOLATION mInterpolation;
00062 
00064     void initialize();
00071     int insertData( QgsFeature* f, bool zCoord, int attr, InputType type );
00072 };
00073 
00074 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines