72 lines
3.5 KiB
C++
72 lines
3.5 KiB
C++
#ifndef _SANITARYSYSFORDRAIN_H__
|
|
#define _SANITARYSYSFORDRAIN_H__
|
|
|
|
#include <DbEquipment.h>
|
|
#include "SanitarySys.h"
|
|
|
|
class SanitarySysForDrain: public SanitarySys
|
|
{
|
|
|
|
public:
|
|
|
|
SanitarySysForDrain();
|
|
// 自动连接洁具点和排水点
|
|
virtual void AutoLinkSanitary(const SanitarySysData &data);
|
|
// 设置倒角大小
|
|
void SetChamferLen(double dChamferLen);
|
|
// 连接洁具产生的管线
|
|
void GetLinkedPipe(std::vector<AcDbLine*> &vecPipe);
|
|
|
|
private:
|
|
|
|
// 处理只有一个洁具的情况
|
|
void LinkSingleSanitary(const SanitarySysData &data);
|
|
// 根据规则设置主干管 ptFrom为排水点或给水点, ptTo为最远洁具点, bDrain判断是否为排水系统
|
|
void SelectMianPipe(std::vector<SanitaryNode> &vec, TPipeSys::SysType sys, const AcDbObjectId &idPipe, AcGePoint3d &ptFrom, AcGePoint3d &ptTo);
|
|
// 设定X轴,Y轴的向量
|
|
void SetVector3dByXOY(AcGeVector3d &vtX, AcGeVector3d &vtY);
|
|
// 在X或Y轴布置主干管
|
|
void SetMainPipeForXOY(std::vector<SanitaryNode> &vec, TPipeSys::SysType sys, const AcDbObjectId &idPipe,
|
|
AcGePoint3d &pt, AcGePoint3d &ptFrom, AcGePoint3d &ptXoY, PipeDir Dir);
|
|
// 按文档规则连接洁具点和管线
|
|
void LinkPipe(std::vector<SanitaryNode> &data, TPipeSys::SysType sys, const AcGePoint3d &ptFrom);
|
|
// 根据洁具点,管线编号,投影点,连接洁具
|
|
void LinkSanitary(std::vector<SanitaryNode> &vec, TPipeSys::SysType sys, int nId, AcGePoint3d &ptSanitary, AcGePoint3d &ptPrj);
|
|
// 添加管线
|
|
void AddPipeLine(std::vector<SanitaryNode> &vec, TPipeSys::SysType sys, AcGePoint3d &ptS, AcGePoint3d &ptE, PipeType type, PipeDir Dir);
|
|
void AddPipeLine(TPipeSys::SysType sys, const AcGePoint3d &ptS, const AcGePoint3d &ptE, PipeType type, PipeDir Dir);
|
|
|
|
//设定排水附件
|
|
void DrawDirtEquip(TPipeSys::SysType sys, SanitaryNode sanData, const AcGePoint3d &ptFrom);
|
|
|
|
// 获取离洁具点最近的X Y轴方向的管线
|
|
int GetNearestPipeForY(TPipeSys::SysType sys, const AcGePoint3d &pt);
|
|
int GetNearestPipeForX(TPipeSys::SysType sys, const AcGePoint3d &pt);
|
|
|
|
// 获得满足sys和nDir的管线
|
|
void GetPipeLine(TPipeSys::SysType sys, PipeDir Dir, std::map<int, AcDbLine*> &mapLine);
|
|
// sys系统中编号nId的管线
|
|
AcDbLine* GetPipeLine(TPipeSys::SysType sys, int nId);
|
|
|
|
// 获取洁具点在管线上的投影点
|
|
bool GetProjectPoint(TPipeSys::SysType sys, int nId, const AcGePoint3d &pt, AcGePoint3d &pt1);
|
|
// 根据 管线类型 和 延长方向 添加延长线
|
|
void ExtendPipeLine(TPipeSys::SysType sys, AcGePoint3d &ptS, AcGePoint3d &ptE, PipeType type, PipeDir Dir, AcGePoint3d &ptTmp, bool bFromStart);
|
|
|
|
// 设定管线移动后的点
|
|
void SetBranchPipePt(TPipeSys::SysType sys, const AcGePoint3d &ptSanitary, const AcGePoint3d &ptProj, const AcGePoint3d &ptStart, const AcGePoint3d &ptEnd, AcGePoint3d &ptChamferStart, AcGePoint3d &ptBranchStart);
|
|
// 获取洁具排水点相关信息
|
|
void GetSanitaryDrainPtInfo(Entity &ent, CString &csBlk, CString &csSysBlk, double &dRadius, double &dDang, double &dBigQ, double &dAngle, XPoint &ptDrain);
|
|
// 检查到管线相交时重新设定管线
|
|
bool CheckIntersectPipe(AcGePoint3d &ptS, AcGePoint3d &ptE, TPipeSys::SysType sys);
|
|
// 从管线排出端延长
|
|
bool ExtendPipeLineFromEnd(TPipeSys::SysType sys, AcGePoint3d &ptS, AcGePoint3d &ptE);
|
|
// 获取上级管线连接点
|
|
void GetDrainPtByPipe(TPipeSys::SysType sys, AcGePoint3d &pt);
|
|
double m_dChamferLen; // 倒角长度
|
|
int m_nId; // 当前可用管线id,使用后自动+1
|
|
AcDbObjectId m_idPipe;// 排水管id
|
|
};
|
|
|
|
#endif
|