Files

122 lines
4.6 KiB
C++
Raw Permalink Normal View History

2026-10-04 00:04:20 +08:00
// 暖通变径实现类
2026-09-28 15:28:50 +08:00
//
2026-10-04 00:04:20 +08:00
// ┏━━━━━━━━━━━┓ ┏━┳━━━┳━┓
// ┃ ┃ ┃ ┃ ③┃ ┃
// ③①━━____ ┃ ┃ ┃ ① ┃ ┃
// ┃ ~~~~___ ┃ ┃ ┃ ┃ ┃
// ┗___ ~~~ ━②④ ┃ ┗━②━┛ ┃
// ~~~___ ┃ ┃ / \ ┃
// ~~__ ┃ ┃ / \ ┃
// ~~__ ┃ ┃/ \┃
// ~~┛ ┗━━━━━━━┛
2026-09-28 15:28:50 +08:00
//
2026-10-04 00:04:20 +08:00
// 夹点说明:
// ①: 变径左端点,移动点
// ②: 变径右端点,移动点
// ③: 左端命令激活点/上下命令激活点
// ④: 右端命令激活点
2026-09-28 15:28:50 +08:00
#if !defined(__THIMPHVACREDUCER_H__)
#define __THIMPHVACREDUCER_H__
#include "AecComplexCurveDraw.h"
#include "AecDbObjXDataMap.h"
#include "AecDbEntityBase.h"
class ImpHvacReducer
{
public:
ImpHvacReducer();
virtual ~ImpHvacReducer();
Acad::ErrorStatus Draw3d(AcGiDraw &mode) const;
Acad::ErrorStatus Draw2d(AcGiDraw &mode) const;
bool GetInterface(AcArray<AecInterface>& arInfs) const;
Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);
AecEqui::Position ExplainGripIndex(int nIndex) const;
AcGeVector3d normal() const;
void list() const;
void Move3DBuffer(AcDbVoidPtrArray& ar3DBuffer) const;
bool Has3DBuffer() const;
protected:
BOOL MakeCurves(AecComplexCurve& cplCurve) const;
BOOL GetCurvesInSide(AecComplexCurve& compCurve) const;
private:
2026-10-04 00:04:20 +08:00
// 变径是否水平放置
2026-09-28 15:28:50 +08:00
BOOL IsHorzAlignment() const;
2026-10-04 00:04:20 +08:00
// 变径是否垂直放置
2026-09-28 15:28:50 +08:00
BOOL IsVertAlignment() const;
2026-10-04 00:04:20 +08:00
// 变径是否倾斜放置
2026-09-28 15:28:50 +08:00
BOOL IsInclineAlignment() const;
2026-10-04 00:04:20 +08:00
// 是否是单线变径
2026-09-28 15:28:50 +08:00
BOOL IsSingleLine() const;
2026-10-04 00:04:20 +08:00
// 返回两侧端面法向,起始侧面向外
2026-09-28 15:28:50 +08:00
AcGeVector3d GetSectNormal() const;
2026-10-04 00:04:20 +08:00
// 绘制三维图形
void ExplodeRect2Rect3d(AcGiDraw& mode) const; // 方对方
void ExplodeRect2Cir3d(AcGiDraw& mode, BOOL bStartIsRound = FALSE) const; // 方对圆
void ExplodeCir2Rect3d(AcGiDraw& mode) const; // 圆对方
void ExplodeCir2Cir3d(AcGiDraw& mode) const; // 圆对圆
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
// 倾斜变径2D绘制
BOOL MakeIncCir2Cir2DCurves(AecComplexCurve& cplCurve, int &nType) const; // 圆对圆
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
// 水平构建二维图形 nType:外轮廓还是内部线, 0:外轮廓, 1内部线
BOOL MakeRect2Rect2DCurves(AecComplexCurve& cplCurve, int &nType) const; // 方对方
BOOL MakeRect2Cir2DCurves(AecComplexCurve& cplCurve, int &nType, BOOL bStartIsRound = FALSE) const; // 方对圆
BOOL MakeCir2Rect2DCurves(AecComplexCurve& cplCurve, int &nType) const; // 圆对方
BOOL MakeCir2Cir2DCurves(AecComplexCurve& cplCurve, int &nType) const; // 圆对圆
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
// 垂直构建二维图形 nType:外轮廓还是内部线, 0:外轮廓, 1内部线
BOOL MakeRect2Rect2DCurvesVer(AecComplexCurve& cplCurve, int &nType) const; // 方对方
BOOL MakeRect2Cir2DCurvesVer(AecComplexCurve& cplCurve, int &nType, BOOL bStartIsRound = FALSE) const; // 方对圆
BOOL MakeCir2Rect2DCurvesVer(AecComplexCurve& cplCurve, int &nType) const; // 圆对方
BOOL MakeCir2Cir2DCurvesVer(AecComplexCurve& cplCurve, int &nType) const; // 圆对圆
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
// 获得外轮廓点
2026-09-28 15:28:50 +08:00
void GetOutVertex(AcGePoint3dArray& arPoint, ESection eStart, ESection eEnd) const;
void GetOutVertex2(AcGePoint3dArray& arPoint, bool bGetStartVertex) const;
2026-10-04 00:04:20 +08:00
// 获取边线、中线,端线宽
2026-09-28 15:28:50 +08:00
double GetEdgeLineWidth() const;
double GetCentLineWidth() const;
double GetEndLineWidth() const;
2026-10-04 00:04:20 +08:00
// 法兰出头边,现在法兰单独连接,不需要了。
2026-09-28 15:28:50 +08:00
double GetPlusEdge() const;
2026-10-04 00:04:20 +08:00
// vtEnd:末向量, dOffset::偏心距离, dPlus:法兰边
2026-09-28 15:28:50 +08:00
AcGePoint3d GetEndPtAuto();
2026-10-04 00:04:20 +08:00
// 角度法获取末点 dAngle:变径两边形成的角度
2026-09-28 15:28:50 +08:00
AcGePoint3d GetEndPtByangle();
2026-10-04 00:04:20 +08:00
// 长度法获取末点 dLen:变径在末端法向上的距离长度
2026-09-28 15:28:50 +08:00
AcGePoint3d GetEndPtByLen();
2026-10-04 00:04:20 +08:00
// 获取两端最大尺寸差
2026-09-28 15:28:50 +08:00
double GetMaxSizeSub();
BOOL GetInterfaceSizeData(int nIndex, AecInterface& inf) const;
BOOL DrawMesh(AcGiDraw &mode,const Adesk::UInt32 rows,const Adesk::UInt32 columns,const AcGePoint3d* pVertexList) const;
BOOL DrawShell(AcGiDraw &mode,const Adesk::UInt32 nbVertex,const AcGePoint3d* pVertexList,const Adesk::UInt32 faceListSize,const Adesk::Int32* pFaceList) const;
public:
AecDbObjXDataMap* m_pXDataMap;
AecDbEntityBase* m_pOwnerEnt;
AcDbObjectId m_idDashLayer;
AcDbObjectId m_idCenterLayer;
AcDbObjectId m_idDoubleLayer;
AcDbObjectId m_idDoubleLnType;
2026-10-04 00:04:20 +08:00
mutable AcDbVoidPtrArray m_ar3DDrableBufPtrs_;//临时缓存
2026-09-28 15:28:50 +08:00
};
#endif // !defined(__THIMPHVACREDUCER_H__)