QLayerObj.h
资源名称:QGIS.rar [点击查看]
上传用户:oybseng
上传日期:2015-04-27
资源大小:7831k
文件大小:3k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // QLayerObj.h: interface for the CQLayerObj class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "afxtempl.h"
- #include "QBaseObj.h"
- #if !defined(AFX_QLAYEROBJ_H__870D3AE4_EDC2_4DDF_B429_A8855880C61D__INCLUDED_)
- #define AFX_QLAYEROBJ_H__870D3AE4_EDC2_4DDF_B429_A8855880C61D__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- class CBoundaryRect;
- class CQCoordSys;
- class CQSelObjManager;
- class CQLayerObj;
- //////////////////////////////////////////
- ///***************CQGIS****************///
- ///类 名:CQLayerObj
- ///基 型:CObject
- ///说 明:图层类对象
- ///***************CQGIS****************///
- //////////////////////////////////////////
- class AFX_EXT_CLASS CQLayerObj : public CObject
- {
- public:
- CQLayerObj();
- virtual ~CQLayerObj();
- CQLayerObj(CQLayerObj & Layer);
- void Copy(CQLayerObj & Layer);
- public:
- void SetLayerID(long lLayerID);
- long GetLayerID();
- void SetMapID(long lMapID);
- long GetMapID();
- void SetLayerName(CString szLayerName);
- CString GetLayerName();
- void SetLayerDis(CString szLayerDis);
- CString GetLayerDis();
- void SetShowFlag(BOOL bShowed);
- BOOL GetShowFlag();
- void SetDeleteFlag(BOOL bDeleted);
- BOOL GetDeleteFlag();
- void SetEditFlag(BOOL bCanEdit);
- BOOL GetEditFlag();
- BOOL IsEmpty();
- void InitLayerBoundary(); // 初始化图层对象的边界矩形
- void CalculateBoundary(CBoundaryRect * pRect);
- void AddObject(CQBaseObj * pObj);
- void RemoveObject(CQBaseObj * pObj); // 没有移除指针
- void Deleteobject(CQBaseObj * pObj);
- inline int GetObjCount();
- CQBaseObj * GetObj(int nIndex); //根据索引好获取对象指针
- CQBaseObj * FindObj(long lObjID); //根据对象的ID查找其对象指针
- inline int GetObjIndex(long lObjID); //根据对象的ID查找对象在列表中的索引
- inline void ClearAll(); //清空图元列表
- CString VarToStr();
- virtual void Save(const char * sz); //存储图层
- BOOL Open(const char * sz); //打开图层
- virtual void Serialize(CArchive & ar);//序列化
- CBoundaryRect * GetBoundary();
- virtual void Display(CQCoordSys * pCoorSys,CDC *pDC,int nDrawMode, int nSpecialMode,COLORREF* pColor);
- virtual void Move(double dx,double dy);
- virtual void Rotate(CQPoint & pt,double fRotateAngle);
- //点选对象
- virtual CQBaseObj * Select(CQSelObjManager * pSelObjs,CQCoordSys *pCoorSys,CQPoint & pt, double fEffectedDistance);
- virtual int Select(CQSelObjManager * pSelObjs,CQCoordSys * pCoorSys,CBoundaryRect & rectSel);
- virtual CQBaseObj * SingleSelect(CQSelObjManager * pSelObjs,CQCoordSys * pCoordSys,CQPoint & pt,double fEffecttedDistance,int nSelectObjType = 0);
- void WriteObjsToFile(CFile * pFile);
- void ReadObjsFromFile(CFile * pFile);
- virtual void WriteToFile(CFile * pFile);
- virtual void ReadFromFile(CFile * pFile);
- void DeleteAllObjsHavaDeletedflag();
- long SetLayerIDByRand();
- void XFlex(double dcp_x,double dFlex);
- void YFlex(double dcp_y,double dFley);
- protected:
- CTypedPtrArray<CObArray,CQBaseObj *> m_ObjList; //存放实体对象的列表
- long m_lLayerID; // 当前图层ID
- long m_lMapID; // 当前图幅ID
- CString m_szLayerName; // 图层名称
- CString m_szLayerDis; // 图层说明信息
- BOOL m_bShowed; // 显示状态
- BOOL m_bDeleted; // 删除状态
- BOOL m_bCanEdited; // 编辑状态
- CBoundaryRect m_Boundary;
- };
- #endif // !defined(AFX_QLAYEROBJ_H__870D3AE4_EDC2_4DDF_B429_A8855880C61D__INCLUDED_)