|
|
|
|
|
#pragma once
|
|
|
|
|
|
#ifndef AFX_EXT_CLASS
|
|
|
|
|
|
#define AFX_EXT_CLASS Q_DECL_IMPORT
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
using std::vector;
|
|
|
|
|
|
/*@file: InterfaceElements.h
|
|
|
|
|
|
* @desc: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><EFBFBD><EFBFBD>õĻ<EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣬<EFBFBD><EFBFBD><EFBFBD>㣬<EFBFBD><EFBFBD>
|
|
|
|
|
|
* @date: 2023.3.11
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//Ԫ<>ػ<EFBFBD><D8BB>࣬
|
|
|
|
|
|
class AFX_EXT_CLASS CBaseElement
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CBaseElement(void):m_strName(_T("") ) {}
|
|
|
|
|
|
virtual ~CBaseElement(void) {}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
inline void SetName( CString str) { m_strName = str; }
|
|
|
|
|
|
inline CString GetName (void) const { return m_strName; }
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
CString m_strName;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//xyz<79><7A>
|
|
|
|
|
|
|
|
|
|
|
|
class AFX_EXT_CLASS CPointXYZ :public CBaseElement
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CPointXYZ(void):x0(0.0),y0(0.0),z0(0.0){}
|
|
|
|
|
|
CPointXYZ(double x, double y, double z) { x0 = x; y0 = y; z0 = z; }
|
|
|
|
|
|
virtual ~CPointXYZ() {}
|
|
|
|
|
|
double GetDist2(double x, double y) { return (x - x0)*(x - x0) + (y - y0)*(y - y0); }
|
|
|
|
|
|
double GetDist(double x, double y) { return sqrt(GetDist2(x, y)); }
|
|
|
|
|
|
|
|
|
|
|
|
double x0;
|
|
|
|
|
|
double y0;
|
|
|
|
|
|
double z0;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
class AFX_EXT_CLASS CWellPoint :public CPointXYZ
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CWellPoint(void) :nWellType(0) {}
|
|
|
|
|
|
CWellPoint(double x, double y, double z, int type) { x0 = x; y0 = y; z0 = z; nWellType = type; }
|
|
|
|
|
|
virtual ~CWellPoint() {}
|
|
|
|
|
|
|
|
|
|
|
|
int nWellType; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȱʡ-1
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><>
|
|
|
|
|
|
class AFX_EXT_CLASS CPolyline :public CBaseElement
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CPolyline(void) {}
|
|
|
|
|
|
virtual ~CPolyline() {}
|
|
|
|
|
|
inline void Clear(void) ;
|
|
|
|
|
|
inline int GetSize(void) const { return static_cast<int>(m_points.size()); }
|
|
|
|
|
|
inline void AddPoint(double x, double y, double z);
|
|
|
|
|
|
inline CPointXYZ& GetPoint(int idx);
|
|
|
|
|
|
std::vector<CPointXYZ>& GetPoints(void) { return m_points; }
|
|
|
|
|
|
|
|
|
|
|
|
bool isClosed(double dDistance = 1e-8); //<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>պ<EFBFBD>
|
|
|
|
|
|
void setClosed(); //<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD>պ<EFBFBD>
|
|
|
|
|
|
void WriteDfd(FILE* fw);
|
|
|
|
|
|
protected:
|
|
|
|
|
|
std::vector<CPointXYZ> m_points;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
inline void CPolyline::Clear(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_points.clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
inline void CPolyline::AddPoint(double x, double y, double z)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_points.push_back(CPointXYZ(x, y, z));
|
|
|
|
|
|
}
|
|
|
|
|
|
inline CPointXYZ& CPolyline::GetPoint(int idx)
|
|
|
|
|
|
{
|
|
|
|
|
|
ASSERT(idx > -1 && idx < m_points.size());
|
|
|
|
|
|
return m_points[idx];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|