67 lines
1.7 KiB
C++
67 lines
1.7 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TGRegionEx2D 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TGRegionEx2D 声明 任意封闭不自交有效边界线构成的平面联通域
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TGREGIONEX2D_H_
|
|
#define _TGREGIONEX2D_H_
|
|
|
|
#ifndef _TPGECURVE2D_H_
|
|
#include "TPGeCurve2D.h"
|
|
#endif
|
|
|
|
#ifndef _TGREGION2D_H_
|
|
#include "TGRegion2D.h"
|
|
#endif
|
|
|
|
#ifndef _TGOBJECTLIST_H_
|
|
#include "TGObjectList.h"
|
|
#endif
|
|
|
|
#ifndef _TPDLIST_H_
|
|
#include "TPDList.h"
|
|
#endif
|
|
|
|
class TGObject;
|
|
|
|
class GEOAPI TGRegionEx2D:public TGRegion2D
|
|
{
|
|
DECLARE_RUN_TIME_CLASS(TGRegionEx2D)
|
|
public:
|
|
//默认有一个NULL外边界
|
|
TGRegionEx2D();
|
|
TGRegionEx2D(TPGeCurve2D* pCurve,bool bCheck = true);
|
|
TGRegionEx2D(const TPGeCurve2D&c,bool bCheck = true);
|
|
TGRegionEx2D(TGObjectList&oList,bool bCheck = true);
|
|
TGRegionEx2D(const TGRegionEx2D&face);
|
|
TGRegionEx2D(const TGRegion2D&face);
|
|
virtual ~TGRegionEx2D();
|
|
|
|
virtual TPGeCurve2D* GetBoundary(long i) const;
|
|
virtual long GetBoundaryNum() const;
|
|
virtual TGObject* Clone() const;
|
|
|
|
//edit
|
|
//检查有效性
|
|
void SetOutline(TPGeCurve2D*pCurve, bool bCheck = true);
|
|
|
|
//检查有效性,如果不成功,内部自动释放pCurve,无限曲线总要反向
|
|
bool AppendHole(TPGeCurve2D*pCurve, bool bCheck = true);
|
|
|
|
void DelHole(long i);
|
|
TPGeCurve2D* FetchHole(long i);
|
|
void ClearHole();
|
|
void Reset();
|
|
|
|
protected:
|
|
//所有边界线,第一个为外边界,允许为NULL
|
|
TPDList<TPGeCurve2D> curves;
|
|
|
|
};
|
|
#endif
|