📄 graphline.cpp
字号:
// GraphLine.cpp: implementation of the CGraphLine class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "SmallCAD203.h"
#include "GraphLine.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CGraphLine::CGraphLine():m_startPoint(0,0),m_endPoint(0,0)
{
nflag=5;
//m_startPoint;
//m_endPoint;
}
CGraphLine::~CGraphLine()
{
}
void CGraphLine::SetStartPoint(CPoint point)
{
m_startPoint=point;
}
CPoint CGraphLine::GetStartPoint()
{
return m_startPoint;
}
void CGraphLine::SetEndPoint(CPoint point)
{
m_endPoint=point;
}
CPoint CGraphLine::GetEndPoint()
{
return m_endPoint;
}
void CGraphLine::Draw(CDC *pDC)
{
CPen pen;
pen.CreatePen(PS_SOLID,m_scale,m_color);
pDC->SelectStockObject(NULL_BRUSH);
pDC->SelectObject(&pen);
pDC->MoveTo(m_startPoint);
pDC->LineTo(m_endPoint);
}
void CGraphLine::Serialize(CArchive& ar)
{
if(ar.IsStoring())
{
ar<<this->m_startPoint<<this->m_endPoint;
}
else
{
ar>>this->m_startPoint>>this->m_endPoint;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -