UND_Rotate.cpp
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:2k
源码类别:
绘图程序
开发平台:
Visual C++
- // UND_Rotate.cpp: implementation of the CUND_Rotate class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "graphsoft.h"
- #include "UND_Rotate.h"
- #include "Core.h"
- #include "GraphDefines.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CUND_Rotate::CUND_Rotate()
- {
- CString str;
- str.LoadString(IDS_ROTATE);
- SetTitle(str);
- m_pSRotate=NULL;
- }
- CUND_Rotate::CUND_Rotate(void* pVoid)
- {
- m_pSRotate=NULL;
- m_pSRotate=(SUNDRotate*)pVoid;
- CString str;
- str.LoadString(IDS_ROTATE);
- SetTitle(str);
- }
- CUND_Rotate::~CUND_Rotate()
- {
- if(m_pSRotate!=NULL)
- delete m_pSRotate;
- m_pSRotate=NULL;
- }
- void CUND_Rotate::Destroy()
- {
- }
- BOOL CUND_Rotate::OnEditUndo(CCore *pCore)
- {
- int nShapeNum=m_pSRotate->ArrId.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=pCore->GetShapeByID(m_pSRotate->ArrId.GetAt(i));
- pCore->DrawGraph(pShape,FALSE);
- pShape->Rotate(pDC,m_pSRotate->flCX,m_pSRotate->flCY,-(m_pSRotate->flAngle));
- pCore->DrawGraph(pShape,TRUE);
- }
- pCore->m_pDoc->RefreshSelectGraph();
- return TRUE;
- }
- BOOL CUND_Rotate::OnEditRedo(CCore *pCore)
- {
- int nShapeNum=m_pSRotate->ArrId.GetSize();
- CShape* pShape;
- CDC* pDC=CDC::FromHandle(GetDC(pCore->m_pView->GetSafeHwnd()));
- for(int i=0;i<nShapeNum;i++){
- pShape=pCore->GetShapeByID(m_pSRotate->ArrId.GetAt(i));
- pCore->DrawGraph(pShape,FALSE);
- pShape->Rotate(pDC,m_pSRotate->flCX,m_pSRotate->flCY,m_pSRotate->flAngle);
- pCore->DrawGraph(pShape,TRUE);
- }
- pCore->m_pDoc->RefreshSelectGraph();
- return TRUE;
- }
- BOOL CUND_Rotate::OutputLog(CCore *pCore)
- {
- //未做
- return false;
- }