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.
91 lines
1.9 KiB
C++
91 lines
1.9 KiB
C++
#include "Stdafx.h"
|
|
#include "SigmaView.h"
|
|
#include "ItemSelect.h"
|
|
#include "ItemCutOut.h"
|
|
#include "ItemCutIn.h"
|
|
|
|
extern "C" __declspec(dllexport)
|
|
int Cut_CutOutByRect(CSigmaView * pView)
|
|
{
|
|
if (pView == 0)
|
|
return -1;
|
|
|
|
if (pView->m_pDoc == 0)
|
|
return -1;
|
|
|
|
CItemSelect * itemSelect = pView->m_pDoc->GetSelectItem();
|
|
if (itemSelect == 0)
|
|
return -1;
|
|
|
|
CRect8 rect = itemSelect->GetRect();
|
|
NItem::CItemCutOut itemCutOut(pView->m_pDoc);
|
|
itemCutOut.CutOutRectangle(rect);
|
|
|
|
return 1;
|
|
}
|
|
|
|
extern "C" __declspec(dllexport)
|
|
int CutOut_GetCountOfPickup(CSigmaView * pView)
|
|
{
|
|
if (pView == NULL)
|
|
return -1;
|
|
|
|
CItem * item = pView->GetItem();
|
|
if (item == NULL)
|
|
return -1;
|
|
|
|
NItem::CItemCutOut * itemCutOut = dynamic_cast<NItem::CItemCutOut *>(item);
|
|
if (itemCutOut == NULL)
|
|
return -1;
|
|
|
|
return itemCutOut->GetCountOfPickup();
|
|
}
|
|
|
|
extern "C" __declspec(dllexport)
|
|
int Cut_CutInByRect(CSigmaView * pView)
|
|
{
|
|
if (pView == 0)
|
|
return -1;
|
|
|
|
if (pView->m_pDoc == 0)
|
|
return -1;
|
|
|
|
CItemSelect * itemSelect = pView->m_pDoc->GetSelectItem();
|
|
if (itemSelect == 0)
|
|
return -1;
|
|
|
|
CRect8 rect = itemSelect->GetRect();
|
|
NItem::CItemCutIn itemCutIn(pView->m_pDoc);
|
|
itemCutIn.CutInRectangle(rect);
|
|
|
|
return 1;
|
|
}
|
|
|
|
extern "C" __declspec(dllexport)
|
|
int CutIn_GetCountOfPickup(CSigmaView * pView)
|
|
{
|
|
if (pView == NULL)
|
|
return -1;
|
|
|
|
CItem * item = pView->GetItem();
|
|
if (item == NULL)
|
|
return -1;
|
|
|
|
NItem::CItemCutIn * itemCutIn = dynamic_cast<NItem::CItemCutIn *>(item);
|
|
if (itemCutIn == NULL)
|
|
return -1;
|
|
|
|
return itemCutIn->GetCountOfPickup();
|
|
}
|
|
extern "C" __declspec(dllexport)
|
|
int CutOutFile(LPCTSTR rangeFile, LPCTSTR sourceFile, LPCTSTR destFile)
|
|
{
|
|
ImageCut cut;
|
|
return cut.CutOutFile(rangeFile, sourceFile, destFile);
|
|
}
|
|
extern "C" __declspec(dllexport)
|
|
int CutOutFileByLine(BYTE * buffWellPath, int bufLen, LPCTSTR sourceFile, LPCTSTR destFile)
|
|
{
|
|
ImageCut cut;
|
|
return cut.CutOutFileByLine(buffWellPath, bufLen, sourceFile, destFile);
|
|
} |