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

57 lines
1.5 KiB
C++

#pragma once
#ifdef BIMCOVERSION_EXPORT
#define BIMCONVDLLIMPEXP __declspec(dllexport)
#else
#define BIMCONVDLLIMPEXP __declspec(dllimport)
#endif
#include "threejs.h"
#include "BIMEntity.h"
// 解析3js文件
class BIMCONVDLLIMPEXP ThreeJsTools
{
public:
// 解析ThreeJs-Json文件到对应的C++结构
static bool parse3Js(LPCTSTR pszJson
, ThreeJs::GeometrySet &gs
, ThreeJs::Object &obj
, ThreeJs::MaterialSet &ms
, ThreeJs::Metadata &meta);
// 将 ThreeJs-Json 中的矩阵转为 AcGeMatrix3d
static bool convert3JsMatrix2AcGeMatrix3d(const std::vector<double> &ar, AcGeMatrix3d &mat);
// 将ThreeJs-Json的faces数组转AcDbSubDMesh的faces数组
static bool convert3JsFaces2SubDMeshFaces(const std::vector<int> &face3Js, AcArray<Adesk::Int32> &faceSubD);
// 将ThreeJs-Json的点数组转AcGePoint3dArray
static bool convert3JsPointArray2AcGePoint3dArray(const std::vector<double> &pnts, AcGePoint3dArray &gepts);
//
static bool collectBimEntitiesFrom3Js(LPCTSTR pszJs, std::vector<BIMEntity> &bims);
};
// 解析上华Js文件
class BIMCONVDLLIMPEXP ShJsTools
{
public:
static bool parseShJs(LPCTSTR pszJson
, ShJs::Objects &objs
, AcGePoint3d &ptLeftDown
, double &dLength
, double &dWidth
, double &dHeight);
static bool collectBimEntitiesFromShJs(LPCTSTR pszJs
, std::vector<BIMEntity> &bims
, AcGePoint3d &ptLeftDown
, double &dLength
, double &dWidth
, double &dHeight);
static bool filterR2SFiles(LPCTSTR pszR2S, std::vector<CString> &paths, bool *bHideEw);
};