|
QGIS API Documentation
master-6227475
|
00001 /*************************************************************************** 00002 qgsrasterchecker.h - compare two rasters 00003 -------------------------------------- 00004 Date : 5 Sep 2012 00005 Copyright : (C) 2012 by Radim Blazek 00006 email : radim dot blazek at gmail dot com 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 #ifndef QGSRASTERCHECKER_H 00017 #define QGSRASTERCHECKER_H 00018 00019 #include <QDir> 00020 #include <QString> 00021 #include <qgsmaprenderer.h> 00022 class QImage; 00023 00029 class CORE_EXPORT QgsRasterChecker 00030 { 00031 public: 00032 00033 QgsRasterChecker(); 00034 00036 ~QgsRasterChecker() {}; 00037 00038 QString report() { return mReport; }; 00046 bool runTest( QString theVerifiedKey, QString theVerifiedUri, 00047 QString theExpectedKey, QString theExpectedUri ); 00048 private: 00049 QString mReport; 00050 QString mExpectedUri; 00051 QString mCheckedUri; 00052 QString mTabStyle; 00053 QString mCellStyle; 00054 QString mOkStyle; 00055 QString mErrStyle; 00056 QString mErrMsgStyle; 00057 00058 // Log error in html 00059 void error( QString theMessage, QString &theReport ); 00060 // compare values and add table row in html report, set ok to false if not equal 00061 QString compareHead(); 00062 bool compare( double verifiedVal, double expectedVal, double theTolerance ); 00063 void compare( QString theParamName, int verifiedVal, int expectedVal, QString &theReport, bool &theOk ); 00064 void compare( QString theParamName, double verifiedVal, double expectedVal, QString &theReport, bool &theOk, double theTolerance = 0 ); 00065 void compareRow( QString theParamName, QString verifiedVal, QString expectedVal, QString &theReport, bool theOk, QString theDifference = "", QString theTolerance = "" ); 00066 double tolerance( double val, int places = 6 ); 00067 }; // class QgsRasterChecker 00068 00069 #endif