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

87 lines
4.6 KiB
C++

#ifndef __PARTITIONSANITARYSYS_H__
#define __PARTITIONSANITARYSYS_H__
#include <vector>
#include <DbEquipment.h>
struct SanitaryNode
{
AcGePoint3d pt;
AcDbObjectId idSanitary;
};
// 洁具系统数据
struct SanitarySysData
{
std::vector<SanitaryNode> vecSanitaryNode; // 洁具点
AcGePoint3d pt; // 排水点或给水点
TPipeSys::SysType type; // 洁具系统类别
AcDbObjectId id; // 排水点或给水点管线id
};
// 根据排水点和给水点将待连接洁具划分为不同的系统
class PartitionSanitarySys
{
public:
// 根据规则划分洁具
bool PartitionSanitary(PickSet &ss, std::vector<SanitarySysData> &vec);
// 按污水-废水-给水-热给水-中水顺序排序
void Sort(std::vector<SanitarySysData> &vec);
// 获得其他洁具系统中的洁具点
void GetOtherSanitaryPt(TPipeSys::SysType sys, const std::vector<SanitarySysData> &vec, std::vector<AcGePoint3d> &vecPt);
private:
// 检查连接管是否唯一,不唯一时,提示用户选择
bool CheckLinkPipe(PickSet &ss, std::vector<SanitarySysData> &vec);
//判断是否为单一洁具系统
bool CheckSanSys(PickSet &ss);
//设定某一类型系统的给水点或排水点,若存在多条 提示用户选择
bool SetPipePt(int &nNum, TDbPipe *&pPipe, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId);
//用户选择给水点或排水点
bool SetPipeByCustom(TPipeSys::SysType sysPipe, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId, std::vector<AcDbObjectId> &vec);
//从管线获取给水点或排水点
void GetPipePt(AcDbObjectId &id, AcGePoint3d &ptPipe);
void GetPipePt(TDbPipe *&pPipe, AcGePoint3d &ptPipe);
// 判断管线是否连接其他管线
bool IsLinkedWithPipe(TDbPipe *&pPipe);
// 判断设备是否连接管线
bool IsLinkedWithPipe(TDbEquipment *&pEquip, bool bIsFeedPipe);
//设定某一类型的点
void SetPt2Sys(TPipeSys::SysType sys, SanitaryNode node, std::vector<SanitarySysData> &vec);
//检查管线信息中是否包含某一类型的管线
bool CheckPipeSys(TPipeSys::SysType sys, const std::vector<SanitarySysData> &vec);
//判断立管和干管是否相连(考虑干管和立管的连接点在立管中部的特殊情况),若相连 重新设定给水点或排水点
bool CheckVPipe(std::vector<AcDbObjectId> &vec, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId);
//用户选择主给水管或排水管
void SetSelPipe(std::vector<AcDbObjectId> &vec, TPipeSys::SysType sys,
std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId);
//高亮显示提供给用户选择的管线
void SetPipeColor(std::vector<AcDbObjectId> &vec, bool bTrue);
//设定洁具本身连接给水点的点
void SetFeedPt2Sys(SanitaryNode node, std::vector<SanitarySysData> &vec);
//设定洁具本身连接热给水水点的点
void SetFeedHeatPt2Sys(SanitaryNode node, std::vector<SanitarySysData> &vec);
//设定洁具本身连接中水点的点
void SetUsedWaterPt2Sys(SanitaryNode node, std::vector<SanitarySysData> &vec);
//检查系统是否具有 洁具和管线
bool CheckSys(PickSet &ss);
//判断某管线是否在管线系统选择集中
bool CheckPipeInVec(Entity &ent, std::vector<AcDbObjectId> &vec);
//获取管线信息
bool GetPipeInfo(bool &bVertical, XPoint &ptStart, XPoint &ptEnd, AcDbObjectId &id, TPipeSys::SysType &sys);
//用户自主选取给水点
bool SetFeedPipeByCust(Entity &entPipe, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId, std::vector<AcDbObjectId> &vec);
//用户自主选取热给水点
bool SetHeadFeedPipeByCust(Entity &entPipe, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId, std::vector<AcDbObjectId> &vec);
//用户自主选取中水给水点
bool SetusedPipeByCust(Entity &entPipe, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId, std::vector<AcDbObjectId> &vec);
//用户自主选取污水排水点
bool SetDirtPipeByCust(Entity &entPipe, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId, std::vector<AcDbObjectId> &vec);
//用户自主选取废水排水点
bool SetUselessPipeByCust(Entity &entPipe, std::map<TPipeSys::SysType, AcGePoint3d> &mapPipe, std::map<TPipeSys::SysType, AcDbObjectId> &mapPipeId, std::vector<AcDbObjectId> &vec);
};
#endif