54 lines
2.1 KiB
C++
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__)
|