QGlobalObj.cpp
资源名称:QGIS.rar [点击查看]
上传用户:oybseng
上传日期:2015-04-27
资源大小:7831k
文件大小:3k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // QGlobalObj.cpp: implementation of the CQGlobalObj class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "..StdAfx.h"
- #include "..includeQGlobalObj.h"
- #include "..includeQCoordSys.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CQGlobalObj::CQGlobalObj()
- {
- g_nPixelsPerInchX = 1;
- g_fEffectiveDistance = 1;
- g_nPixelsPerInchY = 1;
- g_CurBackgroundColor = RGB(0,0,0);//全局变量当前背景色
- g_nCurMapMode = R2_NOT;
- g_uNewlineChar = '$';
- g_pCoordSysObj = NULL;
- }
- CQGlobalObj::CQGlobalObj(int nPixelIsPerInchX,int nPixelIsPerInchY, double fEffectiveDistance,COLORREF crCurBackgroundColor,COLORREF crCurPenColor,COLORREF crBrushColor,int nCurMapMode,unsigned char uNewLineChar,CQCoordSys * pSys)
- {
- g_nCurMapMode = nCurMapMode;
- g_nPixelsPerInchX = nPixelIsPerInchX;
- g_nPixelsPerInchY = nPixelIsPerInchY;
- g_fEffectiveDistance = fEffectiveDistance;
- g_CurBackgroundColor = crCurBackgroundColor;
- g_CurPenColor = crCurPenColor;
- g_CurBackgroundColor = crBrushColor;
- g_uNewlineChar = uNewLineChar;
- g_pCoordSysObj = pSys;
- }
- CQGlobalObj::CQGlobalObj(CQGlobalObj & glObj)
- {
- g_nCurMapMode = glObj.g_nCurMapMode;
- g_nPixelsPerInchX = glObj.g_nPixelsPerInchX;
- g_nPixelsPerInchY = glObj.g_nPixelsPerInchY;
- g_fEffectiveDistance = glObj.g_fEffectiveDistance;
- g_CurBackgroundColor = glObj.g_CurBackgroundColor;
- g_CurPenColor = glObj.g_CurPenColor;
- g_CurBackgroundColor = glObj.g_CurBrushColor;
- g_uNewlineChar = glObj.g_uNewlineChar;
- g_pCoordSysObj = glObj.g_pCoordSysObj;
- }
- void CQGlobalObj::Copy(CQGlobalObj & glObj)
- {
- g_nCurMapMode = glObj.g_nCurMapMode;
- g_nPixelsPerInchX = glObj.g_nPixelsPerInchX;
- g_nPixelsPerInchY = glObj.g_nPixelsPerInchY;
- g_fEffectiveDistance = glObj.g_fEffectiveDistance;
- g_CurBackgroundColor = glObj.g_CurBackgroundColor;
- g_CurPenColor = glObj.g_CurPenColor;
- g_CurBackgroundColor = glObj.g_CurBrushColor;
- g_uNewlineChar = glObj.g_uNewlineChar;
- g_pCoordSysObj = glObj.g_pCoordSysObj;
- }
- CQGlobalObj & CQGlobalObj::operator = (CQGlobalObj & glObj)
- {
- if(&glObj == this)
- return *this;
- g_nCurMapMode = glObj.g_nCurMapMode;
- g_nPixelsPerInchX = glObj.g_nPixelsPerInchX;
- g_nPixelsPerInchY = glObj.g_nPixelsPerInchY;
- g_fEffectiveDistance = glObj.g_fEffectiveDistance;
- g_CurBackgroundColor = glObj.g_CurBackgroundColor;
- g_CurPenColor = glObj.g_CurPenColor;
- g_CurBackgroundColor = glObj.g_CurBrushColor;
- g_uNewlineChar = glObj.g_uNewlineChar;
- g_pCoordSysObj = glObj.g_pCoordSysObj;
- return *this;
- }
- CQGlobalObj::~CQGlobalObj()
- {
- }