shape.cpp

来自「用多态实现的画图小程序」· C++ 代码 · 共 79 行

CPP
79
字号
// Shape.cpp: implementation of the CShape class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "lq01.h"
#include "Shape.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
IMPLEMENT_SERIAL(CShape, CObject, 0)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CShape::CShape()
{

}

CShape::~CShape()
{

}

CPoint CShape::GetPs()
{
	return m_ptStart;
}

CPoint CShape::GetPe()
{
	return m_ptEnd;

}

//DEL void CShape::SetPs(CPoint ps)
//DEL {
//DEL 	m_ptStart=ps;
//DEL 
//DEL }

//DEL void CShape::SetPe(CPoint pe)
//DEL {
//DEL 	m_ptEnd=pe;
//DEL }

void CShape::Draw(CDC *pDC, CPoint ptStart, CPoint ptEnd, COLORREF iColor)
{

}

COLORREF CShape::GetColor()
{
	return m_iColor;

}

void CShape::Serialize(CArchive &ar)
{
//	CObject::Serialize (ar);
//	int version=1;
	if (ar.IsStoring())
	{

		ar<<m_iColor<<m_ptEnd<<m_ptStart;
	}
	else
		ar>>m_iColor>>m_ptEnd>>m_ptStart;



}


⌨️ 快捷键说明

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