Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

108 lines
3.4 KiB
C++

#pragma once
#include "EarThwormDef.h"
class AecDbObjXDataMap;
class AecDbEwEquipment;
#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 bool GetEquipmentFile(CString &filePath);
// 根据数据库索引,得到设备实体文件
static bool GetEquipmentFile(const int &idx, CString &filePath);
// 得到用户选择的设备的数据库索引
static bool GetEquipmentFile(int &idx);
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();
static void getDimTxtHeight_PIPE(double &h, double &w);
static void getDimTxtHeight_EQU(double &h, double &w);
static void getDimTxtHeight_STR(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);
static void initEquSectionBlock(AecDbEwEquipment *pEqu
, LPCTSTR pszTB
, LPCTSTR pszLR
, LPCTSTR pszFB
, LPCTSTR pszENWS
, LPCTSTR pszESWN );
static bool updateEquSection(CUIISQLiteServer *pDb, LPCTSTR sIDEqu);
};