184 lines
7.0 KiB
C++
184 lines
7.0 KiB
C++
#pragma once
|
|
#include "dbmain.h"
|
|
#include "AecDbEwPipe.h"
|
|
#include "aecdbewfitting.h"
|
|
#include "AecDbEwEquipment.h"
|
|
|
|
class AecAngleWatch;
|
|
class TDbPipeJig;
|
|
class AECStatusRecord;
|
|
|
|
class TDbPipeLine : public AecDbCurveBase
|
|
{
|
|
public:
|
|
TDbPipeLine(TDbPipeJig* pJig);
|
|
virtual ~TDbPipeLine(void);
|
|
|
|
//管线基本参数
|
|
void SetPipeParam(WPipe::PipeParam* pPipePar);
|
|
WPipe::PipeParam* GetPipeParam();
|
|
|
|
double GetEndElevation() const;
|
|
|
|
BOOL AddPipeNode(AECStatusRecord* pCurStaRec , WPipe::PipeDraw ePipe );
|
|
|
|
BOOL AddReducer(AECStatusRecord* pCurStaRec,WPipe::PipeParam* pParam);
|
|
|
|
BOOL AddReduceElbow(AECStatusRecord* pCurStaRec,WPipe::PipeParam* pParam,AcGeVector3d& vtMaj,AcGeVector3d& vtMin);
|
|
|
|
AcDbObjectId CreateElbow(AcGeVector3d vtMaj
|
|
,AcGePoint3d ptMid
|
|
,AcGeVector3d vtMin
|
|
,WPipe::PipeParam* pparam
|
|
,BOOL bInsertBeforLast = FALSE);
|
|
|
|
BOOL ChangeEl(AECStatusRecord* pRec,double dNewEl,BOOL bCheckRec,double dRedElPos,WPipe::PipeParam* pParamred);
|
|
|
|
BOOL ChangeEl2(AECStatusRecord* pRec,AECStatusRecord* pRecLast,double dNewEl,BOOL bCheckRec,double dRedElPos,WPipe::PipeParam* pParamred);
|
|
|
|
BOOL ChangeEl3(AECStatusRecord* pRec,AcGePoint3d& ptThis);
|
|
|
|
void SetAngleWath(AcGePoint3d& ptCen,const AcGePoint3d& ptGeTo,const AcGeVector3d& vtDir = AcGeVector3d::kXAxis);
|
|
|
|
void MoveAngWatchPosition();
|
|
|
|
void SwitchAutoSnapOrF8();
|
|
|
|
void AngWatchTo(const AcGePoint3d& ptGeTo);
|
|
|
|
double GetAngWatchSp() const;
|
|
void SetAngWatchSp(double nSp);
|
|
|
|
//画管线停止
|
|
BOOL PipeFinished();
|
|
|
|
void PopUpInterface(int nGroupID);
|
|
void PushPipeParam();
|
|
void PushInterface(AecInterface& intf,BOOL bStartDragFromIt = FALSE);
|
|
|
|
AecInterface* GetLastInterface();
|
|
|
|
void setEApp(WPipe::EApp app);
|
|
WPipe::EApp getEApp();
|
|
|
|
void AddUserData(AcDbObjectId id,AecDbObjXDataMap* pXDataMap,int nType);
|
|
void AddUserData(AecDbEwFitting* pFit,AecDbObjXDataMap* pXDataMap,int nType,AcArray<AecInterface>* parInfs = NULL);
|
|
|
|
public:
|
|
virtual Acad::ErrorStatus Draw2d(AcGiDraw &mode) const;
|
|
virtual const AecDbObjXDataMap* GetSpecialtyData() const { assertReadEnabled(); return NULL; }
|
|
virtual AecDbObjXDataMap* GetSpecialtyData(AcDb::OpenMode bMode = AcDb::kForWrite) { assertWriteEnabled(); return NULL; }
|
|
|
|
public:
|
|
|
|
void FillConfigXDataMap(AecDbObjXDataMap* pXDataMap,WPipe::PipeParam* pParam);
|
|
|
|
void FillConfigXDataMap(AecDbObjXDataMap* pXDataMap,AecDbEwPipe* pWPipeSrc);
|
|
|
|
void FillInInitXDataMap(AecDbObjXDataMap* pXDataMap);
|
|
|
|
//拉命令点前继承夹点的初始化信息,PL_wpipeaddd调用
|
|
void SetInitDataMapPartFrom(AecDbObjXDataMap* pXDataMapSrc);
|
|
|
|
static void XDataMapToPipeParam(const AecDbObjXDataMap* pXDataMapSrc,WPipe::PipeParam* pParamL);
|
|
static void PipeParamToXDataMap(const WPipe::PipeParam* pParamL,AecDbObjXDataMap* pXDataMapSrc);
|
|
static void SetFittingLayer(AecDbEwFitting* pFitting, LPCTSTR pszSys);
|
|
static void SetPipeLayer(AecDbEwPipe *pFitting, LPCTSTR pszSys);
|
|
|
|
BOOL CreateWPipe(AECStatusRecord* pRec,BOOL bMaybeAddTee = FALSE);
|
|
|
|
BOOL CreatePipe(AcGePoint3d ptSta,AcGePoint3d ptEnd,WPipe::PipeParam* pPipeParam);
|
|
|
|
BOOL CreatePipe(AcDbCurve* pCrv, WPipe::PipeParam *pPipeParam);
|
|
|
|
BOOL ExtendLastWPipe(AECStatusRecord* pRec);
|
|
|
|
BOOL CreateElbowAndPipe(AECStatusRecord* pRec, const EFittingType &type = eElbow);
|
|
|
|
BOOL MaybeAddTeeConnectToThis(AcGePoint3d& ptGe,AcGeVector3d& vtDir,AcDbObjectId id,int nPos);
|
|
|
|
BOOL MaybeAddCrossConnectToThis(AcGePoint3d ptFr,AcGePoint3d ptTo,AcDbObjectId id);
|
|
|
|
BOOL SplitWPipe(AcGePoint3d& ptMid,double dL,AecDbEwPipe* pWPipe,BOOL bEraseWhiletooShort = TRUE);
|
|
|
|
BOOL ModifyWPipe(AcGePoint3d& ptGe,AcDbObjectId id,int nPos);
|
|
BOOL ModifyWPipe(AcGePoint3d& ptGe,AecDbEwPipe* pWPipe,int nPos);
|
|
|
|
BOOL AddTee(AecDbEwPipe* pWPipe,double dL,AcGePoint3d ptMid,double dB,AcGeVector3d vtMin);
|
|
BOOL AddTee(AecDbEwPipe *pWPipe, double dL, AcGePoint3d ptMid, double dB, AcGeVector3d vtMin, WPipe::PipeParam *pParmMain);
|
|
BOOL AddTee(AecDbEwPipe* pWPipeMaj,AecDbEwPipe* pPipeMin,double dL,AcGePoint3d ptMid,double dB,AcGeVector3d vtMin);
|
|
BOOL AddTee(AecDbEwPipe* pWPipeMaj,AcDbObjectId& idMin,double dL,AcGePoint3d ptMid,double dB,AcGeVector3d vtMin);
|
|
BOOL AddTee(AecInterface& inf,AcGeVector3d& vtNorm,AcGeVector3d& vtMin, double dL, double dS);
|
|
|
|
//补强圈
|
|
BOOL AddRPorHP(AecDbEwPipe* pWPipeMaj,AecDbEwPipe* pPipeMin,AcGePoint3d ptMid);
|
|
BOOL AddRPorHP(AecDbEwPipe* pWPipeMaj,AcDbObjectId& idMin,AcGePoint3d ptMid);
|
|
|
|
BOOL AddLTee(AecInterface& inf,AcGeVector3d& vtBr,double dE,double dM,double dB,double dInsL,double dInfD);
|
|
|
|
BOOL AddYTee(AecInterface& inf,AcGeVector3d& vtNormal,double dM,double dB,double dInsL,double dInfD);
|
|
|
|
BOOL AddCross(AcDbObjectId id1,AcGePoint3d& ptInt,AcDbObjectId idThis,WPipe::PipeParam* pParamT = NULL);
|
|
|
|
BOOL AddTee(AcDbObjectId id1,AcGePoint3d& ptInt,AcDbObjectId idThis);
|
|
|
|
BOOL AddElbow(AcDbObjectId id1,AcGePoint3d& ptGe,AcDbObjectId idThis);
|
|
|
|
BOOL AddCap(AecInterface& inf,AcGeVector3d& vtNormal,double dL);
|
|
|
|
BOOL Add2Flange(AcGePoint3d& ptMid,double dSpaceHalf,double dPressure,AcGeVector3d& vtDir,CStringArray& arValuesG,CString& sEndF1,CString& sEndF2);
|
|
|
|
BOOL Add1Flange(AcGePoint3d ptSta,AcGeVector3d vtMaj,double dWD,double dWh,double dThk,double dN,CStringArray& arValuesG, CString &sEndF1,BOOL bIsMangBan = false);
|
|
|
|
BOOL Add2Flange(AcGePoint3d& ptMid,double dWD, double dWh, double dSpaceHalf, double dThk, double dN, AcGeVector3d &vtDir, CStringArray &arValuesG, CString &sEndF1, CString &sEndF2);
|
|
|
|
BOOL AddSBFlange(CString &sLevel, double dDn, AcGePoint3d& ptOn,const AcGeVector3d& vtMaj, BOOL bIsMB);
|
|
|
|
AcDbObjectId AddFlxJoin(AecDbObjXDataMap *pXDataMap, const AecInterface &inf);
|
|
|
|
BOOL ChangeElbowToTree(AecDbEwFitting* pDbFit,AcGeVector3d vtMaj,AcGePoint3d ptGeM,AcGeVector3d vtMin,double dDn,AECStatusRecord* pCurRec);
|
|
|
|
BOOL ChangeTeeToCross(AecDbEwFitting* pDbFit,AcGeVector3d& vtMaj,AcGeVector3d& vtMin,AECStatusRecord* pCurRec);
|
|
|
|
void ModifyPipeOfElbow(AcDbObjectId id,AcGePoint3d ptOld,AcGePoint3d ptNew);
|
|
|
|
double PixelToWcs(int nPixel);
|
|
|
|
//是否有上下弯头产生遮挡处理
|
|
bool HasWipeClip();
|
|
|
|
static void RemoveHolePipe(AecDbEwPipe* pWPipe);
|
|
|
|
//查询设置项目等级
|
|
BOOL QuerySetProjectLevel(AecDbObjXDataMap *pXDataMap, WPipe::PipeParam *pParam, LPCTSTR pszFitName);
|
|
|
|
AcDbObjectId AddFitToModelSpace(AecDbEwFitting *pFitting, bool bIsSureAdd2MSp = true);
|
|
AcDbObjectId AddPipeToModelSpace(AecDbEwPipe *pPipe);
|
|
|
|
static bool IsPlasticsMat(WPipe::PipeParam *pParam, CString &sDNo);
|
|
private:
|
|
|
|
void *operator new[](size_t nSize) { return 0; }
|
|
void operator delete[](void *p) {};
|
|
void *operator new[](size_t nSize, const char *file, int line) { return 0; }
|
|
|
|
protected:
|
|
|
|
BOOL m_bStopCommand;
|
|
AecAngleWatch* m_pAngleWatch; //导向罗盘
|
|
AecDbCurveBase* m_pCurPipeLine[2]; //当前的管子
|
|
TDbPipeJig* m_pPipeJig; //当前拖动
|
|
WPipe::PipeParam* m_pPipeParam; //管子参数
|
|
CPtrList m_lstLastPipeParam; //管子参数历史记录
|
|
AcDbObjectId m_idStartDragFrom;
|
|
CArray<AecInterface> m_arHistoryIntfs;//记录历史的接口
|
|
AcDbObjectIdArray m_arIdLast; //用于处理弯头立管弯头 的二维绘制关系
|
|
AcArray<int> m_arETypeLast; //用于处理弯头立管弯头 的二维绘制关系
|
|
bool m_bWipeClip;
|
|
public:
|
|
AecInterface m_intf0; //临时
|
|
AecInterface m_intf1; //
|
|
AecDbObjXDataMap m_xInitDataMap;
|
|
AcDbObjectId m_idTemp; //临时
|
|
};
|