Files
envi-code/SourceCode/Code2026/tg_shs/inc/Mep/OverlapEntity.h
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

54 lines
2.1 KiB
C++

#if !defined(__OVERLAPENTITY_H__)
#define __OVERLAPENTITY_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define OFFSET_SIZE 3.0
class COverlapEntity
{
public:
COverlapEntity();
virtual ~COverlapEntity();
COverlapEntity& operator =(COverlapEntity& entSource);
struct SPartEntityData
{
AcGeLineSeg3d line;
double dSectionHeight; // 圆形截面下,此成员代表直径
double dSectionWidth;
AcGeVector3d vtNml;
BOOL bCircle;
};
BOOL IsIntersectedWith(const COverlapEntity& entOther, AcGePoint3d& ptOverlap);
BOOL IsOverlapped(const SPartEntityData& sPart1, const SPartEntityData& 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;
// 调用前确保vtDir不为0
double EntityPartLengthInDir(const SPartEntityData& sPart, const AcGeVector3d& vtDir);
void BulidLineSegArray(const SPartEntityData& sPart, CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg);
BOOL GetOverlapPoint(const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg1,
const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg2, AcGePoint3d& ptOverlap);
BOOL GetOverlapPoint(const SPartEntityData sPartForPLine, const SPartEntityData sPartForPts);
BOOL GetOverlapPoint(const SPartEntityData sPart1, const SPartEntityData sPart2,
const AcGeLine3d lineNormal, AcGePoint3d& ptOverlap);
BOOL AIsInB(const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg1,
const CArray<AcGeLineSeg3d, AcGeLineSeg3d&>& arLineSeg2, AcGePoint3d& ptOverlap);
void GetSectionPts(const SPartEntityData& sPart, AcGePoint3dArray& arptSection);
void GetProjectedPtArray(const AcGeLine3d& lineNormal, AcGePoint3dArray& arpt);
// 此工具函数使用条件很严格
void DeletePtsBetween(AcGePoint3dArray& arpt);
CArray<SPartEntityData, SPartEntityData&> m_arEntityData;
AcDbObjectId m_idEntity;
BOOL m_bIsHvacEntity;
};
#endif // !defined(__OVERLAPENTITY_H__)