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
1.1 KiB
C++

#pragma once
#include "GlobalDefine.h"
#include "ObjBase.h"
#include "SmartPtr.h"
//鼠标捕捉管理
class CCatchMgr
{
public:
CCatchMgr(void);
~CCatchMgr(void);
void Clear();
void Catch(Dbxy DownPt,Dbxy pt,CDC* pDC,bool bCatchTemp);
void ResetCatchPoint(CDC* pDC);
bool GetCatchPoint(CPoint &pt);
private:
void CatchNode(DbRect rect);
void CatchIntersectPointOfLines(DbRect rect);
void CatchIntersectPointWithMouse(DbRect rect);
void ResetCatchNode();
bool HasCatchPoint();
void DrawCatchPoint(CCatchPoint pt,CDC* pDC);
void DrawCatchPointExt(CCatchPoint pt,CDC* pDC);
CCatchPoint GetNearestCatchPt(Dbxy pt);
void GetLineInRect(DbRect &rect,bool bCatchTemp);
void CatchOrthoPoint(Dbxy DownPt,Dbxy MousePt,DbRect rect);
void CatchCutTrack(DbRect rect);
private:
vector<DbLine> m_DataPtLineVec;//保存rect 范围内所有的线段
vector<CCatchPoint> m_CatchPointVec;//在鼠标范围内的捕获点的容器
CCatchPoint m_CatchNode;//之前抓取的点
};
extern CCatchMgr gCatchMgr;