⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smooth.h

📁 VC实现等值线编成的COM组件的源程序代码
💻 H
字号:
// Smooth.h: interface for the CSmooth class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SMOOTH_H__586F9434_010D_4FA7_AD99_0F33188A8BBD__INCLUDED_)
#define AFX_SMOOTH_H__586F9434_010D_4FA7_AD99_0F33188A8BBD__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>
#include "GlobalFUnctions.h"

class CSmooth  
{
private://平滑用到的参数
	double si0, si1, si2, si3, ssum;	//参数意义可以参考平滑原理部分
	double ax, bx, cx, ay, by, cy;
	double si00, si10, si20, si30;		//余下参数为第一套参数的备份
	double ax0, bx0, cx0, ay0, by0, cy0;
	
	double dts;	//平滑时采用的最短步长

private://平滑之后形成的加密度点
	XYZ * points_;				// 待平滑(加密前)的点
	int count_;						// points的大小
	XYZ *ptArray;	// 平滑(加密度)后的点, 在本类中分配内存
	int ptArrayCount;
	int zValue;		// 标注平滑后的等值线时使用的数据

public:
	CSmooth(XYZ* points, int count);
	virtual ~CSmooth();

private:
	void CalcPara(const int i, bool bCalcS, const XYZ* Points);
	double x1(const double s);
	double y1(const double s);
	double x2(const double s);
	double y2(const double s);
	double a(const double s);
private:
	void RemoveRepeatPoints(XYZ* points, int& count);

public:
	void GetSmoothedPoints(XYZ **afterpoints, int& afterpointscount);
	void Smooth();

protected: // no use!!!
	void DrawSmoothLines(CDC *dc);	//画平滑线
	void DrawLable(CDC *dc, double zValue);	//标注
};

#endif // !defined(AFX_SMOOTH_H__586F9434_010D_4FA7_AD99_0F33188A8BBD__INCLUDED_)


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -