Files
envi-code/SourceCode/Code2026/tg_shs/shs_public/DwgCompareDbMgr.h
T

60 lines
2.0 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
#pragma once
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
//文件加载和文件相关信息的管理类
2026-09-28 15:28:50 +08:00
using namespace std;
2026-10-04 00:04:20 +08:00
const CString g_csLogFile = _T("C:\\DwgCompare_LogFile_图纸比对记录.txt");//比对记录文件路径
2026-09-28 15:28:50 +08:00
class CDwgCompareDbInfo
{
public:
CDwgCompareDbInfo(void);
virtual ~CDwgCompareDbInfo(void);
public:
2026-10-04 00:04:20 +08:00
//读取文件
2026-09-28 15:28:50 +08:00
BOOL LoadFile(const CString sName, const CString sPath);
2026-10-04 00:04:20 +08:00
//读取文件,只保留entPoly范围内的实体
2026-09-28 15:28:50 +08:00
BOOL LoadFile(const CString sName, const CString sPath, XPoly2D poly);
2026-10-04 00:04:20 +08:00
//从pDb导出ObjIds中的实体到m_pDb
2026-09-28 15:28:50 +08:00
BOOL LoadDb(CString& csFilePath, AcDbDatabase*& pDb, const AcDbObjectIdArray& ObjIds, AcGePoint3d& ptBase);
2026-10-04 00:04:20 +08:00
void InitLayerInfo(); //读取文件中的所有图层
void GetAllLayer(std::vector<CString>& vtLayer) const; //获取所有图层
2026-09-28 15:28:50 +08:00
CString GetFileName() const;
CString GetFilePath() const;
AcDbDatabase * GetDb() const;
2026-10-04 00:04:20 +08:00
int InitEntCount(); //模型空间实体个数
2026-09-28 15:28:50 +08:00
int GetEntCount() const;
protected:
2026-10-04 00:04:20 +08:00
int GetEntCountInBlock(AcDbObjectId& idBlock, std::map<AcDbObjectId, int>& mapBlock); //统计块内实体数量
2026-09-28 15:28:50 +08:00
protected:
2026-10-04 00:04:20 +08:00
CString m_sName; //文件名,包括扩展名
CString m_sPath; //文件路径
AcDbDatabase * m_pDb; //加载的文件
vector<CString> m_vtLayerAll; //所有图层
int m_iEntCount; //需要比对的实体数量
2026-09-28 15:28:50 +08:00
};
class CDwgCompareDbMgr : public CDwgCompareDbInfo
{
public:
CDwgCompareDbMgr(void);
~CDwgCompareDbMgr(void);
public:
void Init();
2026-10-04 00:04:20 +08:00
void GetCmpLayer(std::vector<CString>& vtLayer) const; //获取符合比对条件的图层,图层信息只在这个DB对象中有效
void SetCompareLayer(std::vector<CString>& vtLayer); //设置比对图层
2026-09-28 15:28:50 +08:00
public:
2026-10-04 00:04:20 +08:00
//满足条件,比对需要首先对图层进行打开,解冻,解锁操作
BOOL m_bAllLayer; //比对所有图层
BOOL m_bCmpClosedLayer; //比对关闭的图层
BOOL m_bCmpFrozenLayer; //比对冻结的图层
BOOL m_bCmpLockedlayer; //比对锁定的图层
2026-09-28 15:28:50 +08:00
protected:
2026-10-04 00:04:20 +08:00
vector<CString> m_vtLayerCmp; //比对的图层
2026-09-28 15:28:50 +08:00
};