line.cpp
来自「显示地震剖面对地震专业的学生来说显示地震剖面特别重要本程序实现了地震剖面的绘制」· C++ 代码 · 共 97 行
CPP
97 行
// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "cad.h"
#include "Line.h"
#include<afxtempl.h>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CLine,CObject,1)
CLine::CLine()
{
m_status=1;
m_next=1;
}
CLine::~CLine()
{
}
//DEL void CLine::DrawLine(CPoint pt1, CPoint pt2)
//DEL {
//DEL
//DEL }
CLine::CLine(CPoint pt1, CPoint pt2)
{
m_pt1=pt1;
m_pt2=pt2;
m_status=1;
m_next=1;
}
void CLine::DrawLine(CDC *pdc)
{
pdc->MoveTo(m_pt1);
pdc->LineTo(m_pt2);
}
//DEL void CLine::Serialize()
//DEL {
//DEL if()
//DEL
//DEL }
void CLine::Serialize(CArchive &ar)
{
if(ar.IsStoring()) ar<<m_pt1<<m_pt2<<m_next<<m_status;
else ar>>m_pt1>>m_pt2>>m_next>>m_status;
}
bool CLine::isempty()
{
if(m_pt1.x==m_pt2.x==m_pt1.y==m_pt2.y==0)
return TRUE;
else return FALSE;
}
void CLine::Empty()
{
m_pt1.x=m_pt2.x=m_pt1.y=m_pt2.y=0;
}
int CLine::GetStatus()
{
return m_status;
}
void CLine::SetNext(int i)
{
m_next=i;
}
int CLine::GetNext()
{
return m_next;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?