📄 point.cpp
字号:
// Point.cpp: implementation of the Point class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "PainterUsePattern.h"
#include "Point.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Point::Point()
{
m_radix = 2;
}
Point::~Point()
{
}
//=================================================================
//
//=================================================================
void Point::Accept( AbstractVisitor& v , CDC* pDC )
{
v.VisitPoint( this ,pDC);
}
//=================================================================
//
//=================================================================
bool Point::Intersects( CPoint p )
{
int offsetX = ( p.x > m_centrePoint.x )?(p.x - m_centrePoint.x):(m_centrePoint.x - p.x );
int offsetY = ( p.y > m_centrePoint.y )?(p.y - m_centrePoint.y):(m_centrePoint.y - p.y );
if( offsetX <= m_radix && offsetY <= m_radix )
return true;
return false;
}
//=================================================================
//
//=================================================================
void Point::SetOffset( int offsetX , int offsetY )
{
m_centrePoint.x += offsetX;
m_centrePoint.y += offsetY;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -