point.cpp

来自「一个很不错的求Voronoi线与最小凸壳的vc++源程序」· C++ 代码 · 共 69 行

CPP
69
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?