Ellipse.h
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:3k
源码类别:
绘图程序
开发平台:
Visual C++
- // Ellipse.h: interface for the CEllipse class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_ELLIPSE_H__D4BD362E_2010_4806_97A1_98C579C3C57D__INCLUDED_)
- #define AFX_ELLIPSE_H__D4BD362E_2010_4806_97A1_98C579C3C57D__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "Shape.h"
- class CEllipse : public CShape
- {
- DECLARE_SERIAL(CEllipse)
- /////////////////////////////////////
- public:
- public:
- CEllipse();
- CEllipse(COLORREF color,int penWidth,float angle);
- CEllipse(CEllipse * const pEllipse);
- ~CEllipse();
- 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_Ellipse;
- }
- 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:
- void BreEllipse(CDC *pDC,float xc ,float yc,float fla,float flb,COLORREF color,double angle=0,int nPenWidth=1);
- void FillEllipse(CDC *pDC,float xc ,float yc,float fla,float flb,double angle);
- ////////////////////
- private:
- //save(start)
- float m_fla;
- float m_flb;
- float m_flCenterx;
- float m_flCentery;
- //save(end)
- //not save(start)
- //temp(start)
- float m_flaTemp;
- float m_flbTemp;
- float m_flCenterxTemp;
- float m_flCenteryTemp;
- float m_flAnglePrev;
- //temp(end)
- //not save(end)
- };
- #endif // !defined(AFX_ELLIPSE_H__D4BD362E_2010_4806_97A1_98C579C3C57D__INCLUDED_)