// 暖三通实现类 // // 三通示意图(一般类型, 其他类型详见管件类型.doc): // // 水平放置: 侧面垂直放置: // ┏━━━━━━━━━━━━━━━━┓ ┏━━━━━┓ // ┃ ┃ ┃ ③ ┃ // ┃ ┃ ┃ ┃ // ④①━━━━━━━━━━━━━━━━②⑤ ┃ ① ┃ // ┃ ┃ ┃ ┃ ┃ // ┃ ┃ ┃ ┃ ┃ // ┗━━━━━┓ ┃ ┏━━━━┛ ┣━━━━━┫ // ┃ ┃ ┃ ┃ ┃ // ┃ ┃ ┃ ┃ ┃ // ┃ ┃ ┃ ┃ ┃ // ┃ ┃ ┃ ┃ ┃ // ┗━━③━━┛ ┗━━②━━┛ // ⑥ ④ // // 水平放置夹点说明: // ①②③: 三通移动点 // ④⑤⑥: 三通命令点,用于引出新管线 // 垂直放置夹点说明: // ①②: 三通移动点 // ③④: 三通命令点,用于引出新管线 #pragma once #include "AcGiDraw.h" #include "AecComplexCurveDraw.h" class AecDbEntityBase; class AecDbObjXDataMap; class ImpHvacTee { public: ImpHvacTee(); virtual ~ImpHvacTee(); Acad::ErrorStatus Draw2d(AcGiDraw &mode) const; Acad::ErrorStatus Draw3d(AcGiDraw &mode) const; bool GetInterface(AcArray& arInfs) const; Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform); AecEqui::Position ExplainGripIndex( int nIndex ) const; AcGeVector3d normal() const; void list() const; // 获取中心点,即中心线/单线模式三条管线交点 AcGePoint3d GetCenterPt() const; void Move3DBuffer(AcDbVoidPtrArray& ar3DBuffer) const; bool Has3DBuffer() const; protected: BOOL MakeCurves(AecComplexCurve& cplCurve) const; BOOL GetCurvesInSide(AecComplexCurve& compCurve) const; BOOL IsValidConst(AecDbObjXDataMap* pXMap) const; // 获取斜接的圆形口二维关键点 BOOL GetInclineCirPts(AcGePoint3dArray &arPts) const; // 获取倾斜的斜接三通圆形口在投影面上的二维关键点 BOOL GetInclineCirPts2d(AcGePoint3dArray &arPts) const; // 获取投影椭圆上的点集 void GetArcPoint(AcDbPolyline &polyLine, AcGePoint3dArray &ptArcArr) const; // 获取承插及普通的圆形口二维关键点 BOOL GetInsertCirPts(AcGePoint3dArray &arPts) const; // 获取承插及普通的圆形口在消隐面上的关键点 BOOL GetInsertCirPtsOnHidePlan(AcGePoint3dArray &arPts) const; // 求交点 BOOL GetIntersectWith(AcGePoint3d &pt1,AcGePoint3d &pt2,AcGeVector3d &vt1,AcGeVector3d &vt2,AcGePoint3d &ptIntersect) const; BOOL GetIntersectWith(AcGePoint3d &pt1,AcGePoint3d &pt2,AcGePoint3d &pt3,AcGePoint3d &pt4,AcGePoint3d &ptIntersect) const; // 是否水平放置 BOOL IsHorzAlignment() const; // 是否侧面垂直放置 BOOL IsSideVertAlignment() const; // 是否正面垂直放置 BOOL IsFaceVertAlignment() const; // 是否是单线风管 BOOL IsSingleLine() const; // 是否绘制中心线 BOOL IsBaseLine() const; // 是否倾斜放置 BOOL IsInclineAlignment() const; // 是否倾斜垂直放置(可处理斜接三通正面垂直情况) BOOL IsIncVertAlignment() const; // 三管向量 AcGeVector3d StartVect() const; AcGeVector3d EndVect() const; AcGeVector3d BranVect() const; // 获取标准基准投影面,2D相关绘制不在此面上的点都投影到此面上 AcGePlane GetStdPrjPlan(const AcGePoint3d &ptOnPlan) const; // 辅助添加点函数,减少程序行数 int AutoAppendPt(AecComplexCurve &cplCurve, AecEqui::AecCurveElement &cplEle, const AcGePoint3d &ptS, const AcGePoint3d &ptMid, const AcGePoint3d &ptE) const; int AutoAppendPt(AecComplexCurve &cplCurve, AecEqui::AecCurveElement &cplEle, const AcGePoint3d &ptS, const AcGePoint3d &ptMid, const AcGePoint3d &ptE, double dWidth) const; // 获取三通关键的9个点,在中截面上,标高同首尾实际点,不适合类类型返回FALSE BOOL GetSectMidKeyPt(AcGePoint3dArray &ptArr, BOOL bDefault = FALSE) const; // 在GetRectMidKeyPt中调用的工具函数,获取截面图形中弧段上的点并修正弧段开始点 BOOL GetPtOnLowArc(const AcGePoint3d& ptOnPort1, AcGePoint3d& ptExtend1, const double dPortSize1, const AcGePoint3d& ptOnPort2, AcGePoint3d& ptExtend2, const double dPortSize2, const double dCR, AcGePoint3d& ptOnCurve) const; // 获取截面三通上下两面关键的18个点,上下各9个一一对应 bDefault=TRUE为3D模式 BOOL GetTwoSideKeyPt(AcGePoint3dArray &pptUpArr, AcGePoint3dArray &pptDownArr, BOOL bDefault = FALSE) const; // 获取三通上下两面接口所在的6个点 BOOL GetInterfaceKeyPt(AcGePoint3dArray &ptUpArr, AcGePoint3dArray &ptDownArr) const; // 求给出的直线的两点求交点 Adesk::Boolean GetIntersectPointByPts( AcGePoint3d ptL1Sta, AcGePoint3d ptL1End, AcGePoint3d ptL2Sta, AcGePoint3d ptL2End, AcGePoint3d &ptInersect ) const; // 绘制阀门 void DrawValve(AecComplexCurve& cplCurve, AcGePoint3d ptStart) const; // 3D 矩形截面绘制子函数 BOOL DrawSpecial3d(AcGiDraw &mode) const; // 不规则的三通的绘制 void DrawOrthoRect3d(AcGiDraw &mode) const; // 普通 void DrawInsertRect3d(AcGiDraw &mode) const; // 承插 void DrawInclineRect3d(AcGiDraw &mode) const; // 斜接 void DrawYShapeRect3d(AcGiDraw &mode) const; // Y型 void DrawVShapeRect3d(AcGiDraw &mode) const; // V型 void DrawTShapeRect3d(AcGiDraw &mode) const; // T型 void DrawArcuateRect3d(AcGiDraw &mode) const; // 圆角 void DrawArcuateIntubRect3d(AcGiDraw &mode) const; // 插管圆角 // 工具函数,仅在3d矩形截面绘制子函数中调用 void DepartArcByAngle(const AcGePoint3d& ptStart, const AcGePoint3d& ptOnCurve, const AcGePoint3d& ptEnd, double dAng, AcGePoint3dArray& arptPtsOnCur, const AcGeVector3d& vtNormal, int iNum = 0) const; int FixPtsData(AcGePoint3dArray& arpt, int iPos, double dAng, const AcGeVector3d& vtNormal) const; // 3D 圆形截面绘制子函数 void DrawOrthoCircle3d(AcGiDraw &mode) const; void DrawInsertCircle3d(AcGiDraw &mode) const; void DrawInclineCircle3d(AcGiDraw &mode) const; void DrawYShapeCircle3d(AcGiDraw &mode) const; void DrawVShapeCircle3d(AcGiDraw &mode) const; void DrawTShapeCircle3d(AcGiDraw &mode) const; void DrawArcuateCircle3d(AcGiDraw &mode) const; void DrawInsertBranchCircle3d(AcGiDraw &mode) const; void DrawInclineBranchCircle3d(AcGiDraw &mode) const; // 2D Curve绘制,分散函数控制. nOutOrIn: 0:外围 1:内部线 BOOL CusTomMakeCurves( AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 矩形截面 2D Curve绘制 BOOL MakeOrthoRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 普通 BOOL MakeInsertRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 承插 BOOL MakeInsertIntubRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const;// 承插(插管式) BOOL MakeInclineRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 斜接 BOOL MakeYShapeRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // Y型 BOOL MakeVShapeRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // V型 BOOL MakeTShapeRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // T型 BOOL MakeArcuateRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 圆角 BOOL MakeArcuateIntubRect2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const;// 圆角(插管式) // 各种矩形截面三通 水平放置方式下2DCurve绘制, bIntub:是否插管式 BOOL MakeOrthoRectHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 普通 BOOL MakeInsertRectHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn, BOOL bIntub = FALSE) const; // 承插 BOOL MakeInclineRectHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 斜接 BOOL MakeYShapeRectHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // Y型 BOOL MakeVShapeRectHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // V型 BOOL MakeTShapeRectHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // T型 BOOL MakeArcuateRectHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn, BOOL bIntub = FALSE) const; // 圆角 //承插 -- 圆型 BOOL MakeInsertBranchCircle2DCurves(AecComplexCurve &cplCurve, const int &nOutOrIn) const; //承插 -- 圆型 bool GetInsertBranchCircle2DInfs(AcArray &arInfs) const; //斜接 -- 圆型 BOOL MakeInclineBranchCircle2DCurves(AecComplexCurve &cplCurve, const int &nOutOrIn) const; //斜接 -- 圆型 bool GetInclineBranchCircle2DInfs(AcArray &arInfs) const; // 矩形截面三通 侧面垂直放置方式下2DCurve绘制, 基本相同,暂用一个函数(内部区分), BOOL MakeRectSideVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 所有样式 // 矩形截面三通 正面垂直放置方式下2DCurve绘制 基本相同,暂用一个函数(内部区分) BOOL MakeRectFaceVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn, BOOL bIntub = FALSE) const; // 所有样式 // 圆形截面 2D Curve绘制, 圆形各中放置方式基本没有相同画法的,所以一一列出 BOOL MakeOrthoCircle2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 普通 BOOL MakeInsertCircle2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 承插 BOOL MakeInclineCircle2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 斜接 BOOL MakeYShapeCircle2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // Y型 BOOL MakeVShapeCircle2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // V型 // 圆形截面三通 水平放置方式下2DCurve绘制 BOOL MakeOrthoCircleHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 普通 BOOL MakeInsertCircleHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 承插 BOOL MakeInclineCircleHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 斜接 BOOL MakeYShapeCircleHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // Y型 BOOL MakeVShapeCircleHoriz2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // V型 // 圆形截面三通 侧面垂直放置方式下2DCurve绘制 BOOL MakeOrthoCircleSideVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 普通 BOOL MakeInsertCircleSideVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 承插 BOOL MakeInclineCircleSideVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 斜接 BOOL MakeYShapeCircleSideVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // Y型 BOOL MakeVShapeCircleSideVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // V型 // 圆形截面三通 正面垂直放置方式下2DCurve绘制 BOOL MakeOrthoCircleFaceVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 普通 BOOL MakeInsertCircleFaceVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 承插 BOOL MakeInclineCircleFaceVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 斜接 BOOL MakeYShapeCircleFaceVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // Y型 BOOL MakeVShapeCircleFaceVert2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // V型 // 圆形截面三通 倾斜放置方式下2DCurve绘制Lixl BOOL MakeOrthoCircleIncline2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 普通 BOOL MakeInclineCircleInc2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn) const; // 斜接 // 得到圆形截面三通,倾斜放置,三通3个端口投影椭圆的内轮廓线到cplCurve,供所有三通绘制各端口投影椭圆端线 BOOL GetAllIncCircleEndEdge2DCurves(AecComplexCurve& cplCurve, const int &nOutOrIn, BOOL bDrawSta = TRUE, BOOL bDrawEnd = TRUE, BOOL bDrawBran = TRUE) const; // 竖直三通:俯视看去,支管和主管边界相交,这种情况下,支管可能遮挡主管,主管可能遮挡支管,需重新计算 BOOL IsNeedMakeAllCurves(AcGePoint3dArray& arPtJudge) const; BOOL GetVShapeCirclePts(AcGePoint3dArray &ptArr) const; void GetArcPoint(AcDbPolyline &polyLine, AcGePoint3dArray &ptArcArr); BOOL GetInterfaceSizeData(int nIndex, AecInterface& pipeInterface) const; // 根据全局设置获取线宽 double GetEdgeLineWidth() const; double GetCentLineWidth() const; double GetEndLineWidth() 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_;//临时缓存 };