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/InterfaceAddCurve.cpp

36 lines
977 B
C++

#include "stdafx.h"
#include "SigmaView.h"
#include "ActionAddItem.h"
//////////////////////////////////////////////////////////////////////////
// Ìí¼ÓÒ»ÌõÏß
//////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport)
int AddCurve(CSigmaView* pView, double arrayXY[], int ptCount, LPCTSTR curveName, LPCTSTR layerName)
{
CXy * pXy = pView->m_pDoc->m_pXy;
CLayer * pLayer = pXy->FindAddLayer(layerName);
CPointList PointList;
for (int i = 0; i < ptCount; i++)
{
dfPoint point;
point.x0 = arrayXY[i * 2];
point.y0 = arrayXY[i * 2 + 1];
PointList.AddTail(point);
}
CCurveEx* pCurve = new CCurveEx();
pCurve->SetPoints(PointList, 2);
pCurve->SetName(curveName);
POSITION pos = pXy->AddElement(pCurve, DOUBLEFOX_CURVE);
COne* pOne = pXy->GetAt(pos);
pOne->SetLayer(pLayer);
pView->m_pDoc->SetActionItem(new CActionAddItem(pView->m_pDoc, IDS_STRING_ACTION_ADD, pOne));
PointList.RemoveAll();
return 1;
}