Files
envi-code/SourceCode/Code2026/tg_shs/inc/Mep/EasyOverlapEntity.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(__EASYOVERLAPENTITY_H__)
#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;
double dSectionHeight; // 圆形截面下,此成员代表直径
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;
// 调用前确保vtDir不为0
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);
// 此工具函数使用条件很严格
void DeletePtsBetween(AcGePoint3dArray& arpt);
CArray<SEasyPartEntityData, SEasyPartEntityData&> m_arEntityData;
AcDbObjectId m_idEntity;
BOOL m_bIsHvacEntity;
};
#endif // !defined(__EASYOVERLAPENTITY_H__)