RoundRect.h
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:4k
源码类别:
绘图程序
开发平台:
Visual C++
- // RoundRect.h: interface for the CRoundRect class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_ROUNDRECT_H__738DF60E_5192_4326_A226_37022B681F75__INCLUDED_)
- #define AFX_ROUNDRECT_H__738DF60E_5192_4326_A226_37022B681F75__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "Shape.h"
- class CRoundRect : public CShape
- {
- DECLARE_SERIAL(CRoundRect)
- /////////////////////////////////////
- public:
- public:
- CRoundRect();
- CRoundRect(COLORREF color,int penWidth,float angle);
- CRoundRect(CRoundRect * const pRectangle);
- virtual ~CRoundRect();
- 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_RoundRect;
- }
- 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 RoundRectangle(CDC *pDC,CPoint LeftTop,CPoint RightBottom,COLORREF color);
- int CircleStateToRect(CRect rect,CPoint ptCenter,float flRadius);
- ////////////////////
- private:
- //save(start)
- float m_flFirstx;
- float m_flFirsty;//(m_flLTx,m_flLTy)-----左键按下第一点
- float m_flSecondx;
- float m_flSecondy;//(m_flRTx,m_flRTy)-----左键按下第二点
- float m_flThirdx;
- float m_flThirdy;//(m_flRBx,m_flRBy)-----左键按下第三点
- //save(end)
- //not save(start)
- //temp(start)
- float m_flFirstxTemp;
- float m_flFirstyTemp;
- float m_flSecondxTemp;
- float m_flSecondyTemp;
- float m_flThirdxTemp;
- float m_flThirdyTemp;
- float m_flForthx;//用来保存第四个坐标点的信息,主要的用处在编辑图形时为了减少误差积累
- float m_flForthy;
- float m_flForthxTemp;//用来保存第四个坐标点的信息,主要的用处在编辑图形时为了减少误差积累
- float m_flForthyTemp;
- //temp(end)
- //not save(end)
- };
- #endif // !defined(AFX_ROUNDRECT_H__738DF60E_5192_4326_A226_37022B681F75__INCLUDED_)