|
|
|
|
|
|
|
|
#pragma once
|
|
|
#ifndef AFX_EXT_CLASS
|
|
|
#define AFX_EXT_CLASS Q_DECL_IMPORT
|
|
|
#endif
|
|
|
|
|
|
#include "Triangulation.h"
|
|
|
#include <list>
|
|
|
|
|
|
|
|
|
namespace NVoronoi
|
|
|
{
|
|
|
|
|
|
/** @brief 单条等值线结构体*/
|
|
|
class AFX_EXT_CLASS CTLine
|
|
|
{
|
|
|
public:
|
|
|
double z0; //高度值
|
|
|
list<CPoint3D> m_pointList; //等值点链表
|
|
|
/** @brief 得到等值点个数 */
|
|
|
int GetSize();
|
|
|
/** @brief 对等值线进行平滑 */
|
|
|
bool Smooth(int stimes = 100);
|
|
|
string strMark; //等值线备注,可用来存储层位名
|
|
|
};
|
|
|
|
|
|
|
|
|
class AFX_EXT_CLASS CTriContour
|
|
|
{
|
|
|
public:
|
|
|
CTriContour(void);
|
|
|
virtual ~CTriContour(void);
|
|
|
|
|
|
/** @brief 清空类 */
|
|
|
virtual void ClearAll();
|
|
|
|
|
|
/** @brief 追踪给定Z值的等值线 */
|
|
|
int TraceContour(double z,CTriangulation& tNet,string strMark = "");
|
|
|
/** @brief 追踪多条等值线*/
|
|
|
bool TraceContour(CTriangulation& tNet,double zmin, double zmax, double step, long markNameStep, string strMarkLayer, string strOtherLayer);
|
|
|
/** @brief 将等值线输出*/
|
|
|
void WriteContours(char* filename);
|
|
|
/** @brief 五点三次平滑等值线,stimes为平滑次数*/
|
|
|
bool Smooth(int stimes = 100);
|
|
|
/** @brief 得到等值线的条数*/
|
|
|
int GetSize();
|
|
|
/** @brief 得到指定索引的等值线曲线*/
|
|
|
int GetContour(int nIndex, CMyCurve& curve);
|
|
|
|
|
|
private:
|
|
|
/** @brief 清空等值线容器*/
|
|
|
void ClearContourVector();
|
|
|
///** @brief 对高度值恰好为z值的奇异点进行处理,加一个极小值 */
|
|
|
//void DisposeSigularPoints(double z0);
|
|
|
/** @brief 从指定三角形寻找一条等值线 */
|
|
|
int SearchFromThisTriangle(double z0, int triNo, CTLine& line, set<int>& FDNOS);
|
|
|
/** @brief 追踪第triNo个三角形相邻边为npt1和npt2的相邻三角形中另一条含z0的边,并将对应点存入ptlist,addMode为添加方式*/
|
|
|
int OneWayTrace(double& z0, int& triNo, int& npt1, int& npt2,list<CPoint3D>& ptlist, set<int>& FDNOS, int addMode = 0);
|
|
|
|
|
|
//成员变量
|
|
|
public:
|
|
|
CTriangulation* m_pTNet; //三角网
|
|
|
vector<CTLine*> m_ContourVector; //等值线容器
|
|
|
|
|
|
};
|
|
|
|
|
|
}; //namespace NTriangle
|