#ifndef _SANITARYSYSFORFEEDWATER_H__ #define _SANITARYSYSFORFEEDWATER_H__ #include "SanitarySys.h" class SanitarySysForFeedWater: public SanitarySys { public: SanitarySysForFeedWater(); ~SanitarySysForFeedWater(); // 连接洁具产生的管线 void GetLinkedPipe(std::vector &vecPipe); // 碰撞管线 void SetCollidePipe(const std::vector &vecLine); // 其他系统洁具点 void SetOtherSanitaryPoint(const std::vector &vecPt); // 设定管线距离墙体距离 double SetDistPipe2Wall(const double dDist); protected: // 在XOY平面内距离点pt最近的并且与vtDir平行的墙体,pline1是距点较近的墙线,pline2是距点墙较远的墙线 bool GetNearestWall(const AcGePoint3d &pt, const AcGeVector3d &vtDir, AcDbLine &line, double &dWallThick); // 在dDist范围内距离pt点最近的墙体 bool GetNearestWall(const AcGePoint3d &pt, double dDist, XCurveSegment &segNear, XCurveSegment &segFar); // 拷贝直线 void CopyLine(const std::vector &vecSrc, std::vector &vecDes); // 将点pt沿vtDir方向移动至距line距离为dDist处 void MovePipe(AcGePoint3d &pt, const AcDbLine &line, const AcGeVector3d &vtDir, double dDist); // 得到洁具方向 bool GetSanitaryDir(AcGeVector3d &vtDir, const AcDbObjectId &idSan); // 获得墙体边界线 bool GetWallSide(Entity &entWall, std::vector &vecSeg); // 获得墙体边界线 void GetWallSide(PickSet &ss, std::vector > &vecWall); // 在XOY平面距离pt最近的墙体的两条边 bool GetWallSide(const AcGePoint3d &pt, const std::vector > &vecWall, XCurveSegment &segNear,XCurveSegment &segFar); // 洁具点到墙体距离 double GetDistPt2Wall(const AcGePoint3d &ptSan); // 检查ptS, ptE连接的直线没有经过立管和其他系统洁具点并且与其他系统管线无碰撞 dDist为管线间的距离最小值 bool IsConflicting(const AcGePoint3d &ptS, const AcGePoint3d &ptE, double dDist); // 给水点标高 double GetSanitaryPtEle(const AcDbObjectId &idSan); // 给水点标高是否随支管 bool IsSanitaryPtEleSamePipe(const AcDbObjectId &idSan); // 获得洁具的给水点和热给水点,若其中一点与ptSan重合,用两点之差产生向量指向ptSan方向 bool GetSanitaryOffsetDir(AcGeVector3d &vtDir, const AcGePoint3d &ptSan, const AcDbObjectId &idSan); // 判断两点连线是否穿过与之平行的墙体 bool PassParallelWall(const AcGePoint3d &ptS, const AcGePoint3d &ptE); // 是否穿过其他洁具系统的洁具点 bool IsPassOtherSanitarySysPt(const AcGePoint3d &ptS, const AcGePoint3d &ptE); // 检查pLine是否与其他系统管线发生碰撞 dDist为管线间距 bool IsCollidePipe(const AcDbLine *pLine, double dDist); // 获得一个新id int GetID(); // 初始化类中用到的墙体 void InitWallEnt(); // 获得墙线构成的墙体的外包框 bool GetWallOutLine(XPoly2D &poly, const XCurveSegment &seg1, const XCurveSegment &seg2); // 添加附件 void DrawFeedEquip(const AcDbObjectId &idSan, const AcGePoint3d &ptSan); // 在XOY平面两直线最短距离(注意两直线需平行) double GetDistLines(const AcDbLine *pLine1, const AcDbLine *pLine2); ////////////////////////// void DrawWall(); private: // 删除line void DeleteLine(); // 点到墙体中心线的投影 void GetPtProjectToWall(const AcGePoint3d &pt, const XCurveSegment &segNear, const XCurveSegment &segFar, AcGePoint3d &ptPrj); private: // 判断两点连线是否穿过与之平行的墙体 bool PassParallelWall(const std::vector > &vecWall, const AcDbLine &line); // 直线与poly2d是否存在交集 bool ExistIntersection(const AcDbLine &line, const XPoly2D &poly); // 将老版墙线配对组成墙体 void GetWall(PickSet &ss, std::vector > &vecWall); // 过滤墙体将墙边重合的墙线只保留宽度最小的 void FiltrateWall(std::vector > &vecWall); // 判断点与直线在XOY平面的距离是否在规定范围内 bool IsInBound(const AcGePoint3d &pt, const AcDbLine &line, double dDist); // 两平行直线在xoy平面内的垂直间距 double GetParallelDist(const XCurveSegment &seg1, const XCurveSegment &seg2); protected: // 碰撞管线 std::vector m_vecCollidePipe; // 其他系统洁具点,用于判断连接洁具时是否穿过非本系统洁具点 std::vector m_vecOtherSanitaryPoint; // 连接洁具时产生的正交方向,用于确定连接连接方向 // 系统连接洁具时产生的管线 std::vector m_vecPipeData; AcGeVector3d m_vtXAxis; AcGeVector3d m_vtYAxis; // 管线距墙距离 double m_dDistPipe2Wall; // 不同系统管线间水平距离 double m_dDistPipe2Pipe; // 墙体搜索范围 double m_dDistSearchWall; // 管线编号 int m_nId; // 管径 double m_dPipeDn; // 给水管id AcDbObjectId m_idPipe; // 系统类别 TPipeSys::SysType m_sysPipe; // 向量比较时的误差 AcGeTol m_tolVec; // 墙体边线 std::vector > m_vecWallSide; }; #endif