QLineObj.h
资源名称:QGIS.rar [点击查看]
上传用户:oybseng
上传日期:2015-04-27
资源大小:7831k
文件大小:4k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // QLineObj.h: interface for the CQLineObj class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "QBaseObj.h"
- #include "QPointArray.h"
- #include "QCoordSys.h"
- #if !defined(AFX_QLINEOBJ_H__B550BECE_CA9D_4562_8068_7731453D7E3F__INCLUDED_)
- #define AFX_QLINEOBJ_H__B550BECE_CA9D_4562_8068_7731453D7E3F__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- //////////////////////////////////////////
- ///***************CQGIS****************///
- ///类 名:CQLineObj
- ///基 型:CQBaseObj
- ///说 明:线类型
- ///***************CQGIS****************///
- //////////////////////////////////////////
- class AFX_EXT_CLASS CQLineObj : public CQBaseObj
- {
- public:
- CQLineObj();
- virtual ~CQLineObj();
- CQLineObj(CQLineObj & lObj);
- void Copy(CQLineObj & lObj); //以基类对象作为参数
- BOOL IsClosed(); //获取是否
- void SetLineClosed(BOOL bClosed);//设置线对象的封闭状态
- static CQLineObj * Create(CQPointArray & ptArray); //由点集创建线对象
- //显示图元
- //m_nDrawMode为下列值之一
- //R2_BLACK , //R2_COPYPEN , //R2_MASKNOTPEN
- //R2_MASKPEN //R2_MASKPENNOT //R2_MERGENOTPEN
- //R2_MERGEPEN //R2_MERGEPENNOT //R2_NOP
- //R2_NOT ///R2_NOTCOPYPEN //R2_NOTMASKPEN
- //R2_NOTMERGEPEN //R2_NOTXORPEN //R2_WHITE //R2_XORPEN
- virtual void Display(CQCoordSys * pSys,CDC * pDC,int nDrawMode,int nSpecialMode,COLORREF * pColor);
- virtual void Move(double dx,double dy); //移动线对象
- virtual void Rotate(CQPoint & pt,double & fAngleDegree); //旋转线对象
- //镜像操作 0-Y轴镜像1-X轴镜像3-原点镜像
- virtual void Mirror(int nMirrorType,CQPoint & ptOrign,CQLineObj * pNewLine);
- virtual void GetBoundingRect(CBoundaryRect * pRect); // 计算线对象的边界矩形
- virtual BOOL Select(CQCoordSys * pSys,CBoundaryRect & rect); // 框选
- virtual BOOL Select(CQCoordSys * pSys,CQPoint & pt,double fEffactDistance);
- virtual void Serialize(CArchive& ar); // 线图元的序列化
- virtual void XFlex(double dcp_x,double dFlex); //按照X轴进行缩放
- // 所有图元y坐标的按照中心点y坐标和缩放倍数缩放,dFlex>1会放大,dFlex<1会缩小 /
- virtual void YFlex(double dcp_y,double dFley);
- virtual CString VarToStr();
- virtual void CalculateBoundary(CBoundaryRect * pRect = 0 /* = 0 */);
- double GetLineLength(); //获取线条长度
- void SetShowPointFlag(BOOL bShowPt); // 设置显示点的状态
- BOOL GetShowPointFlag(); // 获取是否显示点的状态
- void SetStartNodeID(long lStartID); //设置起始结点ID
- void SetEndNodeID(long lEndID); //设置终止结点ID
- void SetLeftAreaID(long lLeftID); //设置左多边形的ID
- void SetRightAreaID(long lRightID); //设置右多边形ID
- long GetStartNodeID();
- long GetEndNodeID();
- long GetLeftAreaID();
- long GetRightAreaID();
- long GetPtInWndport(CQCoordSys * pSys);
- // 线条抽稀
- void PtListBeThin(double dThinScale);
- //设置样条曲线的类型
- inline void SetSplineType(int nSplineType);
- //获取样条曲线的类型
- inline int GetSplineType() const;
- void CalculateDisplayPtlist(); //计算折线显示时候的点阵
- virtual void WriteToFile(CFile * pFile);
- virtual void ReadFromFile(CFile * pFile);
- inline void SetElevation(double fEle);
- double GetElevation() const;
- public:
- CQPointArray m_PtList; //构成线对象的所有点
- CQPointArray m_ptListDisplay; //显示用的点数组
- protected:
- BOOL m_bClosed; //是否圈闭
- BOOL m_bShowPt; //是否显示线条的端点
- double m_fElevation; //线条的高程信息
- ////线条样式: 0-普通线条; 1-插值曲线; 2-二次B样条; 3-三次B样条
- int m_nSplineType;
- protected:
- //拓扑信息存储
- long m_lStartNode; //开始节点ID
- long m_lEndNode; //结束节点ID
- long m_lLeftArea; //左边区域ID
- long m_lRightArea; //右边区域ID
- CBoundaryRect m_Boundary; //直线的边界矩形对象
- };
- #endif // !defined(AFX_QLINEOBJ_H__B550BECE_CA9D_4562_8068_7731453D7E3F__INCLUDED_)