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

156 lines
5.1 KiB
C++

#ifndef _TCONTAINERSINGLETON_H__
#define _TCONTAINERSINGLETON_H__
#if _MSC_VER > 1000
#pragma once
#endif
#include <list>
#include <algorithm>
class TContainerSingleton
{
public:
typedef std::list<AcDbObjectId> LstIDData;
typedef std::list<double> LstProHeight;
typedef std::map<CString,LstProHeight> LstReMoveMap;
typedef std::map<CString,LstProHeight> LstProHeightMap;
typedef std::map<CString,LstIDData> LstGroupIDMap;
typedef std::map<CString,LstIDData> LstSubIDMap;
public:
static TContainerSingleton* GetInstance();
static void ReleaseInstance();
public:
void MapCurrentDwg();
void AppendThunder(LPCTSTR pszGNo, const AcDbObjectId& idThunder);
void AppendThunder(LPCTSTR pszGNo, const AcDbObjectIdArray& arIdThunder);
int GetGroupThunder(LPCTSTR pszGNo, AcDbObjectIdArray& arIdThunder);
int GetThunderMap(LstGroupIDMap& mapThunder);
void AppendRemoveProHeight(LPCTSTR pszGNo, double dProHeight);
void AppendProHeight(LPCTSTR pszGNo, const AcGeDoubleArray& arProHeight);
void ClearProHeight();
int GetGroupProHeight(LPCTSTR pszGNo, AcGeDoubleArray& arProHeight);
int GetProHeightMap(LstProHeightMap& mapProHeight);
void GetNumArrayBySpecGroup(LPCTSTR pszGNo, AcGeIntArray& arNum);
void RemoveThunderNoGNo(const AcDbObjectId& idThunder);
void RemoveThunder(const AcDbObjectId& idThunder);
void RemoveThunder(const AcDbObjectIdArray& arIdThunder);
void RemoveThunder(LPCTSTR pszGNo, const AcDbObjectId& idThunder);
void RemoveThunder(LPCTSTR pszGNo, const AcDbObjectIdArray& arIdThunder);
AcDbObjectId GetIdFromEntity(Entity& ent);
BOOL GetThunderGroupNo(const AcDbObjectId& idThun, CString& sGroupNo, LPCTSTR pszKey = TEL_GROUP_NO);
BOOL GetThunderNumber(const AcDbObjectId& idThun, CString& sNumber);
BOOL GetThunderNumber(AcDbEntity* pEnt, CString& sNumber);
BOOL GetXData(AcDbEntity* pEnt, LPCTSTR pszAppName, CString& sXData);
// subObjOpt
public:
void AppendCircle(LPCTSTR pszGNo, const AcDbObjectId& idCir);
void AppendCircle(LPCTSTR pszGNo, const AcDbObjectIdArray& arIdCir);
int GetCircle(LPCTSTR pszGNo, AcDbObjectIdArray& arIdCir);
void RemoveCircle(LPCTSTR pszGNo, const AcDbObjectId& idCir);
void EreaseSpecGNoCircl(LPCTSTR pszGNo);
void AppendRegion(LPCTSTR pszGNo, const AcDbObjectId& idReg);
void AppendRegion(LPCTSTR pszGNo, const AcDbObjectIdArray& arIdReg);
int GetRegion(LPCTSTR pszGNo, AcDbObjectIdArray& arIdReg);
void RemoveRegion(LPCTSTR pszGNo, const AcDbObjectId& idReg);
void EreaseSpecGNoRegion(LPCTSTR pszGNo);
void Append3DSolid(LPCTSTR pszGNo, const AcDbObjectId& idSolid);
void Append3DSolid(LPCTSTR pszGNo, const AcDbObjectIdArray& arIdSolid);
int Get3DSolid(LPCTSTR pszGNo, AcDbObjectIdArray& arIdSolid);
void Remove3DSolid(LPCTSTR pszGNo, const AcDbObjectId& idSolid);
void EreaseSpecGNo3dSolid(LPCTSTR pszGNo);
AcGePoint3d GetThunderInsertPosition(const AcDbObjectId& idThunder);
// 避雷线数据
public:
void AppendThunderLine(LPCTSTR pszGNo, const AcDbObjectId& idThunderLine);
void RemoveThunderLine(const AcDbObjectId& idThunderLine);
void RemoveThunderLine(LPCTSTR pszGNo, const AcDbObjectId& idThunderLine);
int GetGroupThunderLine(LPCTSTR pszGNo, AcDbObjectIdArray& arIdThunderLine);
int GetThunderLineMap(LstGroupIDMap& mapThunder);
void GetTLineNumArrayBySpecGroup(LPCTSTR pszGNo, AcGeIntArray& arNum);
void AppendLineRegion(LPCTSTR pszGNo, const AcDbObjectId& idReg);
void RemoveLineRegion(LPCTSTR pszGNo, const AcDbObjectId& idReg);
int GetLineRegion(LPCTSTR pszGNo, AcDbObjectIdArray& arIdReg);
void EreaseSpecGNoLineRegion(LPCTSTR pszGNo);
void AppendLine3DSolid(LPCTSTR pszGNo, const AcDbObjectId& idSolid);
void RemoveLine3DSolid(LPCTSTR pszGNo, const AcDbObjectId& idSolid);
int GetLine3DSolid(LPCTSTR pszGNo, AcDbObjectIdArray& arIdSolid);
void EreaseSpecGNoLine3dSolid(LPCTSTR pszGNo);
void AppendRemoveLineProHeight(LPCTSTR pszGNo, double dProHeight);
void AppendLineProHeight(LPCTSTR pszGNo, const AcGeDoubleArray& arProHeight);
void ClearLineProHeight();
int GetGroupLineProHeight(LPCTSTR pszGNo, AcGeDoubleArray& arProHeight);
int GetProLineHeightMap(LstProHeightMap& mapProHeight);
public:
void AppendPreview3DSolid(LPCTSTR pszGNo, const AcDbObjectId& idSolid);
void EreasePreview3DSolid();
private:
BOOL HasExist(const AcDbObjectId& idThunder, const LstIDData& lstID);
BOOL HasExist(double dProHeight, const LstProHeight& lstProHeight);
void MergeProHeight(LstProHeightMap& mapRomve, LstProHeightMap& mapProHeight);
protected:
TContainerSingleton();
private:
static TContainerSingleton *m_pSingleton;
LstReMoveMap m_mapLineRemove;
LstProHeightMap m_mapLineProHeight;
LstReMoveMap m_mapRemove;
LstProHeightMap m_mapProHeight;
LstGroupIDMap m_mapID;
LstSubIDMap m_mapCircle; // 保护圆
LstSubIDMap m_mapRegion; // 二维联合保护区域
LstSubIDMap m_map3DSolid; // 三维实体
LstSubIDMap m_mapPreview3DSolid; // 预览时临时三维实体
LstGroupIDMap m_mapThundLine; // 避雷线ID数组
LstSubIDMap m_mapTLRegion; // 避雷线区域
LstSubIDMap m_mapTL3DSolid; // 避雷线三维实体
};
#endif // !defined(_TCONTAINERSINGLETON_H__)