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

90 lines
2.7 KiB
C++

#pragma once
#include "EarThwormDef.h"
class AecDbObjXDataMap;
#ifndef NDEBUG
// 使得Debug版本,能够正确实现ASSERT和VERIFY(在没有_DEBUG宏的情况下)
#ifdef ASSERT
#undef ASSERT
#endif
#define ASSERT(n) assert(n)
#ifdef VERIFY
#undef VERIFY
#endif
#define VERIFY(n) assert(n)
#endif
class PipelineTools
{
public:
static LPCTSTR gLayer_Pipe_Dim;
static LPCTSTR gTextStyle_Pipe_Dim;
public:
static AcDbObjectId AecInitLayerEx(LPCTSTR pszLayer,int nColorIndex,LPCTSTR pszLineType,AcDbDatabase* pDb);
static CString getCurrentLayerSys();
static void setCurrentLayerSys(LPCTSTR sys);
static AcDbObjectId getSysLayer(CUIISQLiteServer *pDb,LPCTSTR pszCurrSys);
static bool getSqliteDB(LPCTSTR dbName, CUIISQLiteServer &db);
static Acad::ErrorStatus arxZoomTo(const ads_point ptCen, double nWidth, double nHeight);
static double getPScale();
void getDimTxtHeight_PIPE(double &h, double &w);
void getDimTxtHeight_STR(double &h, double &w);
void getDimTxtHeight_EQU(double &h, double &w);
static int FormatDimText(CUIISQLiteServer *pDb
, AecDbObjXDataMap& xDimMap
, AecDbObjXDataMap* pPipeXData
, CString& sDimUp
, CString& sDimDwn
, double dEl
, TCHAR* pszLayer
, int nUnit = 1000
, bool bDimHorPipeEl = true);
static int GetSamplePoints(AcDbCurve* pCrv, AcGePoint3dArray& arPoints);
static BOOL arxWBlock(ads_name ss, const TCHAR* szFileName, AcGePoint3d ptIns);
static bool makeBlockToDWG(CString &path);
static bool generateBlockRecord(LPCTSTR pszDwg, LPCTSTR pszBlkName, AcDbObjectId &id, AcGePoint3d &ptIns);
static AcDbObjectId makeLayer(LPCTSTR layname, AcDbDatabase *pDb = NULL);
static AcDbObjectId initLineType(LPCTSTR linetype, AcDbDatabase *pDb = NULL, LPCTSTR linfile = NULL);
static AcDbObjectId initShLineType(LPCTSTR linetype, LPCTSTR pszDimkey,AcDbDatabase * pDb = NULL, LPCTSTR linfile = NULL);
// 判断是否是双线显示 dw 是外径
static bool isDoubleLine(const double &dW);
// 提取管线参数
static bool getPipelineParam(AecDbObjXDataMap &xmap, CString &layer);
static bool getPipelineParam(WPipe::PipeParam &param, CString &layer);
// 设置图层系统
static bool setLayerSys(CUIISQLiteServer *pDb, CStringArray &ar);
// 获得系统
static bool getLayerSys(CUIISQLiteServer *pDb, CStringArray &ar);
// 将pszCurrSys系统图层全部生成
static bool createSysAllLayer(CUIISQLiteServer *pDb, LPCTSTR pszCurrSys);
static bool getPipeSysRecord(CUIISQLiteServer * pDb, LPCTSTR pszCurrSys,CStringArray& arVals);
// 设置管线材料
static bool setPipelineMaterial(CUIISQLiteServer *pDb, CStringArray &arPipe, CStringArray & arFitting);
// 获得管线材料
static bool getPipelineMaterial(CUIISQLiteServer *pDb, CStringArray &arPipe, CStringArray & arFitting);
// 获得系统
static bool getSysByLayer(CUIISQLiteServer *pDb, LPCTSTR pszLayer, CString &sys);
};