490 lines
18 KiB
C++
490 lines
18 KiB
C++
#pragma once
|
|
#include <map>
|
|
#include <vector>
|
|
#include <sstream>
|
|
#include <fstream>
|
|
#include <algorithm>
|
|
|
|
|
|
#include "earthwormdef.h"
|
|
|
|
namespace SimpleProperty { struct PropertySetByIndex; struct PropertySetByName; }
|
|
/*
|
|
!!!!!!!!!!!!!!!!!!!!!注意,在这个头文件里添加任何经常变动的头文件,都会影响编译速度!!!!!!!!!!!!!!!!!!!!!
|
|
!!!!!!!!!!!!!!!!!!!!!注意,在这个头文件里添加任何经常变动的头文件,都会影响编译速度!!!!!!!!!!!!!!!!!!!!!
|
|
!!!!!!!!!!!!!!!!!!!!!注意,在这个头文件里添加任何经常变动的头文件,都会影响编译速度!!!!!!!!!!!!!!!!!!!!!
|
|
!!!!!!!!!!!!!!!!!!!!!注意,在这个头文件里添加任何经常变动的头文件,都会影响编译速度!!!!!!!!!!!!!!!!!!!!!
|
|
!!!!!!!!!!!!!!!!!!!!!注意,在这个头文件里添加任何经常变动的头文件,都会影响编译速度!!!!!!!!!!!!!!!!!!!!!
|
|
*/
|
|
|
|
#ifdef EARTHWORM_EXPORT
|
|
#define DLLIMPEXP __declspec(dllexport)
|
|
#else
|
|
#define DLLIMPEXP __declspec(dllimport)
|
|
#endif
|
|
|
|
class AecDbObjXDataMap;
|
|
class CUIISQLiteServer;
|
|
class AecDbEwEquipment;
|
|
class AecDbEwPipe;
|
|
|
|
|
|
class DLLIMPEXP ColorIndex
|
|
{
|
|
public:
|
|
enum EClr
|
|
{
|
|
kColorByBlock = 0,
|
|
kRed = 1,
|
|
kYellow = 2,
|
|
kGreen = 3,
|
|
kCyan = 4,
|
|
kBlue = 5,
|
|
kMagenta = 6,
|
|
kWhite = 7,
|
|
kColorByLayer = 256,
|
|
};
|
|
};
|
|
|
|
class DLLIMPEXP CoreTools
|
|
{
|
|
public:
|
|
|
|
template <class T>
|
|
static bool isDigitString(LPCTSTR psz)
|
|
{
|
|
if (!psz) return false;
|
|
std::wstringstream st(psz);
|
|
T d;
|
|
if (!(st >> d))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
static double GetDPIScale(HWND hWnd = NULL);
|
|
|
|
static BOOL GetPipeInitConfig(AecDbObjXDataMap &xdata);
|
|
|
|
static CString GetCurrentProject();
|
|
|
|
static bool GetDimScaleZone(const AcGePoint3d &ptHit
|
|
, double &dScale
|
|
, AcDb::UnitsValue &drawUnits
|
|
, AcDb::UnitsValue &dimUnits);
|
|
|
|
static BOOL QueryFlangSpecs(CUIISQLiteServer *pDb
|
|
, double dDN
|
|
, WPipe::Trade &eTrade
|
|
, CString &sStd
|
|
, CString &sTyp
|
|
, LPCTSTR pszProName = NULL
|
|
, LPCTSTR pszPreSpecName = NULL);
|
|
|
|
static BOOL QueryFlangDataEx(CUIISQLiteServer *pDb
|
|
, const double dDN
|
|
, const double dPre
|
|
, std::vector<CString> &ss // 内容顺序参考 Plumbing.db/AecFlangeData 表格字段
|
|
, LPCTSTR pszProName = NULL
|
|
, LPCTSTR pszPreSpecName = NULL
|
|
, LPCTSTR pszODNo = NULL);
|
|
|
|
static BOOL QueryFlangData(CUIISQLiteServer *pDb
|
|
, const double dDN
|
|
, const double dPre
|
|
, double &dWD
|
|
, double &dWh
|
|
, double &dThk
|
|
, double &dN
|
|
, LPCTSTR pszProName = NULL
|
|
, LPCTSTR pszPreSpecName = NULL
|
|
, LPCTSTR pszODNo = NULL);
|
|
|
|
|
|
static double MakeSureMMUnit(double &dDn);
|
|
|
|
static BOOL FindSHHLrDll(CString &SHHlrDLL, CString &sDbx);
|
|
|
|
//
|
|
static bool IsMeterUnitForPipeElevDim();
|
|
static bool IsMeterUnitForHoleElevDim();
|
|
static int getPrecForPipeElevDim();
|
|
static int getPrecForHoleElevDim();
|
|
static double getPScaleForSymb();
|
|
|
|
// 刷新数据库实体
|
|
static void refreshGraphics();
|
|
|
|
// 得到当前的行业
|
|
static int getCurrentTrade();
|
|
|
|
// 得到当前行业下的管线系统名称
|
|
static CString getCurrentPipeSysTblName();
|
|
|
|
// 根据管线系统名称得到相关信息
|
|
// sys:管线系统 bCenter:是-中心线 否-外边线
|
|
static int getColorByPipeSys(LPCTSTR sys, bool bCenter); // 管线内外线颜色
|
|
static AcDbObjectId getLtByPipeSys(LPCTSTR sys, bool bCenter); // 管线内外线线形
|
|
static double getLwByPipeSys(LPCTSTR sys, bool bCenter); // 管线内外线线宽
|
|
static AcDbObjectId getLyByPipeSys(LPCTSTR sys, bool bCenter, bool bUpdate = false); // 管线内外线图层
|
|
static AcDbObjectId getLyForPipe(LPCTSTR sys, bool bUpdate = false); // 管线实体图层
|
|
|
|
static bool IsUsePipeOutClrFor3DRender();
|
|
static void SetUsePipeOutClrFor3DRender(const BOOL &b);
|
|
|
|
// 线宽类型与字符串转换,字符串为 0.00mm 形式
|
|
CString LineWeight2String(const AcDb::LineWeight &lw);
|
|
AcDb::LineWeight String2LineWeight(LPCTSTR psz);
|
|
|
|
// 加载线形
|
|
// 在目录 pszDir 里面找 *.lin 文件,并且解析
|
|
static AcDbObjectId loadLineType(LPCTSTR pszDir, LPCTSTR pszName);
|
|
|
|
// 0 软件打包版本为单机 1 软件打包版本为网络
|
|
static int encryptionType();
|
|
|
|
static bool initParamValveJsonData(LPCTSTR pszType
|
|
, LPCTSTR pszSrcSection
|
|
, LPCTSTR pszTemplateSection);
|
|
|
|
static void enumBlockByDWG(LPCTSTR pszDWG, std::vector<CString> &vec, LPCTSTR pszFilter = NULL, AcDbObjectIdArray *pIds = NULL);
|
|
static void enumBlockByDWG(AcDbDatabase *pDb, std::vector<CString> &vec, LPCTSTR pszFilter = NULL, AcDbObjectIdArray *pIds = NULL);
|
|
static CString selectBlockByDWG(LPCTSTR pszDWG, LPCTSTR pszBlkPrefix, LPCTSTR sCurSelet = NULL);
|
|
|
|
// 图纸是否是米单位
|
|
static bool IsMetersUnit();
|
|
|
|
// 发送按键到窗口
|
|
static void sendKeyToWindow(HWND handle, UINT key);
|
|
static void sendKeyToCADView(UINT key);
|
|
|
|
// 只检查文件名称是否符合windows系统命名规范
|
|
static bool checkFileName(LPCTSTR sFile);
|
|
|
|
//static bool intersectWith(AcDbLine *pLine, AcDbRegion *pReg, AcGePoint3dArray &ar);
|
|
//static bool intersectWith(AcDbArc *pArc, AcDbRegion *pReg, AcGePoint3dArray &ar);
|
|
//static bool intersectWith(AcDbCircle *pCir, AcDbRegion *pReg, AcGePoint3dArray &ar);
|
|
static AcGe::PointContainment relationWith(const AcDbRegion *pReg, const AcGePoint3d &pt);
|
|
static AcDbCurve* intersectWith(AcDbPolyline *pPoly, AcDbRegion *pReg, AcGePoint3dArray &ar);
|
|
|
|
// revit 的SWEEP几何体,要求路径与截面正交垂直
|
|
static AcDbPolyline* fixPathAndRegionForRevitSweep(AcDbPolyline *pPoly, AcDbRegion *pReg);
|
|
|
|
// 分割拟合特殊曲线 ellipse 3dpolyline spline
|
|
// nCount 为分割份数
|
|
static AcDbPolyline* spliteCurve(AcDbCurve *pCurve, const int &nCount);
|
|
|
|
// 得到当前选择集
|
|
static int getCurrentSet(AcDbObjectIdArray &ar);
|
|
|
|
static int IsPointInPoly(const AcGePoint3d &pt, const AcDbPolyline &pl);
|
|
|
|
// GeArc->DbArc
|
|
static AcDbArc* geArc2DbArc(const AcGeCircArc3d &geArc);
|
|
//
|
|
static bool sortOfPointByCurve(AcGePoint3dArray &arPts, AcDbCurve *pCurve);
|
|
|
|
// 添加命令
|
|
static void AddCommand(const TCHAR *cmdGroup, const TCHAR *cmdInt, const TCHAR *cmdLoc,
|
|
const int cmdFlags, const AcRxFunctionPtr cmdProc, const int idLocal = -1);
|
|
|
|
// 是否初始设置过?
|
|
static bool hasCSSZ(const bool &bPrompt = false);
|
|
|
|
static int IsArxAppLoaded(const TCHAR * AppName);
|
|
|
|
// 修改 wfK 内的比例
|
|
static void setPScaleForSHSKernal(double dScale);
|
|
|
|
// 修改 wfK 内的绘制单位
|
|
static void setMeterUnitDrawForSHSKernal(bool bMeter);
|
|
|
|
// 修改 wfK 内的标注单位
|
|
static void setMeterUnitDimForSHSKernal(bool bMeter);
|
|
|
|
// 分割AcDbCurve,dSpace长度一段
|
|
static int spliteCurve(const AcDbCurve *pCurve, const double &dSpace, AcDbVoidPtrArray &ar);
|
|
|
|
// 得到弧线的凸度
|
|
static double BulgeFromArc(AcDbCurve *c, bool clockwise);
|
|
|
|
// ar - 直线和弧线 的集合
|
|
// tol 误差
|
|
static bool MakePolyline(const AcDbVoidPtrArray &ar, std::vector<AcDbPolyline*> &polys, const double &tol = AcGeContext::gTol.equalPoint() );
|
|
|
|
// pCurve: line arc circle
|
|
static AcDbPolyline* MakePolyline( const AcDbCurve *pCurve);
|
|
|
|
static bool bimData2IniFile(LPCTSTR pszFile, const std::map<CString, CString> &datas);
|
|
static bool iniFile2BimData(LPCTSTR pszFile, std::map<CString, CString> &datas);
|
|
|
|
static bool getBimDataByDlg(bool bAdd
|
|
, CString &sV1
|
|
, CString &sV2
|
|
, LPCTSTR pszTitle = NULL
|
|
, LPCTSTR pszName1 = NULL
|
|
, LPCTSTR pszName2 = NULL );
|
|
|
|
static AcGePoint3d asAcGePoint3d(const AcGePoint2d &pt, const double &z = .0);
|
|
|
|
// AcCmColor 与 RGB 颜色的转换
|
|
static DWORD AcCmColor2RGB(const AcCmColor &clr);
|
|
static AcCmColor RGB2AcCmColor(const DWORD &clr);
|
|
|
|
static bool getNameByDialog(LPCTSTR pszTitle, LPCTSTR pszItemName, CString &sName);
|
|
|
|
static Acad::ErrorStatus CloneAndAddToModelSpace(const AcDbEntity* pEnt, int clr = 256);
|
|
|
|
static Acad::ErrorStatus AddToModelSpace(AcDbEntity* pEnt
|
|
, AcDbDatabase* pDb
|
|
, bool bClose
|
|
, AcDbObjectId *pId);
|
|
|
|
static AcDbObjectId AddToModelSpace(AcDbEntity* pEnt, bool bClose = true);
|
|
|
|
static int SplitString(LPCTSTR psz, LPCTSTR splite, std::vector<CString> &str);
|
|
static int SplitString(LPCTSTR psz, const TCHAR &splite, std::vector<CString> &strs);
|
|
static int SplitString(LPCTSTR psz, const TCHAR &splite, CStringArray& arVals);
|
|
static CString ConnectString(const std::vector<CString> &strs, LPCTSTR separat);
|
|
static CString merageString(const TCHAR & sp, LPCTSTR pszFormat, const int floatPrec, ...);
|
|
|
|
// ddx 内控制控件显示的数字精度
|
|
static void DDX_Text_Ex(CDataExchange *pDX, int nIDC, double &value, LPCTSTR lpszFormat = _T("%.2f"));
|
|
|
|
static Acad::ErrorStatus generateGroup(LPCTSTR name, AcDbObjectIdArray & ids, AcDbObjectId *pId = NULL);
|
|
|
|
static double PixelToWcs(int nPixel);
|
|
|
|
static int FindFile(const TCHAR *szFile, CString &sFullPath);
|
|
|
|
static AcDbObjectId GetLTypeId(LPCTSTR pszLType, const CString &sLTypeFileName = _T("acadiso.lin"));
|
|
|
|
static void ColorToRGB(int nAcadColor, int *nR, int *nG, int *nB);
|
|
static void ColorToRGB(LPCTSTR clr, int *nR, int *nG, int *nB);
|
|
|
|
static bool UCS2WCS(const AcGePoint3d & ptUcs, AcGePoint3d & ptWcs);
|
|
static bool WCS2UCS(const AcGePoint3d & ptUcs, AcGePoint3d & ptWcs);
|
|
static bool UCS2WCS(const AcGeVector3d & ptUcs, AcGeVector3d & ptWcs);
|
|
static bool WCS2UCS(const AcGeVector3d & ptUcs, AcGeVector3d & ptWcs);
|
|
|
|
// 生成AcDbBlockTableRecord
|
|
static AcDbObjectId makeTableRecord(const AcDbVoidPtrArray &ar, LPCTSTR pszName, AcDbDatabase *pDb = NULL);
|
|
// 生成AcDbBlockReference
|
|
static AcDbBlockReference* makeBlockReference(const AcDbVoidPtrArray &ar, LPCTSTR pszName, AcDbDatabase *pDb = NULL);
|
|
// lookup AcDbBlockTableRecord
|
|
static AcDbObjectId findTableRecord(LPCTSTR pszName, AcDbDatabase *pDb = NULL);
|
|
static AcDbObjectId findTableRecordByPathName(LPCTSTR pszName, AcDbDatabase *pDb = NULL);
|
|
|
|
static AcDbObjectId findLayerId(LPCTSTR layname, AcDbDatabase *pDb = NULL);
|
|
static AcDbObjectId findLinetypeId(LPCTSTR linetype, AcDbDatabase *pDb = NULL);
|
|
static AcDbObjectId findTextStyleId(LPCTSTR linetype, AcDbDatabase *pDb = NULL);
|
|
|
|
static AcGePoint3d MidPt(const AcGePoint3d &pt1, const AcGePoint3d &pt2);
|
|
static AcGePoint2d MidPt(const AcGePoint2d &pt1, const AcGePoint2d &pt2);
|
|
|
|
static CString guid();
|
|
|
|
static Acad::ErrorStatus booleanOper(AcDb3dSolid *pSolid, AcDb3dSolid *pSub, AcDb::BoolOperType btype);
|
|
|
|
static bool createRegion(const AcDbVoidPtrArray& curveSegments, AcDbVoidPtrArray& regions);
|
|
static AcDbRegion* createRegion(const AcDbVoidPtrArray& curveSegments);
|
|
static AcDbRegion* createRegion(AcDbEntity *pEnt);
|
|
|
|
|
|
static bool PolylineToString(AcDbPolyline* pPl, CString& sPoints, bool bMakeSureClosed = true);
|
|
static AcDbPolyline* StringToPolyline(LPCTSTR pszPoint2ds);
|
|
|
|
static bool AcDbCurveToString(AcDbCurve* pPl, CString& str);
|
|
static AcDbCurve* StringToAcDbCurve(LPCTSTR pszPoint2ds);
|
|
|
|
static bool CurveToString(const AcDbCurve* pCurve, CString& sScr2);
|
|
|
|
static Adesk::UInt64 RegionToString(const AcDbRegion *pReg, char*& pszOut);
|
|
static bool RegionToString(const AcDbRegion* pReg, CString& sRegionScrp);
|
|
|
|
static AcDbRegion* StringToRegion(const CString& sRegionScrp);
|
|
static AcDbRegion *StringToRegion(Adesk::UInt64 nLen, char *pszReg);
|
|
|
|
static Adesk::UInt64 BodyToString(const AcDbBody *pBody, char *&pszOut);
|
|
static AcDbSurface *StringToFace(Adesk::UInt64 nLen, char *pszBody);
|
|
|
|
static CString pointToString(const AcGePoint2d &pt, const int &prec = 2);
|
|
static CString pointToString(const AcGePoint3d &pt, const int &prec = 2);
|
|
static AcGePoint3d stringToPoint3d(LPCTSTR psz);
|
|
static AcGePoint2d stringToPoint2d(LPCTSTR psz);
|
|
|
|
static void SplitStrintToArray(LPCTSTR pszDescr, CStringArray& arInfo, TCHAR tcSpace);
|
|
static void SplitStrintToArray(LPCTSTR pszDescr, std::vector<CString> &arInfo, TCHAR tcSpace);
|
|
|
|
// 判断rvt导入的节点类型 是否是建筑附属物
|
|
static bool isBuildingJs(LPCTSTR psz);
|
|
|
|
static void getFilesInFolder(LPCTSTR sPath
|
|
, LPCTSTR filter
|
|
, std::vector<CString> &vs
|
|
, const bool &bOnlyName
|
|
, const bool &bRecursive = true);
|
|
|
|
static void getSubFolderByPath(LPCTSTR sPath, std::vector<CString> &subFolders, const bool &bOnlyName);
|
|
|
|
static bool ZipFile(LPCTSTR pszSrc, LPCTSTR pszDec);
|
|
static void unZipFile(LPCTSTR pszSrc, LPCTSTR pszDec);
|
|
static void unZipFile(LPCTSTR pszSrc, LPCTSTR pszDec,CStringArray& arGetFiles);
|
|
|
|
// 是否是上华对象
|
|
static bool isSHObject(AcDbObjectId &id);
|
|
static bool isSHObject(AcDbEntity *pEnt);
|
|
|
|
// 上华对象DXF转中文
|
|
static CString dxf2Chs(LPCTSTR dxf);
|
|
|
|
//
|
|
static CString getEquipmentName(LPCTSTR pszFile);
|
|
static bool equipment2File(AcDbObjectId &idEqu, LPCTSTR pszFile, LPCTSTR pszName);
|
|
static bool equipment2File(AecDbEwEquipment *pEqu, LPCTSTR pszFile, LPCTSTR pszName);
|
|
static bool equipment2File(AecDbEwEquipment *pEqu, CMemFile &mf, LPCTSTR pszName);
|
|
static bool file2Equipment(AecDbEwEquipment*pEqu, LPCTSTR pszFile, CString *pEquName = NULL);
|
|
static std::string getEquimentMd5(AcDbObjectId &idEqu);
|
|
static std::string getEquimentMd5(AecDbEwEquipment *pEqu);
|
|
|
|
// 显示示例图
|
|
static void showPictureDlg(LPCTSTR pszPath, CWnd *pParent);
|
|
static void hidePictureDlg();
|
|
|
|
// 水槽对象 2维显示方式 0-内径 1-外径
|
|
static int getFlume2DStyle();
|
|
|
|
// 弧/角 转换
|
|
static double R2A(const double &R);
|
|
// 角/弧 转换
|
|
static double A2R(const double &A);
|
|
|
|
static std::string unicode2Ansii(LPCTSTR psz, const DWORD &codePage);
|
|
|
|
static std::wstring ansii2Unicode(LPCSTR psz, const DWORD &codePage);
|
|
|
|
// pSub 头尾两点在 pOrgCurve 上取出最近两点P1,P2,再由P1,P2两点分割 pOrgCurve 曲线
|
|
// 函数成功,则返回值不为空
|
|
static AcDbCurve* spliteCurve(AcDbCurve *pOrgCurve, const AcDbCurve *pSub);
|
|
|
|
// 找出在 inputs 内与 pCurve 共线的曲线
|
|
// 1.只处理直线
|
|
// 2.bExtension 为 true 则在 pCurve 延长线上的曲线也算共线
|
|
// 3.bExtension 为 false 则得到与 pCurve 相同或在其内部的直线
|
|
static void findCollinear(AcDbCurve* pCurve
|
|
, const AcDbVoidPtrArray& inputs
|
|
, AcDbVoidPtrArray& outputs
|
|
, bool bExtension = false );
|
|
|
|
static AcDbObjectId AecInitLayerEx(LPCTSTR pszLayer, LPCTSTR pszSys, int nColorIndex, LPCTSTR pszLineType, AcDbDatabase* pDb);
|
|
static int getPipeColorBySystem(LPCTSTR pszSys);
|
|
|
|
static bool sameSystemForPipe(AecDbEwPipe *pPipe1, AecDbEwPipe *pPipe2);
|
|
|
|
static void getInnerTypeList(std::vector<CString> &list);
|
|
static int getIdxForInnerTypeList(LPCTSTR psz);
|
|
|
|
static bool collectHolesForDTYG(AcDbObjectId id, std::vector<HoleData> &holes);
|
|
|
|
static void getBimDatas(const AecDbObjXDataMap &XData, std::vector<std::pair<CString, CString>> &bim);
|
|
static void setBimDatas(AecDbObjXDataMap &XData, const std::vector<std::pair<CString, CString>> &bim);
|
|
static bool getBimData(const AecDbObjXDataMap &XData, LPCTSTR pszKey, CString &strValue);
|
|
static bool setBimData(AecDbObjXDataMap &XData, LPCTSTR pszKey, LPCTSTR pszValue);
|
|
static bool delBimData(AecDbObjXDataMap &XData, LPCTSTR pszKey);
|
|
|
|
static void getBimDatas(const AcDbEntity *pBase, std::vector<std::pair<CString, CString>> &bim);
|
|
static void setBimDatas(AcDbEntity *pBase, const std::vector<std::pair<CString, CString>> &bim);
|
|
static bool getBimData(const AcDbEntity *pBase, LPCTSTR pszKey, CString &strValue);
|
|
static bool setBimData(AcDbEntity *pBase, LPCTSTR pszKey, LPCTSTR pszValue);
|
|
static bool delBimData(AcDbEntity *pBase, LPCTSTR pszKey);
|
|
|
|
static bool getRegionInfo(AcDbRegion *pReg, AcGePoint3d ¢roid, double &area, AcGePlane &pln);
|
|
// 判断 pt 是否在 region 内,region为简单区域,不是由boolean运算组成的
|
|
// pt 为 region 所在平面上一点.
|
|
// 可用region的getPlane()函数取得region所在平面,将3d点转成平面所在2d点
|
|
// -1 out side
|
|
// 1 on side
|
|
// 2 in side
|
|
static int ptInRegion(const AcGePoint2d &pt, AcDbRegion *pReg);
|
|
|
|
static struct resbuf *MakeFence(const std::vector<AcGePoint3d> &pts);
|
|
|
|
static Adesk::Int32 addNozzForEqu(AecDbEwEquipment *pEqu
|
|
, const AcGeVector3d &vtDir
|
|
, const AcGePoint3d &ptIns
|
|
, AecEqui::XPrimData &data );
|
|
|
|
// 矩形或圆形 但不是HG20592-97标准
|
|
static Adesk::Int32 addNozzForEqu_Rect(AecDbEwEquipment *pEqu
|
|
, const AcGeVector3d &vtDir
|
|
, const AcGePoint3d &ptIns
|
|
, const double &dFL // 长 风管圆口: 管口直径
|
|
, const double &dFW // 宽 风管圆口: 法兰外径
|
|
, const double &dFH // 高 风管圆口: 管嘴高度
|
|
, const double &dO // 卷边 风管圆口: 无效
|
|
, const double &dT // 法兰厚度 风管圆口: 法兰厚度
|
|
, const int &nFlangType // 0 单法兰 1 双法兰 2 无法兰
|
|
, const bool &bHvacCircle // 风管圆口?
|
|
, const bool &bPipeSys // 水管系统?
|
|
);
|
|
|
|
// 圆形 HG20592-97标准
|
|
static Adesk::Int32 addNozzForEqu_Circle(AecDbEwEquipment *pEqu
|
|
, const AcGeVector3d &vtDir
|
|
, const AcGePoint3d &ptIns
|
|
, const double &dDN // 公称
|
|
, LPCTSTR sPress // 压力
|
|
, const int &nFlangType // 0 单法兰 1 双法兰 2 无法兰
|
|
, const bool &bPipeSys // 水管系统?
|
|
, const bool &bHvacCircle // 风管圆口?
|
|
, const bool &bUseDB // 根据 公称和压力搜索数据库,得到数据,不使用 dH, dFlangH
|
|
, const double &dH // 总高度
|
|
, const double &dFlangH // 法兰高度
|
|
);
|
|
|
|
// 从dwg文件载入一个块
|
|
static AcDbObjectId loadBlockFromDwg(LPCTSTR pszDwg, LPCTSTR pszBlkName, AcDbDatabase *pDb = NULL);
|
|
|
|
|
|
// 得到初始设置里面的出图比例
|
|
static double getPScale();
|
|
|
|
// gpc 封装
|
|
static void gpcBoolean(int op
|
|
, const AcDbPolyline &poly
|
|
, const AcDbPolyline &polyClip
|
|
, std::vector<AcDbPolyline*> &outPolys
|
|
, std::vector<int> &outHolds );
|
|
|
|
// 选择一个设备,通过 “设备管理”对话框 "自定义设备\pszPath\pszFile"
|
|
static AecDbEwEquipment* selectEquipment(LPCTSTR pszPath, LPCTSTR pszFile);
|
|
|
|
|
|
static void projectToXOY(AcDbVoidPtrArray &arEntPtrs);
|
|
|
|
// 创建字体,faceName 字体名称,fontSize 字体大小(字号)
|
|
static void createFont(CFont *pFont, LPCTSTR faceName, const int &fontSize, CDC *pDC = NULL);
|
|
|
|
static bool drawIcon(HICON hicon, HDC hDC, CPoint pt, UINT ustyle);
|
|
|
|
static bool drawIcon(HIMAGELIST hImgList, int iImage, HDC hDC, CPoint pt, UINT ustyle);
|
|
|
|
static SIZE getStringSZ(HDC hDc, LPCTSTR lpszLong);
|
|
|
|
static void getAllLayers(std::vector<CString> &ss);
|
|
static void getAllSubSystems(std::vector<CString> &ss);
|
|
|
|
// 向propertys 里面图层属性选项
|
|
static void setLayerPorperty(SimpleProperty::PropertySetByIndex &propertys);
|
|
// 向propertys 里面分系统属性插入选项
|
|
static void setSubSystemPorperty(SimpleProperty::PropertySetByIndex &propertys);
|
|
|
|
// 判断pline是否自共线
|
|
static bool isPolylineSelfCollinear(AcDbPolyline *pLine);
|
|
|
|
// 得到arInput曲线组成的外边界轮廓
|
|
// arInput 里面的曲线必须是同一平面内的,没有悬空边线
|
|
// 并且确实组成了一个或者多个闭合的轮廓
|
|
static AcDbPolyline* getOuterContour(const AcDbVoidPtrArray &arInput);
|
|
};
|
|
|