You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.2 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "dllExport.h"
#include "XJPoint2D.h"
#include "XJPoint3D.h"
#include "Isopleth.h"
#include "ControlPoint2d.h"
#include <string>
#include <vector>
#include <limits>
#include <Eigen/Dense>
#include "RBFInterpolator.hpp"
#include <atomic>
#include "kdtree.hpp"
typedef void(*ProgressCallback)(int percent, void* userData);
enum class InterpolationMethod
{
Default = 0, // 默认
Kriging = 1, // 克里金
RFB = 2, // RFB
IDW = 3 // 反距离加权
};
class RectificationMeshWell
{
public:
RectificationMeshWell();
virtual ~RectificationMeshWell();
//progressCallbackC#传入
bool RectificationMeshWellCompute(
unsigned int numx, unsigned int numy, double x0, double y0, double stepX, double stepY, double* values,
const std::vector<ControlPoint2d>& pointList, InterpolationMethod method, const std::vector<uint8_t>& fault, double deltaz, double factor = 1,
ProgressCallback progressCallback = nullptr,
void* progressUserData = nullptr // 进度回调用户数据,可选
);
//终止线程
void requestStop() { m_stopFlag.store(true); }
void resetStopFlag(); // 每次计算前重置
bool isStopRequested() const { return m_stopFlag.load(); }
protected:
//Kriging
bool KrigingInterpolatorCompute(ProgressCallback progressCallback,
void* progressUserData);
//RFB
bool RFBInterpolatorCompute(ProgressCallback progressCallback,
void* progressUserData);
//IDW
bool IDWInterpolatorCompute(ProgressCallback progressCallback,
void* progressUserData);
//双线性插值函数
double bilinear(const Eigen::MatrixXd& grid, double xmin, double xmax, double ymin, double ymax, double x, double y);
double bicubic(
const Eigen::MatrixXd& grid,
double xmin, double xmax, double ymin, double ymax,
double x, double y);
public:
double m_factor; //步长放大倍数
double m_deltaZ; //网格与井点差值
uint64_t m_row; //行数
uint64_t m_col; //列数
Point2D m_minPoint; //最小点
Point2D m_maxPoint; //最大点
double m_zMin;
double m_zMax;
double m_stepX; //步长
double m_stepY;
std::unique_ptr<double[]> m_data; //z值数据
std::vector<ControlPoint2d> m_controlPnts; //控制点
std::vector<uint8_t> m_fault; //断层点
std::atomic<bool> m_stopFlag{ false };
};