|
|
#pragma once
|
|
|
|
|
|
//#include <vector>
|
|
|
#include "clipper2\clipper.engine.h"
|
|
|
#include "clipper2\clipper.core.h"
|
|
|
#include "clipper2\clipper.h"
|
|
|
//#include "clipper2\clipper.rectclip.h"
|
|
|
#include "clipper2\clipper.rectclip.h"
|
|
|
//#include "clipper2\RectClipLines.h"
|
|
|
//#include "clipper2\clipper.export.h"
|
|
|
#include "DrawOperator\FormatReader\GeoMapDataType.h"
|
|
|
#include "IntersectionUtil.h"
|
|
|
|
|
|
//#include "clipper2\clipper.engine.h"
|
|
|
//#include "clipper2\clipper.offset.h"
|
|
|
//#include "clipper2\clipper.minkowski.h"
|
|
|
//#include "DPoint.h"
|
|
|
|
|
|
using namespace std;
|
|
|
using namespace Clipper2Lib;
|
|
|
#define M_PI 3.14159265358979323846
|
|
|
class AFX_EXT_CLASS IDWCalculation
|
|
|
{
|
|
|
public:
|
|
|
IDWCalculation();
|
|
|
~IDWCalculation();
|
|
|
|
|
|
void SetSortedData(vector<DPoint3>* pData);
|
|
|
void SetData(vector<double>& vecX, vector<double>& vecY, vector<double>& vecZ);
|
|
|
void SetData(vector<array<double, 3>>& data);
|
|
|
double GetValue(double x, double y);
|
|
|
void SetArea(double area);
|
|
|
|
|
|
double TestR(double x, double y);
|
|
|
void SetSearchR(double r);
|
|
|
void SetFaultageHelp(const CIntersectionUtil* intersectHelp);
|
|
|
|
|
|
bool IsIntersects(const Paths64* subjects, Point64& pt1, Point64& pt2);
|
|
|
|
|
|
static bool PointSort(DPoint3& pt1, DPoint3& pt2);
|
|
|
private:
|
|
|
int FindPoints(double centerX, double centerY, double radius, vector<DPoint3>& ptsInrange);
|
|
|
|
|
|
public:
|
|
|
/************************************************************************/
|
|
|
/* 默认值为2。(一般0.5到3的值可获得最合理的结果)。
|
|
|
/* 通过定义更高的幂值,可进一步强调最近点。因此,邻近数据将受到更大影响,
|
|
|
表面会变得更加详细(更不平滑)。随着幂数的增大,内插值将逐渐接近最近采样点的值。
|
|
|
指定较小的幂值将对距离较远的周围点产生更大的影响,从而导致平面更加平滑。
|
|
|
由于反距离权重公式与任何实际的物理过程都不关联,因此无法确定特定幂值是否过大。
|
|
|
作为常规准则,认为值为30的幂是超大幂,因此不建议使用。此外还要牢记一点,如果距离或幂值较大,则可能生成错误结果。*/
|
|
|
/************************************************************************/
|
|
|
double m_factor = 2.5;
|
|
|
//double m_searchDistance = 0;
|
|
|
private:
|
|
|
vector<double>* m_pX;
|
|
|
vector<double>* m_pY;
|
|
|
vector<double>* m_pZ;
|
|
|
|
|
|
vector<DPoint3>* m_pPts;
|
|
|
|
|
|
BOOL m_bCreated = FALSE;
|
|
|
double m_Area;
|
|
|
int m_K;
|
|
|
double m_R; //搜索半径,电视台扫描
|
|
|
int m_SearchTimes;
|
|
|
int m_SearchResult;
|
|
|
double m_RInflexion;
|
|
|
double m_SearchTolerant;
|
|
|
|
|
|
CIntersectionUtil* m_IntersectHelp;
|
|
|
};
|
|
|
|