📄 datapoint.cpp
字号:
// DataPoint.cpp: implementation of the CDataPoint class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "KMeansV.h"
#include "DataPoint.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDataPoint::CDataPoint()
{
}
CDataPoint::~CDataPoint()
{
}
CDataPoint::CDataPoint(CPoint point)
{
m_ptPoint=point;
m_nGroupTag=0;
}
void CDataPoint::ShowPoint(CDC* pDC)
{
CRect Rect;
::GetClientRect(((CFrameWnd*)(AfxGetApp()->m_pMainWnd))->GetActiveView()->m_hWnd,&Rect);
pDC->Ellipse(m_ptPoint.x+Rect.right/2-1,Rect.bottom/2-m_ptPoint.y-1,m_ptPoint.x+Rect.right/2+1,Rect.bottom/2-m_ptPoint.y+1);
CString sXY;
sXY.Format("(%d,%d)",m_ptPoint.x,m_ptPoint.y);
pDC->SetBkMode(TRANSPARENT);
pDC->TextOut(m_ptPoint.x+Rect.right/2,Rect.bottom/2-m_ptPoint.y,sXY);
}
void CDataPoint::ShowPointWithGroup(CDC* pDC)
{
CRect Rect;
::GetClientRect(((CFrameWnd*)(AfxGetApp()->m_pMainWnd))->GetActiveView()->m_hWnd,&Rect);
pDC->Ellipse(m_ptPoint.x+Rect.right/2-1,Rect.bottom/2-m_ptPoint.y-1,m_ptPoint.x+Rect.right/2+1,Rect.bottom/2-m_ptPoint.y+1);
CString sXY;
sXY.Format("(%d,%d)-%d",m_ptPoint.x,m_ptPoint.y,m_nGroupTag);
pDC->SetBkMode(TRANSPARENT);
pDC->TextOut(m_ptPoint.x+Rect.right/2,Rect.bottom/2-m_ptPoint.y,sXY);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -