Files
envi-code/SourceCode/Code2026/inc/AdsXRx/CHole.h
T

139 lines
4.0 KiB
C++
Raw Normal View History

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