395 lines
16 KiB
C++
395 lines
16 KiB
C++
#pragma once
|
|
#include "aecdbewpipebase.h"
|
|
|
|
#ifdef EARTHWORM_EXPORT
|
|
#define DLLIMPEXP __declspec(dllexport)
|
|
#else
|
|
#define DLLIMPEXP __declspec(dllimport)
|
|
#endif
|
|
|
|
class DLLIMPEXP AecDbShEarthWorm : public AecDbEwPipeBase
|
|
{
|
|
public:
|
|
ACRX_DECLARE_MEMBERS(AecDbShEarthWorm);
|
|
|
|
protected:
|
|
static Adesk::UInt32 kCurrentVersionNumber;
|
|
|
|
public:
|
|
AecDbShEarthWorm(void);
|
|
virtual ~AecDbShEarthWorm(void);
|
|
|
|
|
|
virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler);
|
|
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
|
|
virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* pFiler);
|
|
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
|
|
|
|
virtual Acad::ErrorStatus copyFrom(const AcRxObject* pSrc);
|
|
|
|
#if ARX>16
|
|
virtual Acad::ErrorStatus subExplode(AcDbVoidPtrArray& entitySet) const;
|
|
virtual void subList() const;
|
|
|
|
|
|
virtual Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode,
|
|
INT_PTR gsSelectionMark,
|
|
const AcGePoint3d& pickPoint,
|
|
const AcGePoint3d& lastPoint,
|
|
const AcGeMatrix3d& viewXform,
|
|
AcGePoint3dArray& snapPoints,
|
|
AcDbIntArray& geomIds) const;
|
|
|
|
|
|
virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* pEnt,
|
|
AcDb::Intersect intType,
|
|
AcGePoint3dArray& points,
|
|
INT_PTR thisGsMarker,
|
|
INT_PTR otherGsMarker) const;
|
|
|
|
virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* pEnt,
|
|
AcDb::Intersect intType,
|
|
const AcGePlane& projPlane,
|
|
AcGePoint3dArray& points,
|
|
INT_PTR thisGsMarker,
|
|
INT_PTR otherGsMarker) const;
|
|
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcDbGripDataPtrArray& grips,
|
|
const double curViewUnitSize,
|
|
const int gripSize,
|
|
const AcGeVector3d& curViewDir,
|
|
const int bitflags) const;
|
|
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbVoidPtrArray& appData, const AcGeVector3d& offset, const int bitflags);
|
|
|
|
virtual Acad::ErrorStatus subErase(Adesk::Boolean erasing);
|
|
|
|
#endif
|
|
|
|
//AEC 派生
|
|
virtual Acad::ErrorStatus Draw2d(AcGiDraw &dc) const;
|
|
virtual Acad::ErrorStatus Draw3d(AcGiDraw &dc) const;
|
|
|
|
Acad::ErrorStatus DrawBuffer(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus DrawTopView2d(AcGiDraw &dc) const;
|
|
|
|
//绘制节点俯视图
|
|
Acad::ErrorStatus DrawStackPointTopView(AcGiDraw &dc,const EWStackPoint& sp,const AcDbPolyline* pRoadCenLine) const;
|
|
|
|
//绘制纵断1
|
|
Acad::ErrorStatus DrawVerSection(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus DrawVerSectionTbl(AcGiDraw &dc,const AcGePoint2d& ptLast,double dHeight) const;
|
|
Acad::ErrorStatus DrawVerSectionStack(AcGiDraw &dc,const AcGePoint2d& ptLast,const AcGePoint2d& ptrODtTop,const AcGePoint2d& ptrODtBom,AcArray<BreakPos>& arBreakPts,const AcDbPolyline* pCenLine) const;
|
|
Acad::ErrorStatus DrawModelSection2d(AcGiDraw &dc,const EWFnctNode* pNext,double dGradient,double dDistFrom,double dHeight,const AcGePoint2d& ptLast,AcArray<BreakPos>& arBreaks,const AcDbPolyline* pCenLine) const;
|
|
|
|
//纵断设计高程
|
|
Acad::ErrorStatus DrawVerSectionRoad(AcDbPolyline* pPlCen,AcDbCurve* pBaseCurve,AcGiDraw &dc) const;
|
|
//纵断自然高程
|
|
Acad::ErrorStatus DrawVerSectionOldRoad(AcDbPolyline* pPlCen,AcDbCurve* pBaseCurve,AcGiDraw &dc) const;
|
|
|
|
Acad::ErrorStatus DrawVerSectionPipe(AcDbPolyline* pPlCen,AcGiDraw &dc) const;
|
|
|
|
//三维剖视图
|
|
void SetDraw3DStyle(Adesk::UInt16 nDraw3DStyle);
|
|
Adesk::UInt16 GetDraw3DStyle() const;
|
|
|
|
//二维俯视图样式
|
|
void SetLookDwonDrawStyle(Adesk::UInt16 nLookDwonDrawStyle);
|
|
Adesk::UInt16 GetLookDwonDrawStyle() const;
|
|
|
|
//纵断 横断 俯视 切换
|
|
//俯视0 纵断1 横断 2
|
|
void SetSectionDrawStyle(Adesk::UInt16 nSectionDrawStyle);
|
|
Adesk::UInt16 GetSectionDrawStyle() const;
|
|
|
|
//获取二维视图显示的图形[出图]
|
|
int GetDraw2dables(Adesk::UInt16 nSectionDrawStyle, AcDbVoidPtrArray& arEntPtrs) const;
|
|
|
|
//三维导出
|
|
virtual int GetDraw3dables(AcDbVoidPtrArray& arEntPtrs,bool bWriteBimInfo = false) const;
|
|
|
|
//设置设计 道路中心线,点,标高
|
|
void SetRoadCenline(const AcGePoint3dArray& arPts);
|
|
int GetRoadCenline(AcGePoint3dArray& arPts) const;
|
|
AcDbCurve* GetRoadCenline(bool b3d = false) const;
|
|
|
|
//设置现状 道路中心线,点,标高
|
|
void SetOldRoadCenline(const AcGePoint3dArray& arPts);
|
|
int GetOldRoadCenline(AcGePoint3dArray& arPts) const;
|
|
AcDbCurve* GetOldRoadCenline(bool b3d = false) const;
|
|
|
|
//舱室附属物
|
|
void SetAddtionScr(LPCTSTR pszScr);
|
|
void GetAddtionScr(CString& sScr) const;
|
|
bool GetAddtionSection(AcDbVoidPtrArray& arEntPtrs) const;
|
|
|
|
STSection* GetSTSection() const;
|
|
void ShowAddtion(int nShow);
|
|
|
|
AcDbPolyline* GetRoadCenlineVerSection(const AcGePoint3d& ptVSta) const;
|
|
AcDbPolyline* GetOldRoadCenlineVerSection(const AcGePoint3d& ptVSta) const;
|
|
AcDbPolyline* FormatVerSectionPolyline(const AcGePoint3dArray& arPoints,const AcGePoint3d& ptVSta) const;
|
|
|
|
//提取管线位置分段[管位处]
|
|
bool GetPipeLineSegs(int nRoomIndex,AcArray<LineSeg>& arLnSegs, bool bAllRoom = false, bool bByWholeLine = false) const;
|
|
bool GetBossPipeLineSegs(LPCTSTR pszScript,int nRoomIndex,AcArray<LineSeg>& arLnSegs,bool bAllRoom,bool bByWholeLine,int k) const;
|
|
|
|
// 提取线缆位置分段[支架处]
|
|
bool GetCableLineSegsForHolder(int nRoomIndex
|
|
, AcArray<LineSeg>& arLnSegs
|
|
, int idx // 编号
|
|
, int nFloor // 第几层
|
|
, int nCount // 此层画几条线缆
|
|
, double dDD // 每条线缆外径
|
|
, int nClr // 线缆颜色
|
|
, LPCTSTR ltypeString // 线缆线型
|
|
, double dSpace // 线缆间距
|
|
, bool bAllRoom = false
|
|
, bool bByWholeLine = false) const;
|
|
|
|
bool GetCableLineSegsForHolders(LPCTSTR pszScript,int nRoomIndex
|
|
, AcArray<LineSeg>& arLnSegs
|
|
, int idx // 编号
|
|
, int nFloor // 第几层
|
|
, int nCount // 此层画几条线缆
|
|
, double dDD // 每条线缆外径
|
|
, int nClr // 线缆颜色
|
|
, LPCTSTR ltypeString // 线缆线型
|
|
, double dSpace // 线缆间距
|
|
, bool bAllRoom = false
|
|
, bool bByWholeLine = false
|
|
, int kk = 0) const;
|
|
|
|
|
|
bool GetCableLineSegsForHanger(int nRoomIndex
|
|
, AcArray<LineSeg>& arLnSegs
|
|
, int idx // 编号
|
|
, int nFloor // 第几层
|
|
, int nCount // 此层画几条线缆
|
|
, double dDD // 每条线缆外径
|
|
, int nClr // 线缆颜色
|
|
, LPCTSTR ltypeString // 线缆线型
|
|
, double dSpace // 线缆间距
|
|
, bool bAllRoom = false
|
|
, bool bByWholeLine = false) const;
|
|
|
|
|
|
bool GetCableLineSegsForHangers(LPCTSTR pszScript,int nRoomIndex
|
|
, AcArray<LineSeg>& arLnSegs
|
|
, int idx // 编号
|
|
, int nFloor // 第几层
|
|
, int nCount // 此层画几条线缆
|
|
, double dDD // 每条线缆外径
|
|
, int nClr // 线缆颜色
|
|
, LPCTSTR ltypeString // 线缆线型
|
|
, double dSpace // 线缆间距
|
|
, bool bAllRoom = false
|
|
, bool bByWholeLine = false
|
|
, int kk = 0) const;
|
|
|
|
bool HasAddtions(AcRxClass* pRxClass);
|
|
bool AddAddtion(const AcDbObjectId& idAdd);
|
|
bool RemoveAddtions(AcRxClass* pRxClass);
|
|
|
|
//始终标高,设计中心线
|
|
float StartElevation() const;
|
|
float EndElevation() const;
|
|
|
|
//设置纵断始点
|
|
AcGePoint2d VStartPoint() const;
|
|
AcGePoint2d VEndPoint() const;
|
|
|
|
void RemoveAllPipePos();
|
|
bool GetPipePos(AcArray<PipePos>& arPipePos) const;
|
|
bool AddPipePos(const AcArray<PipePos>& arPipePos);
|
|
|
|
Acad::ErrorStatus ImpGetGripPonts(AcArray<GripPtSpec>& gripPoints,const int bitflags) const;
|
|
Acad::ErrorStatus ImpGetVSecGripPonts(AcGePoint3dArray& arPts,const int bitflags) const;
|
|
|
|
AcDbGripData* NewAcDbGripData(const AcGePoint3d& ptOn,const AcGeVector3d& vtDir,int nIndex,EFnctType nGripType,LPCTSTR pszLockID) const;
|
|
AcDbGripData* NewAcDbGripData(const AcGePoint3d& ptOn,const AcGeVector3d& vtDir,int nIndex,EFnctType nGripType,double dDistFr) const;
|
|
Acad::ErrorStatus ImpMoveGripPointsAt(AecGripData* pGripData,const AcGeVector3d& offset);
|
|
EWFnctNode* ImpGetNodeAtLockid(LPCTSTR pszLockId);
|
|
Acad::ErrorStatus AdjustVertexZ(double dDistAtPoint,double dZAdd);
|
|
|
|
Acad::ErrorStatus AddGripPoint(const AcGePoint3d& ptBr);
|
|
|
|
public:
|
|
|
|
//插入桩号节点
|
|
Acad::ErrorStatus InsertStackPos(int nIndex,const EWStackPoint& stackPt);
|
|
Acad::ErrorStatus AppendStackPos(const EWStackPoint& stackPt);
|
|
|
|
//去除桩号点
|
|
Acad::ErrorStatus RemoveStackPos(LPCTSTR pszStack);
|
|
|
|
//获取桩号点
|
|
int GetStackPosSize() const;
|
|
Acad::ErrorStatus GetStackPos(int nIndex,EWStackPoint& stackPt) const;
|
|
Acad::ErrorStatus GetStackPos(LPCTSTR pszStack,EWStackPoint& stackPt) const;
|
|
|
|
//接口重载[空]
|
|
virtual bool GetInterface(AcArray<AecInterface>& arInfs) const;
|
|
virtual bool GetInterface(int nIndex,AecInterface& inf) const;
|
|
virtual int GetInterfaceCount() const;
|
|
virtual int GetActiveInf() const;
|
|
virtual void SetActiveInf(int nIndex);
|
|
|
|
//纵段计算土方,高程,等节点数据
|
|
int CalEarthWork(AcArray<ELongParam>& arELongParams) const;
|
|
int CalEarthWork() const;
|
|
|
|
bool MakeMapBufferFast(byte* pProModel,int nProModelBufLen,LPCTSTR pszLockID);
|
|
|
|
//添加关联的外室
|
|
void AppendPortRoomIds(const AcDbObjectId& id);
|
|
void GetPortRoomIds(AcDbObjectIdArray& arIds) const;
|
|
bool GetPortRoomId(LPCTSTR pszLockID, AcDbObjectId& idPortRoom) const;
|
|
|
|
//管廊混泥土体积
|
|
double GetVolume() const;
|
|
|
|
//管廊腔体体积 nRoom = 999 全部
|
|
double GetCavityVolume(int nRoom) const;
|
|
|
|
//管廊总挖土方,与道路标高先有关 0 现状 1 设计
|
|
double GetDigVolume(int nRoadType = 0) const;
|
|
|
|
//管廊填埋土方,与道路标高先有关
|
|
double GetFillVolume() const;
|
|
|
|
//管廊外表面积
|
|
double GetOutSideArea() const;
|
|
|
|
//管廊舱室内表面积
|
|
double GetInSideArea() const;
|
|
|
|
bool MakeTangentArc(const AcGePoint3d& pt1,const AcGePoint3d& pt2);
|
|
|
|
static void SortRegionRooms( AcDbCircle* pCir,AcDbVoidPtrArray& arRegionRooms);
|
|
static void ExtractRegionRooms(AcDbVoidPtrArray& arRegionRooms,const AcDbRegion* pRegSection);
|
|
|
|
int GetRoom(int nIndex,ERoom& room) const;
|
|
int GetRoomCount() const;
|
|
AcDbCurve* GetRoomRegion(int nIndex) const;
|
|
int OffsetMapToSplitRoom(const CStringArray& arInf,ERoom& room,int nIndex) const;
|
|
int AlongRoomSide(AcGePoint3d& pt,int nRoomIndex,const AcGeVector3d& vtX) const;
|
|
|
|
void GetSectionRoomsTo(AcGeLineSeg3d& ln, AcArray<ERoom>& arRooms, AcGePoint2d& ptThick) const;
|
|
|
|
int CreateHolderSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateBossSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateHangerSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateRingsSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateLampsSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateFileEETSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateGutterwaySection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateFireDoorSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateSecuritySection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateDraFanSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateGasAlarmSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateBomAddSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateRoomSlabSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateRoomNameSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateSmokAlarmSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateTempAlarmSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateCoAlarmSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
int CreateOxAlarmSection(LPCTSTR pszScript,AcDbVoidPtrArray& arEntPtrs) const;
|
|
|
|
//剖切提取
|
|
int GetSection(const AcGePoint3d& ptFr, const AcGePoint3d& ptTo, const AcGeVector3d& vtViewDir,const AcGeVector3d& vtTo,AcDbVoidPtrArray& arRegionPtrs) const;
|
|
int ImpGetSection(AcDb3dSolid* pSolidDraw, const AcGePoint3d& ptFr,const AcGePoint3d& ptTo,const AcGeVector3d& vtViewDir,const AcGeVector3d& vtTo,AcDbVoidPtrArray& arRegionPtrs) const;
|
|
|
|
//获取放样线
|
|
void GetLoftingLines(AcDbVoidPtrArray& arPlines) const;
|
|
|
|
//1.创建附件三维
|
|
Acad::ErrorStatus CreateAddtion3d(AcDbVoidPtrArray& arOther3dPtrs) const;
|
|
|
|
protected:
|
|
|
|
bool CreateVerticalWell3d(const EWStackPoint& sp,AcDbVoidPtrArray& arSubtract3dPtrs,AcDbVoidPtrArray& arOther3dPtrs,AcGePoint2d& ptTopAndBomEl ) const;
|
|
|
|
bool CreateProModel3d(const EWStackPoint& sp,AcDbVoidPtrArray& arSubtract3dPtrs,AcDbVoidPtrArray& arOther3dPtrs,AcGePoint2d& ptTopAndBomEl ) const;
|
|
|
|
|
|
//2.创建支架三维
|
|
Acad::ErrorStatus CreateHolder3d(LPCTSTR pszScript,AcDbVoidPtrArray& arOther3dPtrs) const;
|
|
|
|
//3.创建支墩三维
|
|
Acad::ErrorStatus CreateBoss3d(LPCTSTR pszScript,AcDbVoidPtrArray& arOther3dPtrs) const;
|
|
|
|
//4.创建吊架三维
|
|
Acad::ErrorStatus CreateHanger3d(LPCTSTR pszScript,AcDbVoidPtrArray& arOther3dPtrs) const;
|
|
|
|
AcDbPolyline* GetVerSectionPolyline(const AcGePoint2d& ptLast,double dOffset,bool bUseRoadFit = true) const;
|
|
|
|
int GetEWStackPointOn(const AcGePoint3d& ptPos) const;
|
|
|
|
//内部调用
|
|
void SetCalEarthWorkResult(AcArray<ELongParam>& arELongParams) const;
|
|
|
|
void SortStackPosByDistFrom();
|
|
|
|
Acad::ErrorStatus WriteElXData(AcDbEntity* pPlEnt,double dStaEl,int nPos) const;
|
|
|
|
bool MakeStake2UCSXPos() const;
|
|
|
|
bool FindStakeUCSXPos(LPCTSTR pszStake,double& dXPos,int nIDType) const;
|
|
|
|
Acad::ErrorStatus MerageGradientAndDist(AcArray<TextOnPoint>& arTxtGrLen, AcDbObjectId& idStyle, AcDbObjectId& idLayer, double dTxtH, double dAngle, AcGiDraw &dc) const;
|
|
|
|
bool GetRoofAndBoomElAtPoint(const AcGePoint3d& ptSta,AcGePoint2d& ptEl) const;
|
|
|
|
bool IsUserStackPointHear(const AcGePoint3d& ptPos) const;
|
|
|
|
//获取屏幕向上的向量
|
|
static AcGeVector3d GetScreenUpDirWCS3d();
|
|
static AcGeVector2d GetScreenUpDirWCS2d();
|
|
static bool TransformRegionPerpToLine(AcGePoint3d& ptOnReg, AcGeLineSeg3d& ln,bool bDir);
|
|
|
|
// 解析管廊脚本中的EXT字段
|
|
bool parseExtScript(LPCTSTR field, std::vector<std::vector<CString>> &items) const;
|
|
|
|
protected:
|
|
|
|
AcGePoint3dArray m_arRoadCenPts; //设计 道路中心线 pt.z 为标高
|
|
AcGePoint3dArray m_arOldRoadCenPtrs; //现状 道路中心线 pt.z 为标高
|
|
|
|
bool m_bShowTableHead; //是否显示表格标题
|
|
|
|
//管廊显示俯视图 2D
|
|
Adesk::UInt16 m_nSectionDrawStyle; //俯视0 纵断1 横断 2
|
|
Adesk::UInt16 m_nLookDwonDrawStyle; //俯视图,总图单线 0 舱素线(双线) 1
|
|
float m_dSingleLnWidth; //总图单线单线绘制线宽 1.5 mm
|
|
float m_dBoundaryWidth; //舱素线俯视图线宽 0.5 mm
|
|
float m_dCtrlDimLineLen; //控制线十字长度 500.0 mm
|
|
float m_dXDrawScale; //纵向出图比例;
|
|
float m_dYDrawScale; //横向出图比例;一般不用
|
|
|
|
//管廊显示 3D样式
|
|
Adesk::UInt16 m_nDraw3DStyle; // 全三维 0; 局部剖视(1/4) 1; 水平剖视(1/2) 2;垂直剖视(1/2) 3;
|
|
|
|
//管廊内部尺寸
|
|
AcGePoint3dArray m_arWaterwaySize; //排水沟尺寸位置 x 款,y高 z室位置索引 左0 右1
|
|
float m_dWaterwayGrad; //排水沟地面梯度
|
|
|
|
AcArray<EWStackPoint> m_arStackPts; //节点桩号位置点
|
|
|
|
//外部关联
|
|
AcDbObjectIdArray m_arPortRoomIds; //接口的外部房子,可以像门窗那样删减移动
|
|
|
|
//预留数据
|
|
AcDbObjectIdArray m_arIDAddtions; //附属构件
|
|
TCHAR m_szReserved[1024]; //预留数据
|
|
AcGePoint3dArray m_arPtReserved; //预留数据
|
|
|
|
//以下不需要序列化
|
|
public:
|
|
mutable AcGePoint2d m_ptVStart; //管廊二维纵段出图起点
|
|
mutable AcDbVoidPtrArray m_ar2DPrefbrtBufPtrs; //预制件或纵断表格临时缓存
|
|
mutable CMapStringToDouble m_mapStake2UCSXPos; //临时映射
|
|
mutable AcArray<ELongParam> g_arSHELongParams; //一条线管廊计算数据,半全局
|
|
mutable AcDbVoidPtrArray m_arRegionRooms; //所有的舱室
|
|
};
|