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.

77 lines
3.4 KiB
C

#pragma once
#include "GlobalDefine.h"
#include "SmartPtr.h"
#include "ObjBase.h"
#include "ObjContainer.h"
#include "ObjPline.h"
#if 1//<2F><><EFBFBD><EFBFBD>
#define CMD_TOOL_CIRCLE_DIA_EDGE "_circle ָ<><D6B8>Բ<EFBFBD><D4B2><><D6B1>] [<5B><><EFBFBD><EFBFBD>]"
#define CMD_TOOL_CIRCLE_CENTER "_circle ָ<><D6B8>Բ<EFBFBD><D4B2><><D4B2>] "
#define CMD_LINE_FIRST_PT "_line ָ<><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>"
#define CMD_LINE_NEXT_PT "_line ָ<><D6B8><EFBFBD>߶ε<DFB6>[<5B><><EFBFBD><EFBFBD>] [<5B>Ƕ<EFBFBD>]"
#define CMD_RECT_FIRST_PT "_rectang ָ<><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>"
#define CMD_RECT_SIZE "_rectang ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD>[<5B><><EFBFBD><EFBFBD>][<5B>߶<EFBFBD>]"
#define CMD_TOOL_ROTATO_ANGLE "_rotato ָ<><D6B8><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>[<5B>Ƕ<EFBFBD>]"
#define CMD_TOOL_ROTATO_CENTER "_rotatoָ<6F><D6B8><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>"
#define CMD_TOOL_MOVE_FIRST_PT "_move ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define CMD_TOOL_MOVE_DIS "_moveָ<65><D6B8><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>[x <20><><EFBFBD><EFBFBD>][y <20><><EFBFBD><EFBFBD>]"
#define CMD_TOOL_MEASURE_FIRST_PT "_measure ָ<><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>"
#define CMD_TOOL_MEASURE_SECOND_PT "_measure ָ<><D6B8><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>"
#define CMD_TOOL_MEASURE_RESULT "_measure [<5B><><EFBFBD><EFBFBD>]"
#define CMD_TOOL_MEASURE_RESULT2 "_measure [x ƫ<><C6AB><EFBFBD><EFBFBD>] [y ƫ<><C6AB><EFBFBD><EFBFBD>]"
#define CMD_TOOL_MEASURE_RESULT3 "_measure [<5B>Ƕ<EFBFBD>]"
#define CMD_TOOL_MEASURE_RESULT4 "_measure [ԭ<><D4AD><EFBFBD>Ƕ<EFBFBD>]"
#define CMD_TOOL_COPY_BASE_PT "_copy ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define REDRAW_CNT 5
#endif
class CMouseTool
{
public:
CMouseTool(void);
virtual ~CMouseTool(void);
virtual void OnLButtonDown(UINT nFlags, CPoint point,CClientDC &dc);
virtual void OnLButtonUp(UINT nFlags, CPoint point,CClientDC &dc);
virtual void OnRButtonDown(UINT nFlags, CPoint point,CClientDC &dc);
virtual void OnRButtonUp(UINT nFlags, CPoint point,CClientDC &dc){};
virtual void OnMouseMove(UINT nFlags, CPoint point,CClientDC &dc){};
virtual void OnEscapeKey();
virtual void OperateOver();
virtual bool OnSetCmd(CString str){return false;};
virtual bool NeedToPointTool(){return false;};//<2F><><EFBFBD>߽<EFBFBD><DFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫת<D2AA><D7AA>Ϊָ<CEAA><EFBFBD><EBB9A4>
public:
void SetOperatePar(SObjOperatePar par){m_Par = par;};
bool IsEndStatus();
bool IsStartStatus();
STATUS GetStatus(){return m_Status;};
Dbxy GetDownPoint(){return m_DownPoint;};
protected:
virtual void OperateObj(Dbxy StartPt,Dbxy EndPt){};
void SaveDownPoint(CPoint point);
void SaveDownPoint(Dbxy point);
void SavePreMovePt(CPoint point){m_PreMovePt = point;};
bool HasPreMovePt();
void ClearFirstPoint();
void AddCreatCommand();
void ToNextStatus();
void AddObject(CObjBase *pMarkObject);
void CreatOpSimulateObj();
void XorRedrawOpSimulateObj(CDC* pDC);
void OpSimulateObj(SObjOperatePar &par);
protected:
CObjContainer m_TmpObjContainer;//<2F><>ʱobj <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
STATUS m_Status;//<2F><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD>ʲô<CAB2><C3B4><EFBFBD><EFBFBD>
Dbxy m_DownPoint;//<2F><><EFBFBD><EFBFBD>µĵ<C2B5>
CPoint m_PreMovePt;//<2F><>һ<EFBFBD><D2BB><EFBFBD>ƶ<EFBFBD>λ<EFBFBD><CEBB>
bool m_bFirstMove;//<2F><><EFBFBD>ڱ<EFBFBD><DAB1>ǵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ƶ<EFBFBD>
CObjPline m_OpSimulateObjBak;//<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ԭʼ<D4AD><CABC><EFBFBD><EFBFBD>
CObjPline m_OpSimulateObj;//<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
SObjOperatePar m_Par;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};