QPointObj.h
资源名称:QGIS.rar [点击查看]
上传用户:oybseng
上传日期:2015-04-27
资源大小:7831k
文件大小:3k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // QPointObj.h: interface for the CQPointObj class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_QPOINTOBJ_H__3A997543_C024_4387_8FFB_301E0C99CE2C__INCLUDED_)
- #define AFX_QPOINTOBJ_H__3A997543_C024_4387_8FFB_301E0C99CE2C__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "QBaseObj.h"
- #include "AFXTEMPL.H "
- //////////////////////////////////////////
- ///***************CQGIS****************///
- ///类 名:CQPointObj
- ///基 型:CQBaseObj
- ///说 明:点图元类,具有点位坐标
- ///***************CQGIS****************///
- //////////////////////////////////////////
- class AFX_EXT_CLASS CQPointObj : public CQBaseObj
- {
- public:
- CQPointObj();
- CQPointObj(CQPoint & pt);
- CQPointObj(CQPointObj & ptObj);
- void Copy(CQPointObj & pt);
- virtual ~CQPointObj();
- public:
- void SetPointPos(CQPoint & pt);
- void SetPointPos(double dx,double dy);
- CQPoint GetPointPos();
- void GetPointPos(double &dx,double &dy);
- double GetPtElevation() const;
- void SetPtElevation(double fEle);
- public:
- CQPointObj * CutOut(CBoundaryRect * pBox); //矩形 裁剪
- inline void AddArcID(long lID);
- inline long GetArcID(long nIndex);
- inline CArray<long,long> * GetArcArray() ;
- //其他操作
- DECLARE_SERIAL(CQPointObj);
- virtual void Serialize(CArchive& ar);
- //旋转点对象
- virtual void Rotate(CQPoint & pt,double & fAngleDegree);
- //移动点对象
- virtual void Move(double dx,double dy);
- //获取点对象的边界矩形
- virtual void GetBoundingRect(CBoundaryRect * pRect);
- void SetBoundRect(CBoundaryRect & Rect);
- //计算点的边界矩形
- virtual void CalculateBoundary(CBoundaryRect * pRect = NULL);//计算图元的边界矩形
- //点选
- virtual BOOL Select(CQCoordSys * pSys,CQPoint & pt, double fEffectDistance); //点选
- //框选
- virtual BOOL Select(CQCoordSys * pSys,CBoundaryRect & rect); //框选
- //显示子图图元,调用子图的显示函数实现
- //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
- //nSpecialMode
- //0-代表正常显示,此时pColor为空
- //1-代表鼠标选中显示,此时pColor为空
- //2-以特殊颜色显示,此时pColor不能为空
- virtual void Display(CQCoordSys * pSys,CDC * pDC,int nDrawMode,int nSpecialMode,COLORREF * pColor);
- // 所有图元x坐标的按照中心点x坐标和缩放倍数缩放,dFlex>1会放大,dFlex<1会缩小
- virtual void XFlex(double dcp_x,double dFlex);
- // 所有图元y坐标的按照中心点y坐标和缩放倍数缩放,dFlex>1会放大,dFlex<1会缩小
- virtual void YFlex(double dcp_x,double dFlex);
- //写入文件
- virtual void WriteToFile(CFile * pFile);
- //读出文件
- virtual void ReadFromFile(CFile * pFile);
- virtual CString VarToStr(); //将图元的值转换为字符串格式
- private:
- CQPoint m_ptPos;
- double m_fPtElevation; //将点位高程作为一个属性加进来
- CBoundaryRect m_BoundRect;
- //入弧段为正数 进行拓扑操作的设置
- CArray<long,long> * m_pArcList; //通过该接点的弧段ID的列表
- };
- #endif // !defined(AFX_QPOINTOBJ_H__3A997543_C024_4387_8FFB_301E0C99CE2C__INCLUDED_)