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