geoobject.h

来自「软件参考Windows操作系统下的画图程序」· C头文件 代码 · 共 48 行

H
48
字号
// GeoObject.h: interface for the GeoObject class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GEOOBJECT_H__D5977F54_9183_11D7_908B_00A00CC807C7__INCLUDED_)
#define AFX_GEOOBJECT_H__D5977F54_9183_11D7_908B_00A00CC807C7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//
//虚基类,所有几何图元的基类!!!
//
class GeoObject  
{
public:
	GeoObject();
	virtual ~GeoObject();
	virtual void Draw(CDC &dc) = 0; //绘图
	void SetColor(COLORREF col) 
	{
		m_color = col;
	}
	void SetWidth(int width) 
	{
		m_nWidth = width;
	}
	void SetMode(int mode)
	{
		m_nMode = mode;
	}
	void SetOrderId(long id)
	{
		m_nOrderId = id;
	}
	COLORREF GetColor() { return m_color; }
	int GetWidth() { return m_nWidth; }
	int GetMode() { return m_nMode; }
	long GetOrderId() { return m_nOrderId; }
protected:
	COLORREF m_color;//颜色
	int	     m_nWidth;//宽度
	int		 m_nMode;//绘制模式
	long	 m_nOrderId;//绘制次序号
};

#endif // !defined(AFX_GEOOBJECT_H__D5977F54_9183_11D7_908B_00A00CC807C7__INCLUDED_)

⌨️ 快捷键说明

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