⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thegraph.cpp

📁 希望大家多多交流
💻 CPP
字号:
// 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;
	}
void thegraph::operator =(const thegraph& temp)
	{
	point1=temp.point1;
	point2=temp.point2;
	point3=temp.point3;
	type=temp.type;
	candel=temp.candel;
	}
int thegraph::operator ==(thegraph temp)
	{
	return((point1==temp.point1) &&  (point2==temp.point2) && (point3==temp.point3) && (type==temp.type) && (candel==temp.candel));
	}

⌨️ 快捷键说明

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