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

📄 listcontour.h

📁 这是一个用于生成等值线的源代码
💻 H
字号:
// ListContour.h: interface for the CListContour class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LISTCONTOUR_H__84C3BBC0_6F70_416A_8194_9657813FF3AE__INCLUDED_)
#define AFX_LISTCONTOUR_H__84C3BBC0_6F70_416A_8194_9657813FF3AE__INCLUDED_

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

#include <list>
#include <ostream>
#include "Contour.h"

// a list of point index referring to the secondary grid
// Let i the index of a point,
// then 
//typedef CList< int, int > CLineStrip;
//typedef CList< CLineStrip*, CLineStrip*> CLineStripList;
typedef std::list<int> CLineStrip;
typedef std::list<CLineStrip*> CLineStripList;

class CListContour : public CContour  
{
public:
	CListContour();
	virtual ~CListContour();

	// retreiving list of line strip for the i-th contour
	CLineStripList* GetLines(int iPlane)
	{	ASSERT(iPlane>=0); ASSERT(iPlane<m_iNPlanes);
		return &m_pStripLists[iPlane];};

	// Initializing memory
	virtual void InitMemory();
	// Cleaning memory and line strips
	virtual void CleanMemory();
	// Generate contour strips
	virtual void Generate();

	// Adding segment to line strips
	// See CContour::ExportLine for further details
	void ExportLine(int iPlane,int x1, int y1, int x2, int y2);

	// Basic algorithm to concatanate line strip. Not optimized at all !
	void CompactStrips();
	/// debuggin
	void DumpPlane(int iPlane, std::ostream& out) const;
	void DumpPlane(int iPlane, CString& out) const;
protected:
	// Merges pStrip1 with pStrip2 if they have a common end point
	bool MergeStrips(CLineStrip* pStrip1, CLineStrip* pStrip2);

	// array of line strips
	CLineStripList* m_pStripLists;
};

#endif // !defined(AFX_LISTCONTOUR_H__84C3BBC0_6F70_416A_8194_9657813FF3AE__INCLUDED_)

⌨️ 快捷键说明

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