You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/Module/GeoSigmaDraw/GraphItemTransform.cpp

59 lines
1.2 KiB
C++

#include "stdafx.h"
#include <gdiplus.h>
#include <DrawModel/Curve.h>
#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;
}