269 lines
14 KiB
C
269 lines
14 KiB
C
#ifndef __TWTDEF_H
|
|
#define __TWTDEF_H
|
|
|
|
//extern TARCH_IMPEXP int DragMovePickSet(PickSet &ss, const TCHAR *pszPrompt, const XPoint &ptBase, XPoint &ptFinal);
|
|
//extern GEOAPI int DragPickSet1(PickSet &ss, XPoint &ptBase);
|
|
|
|
//**********************************************************************
|
|
// 给排水全局变量
|
|
//**********************************************************************
|
|
extern TELAPI BOOL g_bLineTypeByLayer;
|
|
|
|
extern TELAPI double g_nSprinklerRadius, g_nStandPipe2Wall, g_nWellRadius,g_nDoubleDist,g_nValveScale,
|
|
g_nBreakPipeWidth, g_nDrainPtRadius,g_nDnDimDist2Pipe, g_nPipeTextBreak,g_nFeedCircleScale,
|
|
g_nInsBlkRotate, g_nCurPipeWidth, g_nDimCirDiam, g_nElbowRate,g_dDbPipeLineWidth;
|
|
extern TELAPI int g_iDefaultPipeDn, g_iElbowType, g_iVPipeDimStyle, g_iSprinklerDistMod,g_nSinataryDataType;
|
|
extern TELAPI CString g_csInsBlkName, g_csVerticalSectionHead, g_csVerticalSectionHeadFeed;
|
|
//extern TELAPI CString g_csDwbPath, g_csSysPath, g_csLineTypeStyle;
|
|
extern TELAPI double g_nPipeWidth[35];
|
|
extern TELAPI double g_nPipeRadius[35];
|
|
extern TELAPI int g_iPipeMaterial[35];
|
|
extern TELAPI CString g_csPipeDim[35];
|
|
extern TELAPI CString g_csTwtLineType[35];
|
|
extern TELAPI CString g_csPipeName[7];
|
|
extern TELAPI BOOL g_bPipeDouble[35];
|
|
extern TELAPI BOOL g_bIsPipeThick, g_bToolbar, g_bTgOsnap, g_bEquipByScale, g_bBlk3D, g_bIsPipeCanalThick;
|
|
extern TELAPI BOOL g_bIsPipeDimCir, g_bIsFeedPoint, g_bStandPipeArc, g_bDimWellOnlyEle;
|
|
extern TELAPI int g_iDimPipeGradientType, g_iDimShortPipeGradientType, g_iDimPipeLen,g_iDimPipeLinePos,g_iDimPipeBaseLineAng; //室外管线标注样式
|
|
|
|
extern TELAPI int g_iDimWellNamePos, g_iDimWellNameAngle; //井编号距井上下位置
|
|
extern TELAPI double g_dDimWellNameDist; //井编号距离
|
|
extern TELAPI int g_iDimWellEleType, g_iDimWellEleLeadAngle; //管底标注样式
|
|
extern TELAPI int g_nAlignTypeForVPipeDim4; //立管标注样式4中管径的对齐方式 cet 2012-4-19
|
|
extern TELAPI int g_nAlignTypeForWellDim; //井标注对齐方式 0:居中 1:端对齐
|
|
extern TELAPI double g_dWellDimText2Base; //井标注文字距线距离
|
|
extern TELAPI double g_dVPipeDimDn2Label;
|
|
extern TELAPI BOOL g_bIsElevDimChangeByPipeElev; // 单注标高是否随管线标高联动
|
|
|
|
|
|
extern TELAPI int g_nDimPipeGradientType;// 短管坡度标注样式
|
|
extern TELAPI int g_nDimShortPipeGradientType;// 管线管径标注样式
|
|
extern TELAPI int g_nDimPipeDnType;// 短线管径标注样式
|
|
extern TELAPI int g_nDimShortPipeDnType;// 管线管长标注样式
|
|
extern TELAPI int g_nDimShortPipeLenType;// 管线标注分隔符样式
|
|
extern TELAPI int g_nDimPipeLabelType;// 短线标注分隔符样式
|
|
extern TELAPI int g_nDimShortPipeLabelType;// 管线标注排列方式
|
|
extern TELAPI int g_nDimPipeDrawType;
|
|
|
|
|
|
//**********************************************************************
|
|
// 给排水全局变量-标注文字
|
|
//**********************************************************************
|
|
|
|
extern TELAPI CString g_csPipeDnStyle;
|
|
extern TELAPI CString g_csVPipeStyle;
|
|
extern TELAPI CString g_csPipeTextStyle;
|
|
extern TELAPI CString g_csCircleTextStyle;
|
|
extern TELAPI CString g_csSanTextStyle;
|
|
extern TELAPI CString g_csDimWellStyle;
|
|
extern TELAPI CString g_csSheetStyle;
|
|
extern TELAPI CString g_csTwtDimStyle;
|
|
extern TELAPI CString g_csEleDimStyle; ///
|
|
extern TELAPI CString g_csPipeDnChn;
|
|
extern TELAPI CString g_csPipeDnEng;
|
|
extern TELAPI CString g_csVPipeChn;
|
|
extern TELAPI CString g_csVPipeEng;
|
|
extern TELAPI CString g_csPipeTextChn;
|
|
extern TELAPI CString g_csPipeTextEng;
|
|
extern TELAPI CString g_csCircleTextChn;
|
|
extern TELAPI CString g_csCircleTextEng;
|
|
extern TELAPI CString g_csSanTextChn;
|
|
extern TELAPI CString g_csSanTextEng;
|
|
extern TELAPI CString g_csDimWellChn;
|
|
extern TELAPI CString g_csDimWellEng;
|
|
extern TELAPI CString g_csSheetChn;
|
|
extern TELAPI CString g_csSheetEng;
|
|
extern TELAPI CString g_csDimChn;
|
|
extern TELAPI CString g_csDimEng;
|
|
extern TELAPI CString g_csEleDimChn; ///
|
|
extern TELAPI CString g_csEleDimEng; ///
|
|
extern TELAPI double g_nPipeDnHeight;
|
|
extern TELAPI double g_nPipeDnScale;
|
|
extern TELAPI double g_nVPipeHeight;
|
|
extern TELAPI double g_nVPipeScale;
|
|
extern TELAPI double g_nPipeTextHeight;
|
|
extern TELAPI double g_nPipeTextScale;
|
|
extern TELAPI double g_nCircleTextHeight;
|
|
extern TELAPI double g_nCircleTextScale;
|
|
extern TELAPI double g_nSanTextHeight;
|
|
extern TELAPI double g_nSanTextScale;
|
|
extern TELAPI double g_nDimWellHeight;
|
|
extern TELAPI double g_nDimWellScale;
|
|
extern TELAPI double g_nSheetHeight;
|
|
extern TELAPI double g_nSheetScale;
|
|
extern TELAPI double g_nTwtDimHeight;
|
|
extern TELAPI double g_nDimScale;
|
|
extern TELAPI double g_nEleDimHeight; ////
|
|
extern TELAPI double g_nEleDimScale; ////
|
|
|
|
|
|
//**********************************************************************
|
|
// 给排水全局函数
|
|
//**********************************************************************
|
|
TELAPI AcDbObjectId InitTwtTextStyle(const TCHAR *szTextStyle);
|
|
|
|
//快速绘制
|
|
extern AcDbObjectId DrawSysPipeByLayer(XPoint ptStart, XPoint ptEnd, const TCHAR* szLayer, int iLevel=0);
|
|
extern AcDbObjectId DrawPlanPipeByLayer(XPoint ptStart, XPoint ptEnd, const TCHAR* szLayer, int iLevel=0);
|
|
extern AcDbObjectId InsElevation(XPoint pt, const TCHAR* szTextText, const TCHAR*szText);
|
|
extern AcDbObjectId InsValveByName(const TCHAR* szName, XPoint pt, const TCHAR* szPipeLay, BOOL bHorizontal = FALSE);
|
|
extern AcDbObjectId InsValveByName(const TCHAR* szName, XPoint pt, const TCHAR* szPipeLay, XPoint ptPipeS, XPoint ptPipeE);
|
|
extern AcDbObjectId InsEquipmentByName(const TCHAR* szName, XPoint pt, double nAng, const TCHAR* szLayer, BOOL bReversal = FALSE, BOOL bHidePipe = TRUE);
|
|
extern void DrawPLine(XPoint ptStart, XPoint ptEnd, double nWidth = 0.35);
|
|
|
|
TELAPI AcDbObjectId InitPipeLayer(const TCHAR* szLay);
|
|
extern BOOL GetLayerReMark(const TCHAR *szLayer, CString &sRemark);
|
|
|
|
//Get管线信息
|
|
TELAPI TPipeSys::SysType GetPipeSysByLayer(const TCHAR* szLayer);
|
|
TELAPI int GetPipeLayerIdxBySys(TPipeSys::SysType sys);
|
|
extern CString GetPipeLineTypeByIdx(int iLineMode);
|
|
TELAPI CString GetPipeLayerByIdx(int iLayer);
|
|
TELAPI int GetPipeLayerIdxByName(const TCHAR* szLayer);
|
|
TELAPI void GetPipePoint(Entity ent, XPoint &pt1, XPoint& pt2);
|
|
TELAPI void GetPipePoint(Entity ent, XPoint &pt1, XPoint& pt2, XPoint &ptMid);
|
|
extern int GetPipeLineIdxByName(const TCHAR* szLineType);
|
|
extern TPipeSys::SysType GetPipeSys(Entity ent);
|
|
TELAPI CString GetPipeNameBySys(TPipeSys::SysType sys);
|
|
|
|
//extern BOOL IsPipeVertical(Entity ent);
|
|
extern double GetPipeCalcDiameter(AcDbObjectId id);
|
|
extern BOOL Is2PipeParallel(AcDbObjectId id1, AcDbObjectId id2);
|
|
extern BOOL Is2PipeParallel(Entity ent1, Entity ent2);
|
|
|
|
TELAPI Entity GetPipeByPt(XPoint pt, double &nElevation, int &iPipeSys);
|
|
TELAPI void ChangeWellSerial(Entity ent, const TCHAR* szNewName);
|
|
//TELAPI CString GetPipeNameBySys(TPipeSys::SysType sys);
|
|
TELAPI BOOL GetInterPipeLevel(XPoint pt1, XPoint pt2, double nElevation, int &up, int &low);
|
|
|
|
//管线标注
|
|
TELAPI void DoDimPipeDn(Entity ent, int iRadius, const TCHAR* szType, double nHeight, BOOL bIsDown, BOOL bModifyPos = FALSE);
|
|
extern void DimPipeGradient(Entity ent, double i, BOOL bReverse, double nArrowLen, BOOL bHalfArrow, BOOL bDrawLen = TRUE);
|
|
|
|
TELAPI void UpdateMultDim();
|
|
TELAPI BOOL SetDnByMat(const TCHAR* szMat, const TCHAR*szNewDn);
|
|
TELAPI CString GetDnByMat(const TCHAR* szMat);
|
|
TELAPI void GetFlangeDataByDn(int m_iPn, double m_dRetDn, double &m_nFlangeDn, double &m_nFlangeThick);
|
|
TELAPI void UpdatePipeTextDim(Entity ent, CString csDnType, int nPipeDn);
|
|
|
|
TELAPI void UpdateElevationDim(const AcDbObjectId &idPipe);//更新管线标高标注
|
|
TELAPI void UpdateElevationDim(Entity &entPipe); //更新管线标高标注
|
|
TELAPI void UpdateElevationDim(PickSet &ssPipe); //更新管线标高标注
|
|
|
|
|
|
TELAPI BOOL GetPipeMaterialList(XStringList &lstMat);
|
|
TELAPI CString GetPipeMaterialByIdx(int idx);
|
|
TELAPI double GetPipeDjByDn(const TCHAR* szMat, int iDnIn);//得到计算内径
|
|
TELAPI double GetPipeOutDByDn(const TCHAR* szMat, int iDnIn);//得到外径
|
|
TELAPI int GetPipeDnByQ(double nQ, AcDbObjectId id, double &nLost, double &nI, double &nSpeed, BOOL bIsReCalc = FALSE);
|
|
TELAPI void GetPipeSpecList(DList<int> &lstSpec, const TCHAR* szMat);
|
|
|
|
TELAPI CString GetDimLayerNameByPipeLayer(const CString &strLayer);
|
|
TELAPI BOOL GetNearestPoint(const AcGePoint3dArray &points, const XPoint &ptWcs, XPoint &ptNearest);
|
|
TELAPI BOOL IsPipeVertical(Entity ent);
|
|
TELAPI CString GetPipeLayer(Entity entPipe);
|
|
TELAPI CString GetTextLayBySys(TPipeSys::SysType sys);
|
|
TELAPI CString GetPipeTextLayByEnt(Entity ent);
|
|
TELAPI CString GetDimLayBySys(TPipeSys::SysType sys);
|
|
TELAPI CString GetDimPipeLen(double dLen);
|
|
TELAPI CString GetDimWellDeep(double dDeep);
|
|
TELAPI void UpdateMultDim(Entity ent);
|
|
TELAPI void GetAllVertPipeByPt(PickSet &ss, AcDbObjectId id);
|
|
TELAPI void RebindVPipeDim(const AcDbObjectId id);
|
|
TELAPI double GetFullByPercentQ(double nPercentQ);
|
|
// cet 2016.5.19 del 代码移入水工程tch_pipeSystem
|
|
TELAPI BOOL IsShowVPipeDimDn(const CString &sPipeLayer);
|
|
TELAPI BOOL SetShowVPipeDimDn(const CString &sPipeLayer, BOOL bShow);
|
|
|
|
|
|
//**********************************************************************
|
|
// 室外函数
|
|
//**********************************************************************
|
|
TELAPI Entity GetWellByPt(XPoint &pt, int &iPipeIdx);
|
|
|
|
//**********************************************************************
|
|
// 全局通用函数
|
|
//**********************************************************************
|
|
TELAPI AcDbObjectId GetBlkIdByName(const TCHAR* szBlkName);
|
|
TELAPI CString GetBlkNameById(AcDbObjectId id);
|
|
extern CString BlockName2SldName(const TCHAR* szBlkName);
|
|
extern void LoadTkBlock(const TCHAR* szBlk);
|
|
TELAPI double GetValveWidth(const TCHAR* szBlockName);
|
|
TELAPI BOOL InvokeTkwMan(const TCHAR *pszLib, BOOL bSelOnly, XString &sBlockName);
|
|
TELAPI BOOL GetBlkRecordWidth(const TCHAR* szBlkName, double nScaleX, double nScaleY, double &nWidth, double &nHeight);
|
|
TELAPI XCurveSegment GetExternalBlockSeg(Entity entBlk, XPoint &ptPick);
|
|
TELAPI double GetInsRotate(XPoint ptIns, XCurveSegment seg);
|
|
|
|
//**********************************************************************
|
|
// 系统生成
|
|
//**********************************************************************
|
|
TELAPI void PlanEquip2Sys(AcDbObjectId id, TDbPipe *pPipe, double nRadian, AcGeMatrix3d mat, AcGeScale3d scale);
|
|
TELAPI CString GetSysBlockByAng(const TCHAR* szOld, double angEq, BOOL &bIsBreak);
|
|
TELAPI TDbPipe * ClonePipe(TDbPipe *pOldPipe);
|
|
TELAPI AcDbObjectId PlanValve2Sys(AcDbObjectId id, TDbPipe *pPipe, double nRadian, AcGeMatrix3d mat, AcGeScale3d scale,int nValveType = 0);
|
|
TELAPI AcDbObjectId PlanLabel2Sys(AcDbObjectId id, TDbPipe *pPipe);
|
|
|
|
//**********************************************************************
|
|
// 其它
|
|
//**********************************************************************
|
|
|
|
inline double R2A(double Radian){
|
|
return Radian * 180 / PI;
|
|
}
|
|
|
|
inline double A2R(double Angle){
|
|
return Angle / 180 * PI;
|
|
}
|
|
|
|
//**********************************************************************
|
|
// 给排水word公式索引
|
|
//**********************************************************************
|
|
#define WORD_FORMULA1 1 // 给水当量平均出流概率
|
|
#define WORD_FORMULA2 2 // 给水当量同时出流概率
|
|
#define WORD_FORMULA3 3 // 住宅给水设计秒流量
|
|
#define WORD_FORMULA4 4 // 公建给水设计秒流量
|
|
#define WORD_FORMULA5 5 // 工业给水设计秒流量
|
|
#define WORD_FORMULA6 6 // 住宅排水设计秒流量
|
|
#define WORD_FORMULA7 7 // 全日供应热水设计小时耗热量
|
|
#define WORD_FORMULA8 8 // 定时供应热水设计小时耗热量
|
|
#define WORD_FORMULA9 9 // 设计小时热水量
|
|
#define WORD_FORMULA10 10 // 最不利点消火栓流量
|
|
#define WORD_FORMULA11 11 // 最不利点消火栓压力
|
|
#define WORD_FORMULA12 12 // 次不利点消火栓压力
|
|
#define WORD_FORMULA13 13 // 次不利点消火栓流量
|
|
#define WORD_FORMULA14 14 // 流速
|
|
#define WORD_FORMULA15 15 // 水力坡降
|
|
#define WORD_FORMULA16 16 // 沿程水头损失
|
|
#define WORD_FORMULA17 17 // 局部水头损失
|
|
#define WORD_FORMULA18 18 // 喷头流量
|
|
#define WORD_FORMULA19 19 // 总水头损失
|
|
#define WORD_FORMULA20 20 // 喷淋终点压力
|
|
#define WORD_FORMULA21 21 // 暴雨强度公式
|
|
#define WORD_FORMULA22 22 // 雨水设计流量公式
|
|
#define WORD_FORMULA23 23 // 流速
|
|
#define WORD_FORMULA24 24 // 沿程阻力损失
|
|
#define WORD_FORMULA25 25 // 管道沿程阻力损失系数
|
|
#define WORD_FORMULA26 26 // 局部阻力损失
|
|
#define WORD_FORMULA27 27 // 总阻力损失
|
|
#define WORD_FORMULA28 28 // 管道某一x断面处的压力
|
|
#define WORD_FORMULA29 29 // 压力余量计算公式
|
|
#define WORD_FORMULA30 30 // 降雨强度公式
|
|
#define WORD_FORMULA31 31 // 雨水管渠的设计降雨历时公式
|
|
#define WORD_FORMULA32 32 // 管渠内雨水流行时间
|
|
#define WORD_FORMULA33 33 // 暴雨强度公式
|
|
#define WORD_FORMULA34 34 // 雨水设计流量公式
|
|
#define WORD_FORMULA35 35 // 流速公式
|
|
#define WORD_FORMULA36 36 // 泄流量公式
|
|
#define WORD_FORMULA37 37 // 新消防计算公式1
|
|
#define WORD_FORMULA38 38 // 新消防计算公式2
|
|
#define WORD_FORMULA39 39 // 新消防计算公式3
|
|
#define WORD_FORMULA40 40 // 管道速度压力
|
|
#define WORD_FORMULA41 41 // 管道压力
|
|
#define WORD_FORMULA42 42 // 次不利点消火栓压力
|
|
#define WORD_FORMULA43 43 // 流速V
|
|
#define WORD_FORMULA44 44 // 沿程水头损失
|
|
#define WORD_FORMULA45 45 // 局部损失(采用当量长度法)
|
|
#define WORD_FORMULA46 46 // 设计扬程
|
|
#define WORD_FORMULA47 47 // 水力坡降(2017规范)
|
|
#define WORD_FORMULA48 48 // 总损失(2017规范)
|
|
#endif |