|
|
|
|
|
#ifndef NMCALCULATIONUTILS_H
|
|
|
|
|
|
#define NMCALCULATIONUTILS_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
#include <QPointF>
|
|
|
|
|
|
#include <QVector>
|
|
|
|
|
|
#include "nmCalculation_global.h"
|
|
|
|
|
|
#include "nmCalculationDefine.h"
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
|
|
class NMCALCULATION_EXPORT nmCalculationUtils {
|
|
|
|
|
|
public:
|
|
|
|
|
|
nmCalculationUtils();
|
|
|
|
|
|
|
|
|
|
|
|
static bool copyFileToDir(QString filePath, QString destDir);
|
|
|
|
|
|
static bool createDirectoryIfNotExists(QString directoryPath);
|
|
|
|
|
|
static bool copyFile(const std::string& sourcePath, const std::string& destinationPath);
|
|
|
|
|
|
static bool removeDirectory(const QString &dirPath);
|
|
|
|
|
|
static bool writeFile(const QStringList& content, const QString &filePath);
|
|
|
|
|
|
static QStringList readFile(const QString & filePath);
|
|
|
|
|
|
|
|
|
|
|
|
// 调用求解器Kriging接口,对targetPoints中的坐标依次进行属性插值.
|
|
|
|
|
|
// measurementPoints与measurementValues按下标一一对应.
|
|
|
|
|
|
// 成功时outputValues与targetPoints数量相同且顺序一致;失败时清空outputValues.
|
|
|
|
|
|
static bool calculateKriging(const QVector<QPointF>& targetPoints,
|
|
|
|
|
|
const QVector<QPointF>& measurementPoints,
|
|
|
|
|
|
const QVector<double>& measurementValues,
|
|
|
|
|
|
double nugget,
|
|
|
|
|
|
double sill,
|
|
|
|
|
|
double range,
|
|
|
|
|
|
int model,
|
|
|
|
|
|
const QString& licensePath,
|
|
|
|
|
|
QVector<double>& outputValues,
|
|
|
|
|
|
QString* errorMessage = 0);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NMCALCULATIONUTILS_H
|