bp_node.cpp

来自「故障诊断工作涉及的领域相当广泛」· C++ 代码 · 共 88 行

CPP
88
字号
// bp_node.cpp: implementation of the bp_node class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "richtest.h"
#include "bp_node.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

bp_node::bp_node()
{
type=sigmod;
dipan=CRect(-1,-1,-1,-1);
frenew=TRUE;
rand(1,1).ExtractData(&bar);
}

bp_node::~bp_node()
{
int c;
c=0;

}
double bp_node::calculate(double in)
{
return 0;
};
 _declspec(dllexport) void operator <<(CArchive& ar,bp_node& it)
{	
	ar<<it.bar;
	ar<<(int)it.type;
	ar<<it.frenew;
	ar<<it.dipan;
}
  _declspec(dllexport) void operator >>(CArchive& ar,bp_node& it)
{
	ar>>it.bar;
	int bag;
	ar>>bag;
	it.type=(bp_node_type)bag;
	ar>>it.frenew;
	ar>>it.dipan;		
}
_declspec(dllexport) void bp_node::Serialize(CArchive&  ar)
{AFX_MANAGE_STATE(AfxGetStaticModuleState());
//	CObject::Serialize(ar);
if(ar.IsStoring())
 ar<<*this;
else
 ar>>*this;
}

void bp_node::operator =(bp_node &in)
{
bar=in.bar;
type=in.type;
frenew=in.frenew;
dipan=in.dipan;
}
BOOL bp_node::is_snap(const CPoint &point)
{
if(dipan.PtInRect(point))
{	frenew=TRUE;
	return TRUE;
}
	return FALSE;
}

void bp_node::draw_area(CDC *pdc,BOOL visible)
{
	if(visible)
	{
		pdc->MoveTo(dipan.left,dipan.top);
		pdc->LineTo(dipan.left,dipan.bottom);
		pdc->LineTo(dipan.right,dipan.bottom);
		pdc->LineTo(dipan.right,dipan.top);
		pdc->LineTo(dipan.left,dipan.top);
	}
}

⌨️ 快捷键说明

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