-
Notifications
You must be signed in to change notification settings - Fork 0
/
MCommand.cpp
69 lines (57 loc) · 1.3 KB
/
MCommand.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "MCommand.h"
#include "math.h"
#include <QStatusBar>
#include <QMouseEvent>
//show a circle
void MCommand::ShowCapturePoint(const QPointF& pos, bool bShow)
{
if (bShow)
{
//CDC* pDC = g_pView->GetDC(); // 得到设备环境指针
//CCircle* pTempCircle = new CCircle(pos, 3);
//pTempCircle->Draw(pDC, dmDrag);
//delete pTempCircle;
//g_pView->ReleaseDC(pDC); // 释放设备环境指针
}
}
bool MCommand::GetNearKeyPoint(QPointF& pt)
{
return false;
//CVCadDoc *pDoc = (CVCadDoc *)g_pView->GetDocument();
//POSITION pos = pDoc->m_EntityList.GetHeadPosition();
//while(pos!=NULL)
//{
// MEntity* pEntity = (MEntity *) pDoc->m_EntityList.GetNext(pos);
// /////////////////////////////////////////////////////////
// if(pEntity->m_nOperationNum <= g_pView->m_nCurrentOperation) {
// MEntity * pEntShow = pEntity->GetShowEnt();
// if(pEntShow && pEntShow->m_nOperationNum >= 0 )
// {
// if(pEntity->GetSnapPos(pt))
// {
// return TRUE;
// }
// }
// }
//}
}
//
int MCommand::OnMouseMove(QMouseEvent* mouseEvent)
{
QPointF pt = mouseEvent->pos();
if (GetNearKeyPoint(pt))
{
if (!m_bCaptured)
{
ShowCapturePoint(pt, true);
}
m_bCaptured = true;
m_ptCapture = pt;
}
else if (m_bCaptured)
{
ShowCapturePoint(m_ptCapture, true);
m_bCaptured = true;
}
return 0;
}