Files
envi-code/SourceCode/Code2026/inc/ImpHvacOffset.h
T
2026-09-28 15:28:50 +08:00

167 lines
5.1 KiB
C++
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 暖乙子弯实现类
//
// 乙子弯示意图(角接类型, 其他类型详见管件类型.doc):
//
// 水平放置: 侧面垂直放置: 正面垂直放置:
// ┃ ┏━━━━━┓ ┏━━━━━┓
// ┃\ ┃ ┃ ┃ ┃
// ┃ \ ┃ ③ ┃ ┃ ┃
// ③ ① \ ┃ ① ┃ ③ ① ② ④
// ┃ \ ┃ ┃ ┃ ┃
// ┃ \ ┃ ┃ ┃ ┃
// \ ┃ ┣━━━━━┫ ┗━━━━━┛
// \ ┃ ┃ ┃
// \ ┃ ┃ ④ ┃
// \ ② ④ ┃ ② ┃
// \ ┃ ┃ ┃
// \┃ ┗━━━━━┛
//
//
// 夹点说明:
// ①②: 移动点
// ③④: 命令点,用于引出新管线
#if !defined(AFX_THIMPHVACOFFSET_H__)
#define AFX_THIMPHVACOFFSET_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "AecComplexCurveDraw.h"
#include "AcGiDraw.h"
class AecDbObjXDataMap;
class AecDbEntityBase;
class ImpHvacOffset
{
public:
ImpHvacOffset();
virtual ~ImpHvacOffset();
Acad::ErrorStatus Draw3d(AcGiDraw &mode) const;
Acad::ErrorStatus Draw2d(AcGiDraw &mode) const;
bool GetInterface(AcArray<AecInterface>& arInfs) const;
AecEqui::Position ExplainGripIndex(int nIndex) const;
Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);
void list() const;
AcGeVector3d normal() const;
void Move3DBuffer(AcDbVoidPtrArray& ar3DBuffer) const;
bool Has3DBuffer() const;
protected:
BOOL MakeCurves(AecComplexCurve& compCurve) const;
BOOL GetCurvesInSide( AecComplexCurve& compCurve ) const;
// 是否水平放置
BOOL IsHorzAlignment() const;
// 是否侧面垂直放置
BOOL IsSideVertAlignment() const;
// 是否正面垂直放置
BOOL IsFaceVertAlignment() const;
// 是否是单线
BOOL IsSingleLine() const;
// 是否绘制中心线
BOOL IsBaseLine() const;
// 管向量
AcGeVector3d StartVect() const;
AcGeVector3d EndVect() const;
/*
0━7
┃ \
┃ \
S ┃ \
┃ \
┃ \
1━2 6━ 5
\ ┃
\ ┃
\ ┃
\ ┃ E
\ ┃
3━4
*/
void GetMidKeyPoints( AcGePoint3dArray &ptArr, BOOL bSingleLine = FALSE) const;
// 创建关键的两面16个点
BOOL GetTwoSideKeyPoints( AcGePoint3dArray &ptUpArr, AcGePoint3dArray &ptDownArr, BOOL bSingleLine = FALSE) const;
// 得到双弧类型中心弧线多段线各点
// 如有变径,在起始端变
// 0-7点说明:起始端、起始弧点、起始弧中点、中点、末端弧中点、末端弧点、末端点
/*
0----1\
--\--2--\
--\
 3
\--
\--4--\
5----6
*/
BOOL GetArcBaseKeyPt(AcGePoint3dArray &ptKeyArr) const;
// 以中线线弧点为基准,得到双弧类型两边多段线各点(左右从起始法向看),推到方法同弯头
// bSingleLine:是否是单线模式,用于polyline和3Dface,而单线三维也要求正常显示
BOOL GetArcTwoSideKeyPt(AcGePoint3dArray &ptArrLeft, AcGePoint3dArray &ptArrRight, BOOL bSingleLine = FALSE) const;
// 得到所有按分度角划分后的点
void GetAllMinAnglePt(AcGePoint3dArray &ptArrLeftPart, AcGePoint3dArray &ptArrRightPart, BOOL bSingleLine = FALSE) const;
// 是否能够绘制正确的乙子弯
BOOL IsCanDraw() const;
// 获取边线、中线/端部线宽
double GetEdgeLineWidth() const;
double GetCentLineWidth() const;
double GetEndLineWidth() const;
// 3D 绘制
Acad::ErrorStatus DrawRectArcuate3d(AcGiDraw &mode) const ; // 矩形双弧
Acad::ErrorStatus DrawRectLinear3d(AcGiDraw &mode) const ; // 矩形角接
Acad::ErrorStatus DrawCircleArcuate3d(AcGiDraw &mode) const ; // 圆形双弧
Acad::ErrorStatus DrawCircleLinear3d(AcGiDraw &mode) const ; // 圆形角接
// 2D Curve 绘制
BOOL MakeHorizArcuate2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 双弧放置
BOOL MakeHorizLinear2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 角接放置
BOOL MakeSideVertRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 侧垂直矩形放置
BOOL MakeSideVertCircle2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 侧垂直圆形放置
BOOL MakeFaceVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 正垂直放置
AcDbObjectId GetBaseLayerId() const;
// 获取角度双弧为半圆弧弧度,角接为倾斜角度
double GetAngle() const;
// 通过起始点及角度计算末点
AcGePoint3d GetEndPointByAngle();
// 通过起始点及长度参数等计算末点
AcGePoint3d GetEndPtByLength();
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;
mutable AcDbVoidPtrArray m_ar3DDrableBufPtrs_;//临时缓存
};
#endif // !defined(AFX_THIMPHVACOFFSET_H__)