Files
envi-code/SourceCode/Code2026/inc/AecDbX3dGroup.h
T
2026-09-28 15:28:50 +08:00

192 lines
5.3 KiB
C++

#pragma once
#ifdef EARTHWORM_EXPORT
#define DLLIMPEXP __declspec(dllexport)
#else
#define DLLIMPEXP __declspec(dllimport)
#endif
#ifndef MAX_AXISROTATS
#define MAX_AXISROTATS 16
#endif
#include "AcDbX3dSolid.h"
#include "AecDbObjXDataMap.h"
class DLLIMPEXP AecDbX3dGroup
{
public:
AecDbX3dGroup(void);
AecDbX3dGroup(const AecDbX3dGroup& group);
~AecDbX3dGroup(void);
static Adesk::UInt32 kCurrentVersionNumber;
void SetName(LPCTSTR pszName);
void GetName(CString& sName) const;
LPCTSTR GetGUID() const;
void ReCreateGUID();
//添加基本单元
void AddX3dSolidRec(X3dSolidRec& rec);
bool RemoveAll3dSolidRec();
void AddSubX3dGroup(AecDbX3dGroup* pGroup);
bool RemoveAllSubX3dGroup();
bool GetSubX3dGroup(int nPos,AecDbX3dGroup*& pGroup) const;
int GetSubX3dGroupCount() const;
int GetRecCount() const;
bool GetX3dSolidRec(int nPos,X3dSolidRec& rec) const;
bool GetX3dSolidRecs(AcArray<X3dSolidRec>& arRecs) const;
void SetOrgPoint(const AcGePoint3d& ptOrg);
AcGePoint3d GetOrgPoint() const;
AcGePoint3d GetBasePoint() const;
bool SetAxis(int nIndex,const AcGeVector3d& vtAxis);
bool GetAxis(int nIndex,AcGeVector3d& vtAxis) const;
void SetHide(bool bHide);
void SetHideShow( );
bool IsHide() const;
void PeelOffTheSkin(int nPos);
bool IsPeelOffTheSkin() const;
void SetActive(bool bActive,int nSubIndex = -1);
//移动
void AddMove(const AcGeVector3d& vtMove);
void AddMove(const AcGeMatrix3d& xMirror);
void ResetMove();
//旋转
void AddRotate(int nAxisIndex,double dRot);
void AddInfRotate(int nActiveInf,double dRot);
void ResetRotate(int nAxisIndex);
void Transformby(AcDbEntity* pSolid) const;
void Transformby(AcGePoint3d& pt) const;
void Transformby(AcGeVector3d& vt) const;
void DrawAxis(AcGiDraw &dc) const;
void DrawInf(AcGiDraw &dc) const;
void DrawSubAxis(AcGiDraw &dc) const;
AcDb3dSolid* CreateDraw3dSolid() const;
AcDb3dSolid* CreateDraw3dSolidNoBJ() const;
AcDb3dSolid* CreateSubDraw3dSolid() const;
#if ARX > 17
AcDbSubDMesh* CreateSubDMesh(AcArray<AcGeLineSeg3d> *pArr = NULL);
#endif
bool GetInterface(AcArray<AecInterface>& arInfs) const;
bool GetInterface(int nIndex,AecInterface& inf) const;
bool IsPipeLine() const;
//旧的管线接口
int GetActiveInf() const;
void SetActiveInf(int nIndex);
//开孔的接口提取
bool GetInterface(int nRow,int nCol,AecInterface& inf) const;
bool GetInterfaceCount(CPoint& ptRC) const;
bool SetActiveInf(const CPoint& ptRC);
bool GetActiveInf(CPoint& ptRC) const;
//获取变径体的边线
int GetGLBJSideLine(int nPos,int nSubIndex,AcGePoint3dArray& arLinePts,AcGeVector3d& vtDir,GLBJRecord& rc) const;
//获取内壁走线
int GetInnerWallLine(int nRoomIndex,int nPos,AcGePoint3dArray& arLinePts) const;
bool GetEwormLine(AcDbLine& ln);
//盾构管廊段
STSection* GetShEwSection() 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 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 GetSlicePlan(AcGePlane& plan) const;
// 专业数据
AecDbObjXDataMap* GetSpecialtyData();
const AecDbObjXDataMap* GetSpecialtyData() const;
Acad::ErrorStatus getOsnapPoints( AcDb::OsnapMode osnapMode,
INT_PTR gsSelectionMark,
const AcGePoint3d& pickPoint,
const AcGePoint3d& lastPoint,
const AcGeMatrix3d& viewXform,
AcGePoint3dArray& snapPoints,
AcDbIntArray& geomIds) const;
Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
bool IsFrom3JS() const;
private:
int GetBJX3dSolidRecs(AecDbX3dGroup*& pGroup,GLBJRecord& rc,const AcGePoint3d& ptFr,const AcGeVector3d& vtDir) const;
protected:
CString m_sName;
CString m_sGUID;
AcArray<X3dSolidRec> m_arX3dSolidRecs;
AcArray<AecDbX3dGroup*> m_arSubX3DGroups;
//先旋转,后移动
//移动
AcGeVector3d m_vtMove; //总移动
//旋转
AcGePoint3d m_ptOrg; //原点
AcGeVector3dArray m_arVtAxis; //轴向
double m_dAxisRotats[MAX_AXISROTATS];//最多10个轴向旋转
AecDbObjXDataMap m_mapXData;
//显示,临时 不序列化
int m_nInfActive;
bool m_bActive; //活动状态
int m_nSubIndex;
CPoint m_ptActiveInf; //开孔的活动接口索引行x列 不序列化
int m_nPeelOff; //是否需要剖开
mutable AcDbEntity* m_pSolidDraw; //临时绘制solid元
mutable AcDbEntity* m_pSolidDraw2; //临时绘制solid元子级别激活
#if ARX > 17
// 拷贝出来的subdmesh对象,指针存在这里一份,在外部的fitting里也存一份
// 当GJYXJMDlg内的组件记录被点中时,进行移动,旋转,删除 操作,是直接对m_pSubDMesh操作
// 节省了遍历时间
mutable AcDbSubDMesh *m_pSubDMesh; // 临时绘制
mutable AcArray<AcGeLineSeg3d> m_pSubDMesh2Ds;
#endif
};