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.
75 lines
1.8 KiB
C++
75 lines
1.8 KiB
C++
#pragma once
|
|
#include "DrawModel\BaseLib.h"
|
|
#include "DrawOperator\DrawLib.h"
|
|
#include "CallBack.h"
|
|
|
|
//#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"
|
|
|
|
using namespace Clipper2Lib;
|
|
//#include "DrawLib\XyIO.h"
|
|
class AFX_EXT_CLASS CIDWCreator
|
|
{
|
|
public:
|
|
CIDWCreator();
|
|
~CIDWCreator();
|
|
// double dSearchDistance =0,
|
|
void Create(CString xyzFile, CString borderFile,CString faultFile, CString resultFile, int XCount,
|
|
double smoothFactor = 1, int smoothTimes = 2,
|
|
CPPCallback callBack = nullptr,
|
|
int insertTimes = 0, double contourStep = 5.0, int contourMarkStep = 5
|
|
, double xMin=-1, double yMin=-1, double xMax=-1, double yMax=-1);
|
|
|
|
void SmoothMesh(CGrid* pGrid, CIntersectionUtil* intersectHelp, double smoothFactor=1);
|
|
|
|
bool Calculate();
|
|
|
|
private:
|
|
bool OpenFile(LPCTSTR lpszFileName, CXy* pXy);
|
|
void Serialize(CArchive& ar, CXy* pXy);
|
|
void ReadInToMatrix(string FilePath, vector<array<double, 3>>& data);
|
|
|
|
void AddContourCurve(CXy* pXy, vector<CCurve*>* curves, vector<CString*>* layer);
|
|
static void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
|
|
|
|
bool IsPointInPolygon(double ptX, double ptY, CCurve* pCurve);
|
|
|
|
private:
|
|
CString m_strBorderFile;
|
|
CString m_strXyzFile;
|
|
|
|
int m_XCount;
|
|
int m_YCount;
|
|
|
|
double m_dX;
|
|
double m_dY;
|
|
|
|
double m_XMin;
|
|
double m_XMax;
|
|
double m_YMin;
|
|
double m_YMax;
|
|
double m_ZMin;
|
|
double m_ZMax;
|
|
|
|
DPoint3 ptO;
|
|
|
|
};
|
|
|
|
class StepProgress
|
|
{
|
|
public:
|
|
static CPPCallback DoProgress;
|
|
static int stepCount;
|
|
static int progress;
|
|
static int lastProgress;
|
|
};
|
|
|