#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& arLineSeg); BOOL GetOverlapPoint(const CArray& arLineSeg1, const CArray& 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& arLineSeg1, const CArray& arLineSeg2, AcGePoint3d& ptOverlap); void GetSectionPts(const SPartEntityData& sPart, AcGePoint3dArray& arptSection); void GetProjectedPtArray(const AcGeLine3d& lineNormal, AcGePoint3dArray& arpt); // 此工具函数使用条件很严格 void DeletePtsBetween(AcGePoint3dArray& arpt); CArray m_arEntityData; AcDbObjectId m_idEntity; BOOL m_bIsHvacEntity; }; #endif // !defined(__OVERLAPENTITY_H__)