You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
810 B
C++

#include "StdAfx.h"
#include "MeasureMgr.h"
#include "GlobalFunction.h"
#include "LogMgr.h"
CMeasureMgr gMeasureMgr;
CMeasureMgr::CMeasureMgr(void)
{
m_bSelFirstPt = false;//是否设置了第一个点
}
CMeasureMgr::~CMeasureMgr(void)
{
}
//设置新的采集点
void CMeasureMgr::SetNewPt(Dbxy pt)
{
CString LogStr;
LogStr.Format(_T("MeasureMgr:[pt.x] = [%f] ,[pt.y] = [%f]"),pt.x,pt.y);
gLogMgr->WriteDebugLog(LogStr);
if(!m_bSelFirstPt)//设置第一个点
{
m_OldPt = pt;
m_bSelFirstPt = true;
return;
}
//距离
double Dis = CalDistance(m_OldPt,pt);
//角度
double Ang = Cal360AngleByTwoPt(m_OldPt,pt);
LogStr.Format(_T("MeasureMgr:[Dis] = [%f] ,[Ang] = [%f]"),Dis,Ang);
gLogMgr->WriteDebugLog(LogStr);
}