|
|
#pragma once
|
|
|
#include "dfdimension.h"
|
|
|
#include "ScreenXY.h" // Added by ClassView
|
|
|
#include "ContourValue.h"
|
|
|
#include "ContourCreate.h"
|
|
|
|
|
|
namespace NContour
|
|
|
{
|
|
|
|
|
|
class AFX_EXT_CLASS CDimension2D :
|
|
|
public CDimensionBase
|
|
|
{
|
|
|
public:
|
|
|
CDimension2D(void);
|
|
|
~CDimension2D(void);
|
|
|
|
|
|
virtual CGrid* CloneObject(void); //克隆自己
|
|
|
virtual int Create(int numx, int numy, double x0, double y0, double dx, double dy);
|
|
|
virtual void SetValue(int i, int j, double v);
|
|
|
virtual double Value(double x0, double y0);///< 插值出x0,y0点z值
|
|
|
virtual double Value(int i, int j); ///< 结点z值
|
|
|
|
|
|
void operator=(CDimension2D& d2d);
|
|
|
/** @brief 得到直线与面的交点对应的NContour::CDimension2D直线方程系数值l,精确度由pre控制 */
|
|
|
int Cross(CLine3D& line, double& l, double pre); //返回-1表示没有交点
|
|
|
/** @brief 计算线段与曲面的交点坐标, 精确度由pre控制, 若无交点,返回false */
|
|
|
bool Cross(CPoint3D& pt1, CPoint3D& pt2, CPoint3D& csPt, double pre);
|
|
|
/** @brief 计算曲线与曲面的交点坐标, 精确度由pre控制, 若无交点,返回false */
|
|
|
bool Cross(CCurve& curve, CPoint3D& csPt, double pre);
|
|
|
/** @brief 对网格结点的z值进行加减乘的运算,0代表+ ,1 为减,2为乘,3为除*/
|
|
|
void ChangeZValue(double cv, int mode);
|
|
|
|
|
|
virtual void Serialize(CArchive& ar, const short& ver); //*.dfg
|
|
|
virtual int WriteDfg(LPCTSTR m_output);
|
|
|
int ReadDfgHead(CString m_input);
|
|
|
int ReadDfg(CFile& fr);
|
|
|
int ReadDfg(CString m_input);
|
|
|
int WriteDfg(CFile& fw);
|
|
|
int WriteDfg(FILE* fw);
|
|
|
|
|
|
int ReadGridText(CString m_input);
|
|
|
int ReadGridText(CFile& fr); //双狐文本网格格式
|
|
|
void WriteGridText(CFile& fw); //双狐文本网格格式
|
|
|
int WriteGridText(CString m_output); //双狐文本网格格式
|
|
|
void WriteGridTextData(CFile& fw); //双狐文本网格格式,网格参数及数据部分
|
|
|
//读取ASCII文件中纯网格数据部分,这些数据以空格间隔
|
|
|
//网格的行列数已设置给当前对象
|
|
|
int ReadGridTextData(CFile& fr, BOOL bReversal);
|
|
|
|
|
|
void WriteGrid(CString m_output);
|
|
|
int WriteToSEGY(CString m_output);
|
|
|
int Write(int fw, int i, int j, double z0);
|
|
|
double Read(int fr, int i, int j);
|
|
|
int WriteI64(int fw, int i, int j, __int64 z0);
|
|
|
__int64 ReadI64(int fr, int i, int j);
|
|
|
int WriteFaultage(FILE *&fw);
|
|
|
|
|
|
int GetBitmap(CImage &m_bmp,CColorBase &dcolor,int step);
|
|
|
int Draw(CDC *pDC,CScreenXY* pScreenXY,CColorBase &dcolor);
|
|
|
void FaultagePolygon(int k,int m_direction);
|
|
|
|
|
|
double fValue(int fr, double x0, double y0);
|
|
|
double Volume(CCurve& curve, double baseZ=0);
|
|
|
// 面积衡量
|
|
|
double TradeArea(CCurve& curve, double baseZ = 0);
|
|
|
|
|
|
int Extremum(FILE *& fw,int mm);
|
|
|
int Extremum(int i,int j,int mm);
|
|
|
/** @brief 为网格增加边界*/
|
|
|
void Outline(CCurve& curve);
|
|
|
/** @brief 为网格增加边界*/
|
|
|
int Outline(CString m_input);
|
|
|
|
|
|
int GetPlane(double x, double y, CPlane& plane);
|
|
|
int DX(CPoint3D &point);
|
|
|
int DY(CPoint3D &point);
|
|
|
double DifferentialX(int fr, int i, int j);
|
|
|
double DifferentialY(int fr, int i, int j);
|
|
|
double Differential(int fr, int i, int j);
|
|
|
double DX(int i, int j, int nt); //nt为几阶偏导数,1=一阶,2=二阶....
|
|
|
double DY(int i, int j, int nt);
|
|
|
double DXY(int i, int j,int nt);
|
|
|
double DifferentialX(int fr, int k);
|
|
|
double DifferentialY(int fr, int k);
|
|
|
double Differential(int fr, int k);
|
|
|
|
|
|
//等值线生成
|
|
|
int ContourCreate(CString m_output, CString m_contour, CString markLayer, CString otherLayer, char *mode="at");
|
|
|
void ContourCreate(CContour& cv);
|
|
|
void ContourCreate(POSITION AddContourCurve(CCurve* pCurve, CString strLayer), CContour& cv, CString markLayer, CString otherLayer);
|
|
|
|
|
|
void ContourCreate(std::vector<CCurve*>* curves, std::vector<CString*>* layers, CContour& cv, CString markLayer, CString otherLayer);
|
|
|
|
|
|
//template<class T, class PMemFun>
|
|
|
//void ContourCreate(T& obj, PMemFun pmemfun, CContour& cv, CString markLayer, CString otherLayer);
|
|
|
int Faultage(CString name);
|
|
|
void Faultage(CCurve& fal);
|
|
|
|
|
|
void SetContourCreateFile(FILE* fw);
|
|
|
/** @brief 追踪二维平面上值为m_contour的等值线,先j方向再i方向搜索*/
|
|
|
void Contour2D(double m_contour);
|
|
|
/** @brief 从(i,j)位置查到到一条完整等值线*/
|
|
|
int Contour2DK(int i, int j, double m_contour, char* mark);
|
|
|
|
|
|
//CList <dfPoint,dfPoint> m_contour_line;
|
|
|
std::vector<dfPoint> m_contour_line;
|
|
|
|
|
|
CCurve flt_u;
|
|
|
|
|
|
private:
|
|
|
//断层
|
|
|
void Faultage(double *xl, double *yl);
|
|
|
void FaultageY(int i,int j,double t);
|
|
|
void FaultageX(int i,int j,double t);
|
|
|
void FaultageY(double *xl, double *yl);
|
|
|
void FaultageX(double *xl, double *yl);
|
|
|
|
|
|
int DrawFaultage(int k,CDC *pDC,CScreenXY* pScreenXY,CColorBase &cr);
|
|
|
|
|
|
std::vector<CCurve*>* m_pCurves = nullptr;
|
|
|
std::vector<CString*>* m_pLayers = nullptr;
|
|
|
|
|
|
protected:
|
|
|
//等值线生成
|
|
|
|
|
|
/** @brief 判断是否到达边界,以及指定结点间等值点是否存在。若存在,返回等值点到本结点距离与网格点段长之比*/
|
|
|
double ContourGet(int k,double m_contour,int m_offset);
|
|
|
void ContourAddPoint(double x,double y,double z);
|
|
|
void ContourAddPoint(CList<dfPoint, dfPoint>& lstPoint, double x, double y, double z);
|
|
|
/** @brief 通过给定方向找到等值点,并递归调用自身,搜索整条等值线,优先顺序为→↑←↓,详细说明见cpp注释*/
|
|
|
void Contour2D(double &m_contour,int &k, char *mark,int m_direction);
|
|
|
//void Contour2DB(double &m_contour, int &k, char *mark, int m_direction);
|
|
|
void Contour2DPolygon(double m_contour);
|
|
|
void Contour2DFaultage(double &m_contour, int &k, char *mark, int m_direction);
|
|
|
int Contour2DFaultageIsBreak(int k1,int k2);
|
|
|
void ContourWrite(char *name);
|
|
|
void Contour(double m_contour);
|
|
|
|
|
|
int IsTail;
|
|
|
CContourCreate m_contourCreate;
|
|
|
// private:
|
|
|
// /** @brief 将所有范围内结点值增加一个小数*/
|
|
|
// void EnlageU(double dz);
|
|
|
// /** @brief 将所有范围内结点减小一个小数*/
|
|
|
// void ReduceU(double dz);
|
|
|
// /** @brief 将等值线追踪中微调的结点值归位*/
|
|
|
// void HomeU();
|
|
|
// list<int> m_tempNodNoLst; ///< 存储临时结点序号,在临时调整结点值时用到
|
|
|
// double m_tinydz; ///< z值微小改变量
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|