UND_ShowPoints.cpp
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:2k
源码类别:

绘图程序

开发平台:

Visual C++

  1. // UND_ShowPoints.cpp: implementation of the CUND_ShowPoints class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "graphsoft.h"
  6. #include "UND_ShowPoints.h"
  7. #include "Core.h"
  8. #include "GraphDefines.h"
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char THIS_FILE[]=__FILE__;
  12. #define new DEBUG_NEW
  13. #endif
  14. //////////////////////////////////////////////////////////////////////
  15. // Construction/Destruction
  16. //////////////////////////////////////////////////////////////////////
  17. CUND_ShowPoints::CUND_ShowPoints()
  18. {
  19. CString str;
  20. str.LoadString(IDS_SHOWPOINTS);
  21. SetTitle(str);
  22. m_pSShowPoints=NULL;
  23. }
  24. CUND_ShowPoints::CUND_ShowPoints(void* pVoid)
  25. {
  26. m_pSShowPoints=NULL;
  27. m_pSShowPoints=(SUNDShowPoints*)pVoid;
  28. CString str;
  29. if(m_pSShowPoints->nShowFlag==0){
  30. str.LoadString(IDS_HIDEPOINTS);
  31. }else{
  32. str.LoadString(IDS_SHOWPOINTS);
  33. }
  34. SetTitle(str);
  35. }
  36. CUND_ShowPoints::~CUND_ShowPoints()
  37. {
  38. if(m_pSShowPoints!=NULL)
  39. delete m_pSShowPoints;
  40. m_pSShowPoints=NULL;
  41. }
  42. void CUND_ShowPoints::Destroy()
  43. {
  44. }
  45. BOOL CUND_ShowPoints::OnEditUndo(CCore *pCore)
  46. {
  47. int nShapeNum=m_pSShowPoints->ArrId.GetSize();
  48. CShape* pShape;
  49. int nShow;
  50. if(m_pSShowPoints->nShowFlag==0){
  51. nShow=1;
  52. }else{
  53. nShow=0;
  54. }
  55. CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
  56. for(int i=0;i<nShapeNum;i++){
  57. pShape=pCore->GetShapeByID(m_pSShowPoints->ArrId.GetAt(i));
  58. pCore->DrawGraph(pShape,FALSE);
  59. pShape->SetDrawPointsFlag(nShow);
  60. pCore->DrawGraph(pShape,TRUE);
  61. }
  62. return TRUE;
  63. }
  64. BOOL CUND_ShowPoints::OnEditRedo(CCore *pCore)
  65. {
  66. int nShapeNum=m_pSShowPoints->ArrId.GetSize();
  67. CShape* pShape;
  68. int nShow=m_pSShowPoints->nShowFlag;
  69. CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
  70. for(int i=0;i<nShapeNum;i++){
  71. pShape=pCore->GetShapeByID(m_pSShowPoints->ArrId.GetAt(i));
  72. pCore->DrawGraph(pShape,FALSE);
  73. pShape->SetDrawPointsFlag(nShow);
  74. pCore->DrawGraph(pShape,TRUE);
  75. }
  76. return TRUE;
  77. }
  78. BOOL CUND_ShowPoints::OutputLog(CCore *pCore) 
  79. //未做
  80. return false; 
  81. }