Trigon.h
资源名称:CAD2006.rar [点击查看]
上传用户:ckg1000
上传日期:2013-01-26
资源大小:630k
文件大小:2k
源码类别:
CAD
开发平台:
Visual C++
- // Trigon.h: interface for the CTrigon class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_TRIGON_H__06700922_C919_4A62_BE02_033B4EC679E2__INCLUDED_)
- #define AFX_TRIGON_H__06700922_C919_4A62_BE02_033B4EC679E2__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- static int m_angle = 30;
- #include "Shape.h"
- enum STATUS { NoClicked, FirstClicked, SecondClicked, ThirdClicked};
- class CTrigon : public CShape
- {
- public:
- void KillRound(CDC *pDC);
- void SetAngle(int angle);
- void Delete(CDC *pDC);
- void SetPosEnd(CPoint point);
- void SetPosCenter(CPoint point);
- void SetPosBegin(CPoint point);
- CPoint GetPosEnd();
- CPoint GetPosCenter();
- CPoint GetPosBegin();
- CTrigon();
- virtual ~CTrigon();
- virtual void OnLbuttondown(CDC *pDC,CPoint point);
- virtual void Onmousemove(CDC *pDC,CPoint point);
- virtual void Draw(CDC *pDC);
- void DrawOnSedPtDown(CDC *pDC);
- int Distance(POINT Pt1, POINT Pt2);
- bool IsOnTrigon(POINT curPt);
- void DrawRound(CDC *pDC,COLORREF colorRound = RGB(255,0,0));
- bool Select(CDC *pDC,CPoint point);
- bool SelectOnePt(CDC *pDC,CPoint point);
- void DrawMove(CDC *pDC,POINT FirstPt, POINT SecondPt, POINT ThirdPt,
- POINT FirstOldPt, POINT SecondOldPt, POINT ThirdOldPt);
- void Move(CDC *pDC,CPoint point);
- POINT GetMirPt(const POINT& ptBegin, const POINT& ptEnd,POINT ptCur);
- void OnMirLBtnDn(CDC *pDC,CPoint point);
- void DrawMirLine(CDC *pDC,POINT MirBegPt, POINT MirEndPt);
- void KillMirLine(CDC *pDC);
- void Mirror(CDC *pDC,CPoint point);
- void Update(CDC *pDC);
- void Zoom(CDC *pDC,CPoint point);
- void Rotate(CDC *pDC,CPoint point);
- POINT CalRotatePt(POINT ptCenter,POINT ptPos,double dbAngle);
- POINT CaleSignPt(POINT centPt, POINT orderPt);
- protected:
- POINT m_firstPt;
- POINT m_secondPt;
- POINT m_thirdPt;
- bool blntemp; //保存镜像点状态
- POINT m_oldPt;
- POINT m_FirstMirPt; //镜像后的点
- POINT m_SecondMirPt;
- POINT m_ThirdMirPt;
- POINT m_MirBegPt; //镜像直线起点
- POINT m_MirEndPt;
- bool KILLRECT;
- STATUS m_status;
- };
- #endif // !defined(AFX_TRIGON_H__06700922_C919_4A62_BE02_033B4EC679E2__INCLUDED_)