Files

56 lines
1.5 KiB
C++
Raw Permalink Normal View History

2026-10-04 00:04:20 +08:00
#pragma once
2026-09-28 15:28:50 +08:00
#ifdef BIMCOVERSION_EXPORT
#define BIMCONVDLLIMPEXP __declspec(dllexport)
#else
#define BIMCONVDLLIMPEXP __declspec(dllimport)
#endif
#include "threejs.h"
#include "BIMEntity.h"
2026-10-04 00:04:20 +08:00
// 解析3js文件
2026-09-28 15:28:50 +08:00
class BIMCONVDLLIMPEXP ThreeJsTools
{
public:
2026-10-04 00:04:20 +08:00
// 解析ThreeJs-Json文件到对应的C++结构
2026-09-28 15:28:50 +08:00
static bool parse3Js(LPCTSTR pszJson
, ThreeJs::GeometrySet &gs
, ThreeJs::Object &obj
, ThreeJs::MaterialSet &ms
, ThreeJs::Metadata &meta);
2026-10-04 00:04:20 +08:00
// 将 ThreeJs-Json 中的矩阵转为 AcGeMatrix3d
2026-09-28 15:28:50 +08:00
static bool convert3JsMatrix2AcGeMatrix3d(const std::vector<double> &ar, AcGeMatrix3d &mat);
2026-10-04 00:04:20 +08:00
// 将ThreeJs-Json的faces数组转AcDbSubDMesh的faces数组
2026-09-28 15:28:50 +08:00
static bool convert3JsFaces2SubDMeshFaces(const std::vector<int> &face3Js, AcArray<Adesk::Int32> &faceSubD);
2026-10-04 00:04:20 +08:00
// 将ThreeJs-Json的点数组转AcGePoint3dArray
2026-09-28 15:28:50 +08:00
static bool convert3JsPointArray2AcGePoint3dArray(const std::vector<double> &pnts, AcGePoint3dArray &gepts);
//
static bool collectBimEntitiesFrom3Js(LPCTSTR pszJs, std::vector<BIMEntity> &bims);
};
2026-10-04 00:04:20 +08:00
// 解析上华Js文件
2026-09-28 15:28:50 +08:00
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);
};