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.
72 lines
2.0 KiB
C++
72 lines
2.0 KiB
C++
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//功能: 图件外切
|
|
//编程:
|
|
//日期: 2009-7-15
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
#include "Xy.h"
|
|
#include "CurveAnd.h"
|
|
|
|
class AFX_EXT_CLASS CCutOut
|
|
{
|
|
public:
|
|
CCutOut(void);
|
|
virtual ~CCutOut(void);
|
|
|
|
public:
|
|
CXy* GetXY(void);
|
|
|
|
void SetXY(CXy* pXY); //在调用切图之前,必须先设置图件内容
|
|
void SetSourceCurveRange(CCurveEx* pCurveRange); //如果有任意多边形做为剪切区域时,需要指定源曲线,以便判断不进行计算
|
|
|
|
int CutOut(CCurveEx* pCurveRange, CPositionList* values);
|
|
int CutOut(CCurveEx* pCurveRange);
|
|
int CutOutOld(CCurveEx* pCurveRange);
|
|
|
|
CPositionList m_plDel, m_plAdd; //切图完成后,需要删除的元素及已经增加的元素
|
|
double m_dMiniCurveSmoothStep;
|
|
|
|
void ClearList(void);
|
|
void DeleteElement(CPositionList& plDel);
|
|
|
|
protected:
|
|
int CutOutCurveSolid(POSITION pos, CCurveAnd& ca, COne* pSourceOne, CPositionList& plAdd);
|
|
int CutOutCurve (POSITION pos, CCurveAnd& ca, COne* pSourceOne, CPositionList& plAdd);
|
|
|
|
int RemoveFlags(CHowToViewCurve* pvc, UINT nFlagsType);
|
|
CHowToViewCurve* GetSolidHowToViewCurve(CHowToViewCurve* pvc);
|
|
CHowToViewCurve* GetPlineHowToViewCurve(CHowToViewCurve* pvc);
|
|
|
|
protected:
|
|
CCurveEx* m_pSourceCurveRange;
|
|
CXy* m_pXY;
|
|
|
|
private:
|
|
/**
|
|
* 判断两条线前面部分是否重合
|
|
*
|
|
* \param mainCurve
|
|
* \param subCurve
|
|
* \return
|
|
*/
|
|
bool IsCurveStartsWith(const CCurveEx& mainCurve, const CCurveEx& subCurve) const;
|
|
};
|
|
|
|
class AFX_EXT_CLASS CCutIn : public CCutOut
|
|
{
|
|
public:
|
|
CCutIn(void);
|
|
virtual ~CCutIn(void);
|
|
|
|
int CutIn(CCurveEx* pCurveRange);
|
|
|
|
protected:
|
|
int CutInCurveSolid (POSITION pos, CCurveAnd& ca, COne* pSourceOne, CPositionList& plAdd);
|
|
int CutInCurve (POSITION pos, CCurveAnd& ca, COne* pSourceOne, CPositionList& plAdd);
|
|
|
|
BOOL CutInImage(CImageInsert* pImage, CCurveEx* pCurveRange);
|
|
BOOL CutInMesh(CMesh* pMesh, CCurveEx* pCurveRange);
|
|
CCurveEx* GetXorRange(CRect8& rect, CCurveEx* pCurveRange);
|
|
}; |