#include "stdafx.h" #include #include #include "SigmaDoc.h" static bool Transform(Gdiplus::REAL* matrix, NBase::CPositionList & selectionSet, CSigmaDoc * pDoc); bool GraphItemTransform(Gdiplus::Matrix * pMat, CPositionList & selectionSet, CSigmaDoc * pDoc) { if (pMat == NULL || pDoc == NULL) return false; Gdiplus::REAL elements[6]; memset(elements,0,sizeof(Gdiplus::REAL)*6); if(pMat->IsIdentity())//单位矩阵 return true; if(pMat->GetElements(elements)!= Gdiplus::Ok) { return false; } return Transform(elements, selectionSet, pDoc); } static bool Transform(Gdiplus::REAL* matrix, NBase::CPositionList & selectionSet, CSigmaDoc * pDoc) { COne* pOne; POSITION pos,pt; pos = selectionSet.GetHeadPosition(); if(pos == NULL) return false; while (pos != NULL) { pt = selectionSet.GetNext(pos); pOne=(COne*)pDoc->GetDraw()->GetAt(pt); switch(pOne->GetType()) { case DOUBLEFOX_POINT: pOne->Transform(&pDoc->GetDC(), matrix); break; case DOUBLEFOX_IMAGE: break; default: if(pOne->Transform(&pDoc->GetDC(),matrix)) { //ml.AddTail(pt); //br=TRUE; } break; } } //end while return true; }