QGlobalObj.cpp
上传用户:oybseng
上传日期:2015-04-27
资源大小:7831k
文件大小:3k
源码类别:

GDI/图象编程

开发平台:

Visual C++

  1. // QGlobalObj.cpp: implementation of the CQGlobalObj class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "..StdAfx.h"
  5. #include "..includeQGlobalObj.h"
  6. #include "..includeQCoordSys.h"
  7. #ifdef _DEBUG
  8. #undef THIS_FILE
  9. static char THIS_FILE[]=__FILE__;
  10. #define new DEBUG_NEW
  11. #endif
  12. //////////////////////////////////////////////////////////////////////
  13. // Construction/Destruction
  14. //////////////////////////////////////////////////////////////////////
  15. CQGlobalObj::CQGlobalObj()
  16. {
  17. g_nPixelsPerInchX = 1;
  18. g_fEffectiveDistance = 1;
  19. g_nPixelsPerInchY = 1;
  20. g_CurBackgroundColor = RGB(0,0,0);//全局变量当前背景色
  21. g_nCurMapMode = R2_NOT;
  22. g_uNewlineChar = '$';
  23. g_pCoordSysObj = NULL;
  24. }
  25. CQGlobalObj::CQGlobalObj(int nPixelIsPerInchX,int nPixelIsPerInchY, double fEffectiveDistance,COLORREF crCurBackgroundColor,COLORREF crCurPenColor,COLORREF crBrushColor,int nCurMapMode,unsigned char uNewLineChar,CQCoordSys * pSys)
  26. {
  27. g_nCurMapMode = nCurMapMode;
  28. g_nPixelsPerInchX = nPixelIsPerInchX;
  29. g_nPixelsPerInchY = nPixelIsPerInchY;
  30. g_fEffectiveDistance = fEffectiveDistance;
  31. g_CurBackgroundColor = crCurBackgroundColor;
  32. g_CurPenColor = crCurPenColor;
  33. g_CurBackgroundColor = crBrushColor;
  34. g_uNewlineChar = uNewLineChar;
  35. g_pCoordSysObj = pSys;
  36. }
  37. CQGlobalObj::CQGlobalObj(CQGlobalObj & glObj)
  38. {
  39. g_nCurMapMode = glObj.g_nCurMapMode;
  40. g_nPixelsPerInchX = glObj.g_nPixelsPerInchX;
  41. g_nPixelsPerInchY = glObj.g_nPixelsPerInchY;
  42. g_fEffectiveDistance = glObj.g_fEffectiveDistance;
  43. g_CurBackgroundColor = glObj.g_CurBackgroundColor;
  44. g_CurPenColor = glObj.g_CurPenColor;
  45. g_CurBackgroundColor = glObj.g_CurBrushColor;
  46. g_uNewlineChar = glObj.g_uNewlineChar;
  47. g_pCoordSysObj = glObj.g_pCoordSysObj;
  48. }
  49. void CQGlobalObj::Copy(CQGlobalObj & glObj)
  50. {
  51. g_nCurMapMode = glObj.g_nCurMapMode;
  52. g_nPixelsPerInchX = glObj.g_nPixelsPerInchX;
  53. g_nPixelsPerInchY = glObj.g_nPixelsPerInchY;
  54. g_fEffectiveDistance = glObj.g_fEffectiveDistance;
  55. g_CurBackgroundColor = glObj.g_CurBackgroundColor;
  56. g_CurPenColor = glObj.g_CurPenColor;
  57. g_CurBackgroundColor = glObj.g_CurBrushColor;
  58. g_uNewlineChar = glObj.g_uNewlineChar;
  59. g_pCoordSysObj = glObj.g_pCoordSysObj;
  60. }
  61. CQGlobalObj & CQGlobalObj::operator = (CQGlobalObj & glObj)
  62. {
  63. if(&glObj == this)
  64. return *this;
  65. g_nCurMapMode = glObj.g_nCurMapMode;
  66. g_nPixelsPerInchX = glObj.g_nPixelsPerInchX;
  67. g_nPixelsPerInchY = glObj.g_nPixelsPerInchY;
  68. g_fEffectiveDistance = glObj.g_fEffectiveDistance;
  69. g_CurBackgroundColor = glObj.g_CurBackgroundColor;
  70. g_CurPenColor = glObj.g_CurPenColor;
  71. g_CurBackgroundColor = glObj.g_CurBrushColor;
  72. g_uNewlineChar = glObj.g_uNewlineChar;
  73. g_pCoordSysObj = glObj.g_pCoordSysObj;
  74. return *this;
  75. }
  76. CQGlobalObj::~CQGlobalObj()
  77. {
  78. }