#include "stdafx.h" #include "SigmaView.h" #include "SectionDoc.h" #include "ItemArc.h" //此文件指定包含圆弧、弦、扇形接口 static CItemArc * getItemArc(CSigmaView * pView) { CItem * pItem = pView->GetItem(); if (pItem == NULL) return NULL; CItemArc * arcItem = dynamic_cast(pItem); return arcItem; } //type 绘制的图元的类型 0--圆弧 1--弦 2--扇形 extern "C" __declspec(dllexport) int Arc_SetType(CSigmaView * pView, int type) { if (pView == NULL) return -1; CItemArc * pItem = getItemArc(pView); if (pItem == NULL) return -1; if (type == 0) { pItem->SetState(CArc::drawArc); return 1; } else if (type == 1) { pItem->SetState(CArc::drawChord); return 1; } else if (type == 2) { pItem->SetState(CArc::drawPie); return 1; } return -1; }