Files
envi-code/SourceCode/Code2026/tg_shs/inc/Mep/EasyOverlapEntity.h
T

53 lines
2.1 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
#if !defined(__EASYOVERLAPENTITY_H__)
2026-09-28 15:28:50 +08:00
#define __EASYOVERLAPENTITY_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define OFFSET_SIZE 3.0
class CEasyOverlapEntity
{
public:
CEasyOverlapEntity();
virtual ~CEasyOverlapEntity();
CEasyOverlapEntity& operator =(CEasyOverlapEntity& entSource);
struct SEasyPartEntityData
{
AcGeLineSeg3d line;
2026-10-04 00:04:20 +08:00
double dSectionHeight; // 圆形截面下,此成员代表直径
2026-09-28 15:28:50 +08:00
double dSectionWidth;
AcGeVector3d vtNml;
BOOL bCircle;
};
BOOL IsIntersectedWith(const CEasyOverlapEntity& entOther, AcGePoint3d& ptOverlap);
BOOL IsOverlapped(const SEasyPartEntityData& sPart1, const SEasyPartEntityData& sPart2,
AcGePoint3d& ptOverlap);
void AddDataPartment(const AcGePoint3d& ptS, const AcGePoint3d& ptE,
const double dSectionHeight, const double dSectionWidth,
const AcGeVector3d& vtNml, const BOOL bCircle);
BOOL IsConnecttingWith(const AcDbObjectId id) const;
2026-10-04 00:04:20 +08:00
// 调用前确保vtDir不为0
2026-09-28 15:28:50 +08:00
double EntityPartLengthInDir(const SEasyPartEntityData& sPart, const AcGeVector3d& vtDir);
void BulidLineSegArray(const SEasyPartEntityData& sPart, CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg);
BOOL GetOverlapPoint(const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg1,
const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg2, AcGePoint3d& ptOverlap);
BOOL GetOverlapPoint(const SEasyPartEntityData sPartForPLine, const SEasyPartEntityData sPartForPts);
BOOL GetOverlapPoint(const SEasyPartEntityData sPart1, const SEasyPartEntityData sPart2,
const AcGeLine3d lineNormal, AcGePoint3d& ptOverlap);
BOOL AIsInB(const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg1,
const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg2, AcGePoint3d& ptOverlap);
void GetSectionPts(const SEasyPartEntityData& sPart, AcGePoint3dArray& arptSection);
void GetProjectedPtArray(const AcGeLine3d& lineNormal, AcGePoint3dArray& arpt);
2026-10-04 00:04:20 +08:00
// 此工具函数使用条件很严格
2026-09-28 15:28:50 +08:00
void DeletePtsBetween(AcGePoint3dArray& arpt);
CArray<SEasyPartEntityData, SEasyPartEntityData&> m_arEntityData;
AcDbObjectId m_idEntity;
BOOL m_bIsHvacEntity;
};
#endif // !defined(__EASYOVERLAPENTITY_H__)