Polygon.h
资源名称:CAD2006.rar [点击查看]
上传用户:ckg1000
上传日期:2013-01-26
资源大小:630k
文件大小:2k
源码类别:
CAD
开发平台:
Visual C++
- // Polygon.h: interface for the CPolygon class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_POLYGON_H__392610C9_A69D_4CFE_A0BD_A7A13714FC7D__INCLUDED_)
- #define AFX_POLYGON_H__392610C9_A69D_4CFE_A0BD_A7A13714FC7D__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "Trigon.h"
- #include "Shape.h"
- extern enum STATUS;
- class CPolygon : public CShape
- {
- public:
- void SetAngle(int angle);
- bool SelectOnePt(CDC *pDC,CPoint point);
- void SetPosBorder( POINT* point );
- POINT* GetPosBorder();
- void SetPosEnd(CPoint point);
- void SetPosBegin(CPoint point);
- CPoint GetPosEnd();
- CPoint GetPosBegin();
- void SetSide(int side);
- void SetBorder(int i);
- CPolygon();
- virtual ~CPolygon();
- virtual void OnLbuttondown(CDC *pDC,CPoint point);
- virtual void Onmousemove(CDC *pDC,CPoint point);
- int Distance(POINT Pt1, POINT Pt2);
- void CalculateTopPt(POINT PtArray[], int nRadius);
- void Draw(CDC *pDC,POINT topPt[], POINT OldTopPt[]);
- void Update(CDC *pDC);
- bool IsOnPolygon(POINT curPt);
- void DrawRound(CDC *pDC,COLORREF colorRound = RGB(255,0,0) );
- bool Select(CDC *pDC,CPoint point);
- void Move(CDC *pDC,CPoint point);
- void Mirror(CDC *pDC,CPoint point);
- void Zoom(CDC *pDC,CPoint point);
- void Rotate(CDC *pDC,CPoint point);
- POINT CalRotatePt(POINT ptCenter,POINT ptPos,double dbAngle);
- POINT GetMirPt(const POINT& ptBegin, const POINT& ptEnd,POINT ptCur);
- void DrawMirLine(CDC *pDC,POINT MirBegPt, POINT MirEndPt);
- void KillMirLine(CDC *pDC);
- void OnMirLBtnDn(CDC *pDC,CPoint point);
- POINT CaleSignPt(POINT centPt, POINT orderPt);
- void Delete(CDC *pDC);
- static int m_nSide; //边数
- static int m_angle;
- POINT m_centPt; //中心点
- POINT *m_topPt; //指向的各顶点
- POINT m_endPt;
- POINT m_oldPt;
- int m_Radius; //半径
- POINT m_MirCentPt; //镜像后的中心点
- POINT *m_MirTopPt; //镜像后指向的各顶点
- POINT m_MirBegPt; //镜像直线起点
- POINT m_MirEndPt;
- /* COLORREF m_colorPen; //边框色
- COLORREF m_colorBrush; //背景色
- int m_PenStyle; //画笔样式
- int m_PenWidth; //画笔宽度*/
- STATUS m_status;
- };
- #endif // !defined(AFX_POLYGON_H__392610C9_A69D_4CFE_A0BD_A7A13714FC7D__INCLUDED_)