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.

62 lines
1.7 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/************************************************************************/
/* 类名CTriContour */
/* 功能:对三角网进行等值线追踪 */
/* 王昌伟 2011-12-14 */
/************************************************************************/
#pragma once
#include "triangulation.h"
#include <list>
/** @brief 单条等值线结构体*/
class AFX_EXT_CLASS CTLine
{
public:
double z0; //高度值
list<CPoint3D> m_pointList; //等值点链表
/** @brief 得到等值点个数 */
int GetSize();
/** @brief 对等值线进行平滑 */
bool Smooth(int stimes = 100);
};
class AFX_EXT_CLASS CTriContour
{
public:
CTriContour(void);
virtual ~CTriContour(void);
/** @brief 清空类 */
virtual void ClearAll();
/** @brief 追踪给定Z值的等值线 */
int TraceContour(double z,CTriangulation& tNet);
/** @brief 将等值线输出*/
void WriteContours(char* filename);
/** @brief 五点三次平滑等值线,stimes为平滑次数*/
bool Smooth(int stimes = 100);
/** @brief 得到等值线的条数*/
int GetSize();
/** @brief 得到指定索引的等值线曲线*/
int GetContour(int nIndex, CCurve& 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的边并将对应点存入ptlistaddMode为添加方式*/
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; //等值线容器
};