www.pudn.com > glGraph.rar > glPolygon.h
// glPolygon.h: interface for the glPolygon class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GLPOLYGON_H__BE0DF9A4_4C6F_44DF_BB9B_060C57D14011__INCLUDED_)
#define AFX_GLPOLYGON_H__BE0DF9A4_4C6F_44DF_BB9B_060C57D14011__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "glGraph.h"
struct point//点
{
float nod[2];
struct point* m_next;
};
struct EDGE//边结构
{
int ymax;
float x;
float deltax;
EDGE* nextEdge;
};
class glPolygon : public glGraph
{
public:
void DeleteLastPoint();
void InsetEdgeToAEL(int y);
void Fill();
void DeleteET();
void InsertEdgeToET(int kind,EDGE* e);
point* GetPointForY(float y);
point* GetNextPointForY(float y);
point* GetPrePointForY(float y);
void CreatET();
int IsAble();
void AddPoint(float x,float y,double width,double height);
glPolygon();
virtual ~glPolygon();
void Draw();
protected:
int num;//定点数
EDGE* AEL;//活化边表
point* head;
point* tail;
EDGE* ET;//边分类表
float ymin;
float ymax;
};
#endif // !defined(AFX_GLPOLYGON_H__BE0DF9A4_4C6F_44DF_BB9B_060C57D14011__INCLUDED_)