📄 point.cpp
字号:
// Point.cpp: implementation of the CPoint class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Voronoi.h"
#include "Point.h"
#include "VoronoiDoc.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
extern CGraphPara *p_GraphPara;
extern void RPtoLP(double x,double y,int *X,int *Y);
extern int RLtoLL(double l);
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CNetPoint::CNetPoint()
{
}
CNetPoint::~CNetPoint()
{
}
void CNetPoint::Draw(CDC *pDC,int m_DrawMode,int m_DrawModel,short BackColor,int id)
{
CString str;
if(b_Delete)
return;
if(m_DrawMode==0)
pDC->SetROP2(R2_COPYPEN);
else if(m_DrawMode==1)
pDC->SetROP2(R2_NOT);
int x,y,r;
short ColorPen=m_ColorPen;
if(m_DrawModel==2)
ColorPen=BackColor;
p_GraphPara=new CGraphPara;
CPen pen(0,1,p_GraphPara->GetColor(ColorPen));
CPen* pOldPen=pDC->SelectObject(&pen);
RPtoLP(m_x,m_y,&x,&y);
r=RLtoLL(m_rRadiu);
pDC->SelectStockObject(NULL_BRUSH);
pDC->Ellipse(x-r,y-r,x+r,y+r);
str.Format("%d",id);
pDC->TextOut(x,y,str);
pDC->SelectObject(pOldPen);
}
double CNetPoint::ReturnY()
{
return m_y;
}
double CNetPoint::ReturnX()
{
return m_x;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -