// DbDoubleLinePipe.h: interface for the TDbDoubleLinePipe class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_DBDOUBLELINEPIPE_H__33485C04_82F0_4304_ADF9_A82CEC1A599C__INCLUDED_) #define AFX_DBDOUBLELINEPIPE_H__33485C04_82F0_4304_ADF9_A82CEC1A599C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 /*============================================================================* * Copyright(c), 1994-2007, Beijing Tangent Engineering Software Co.Ltd. * 作 者: 沈睿 * 创建时间: 大约在冬季 * 描 述: 双线水管 * 归属项目: 给排水 * 历史记录: 2008-6-26 补头文件注释 =============================================================================*/ #include "DbPipe.h" #include "TGripData.h" #define GRIP_MAXNUM_DBPIPE_DBPIPE 10 // 夹点最大值 class PS_EXP TDbDoubleLinePipe : public TDbPipe { DECLARE_TENTBASE(); ACRX_DECLARE_MEMBERS(TDbDoubleLinePipe); private: static const Adesk::UInt8 g_nVersion; public: TDbDoubleLinePipe(); virtual ~TDbDoubleLinePipe(); protected: Adesk::UInt16 m_iFlange;// 连接类型 0:法兰 1:焊接 double m_nWidth; // 宽度 如果是圆风管,这里是直径 double m_nRate; // 弯头 曲率 double m_nFlangeDn; // 法兰直径 double m_nFlangeThick; // 法兰厚度 double m_nSpare; // 备用 AcDbHardPointerId m_idDoteLayer; static TWT_GRIPAPPDATA s_gripAppData[GRIP_MAXNUM_DBPIPE_DBPIPE]; // cet 2012.11.6 add 保存夹点数据 public: int GetFlange() const { return (int)m_iFlange; } void SetFlange(int iFlange) { assertWriteEnabled(); m_iFlange=(Adesk::UInt16)iFlange; } double GetWidth() const { return m_nWidth; } void SetWidth(double nWidth) { assertWriteEnabled(); m_nWidth = nWidth; } double GetFlangeDn() const { return m_nFlangeDn; } void SetFlangeDn(double nFlangeDn) { assertWriteEnabled(); m_nFlangeDn = nFlangeDn; } double GetFlangeThick() const { return m_nFlangeThick; } void SetFlangeThick(double nFlangeThick) { assertWriteEnabled(); m_nFlangeThick = nFlangeThick; } double GetRate() const { return m_nRate; } void SetRate(double nRate) { assertWriteEnabled(); m_nRate = nRate; } double GetSpare() const { return m_nSpare; } void SetSpare(double nSpare) { assertWriteEnabled(); m_nSpare = nSpare; } void SetDoteLayer(const AcDbObjectId& id) { assertWriteEnabled(); m_idDoteLayer=id; } AcDbObjectId GetDoteLayer() const { return m_idDoteLayer; } // cet 2018.7.10 add 中心线线型 void SetMidLinetype(const AcDbObjectId &idLinetype); void SetMidLinetype(const CString &sLinetypeName); AcDbObjectId MidLinetypeId(bool bLayerWhenNotFound = true) const; CString MidLinetype() const; // cet 2018.6.20 add 双线水管系统名 virtual CString GetPipeSystemName() const; // cet 2012.11.2 add 双线水管连接fitting时,水管一点是否需要连接变径 // 起点 nSide = 0; 终点 nSide = 1; dDn 表示变径另一端大小 bool IsLinkReducing(int nSide) const; // cet 2012.11.2 add 双线水管端点是否连接变径 void SetLinkReducing(int nSide, bool bLink); void GetBrokenCurves(const XCurveSegment &cv,DList &lstRes) const; // 根据夹点索引获得,该索引类型和夹点提示 cet 2012.11.6 add void ExplainGripIndex(int nIndex, bool &bCmd, CString &sTip) const; public: // Override TDbEntity virtual void CopyPropertiesFrom(AcDbEntity *pSrc, unsigned gMatchFlag); virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const; virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const; virtual Acad::ErrorStatus ExplodeOrDraw3d(XExplodeDraw &dc) const; virtual void GetTips(DList &info) const; //取动态属性显示数据 virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const; virtual int GetFirstVersion()const{return 7;} public: // Override AcDbEntity Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode, INT_PTR gsSelectionMark, const AcGePoint3d& ptPick, const AcGePoint3d& lastPoint, const AcGeMatrix3d& viewXform, AcGePoint3dArray& snapPoints, AcDbIntArray& geomIds) const; virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints, AcDbIntArray& osnapModes, AcDbIntArray& geomIds) const; // cet 2012.11.6 add 支持夹点启动绘制命令 #if ADS > 15 virtual Acad::ErrorStatus subGetGripPoints(AcDbGripDataPtrArray& grips, const double curViewUnitSize, const int gripSize, const AcGeVector3d& curViewDir, const int bitflags) const; virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbVoidPtrArray& appData, const AcGeVector3d& offset, const int bitflags); #endif virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*); virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const; virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*); virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const; virtual Acad::ErrorStatus subClose(); virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices, const AcGeVector3d& offset); public:// Override TDbPipePrototype // 派生类可以加入其他的判断条件(如管径等) // 自动增加节点到当前数据库,ids-该节点自动连接的管线,派生类应当重载 virtual AcDbObjectId AddAutoNodeToDb(const XPoint &ptAt,const DList &ids) const; virtual void ResetDrawSpeed();//重新设置显示加速数据 // 考虑遮挡的当前曲线,二维 void GetHideCurve(XCurveSegment& cvHide) const; Acad::ErrorStatus DrawVerPipe2d(XExplodeDraw &dc) const; protected: virtual void DisposeBreak(const XCurveSegment &cv, AcGePoint3dArray &arPoint,const XPoint &ptLoc,double dWidth, double dDistance,const AcGeVector3d &vtDir, DList &lstBreakCurve) const; private: Acad::ErrorStatus MoveGSPointsAt(const AcDbIntArray& indices,const AcGeVector3d& offset,BOOL bGrip); }; #endif // !defined(AFX_DBDOUBLELINEPIPE_H__33485C04_82F0_4304_ADF9_A82CEC1A599C__INCLUDED_)