Files
envi-code/SourceCode/Code2026/tg_shs/inc/geo/THole.h
T

139 lines
3.8 KiB
C++
Raw Normal View History

2026-09-28 15:28:50 +08:00
//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : THole.h
// = Version : ver2.0
// = Author : xlc
// = CreateDate : 2002-09-09
// = Description: 类的声明
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#ifndef _THOLE_H_
#define _THOLE_H_
#ifndef _TACDBFACEPTR_H_
#include "TAcDbFacePtr.h"
#endif
#ifndef _TDPTRLIST_H_
#include "TDPtrList.h"
#endif
#ifndef _TGGETRIANGLE_H_
#include "TGGeTriangle.h"
#endif
#ifndef _TGGEPOLY2D_H_
#include "TGGePoly2D.h"
#endif
#ifndef _TGGEPOLYGONEX_H_
#include "TGGePolygonEx.h"
#endif
#ifndef _TBPLOYGON_H_
#include "TBPloygon.h"
#endif
#ifndef _TACDBENTITYPTR_H_
#include "TAcDbEntityPtr.h"
#endif
class TBNode;
class GEOAPI THole
{
public:
THole();
virtual ~THole();
//构造边界线链表,用基线描述边界,第一个链表为外边,其余为内边
BOOL ConstructEdgeList();
//单连通化\然后三角化,返回3DFACE
BOOL SimplifyToFace(TAcDbFacePtrList& face3DList);
//将空从左到右\从下到上排序
BOOL SortHolesInXY();
//将外边界变为逆时针,内边界顺时针,并且按X从小到大排序
BOOL SortNodesAlongClockWise();
TBNode* GetADivideNode(TBPloygon* pEdge,TBPloygon* pEdge1,TBNode* pNode);
//在边界pEdge上选择一个适当的顶点,它和pNode的连线不与任何其他边界相交(包括pEdge和pEdge1)
//因此可将多边形一分为二
//创建孔洞
void CreateHoles();
//单连通化\然后三角化,返回3DFACE
BOOL SimplifyToTriangle(TDPtrList<TGGeTriangle> &lstRes);
//构造边界线链表,用基线描述边界,第一个链表为外边,其余为内边
BOOL ConstructEdgeList(const TDPtrList<TGGePoly2D> &lstHole);
//构造边界线链表,用基线描述边界,第一个链表为外边,其余为内边
BOOL ConstructEdgeList(const TDPtrList<TGGePolygonEx> &lstHole);
//构造边界线链表,用基线描述边界,第一个链表为外边,其余为内边
BOOL ConstructEdgeList(const TGGePoly2D &out, const TDPtrList<TGGePoly2D> &lstHole);
//构造边界线链表,用基线描述边界,第一个链表为外边,其余为内边
BOOL ConstructEdgeList(const TGGePolygonEx &out, const TDPtrList<TGGePoly2D> &lstHole);
//构造边界线链表,用基线描述边界,第一个链表为外边,其余为内边
BOOL ConstructEdgeList(const TGGePolygonEx &out, const TDPtrList<TGGePolygonEx> &lstHole);
BOOL GetTriangles(TDPtrList<TGGeTriangle> &lstRes);
BOOL FormatEdgeList();
BOOL FormatEdgeListAuto();
public:
//区域各边链表
TBPolygonList m_RegionLst;
//基线插入基点
AcGePoint3d m_insertPt;
private:
BOOL CreateReference(AcGePoint3d org,CString& BlockTableRecordName,double rotAng,CString layerName = "");
//构造块名
BOOL BlockName(CString& blockName);
//根据entLst创建块
BOOL CreateBlock(CEntityList& entLst,CString& blockName,AcDbObjectId& blockId,AcGePoint3d org);
//返回层layerName的记录ID
AcDbObjectId GetLayerRecordId(CString layerName);
//只删除C3DFface对象,不删除其AcDbFace对象
void ReleaseC3DFaceList(TAcDbFacePtrList& c3dfaceLst);
//只删除TAcDbEntityPtr对象,不删除其AcDbEntity对象
void ReleaseCEntityList(CEntityList& centityLst);
//将链表中的所有实体的层设置为layerName
void SetLayerOfEntities(CEntityList& entLst,CString layerName, int colorNum = 7);
//层layerName是否存在于数据库中
BOOL IsLayerExistInDb(CString layerName);
//设置层,如果不存在则新建。
BOOL SetLayer(CString layerName, int colorNum = 0);
//新建层layerName。
BOOL NewLayer(CString& layerName, int colorNum = 0, BOOL bFreeze = 0);
//将TAcDbFacePtrList转换为CEntityList
void C3DFaceList2EntityList(TAcDbFacePtrList& c3dFaceLst,CEntityList& entLst);
//将层冻结
BOOL SetLayerFrozen(CString layerName, bool bFreeze = 1);
//将层关闭
BOOL SetLayerOff(CString layerName, bool bOff = 1);
};
#endif