Line.h
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:3k
源码类别:
绘图程序
开发平台:
Visual C++
- // Line.h: interface for the CLine class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_LINE_H__45399653_2641_4005_A802_E99F59970D51__INCLUDED_)
- #define AFX_LINE_H__45399653_2641_4005_A802_E99F59970D51__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "Shape.h"
- class CLine : public CShape
- {
- //for serialization
- DECLARE_SERIAL(CLine)
- /////////////////////////////////////
- public:
- CLine();
- CLine(COLORREF color,int penWidth,float angle);
- CLine(CLine * const line);
- virtual ~CLine();
- 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_Line;
- }
- 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 2;
- //}
- //end of deletion
- protected:
- void Draw_DDALine(CPoint ptStart,CPoint ptEnd,CDC *pDC,int penWidth,COLORREF color);
- ////////////////////
- private:
- //save(start)
- float m_flStartx;
- float m_flStarty;
- float m_flEndx;
- float m_flEndy;
- //save(end)
- //not save(start)
- //temp(start)
- float m_flStartxTemp;
- float m_flStartyTemp;
- float m_flEndxTemp;
- float m_flEndyTemp;
- //temp(end)
- //not save(end)
- };
- #endif // !defined(AFX_LINE_H__45399653_2641_4005_A802_E99F59970D51__INCLUDED_)