thegraph.cpp

来自「希望大家多多交流」· C++ 代码 · 共 70 行

CPP
70
字号
// thegraph.cpp: implementation of the thegraph class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "draw.h"
#include "thegraph.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(thegraph,CObject,1)//serialize的要求
thegraph::thegraph()
{
	CPoint p1(0,0);
	point1=p1;
	point2=p1;
	point3=p1;
	type=0;
	candel=0;

}

thegraph::~thegraph()
{
	

}
thegraph::thegraph(CPoint p1,CPoint p2,CPoint p3,int i,int b=1)
	{
		point1=p1;
		point2=p2;
		point3=p3;
		type=i;
		candel=b;
	}
thegraph::thegraph(CPoint p1,int i,int b=1)//为点提供的构造函数
	{
		point1=p1;
		point2=p1;//附注:对于point2和3以后可用来存储关联度
		point3=p1;
		type=i;
		candel=b;
	}
thegraph::thegraph(CPoint p1,CPoint p2,int i,int b=1)//为线段提供的构造函数
	{
		point1=p1;
		point2=p2;
		point3=p1;
		type=i;
		candel=b;
	}
void thegraph::Serialize(CArchive& ar)
	{
	CObject::Serialize(ar);
	if (ar.IsStoring())
		ar<<type<<candel<<point1<<point2<<point3;
	else
		ar>>type>>candel>>point1>>point2>>point3;
	}
int  thegraph::setcantdel()
	{
	candel=0;
	}

⌨️ 快捷键说明

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