Polygon.h
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:3k
源码类别:
绘图程序
开发平台:
Visual C++
- // Polygon.h: interface for the CPolygon class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_POLYGON_H__2EA7B4DD_FF91_42F8_B490_61B2564DCCF8__INCLUDED_)
- #define AFX_POLYGON_H__2EA7B4DD_FF91_42F8_B490_61B2564DCCF8__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "Shape.h"
- class CPolygon : public CShape
- {
- DECLARE_SERIAL(CPolygon)
- /////////////////////////////////////
- public:
- public:
- CPolygon();
- CPolygon(COLORREF color,int penWidth,float angle);
- CPolygon(CPolygon * const pPolygon);
- virtual ~CPolygon();
- public:
- //virtual operations
- virtual void Serialize( CArchive& );
- virtual void SetPtData(CArray<float,float>& flArrayX,CArray<float,float>& flArrayY);
- virtual void GetPtData(CArray<float,float>& flArrayX,CArray<float,float>& flArrayY);
- virtual void Draw(CDC *pDC,COLORREF color,COLORREF fillColor,int penWidth);
- virtual void DrawPoints(CDC *pDC,COLORREF color);
- virtual void DrawPointsCutTo(CDC *pDC,COLORREF color,CFlRect m_rectFrom,CRect m_rectTo);
- virtual int IsPointinRegion(POINT point);
- virtual void CreatGraph(CArray<CPoint,CPoint>& ptArray,int nPenWidth,COLORREF color,COLORREF fillColor,SHAPE_FILLSTYLE nStyle=_shape_none_fill);
- virtual void CreatGraph(CArray<float,float>& flArrayX,CArray<float,float>& flArrayY,int nPenWidth,COLORREF color,COLORREF fillColor,SHAPE_FILLSTYLE nStyle=_shape_none_fill);
- virtual void DrawCutToRect(CDC *pDC,COLORREF color,COLORREF fillColor,int penWidth,CFlRect m_rectFrom,CRect m_rectTo);
- virtual void Move(CDC *pDC,float stepx,float stepy);
- virtual void PartMove(CDC *pDC,float PrevX,float PrevY,float CurX,float CurY);
- virtual void Rotate(CDC *pDC,float CX,float CY,float flAngle);
- virtual void Magnify(CDC *pDC,float CX,float CY,float flScale);
- //在矩形内上下反转
- virtual void TopToBottom(CDC* pDC,CRect rect);
- //在矩形内左右反转
- virtual void LeftToRight(CDC* pDC,CRect rect);
- virtual CShape* GetCopy();
- virtual void ExPort(FILE* outStream);//增加导出txt功能时用
- virtual void ImPort(FILE* InStream);
- virtual CString GetNameString();
- virtual GRAPH_SHAPE_TYPE GetShapeKind(){
- return _shape_Polygon;
- }
- virtual void RefreshData(bool bRefresh);
- virtual int IsInRect(CRect rect);
- virtual CRect GetBoundaryRect();
- virtual CPoint GetCenterPoint();
- virtual int GetPtState(float flx,float fly,float flRate);
- virtual float GetSelectLineRate();
- //Begin of deletion
- //For Project GraphSoft,delete by FNST)Xiagongli 2004.3.31
- //virtual int GetPointNum(){
- // return 4;
- //}
- //end of deletion
- protected:
- ////////////////////
- private:
- //save(start)
- CArray<float,float> m_flArrayx;
- CArray<float,float> m_flArrayy;
- //save(end)
- //not save(start)
- //temp(start)
- CArray<float,float> m_flArrayxTemp;
- CArray<float,float> m_flArrayyTemp;
- //temp(end)
- //not save(end)
- };
- #endif // !defined(AFX_POLYGON_H__2EA7B4DD_FF91_42F8_B490_61B2564DCCF8__INCLUDED_)