93 lines
3.1 KiB
C++
93 lines
3.1 KiB
C++
// MovePipe.h: interface for the MovePipe class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_MOVEPIPE_H__C4FA001F_129F_4F56_BFA1_55ED4568A1D5__INCLUDED_)
|
|
#define AFX_MOVEPIPE_H__C4FA001F_129F_4F56_BFA1_55ED4568A1D5__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include "TPipeGraph.h"
|
|
#include "DbPipeValve.h"
|
|
#include "DbPipeLabel.h"
|
|
#include "DbVPipeDim.h"
|
|
#include "PipeWireMonitor.h"
|
|
#include "DbEquipment.h"
|
|
|
|
#define MINDIST 0.1
|
|
|
|
// 联动管线相关信息
|
|
struct PipeLinkedInfo
|
|
{
|
|
bool bSideOnPipe;// 端点是否在移动管线上
|
|
XPoint ptOnPipe;// 联动管线和移动管线的交点
|
|
AcGeVector3d vtPipe;// 联动管线法向量
|
|
std::vector<AcDbObjectId> vecPipeLink;// 联动管线集合
|
|
};
|
|
|
|
class MovePipe
|
|
{
|
|
public:
|
|
MovePipe();
|
|
virtual ~MovePipe();
|
|
|
|
void InitPipeSys(const Entity entPipe);
|
|
void Move();
|
|
|
|
private:
|
|
|
|
// 管线是否是移动管线
|
|
bool IsParallelToPipe(const AcDbObjectId idPipe, const AcDbObjectId idPipeDes, PickSet &ssVist);
|
|
// 管线是否是联动管线
|
|
bool IsLinkedWithPipe(const PickSet ssLine, const AcDbObjectId idPipeLinked, PickSet &ssVist, AcGeVector3d &vtPipeLinked, AcGePoint3d &ptOnPipe);
|
|
// 搜索移动管线
|
|
void SearchMovePipe();
|
|
void ModifyMovedVPipe();
|
|
// 搜索联动管线
|
|
void SearchLinkedPipe();
|
|
// 初始化联动管线
|
|
void InitPipeLinkSys();
|
|
// 移动主干管
|
|
bool MoveMainPipe();
|
|
// 沿移动管线垂直方向移动管网
|
|
void MovePipeByPerpendicularVt();
|
|
// T型管线移动
|
|
void ModifyPipeBy1Side(std::vector<AcDbObjectId> &vecPipe, XPoint pt, XPoint ptOld);
|
|
// +型管线移动
|
|
void ModifyPipeBy2Side(std::vector<AcDbObjectId> vecPipe, XPoint ptNew, XPoint ptOld);
|
|
// 延长管线到交点
|
|
void ExtendPipe2Pt(const AcDbObjectId idPipe, XPoint &ptNew, bool bExtendNearPt = true);
|
|
// T型管线移动时 根据交点删除或延长
|
|
void ModifyPipeByPt(std::vector<AcDbObjectId> &vecPipe, XPoint ptNew, XPoint ptOld);
|
|
// 重置附件和管线文字位置
|
|
void ResetAttachmentsPos(const AcDbObjectId idPipe, DList<AcDbObjectId> &lstAttachs);
|
|
void ReLinkEquipment(std::map<double, AcDbObjectId> mapEq, AcDbObjectId idPipe, std::vector<AcDbObjectId> &vec);
|
|
// 联动管线和移动管线交点处创建立管
|
|
AcDbObjectId CreateVPipe(const XPoint ptNew, const AcDbObjectId idOldVPipe);
|
|
// 获取距离点最近的移动管线
|
|
AcDbObjectId GetNearestMovePipe(const AcDbLine &line);
|
|
// 管线不联动时交点处生成立管
|
|
void LinkPipeByVPipe();
|
|
// 删除无用立管
|
|
void DeleteUselessVPipe(bool bMoveLinked);
|
|
// 根据点搜索立管标注
|
|
AcDbObjectId GetVPipeDimByPt(const XPoint pt);
|
|
AcDbObjectId GetVPipeByPt(const XPoint pt);
|
|
// 重新定位立管标注
|
|
void ResetDimPos(const AcDbObjectId idDim, const XPoint pt, const AcDbObjectId idVPipe);
|
|
|
|
private:
|
|
PickSet m_ssLink;
|
|
PickSet m_ssMove;
|
|
|
|
TPipeGraph m_graphPipe;
|
|
TPipeSys::SysType m_typeSys;
|
|
std::vector<PipeLinkedInfo> m_vecPipeLink;// 联动管线
|
|
std::vector<AcDbObjectId> m_vecPipeMove;// 移动管线
|
|
AcDbObjectId m_idPipeMove;
|
|
};
|
|
|
|
#endif // !defined(AFX_MOVEPIPE_H__C4FA001F_129F_4F56_BFA1_55ED4568A1D5__INCLUDED_)
|