www.pudn.com > Poly.rar > SortPoly.h


// SortPoly.h: interface for the CSortPoly class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_SORTPOLY_H__351A23F4_127F_410C_A6ED_FDE09EC3EF71__INCLUDED_) 
#define AFX_SORTPOLY_H__351A23F4_127F_410C_A6ED_FDE09EC3EF71__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include "ptpdata.h" 
#include "datasdef.h" 
using namespace std; 
class CSortPoly   
{ 
public: 
	bool        ReadMlFile(CString fileName); 
	void        InitData(); 
	Point       GetPointByNum(int num); 
	intIntList  GetPolyList(); 
	pointList   GetPtList(); 
	bool        EquelList(intList ptlist1,intList ptlist2); 
	void        PrintVectot(intList  ptlist); 
	void        CheckResult(); 
	void        SortPolygons(); 
	 
	bool        Recursion( int num1, int num2 ); 
	double      AngleOfTwoLines( Point start, Point inf, Point end ); 
	void        CalUsedTimesOfPoints(); 
	bool        ReadFile( CString filepath ); 
	CSortPoly(); 
	virtual ~CSortPoly(); 
 
 
	//属性: 
private: 
	bool PutPtInLine(intList& ptlist); 
	bool         PutLineInPolyS(intIntList &polylist); 
	int          GetPtNum(int code); 
	void         SetLineStartEnd(lineList& linelist); 
	bool         LineAroundBorder_disLine(MatchPoint* mp,listMatchPoint* ptlist,lineList&  lineS); 
	bool         listSort(listMatchPoint& ptlist,int pos); 
	bool         LineAroundBorder(lineList& lineS,int width,int height,listMatchPoint borderList); 
	bool         DisLine(lineList& lineS,intList ptlist); 
	bool         LineProc(lineList  lineS,listMatchPoint mplist,int width,int height); 
	bool         IsIn(intIntList int2list, intList intlist); 
	bool         IsIn(intList intlist,int num); 
	CString      GetPointStyle(POINTSTYLE pStyle); 
	POINTSTYLE   GetPointStyle(const char *style); 
	int					m_nNumberOfPoints;				//保存点个数 
	int					m_nNumberOfLines;				//保存线个数			 
	int					m_nNum1, m_nNum2;				//保存待处理点的序号 
	pointList	        m_vPoints;						//保存所有点的集合 
	lineList			m_vLines;						//保存所有线的集合 
	 
 
	cpList              m_vConnectedPoints;				//保存点相连的信息 
	intIntList      	m_sPolygons;					//保存结果,集合的集合,只做中间过程使用 
	intIntList          m_vPolygons;					//保存结果,向量的结合,用作最终结果 
	intList     		m_sResult;						//中间变量 
		 
	intList			    m_vResult;						//中间变量 
	intList     		m_sOuterPoints;					//保存外围点的信息 
	bool				m_bOnePolygon;					//判断是否只有一个多边形 
     
	bool                m_flag;                         //生成标志 
	listMatchPoint      m_mpList;                       //存储mp点  
	CSize               m_size; 
public: 
	bool GetExtraPt(int start, int end,intList& extralist); 
	CSize GetSize(); 
	 
 
 
}; 
 
#endif // !defined(AFX_SORTPOLY_H__351A23F4_127F_410C_A6ED_FDE09EC3EF71__INCLUDED_)