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

📄 shape.h

📁 C++视图的程序
💻 H
字号:
//shape.h

//以下为第二章所用的类定义
class CShape:public CObject
{
protected:
	COLORREF m_pColor;     
	int m_pWidth,m_pStyle;
	CShape(){}
	DECLARE_SERIAL(CShape)
public:
    virtual void Drawing(CDC *pDC){}
	virtual void Serialize(CArchive &ar);
};

class CLine:public CShape
{
protected:
	CPoint m_pStart,m_pEnd;
    CLine(){}
	DECLARE_SERIAL(CLine)
public:
	CLine(CPoint pStart,CPoint pEnd,int Width,int Style,COLORREF Color);
	void Drawing(CDC *pDC);
	void Serialize(CArchive &ar);
};

class CBezier:public CShape
{
protected:
	CPoint m_pPoints[20];
	int m_pNum;
    CBezier(){}
	DECLARE_SERIAL(CBezier)
public:
	CBezier(CPoint points[20],int n,int Width,int Style,COLORREF Color);
	void Drawing(CDC *pDC);
	void Serialize(CArchive &ar);
};

class CRectangle:public CShape
{
protected:
	CPoint m_pFP,m_pSP;
    int m_FFlag;
	COLORREF m_FColor;
	int m_HFlag,m_HPattern;
    CRectangle(){}
	DECLARE_SERIAL(CRectangle)
public:
	CRectangle(CPoint pFP,CPoint pSP,int Width,int Style,COLORREF Color,
		int m_FFlag,COLORREF FColor,int HFlag,int HPattern);
	void Drawing(CDC *pDC);
	void Serialize(CArchive &ar);
};

class CCircle:public CShape
{
protected:
	CPoint m_pFP,m_pSP;
    int m_FFlag;
	COLORREF m_FColor;
	int m_HFlag,m_HPattern;
    CCircle(){}
	DECLARE_SERIAL(CCircle)
public:
	CCircle(CPoint pFP,CPoint pSP,int Width,int Style,COLORREF Color,
		int m_FFlag,COLORREF FColor,int HFlag,int HPattern);
	void Drawing(CDC *pDC);
	void Serialize(CArchive &ar);
};

class CEllipse:public CShape
{
protected:
	CPoint m_pFP,m_pSP;
    int m_FFlag;
	COLORREF m_FColor;
	int m_HFlag,m_HPattern;
    CEllipse(){}
	DECLARE_SERIAL(CEllipse)
public:
	CEllipse(CPoint pFP,CPoint pSP,int Width,int Style,COLORREF Color,
		int m_FFlag,COLORREF FColor,int HFlag,int HPattern);
	void Drawing(CDC *pDC);
	void Serialize(CArchive &ar);

};

class CPolygon:public CShape
{
protected:
    int m_FFlag;
	COLORREF m_FColor;
	int m_HFlag,m_HPattern;
    CPolygon(){}
	DECLARE_SERIAL(CPolygon)
public:
	CPoint m_pPoints[20];
	int m_pNum;
	CPolygon(CPoint points[20],int n,int Width,int Style,COLORREF Color,int FFlag,
		COLORREF FColor,int HFlag,int HPattern);
	void Drawing(CDC *pDC);
	void Serialize(CArchive &ar);
};

⌨️ 快捷键说明

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