#pragma once #include "DbWell.h" class CWellSerial { public: CWellSerial(); // 设置起点井 void SetStartWell(Entity &ent); // 设置终点井 void SetEndWell(Entity &ent); // 设置支路编号类型 void SetSerialType(int nType); // 设置是否躲避 void SetEvade(bool bEvade); // 设置主干递增递减 void SetAdd(bool bAdd); // 设置井编号 void SetWellSerial(const CString &sSerial); // 进行编号 void UpdateWellSerival(); private: // 找出终点井 SSearchPipeList* FindEndWell(SSearchPipeList *pList); // 初始化管网,以便判断井是否已编号 void InitPipeSys(SSearchPipeList *pList, SSearchPipeList *pLstNew); // 获取当前节点能到达的各个子节点的指针 void CalcNodeNum(SSearchPipeList *pList, int iLen, double dLen, std::vector &vecPList); // 更新编号 void UpdateSerialType0(SSearchPipeList *pEndWell); void ModifyBranchSeiral0(SSearchPipeList *pList, AcDbObjectId &id); void UpdateSerialType1(SSearchPipeList *pEndWell); void ModifyBranchSeiral1(SSearchPipeList *pList, AcDbObjectId &id); void UpdateSerialType2or3(SSearchPipeList *pEndWell, bool bBraSerial, bool bAdd); void UpdateSerialType2(SSearchPipeList *pEndWell, bool bBraSerial); void UpdateSerialType3(SSearchPipeList *pEndWell, bool bBraSerial); void UpdateSerialType4or5(SSearchPipeList *pEndWell, bool bBraSerial, bool bAdd); void UpdateSerialType4(SSearchPipeList *pEndWell, bool bBraSerial); void UpdateSerialType5(SSearchPipeList *pEndWell, bool bBraSerial); void UpdateSerialType6(SSearchPipeList *pEndWell); // 获得所有起点到终点所有井(有序存储) void GetMainWell(SSearchPipeList *pEndWell, std::vector &vecWell, std::vector &vecPipe); //设置管线流向 void SetPipeDirection(std::vector &vecPipe, std::vector &vecWell, bool bBra); // 修改井编号 void ModifyWellSerial(const AcDbObjectId &idWell); //判断递增还是递减,重设井编号名字 void ChangeWellSerial(); //判断井编号是否小于1 bool IsLessEqual1(); //检查井是否只有一条分支井 zxl 2011.10.27 add bool CheckPipeBra(SSearchPipeList *&pListBra); // 起始井和终止井不是同一图层 zxl 2013.04.25 add bool CheckWellSys(); // 判断该井是否和起始井是同一系统 zxl 2013.04.25 add bool IsSameSys(const AcDbObjectId &id); private: Entity m_entStartWell; // 起点井 Entity m_entEndWell; // 终点井 int m_nSeriralType; // 支路编号类型 bool m_bAdd; // 主干是否递增 CString m_sWellSerial; // 井编号 bool m_bEvade; // 是否躲避更新 bool m_bUpdateSerial; // 是否更新编号 CString m_sWellLayer; // 类型 };