144 lines
4.0 KiB
C++
144 lines
4.0 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 AcDbX3dSolid;
|
|
class DLLIMPEXP AecDbX3dPart
|
|
{
|
|
public:
|
|
AecDbX3dPart(void);
|
|
AecDbX3dPart(const AecDbX3dPart& pPart);
|
|
~AecDbX3dPart(void);
|
|
|
|
static Adesk::UInt32 kCurrentVersionNumber;
|
|
|
|
void SetName(LPCTSTR pszName);
|
|
void GetName(CString& sName) const;
|
|
|
|
LPCTSTR GetGUID() const;
|
|
void ReCreateGUID();
|
|
|
|
//添加基本单元
|
|
void AddX3dSolid(AcDbX3dSolid* pXSolid,AcDb::BoolOperType bType = AcDb::kBoolUnite,bool bForHouseSub = false);
|
|
void RemoveAt(int nIndex,AcDb::BoolOperType bType = AcDb::kBoolUnite,bool bForHouseSub = false );
|
|
void RemoveAll3dSolidRec();
|
|
|
|
int GetX3dSolidCount(AcDb::BoolOperType bType = AcDb::kBoolUnite,bool bForHouseSub = false) const;
|
|
AcDbX3dSolid* GetX3dSolid(int nIndex,AcDb::BoolOperType bType = AcDb::kBoolUnite) const;
|
|
|
|
void SetOrgPoint(const AcGePoint3d& ptOrg);
|
|
AcGePoint3d GetOrgPoint(bool bByTransform = false) 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);
|
|
|
|
//移动
|
|
void AddMove(const AcGeVector3d& vtMove);
|
|
void AddMove(const AcGeMatrix3d& xMirror);
|
|
AcGeVector3d GetMove() const;
|
|
void ResetMove();
|
|
|
|
//旋转
|
|
void AddRotate(int nAxisIndex,double dRot);
|
|
double GetRotate(int nAxisIndex) const;
|
|
void ResetRotate(int nAxisIndex);
|
|
|
|
void Transformby(AcGePoint3d& pt) const;
|
|
void Transformby(AcGeVector3d& vt) const;
|
|
|
|
void SetBoolOperFor(int nOper);
|
|
int GetBoolOperFor() const;
|
|
|
|
bool Create();
|
|
AcDb3dSolid* CreateDraw3dSolid() const;
|
|
|
|
int GetForHouseSubtract(AcDbVoidPtrArray& arSolidPtrs) const;
|
|
|
|
int GetActiveInf() const;
|
|
void SetActiveInf(int nIndex);
|
|
|
|
//开孔的接口提取
|
|
bool GetInterface(int nIndex,AecInterface& inf) const;
|
|
bool GetInterface(int nRow,int nCol,AecInterface& inf) const;
|
|
bool GetInterfaceCount(CPoint& ptRC) const;
|
|
bool SetActiveInf(const CPoint& ptRC);
|
|
bool GetActiveInf(CPoint& ptRC) const;
|
|
|
|
Acad::ErrorStatus Draw2d(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus Draw3d(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus DrawAxis(AcGiDraw &dc) const;
|
|
Acad::ErrorStatus DrawInf(AcGiDraw &dc) 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;
|
|
|
|
Acad::ErrorStatus CopyFrom(AecDbX3dPart* pSrcPart);
|
|
void List() const;
|
|
SHJson::WValue& ToJson() const;
|
|
bool ByJson(const SHJson::WValue &v);
|
|
|
|
void setBimDatas(const SH_BIM_BLOCK &bims);
|
|
void getBimDatas(SH_BIM_BLOCK &bims);
|
|
|
|
protected:
|
|
|
|
//序列化
|
|
CString m_sName;
|
|
CString m_sGUID;
|
|
|
|
Adesk::Int32 m_nBoolOper; //
|
|
AcDbVoidPtrArray m_arX3DSolidPtrsUnite;
|
|
AcDbVoidPtrArray m_arX3DSolidPtrsSubtr;
|
|
AcDbVoidPtrArray m_arX3DSolidPtrsSubtrForHouse;
|
|
|
|
//先旋转,后移动
|
|
AcGeVector3d m_vtMove; //总移动
|
|
AcGePoint3d m_ptOrg; //原点
|
|
AcGeVector3dArray m_arVtAxis; //轴向
|
|
double m_dAxisRotats[MAX_AXISROTATS];//最多10个轴向旋转
|
|
AecDbObjXDataMap m_mapXData; //BIM数据
|
|
|
|
//显示,临时
|
|
CPoint m_ptActiveInf; //开孔的活动接口索引行x列 不序列化
|
|
bool m_bActive; //活动状态
|
|
int m_nPeelOff; //是否需要剖开
|
|
AcDb3dSolid* m_pSolid; //原始solid元
|
|
mutable AcDb3dSolid* m_pSolidDraw; //临时绘制solid元
|
|
mutable SHJson::WValue m_json;
|
|
};
|