diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index 96c1eb0e..ecbacf50 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -17,7 +17,7 @@ "arkOptions": { "runtimeOnly" : { "packages": [ - "libocctrender.so" + "libnativeocct.so" ] } } diff --git a/entry/libs/x86_64/libTKBO.so.7.9 b/entry/libs/x86_64/libTKBO.so.7.9 deleted file mode 100644 index a5693c68..00000000 Binary files a/entry/libs/x86_64/libTKBO.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKBRep.so.7.9 b/entry/libs/x86_64/libTKBRep.so.7.9 deleted file mode 100644 index c98ddc22..00000000 Binary files a/entry/libs/x86_64/libTKBRep.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKBin.so.7.9 b/entry/libs/x86_64/libTKBin.so.7.9 deleted file mode 100644 index 0b16e150..00000000 Binary files a/entry/libs/x86_64/libTKBin.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKBinL.so.7.9 b/entry/libs/x86_64/libTKBinL.so.7.9 deleted file mode 100644 index 161b676d..00000000 Binary files a/entry/libs/x86_64/libTKBinL.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKBinTObj.so.7.9 b/entry/libs/x86_64/libTKBinTObj.so.7.9 deleted file mode 100644 index 1b198d71..00000000 Binary files a/entry/libs/x86_64/libTKBinTObj.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKBinXCAF.so.7.9 b/entry/libs/x86_64/libTKBinXCAF.so.7.9 deleted file mode 100644 index b2446939..00000000 Binary files a/entry/libs/x86_64/libTKBinXCAF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKBool.so.7.9 b/entry/libs/x86_64/libTKBool.so.7.9 deleted file mode 100644 index c620c0e4..00000000 Binary files a/entry/libs/x86_64/libTKBool.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKCAF.so.7.9 b/entry/libs/x86_64/libTKCAF.so.7.9 deleted file mode 100644 index 4149045a..00000000 Binary files a/entry/libs/x86_64/libTKCAF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKCDF.so.7.9 b/entry/libs/x86_64/libTKCDF.so.7.9 deleted file mode 100644 index cc433e1d..00000000 Binary files a/entry/libs/x86_64/libTKCDF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDE.so.7.9 b/entry/libs/x86_64/libTKDE.so.7.9 deleted file mode 100644 index 0558ed88..00000000 Binary files a/entry/libs/x86_64/libTKDE.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDECascade.so.7.9 b/entry/libs/x86_64/libTKDECascade.so.7.9 deleted file mode 100644 index 89811331..00000000 Binary files a/entry/libs/x86_64/libTKDECascade.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDEGLTF.so.7.9 b/entry/libs/x86_64/libTKDEGLTF.so.7.9 deleted file mode 100644 index b9f77727..00000000 Binary files a/entry/libs/x86_64/libTKDEGLTF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDEIGES.so.7.9 b/entry/libs/x86_64/libTKDEIGES.so.7.9 deleted file mode 100644 index fd0b3636..00000000 Binary files a/entry/libs/x86_64/libTKDEIGES.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDEOBJ.so.7.9 b/entry/libs/x86_64/libTKDEOBJ.so.7.9 deleted file mode 100644 index 8cccb9e2..00000000 Binary files a/entry/libs/x86_64/libTKDEOBJ.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDEPLY.so.7.9 b/entry/libs/x86_64/libTKDEPLY.so.7.9 deleted file mode 100644 index b65e667c..00000000 Binary files a/entry/libs/x86_64/libTKDEPLY.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDESTEP.so.7.9 b/entry/libs/x86_64/libTKDESTEP.so.7.9 deleted file mode 100644 index e49e3ac6..00000000 Binary files a/entry/libs/x86_64/libTKDESTEP.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDESTL.so.7.9 b/entry/libs/x86_64/libTKDESTL.so.7.9 deleted file mode 100644 index 255b53e5..00000000 Binary files a/entry/libs/x86_64/libTKDESTL.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKDEVRML.so.7.9 b/entry/libs/x86_64/libTKDEVRML.so.7.9 deleted file mode 100644 index 12539208..00000000 Binary files a/entry/libs/x86_64/libTKDEVRML.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKFeat.so.7.9 b/entry/libs/x86_64/libTKFeat.so.7.9 deleted file mode 100644 index 3cdc4196..00000000 Binary files a/entry/libs/x86_64/libTKFeat.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKFillet.so.7.9 b/entry/libs/x86_64/libTKFillet.so.7.9 deleted file mode 100644 index 55317bfc..00000000 Binary files a/entry/libs/x86_64/libTKFillet.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKG2d.so.7.9 b/entry/libs/x86_64/libTKG2d.so.7.9 deleted file mode 100644 index a3cce573..00000000 Binary files a/entry/libs/x86_64/libTKG2d.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKG3d.so.7.9 b/entry/libs/x86_64/libTKG3d.so.7.9 deleted file mode 100644 index c52c533e..00000000 Binary files a/entry/libs/x86_64/libTKG3d.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKGeomAlgo.so.7.9 b/entry/libs/x86_64/libTKGeomAlgo.so.7.9 deleted file mode 100644 index 130293bd..00000000 Binary files a/entry/libs/x86_64/libTKGeomAlgo.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKGeomBase.so.7.9 b/entry/libs/x86_64/libTKGeomBase.so.7.9 deleted file mode 100644 index 37260bfa..00000000 Binary files a/entry/libs/x86_64/libTKGeomBase.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKHLR.so.7.9 b/entry/libs/x86_64/libTKHLR.so.7.9 deleted file mode 100644 index b25c357a..00000000 Binary files a/entry/libs/x86_64/libTKHLR.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKLCAF.so.7.9 b/entry/libs/x86_64/libTKLCAF.so.7.9 deleted file mode 100644 index 440bf9d1..00000000 Binary files a/entry/libs/x86_64/libTKLCAF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKMath.so.7.9 b/entry/libs/x86_64/libTKMath.so.7.9 deleted file mode 100644 index 5b94b28d..00000000 Binary files a/entry/libs/x86_64/libTKMath.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKMesh.so.7.9 b/entry/libs/x86_64/libTKMesh.so.7.9 deleted file mode 100644 index cea5129b..00000000 Binary files a/entry/libs/x86_64/libTKMesh.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKMeshVS.so.7.9 b/entry/libs/x86_64/libTKMeshVS.so.7.9 deleted file mode 100644 index 97cc4a93..00000000 Binary files a/entry/libs/x86_64/libTKMeshVS.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKOffset.so.7.9 b/entry/libs/x86_64/libTKOffset.so.7.9 deleted file mode 100644 index ddf08b0d..00000000 Binary files a/entry/libs/x86_64/libTKOffset.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKOpenGles.so.7.9 b/entry/libs/x86_64/libTKOpenGles.so.7.9 deleted file mode 100644 index e67563a9..00000000 Binary files a/entry/libs/x86_64/libTKOpenGles.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKPrim.so.7.9 b/entry/libs/x86_64/libTKPrim.so.7.9 deleted file mode 100644 index 8fd97f4d..00000000 Binary files a/entry/libs/x86_64/libTKPrim.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKRWMesh.so.7.9 b/entry/libs/x86_64/libTKRWMesh.so.7.9 deleted file mode 100644 index 9dee1b75..00000000 Binary files a/entry/libs/x86_64/libTKRWMesh.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKService.so.7.9 b/entry/libs/x86_64/libTKService.so.7.9 deleted file mode 100644 index 16f2b3d0..00000000 Binary files a/entry/libs/x86_64/libTKService.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKShHealing.so.7.9 b/entry/libs/x86_64/libTKShHealing.so.7.9 deleted file mode 100644 index 63180e86..00000000 Binary files a/entry/libs/x86_64/libTKShHealing.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKStd.so.7.9 b/entry/libs/x86_64/libTKStd.so.7.9 deleted file mode 100644 index f2aab953..00000000 Binary files a/entry/libs/x86_64/libTKStd.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKStdL.so.7.9 b/entry/libs/x86_64/libTKStdL.so.7.9 deleted file mode 100644 index ece2be82..00000000 Binary files a/entry/libs/x86_64/libTKStdL.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKTObj.so.7.9 b/entry/libs/x86_64/libTKTObj.so.7.9 deleted file mode 100644 index 1194029f..00000000 Binary files a/entry/libs/x86_64/libTKTObj.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKTopAlgo.so.7.9 b/entry/libs/x86_64/libTKTopAlgo.so.7.9 deleted file mode 100644 index a9fc40d1..00000000 Binary files a/entry/libs/x86_64/libTKTopAlgo.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKV3d.so.7.9 b/entry/libs/x86_64/libTKV3d.so.7.9 deleted file mode 100644 index 5b319c6b..00000000 Binary files a/entry/libs/x86_64/libTKV3d.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKVCAF.so.7.9 b/entry/libs/x86_64/libTKVCAF.so.7.9 deleted file mode 100644 index a76807fd..00000000 Binary files a/entry/libs/x86_64/libTKVCAF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKXCAF.so.7.9 b/entry/libs/x86_64/libTKXCAF.so.7.9 deleted file mode 100644 index 35b8774f..00000000 Binary files a/entry/libs/x86_64/libTKXCAF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKXMesh.so.7.9 b/entry/libs/x86_64/libTKXMesh.so.7.9 deleted file mode 100644 index ace70a00..00000000 Binary files a/entry/libs/x86_64/libTKXMesh.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKXSBase.so.7.9 b/entry/libs/x86_64/libTKXSBase.so.7.9 deleted file mode 100644 index 28057222..00000000 Binary files a/entry/libs/x86_64/libTKXSBase.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKXml.so.7.9 b/entry/libs/x86_64/libTKXml.so.7.9 deleted file mode 100644 index f3fedfd4..00000000 Binary files a/entry/libs/x86_64/libTKXml.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKXmlL.so.7.9 b/entry/libs/x86_64/libTKXmlL.so.7.9 deleted file mode 100644 index 16d57e49..00000000 Binary files a/entry/libs/x86_64/libTKXmlL.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKXmlTObj.so.7.9 b/entry/libs/x86_64/libTKXmlTObj.so.7.9 deleted file mode 100644 index 7b6282ff..00000000 Binary files a/entry/libs/x86_64/libTKXmlTObj.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKXmlXCAF.so.7.9 b/entry/libs/x86_64/libTKXmlXCAF.so.7.9 deleted file mode 100644 index 89738eda..00000000 Binary files a/entry/libs/x86_64/libTKXmlXCAF.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libTKernel.so.7.9 b/entry/libs/x86_64/libTKernel.so.7.9 deleted file mode 100644 index 6a7b71ff..00000000 Binary files a/entry/libs/x86_64/libTKernel.so.7.9 and /dev/null differ diff --git a/entry/libs/x86_64/libbrotlicommon.so.1 b/entry/libs/x86_64/libbrotlicommon.so.1 deleted file mode 100644 index 2a79804c..00000000 Binary files a/entry/libs/x86_64/libbrotlicommon.so.1 and /dev/null differ diff --git a/entry/libs/x86_64/libbrotlidec.so.1 b/entry/libs/x86_64/libbrotlidec.so.1 deleted file mode 100644 index bce04483..00000000 Binary files a/entry/libs/x86_64/libbrotlidec.so.1 and /dev/null differ diff --git a/entry/libs/x86_64/libbrotlienc.so.1 b/entry/libs/x86_64/libbrotlienc.so.1 deleted file mode 100644 index 55af6b42..00000000 Binary files a/entry/libs/x86_64/libbrotlienc.so.1 and /dev/null differ diff --git a/entry/libs/x86_64/libbz2.so.1.0 b/entry/libs/x86_64/libbz2.so.1.0 deleted file mode 100644 index e945be82..00000000 Binary files a/entry/libs/x86_64/libbz2.so.1.0 and /dev/null differ diff --git a/entry/libs/x86_64/libexpat.so.1 b/entry/libs/x86_64/libexpat.so.1 deleted file mode 100644 index a2703820..00000000 Binary files a/entry/libs/x86_64/libexpat.so.1 and /dev/null differ diff --git a/entry/libs/x86_64/libfontconfig.so.1 b/entry/libs/x86_64/libfontconfig.so.1 deleted file mode 100644 index 0480535d..00000000 Binary files a/entry/libs/x86_64/libfontconfig.so.1 and /dev/null differ diff --git a/entry/libs/x86_64/libfreetype.so.6 b/entry/libs/x86_64/libfreetype.so.6 deleted file mode 100644 index dbd514fc..00000000 Binary files a/entry/libs/x86_64/libfreetype.so.6 and /dev/null differ diff --git a/entry/libs/x86_64/libpng16.so.16 b/entry/libs/x86_64/libpng16.so.16 deleted file mode 100644 index 7664a931..00000000 Binary files a/entry/libs/x86_64/libpng16.so.16 and /dev/null differ diff --git a/entry/libs/x86_64/libz.so.1 b/entry/libs/x86_64/libz.so.1 deleted file mode 100644 index 190094a9..00000000 Binary files a/entry/libs/x86_64/libz.so.1 and /dev/null differ diff --git a/entry/oh-package-lock.json5 b/entry/oh-package-lock.json5 index d1581864..6e11548f 100644 --- a/entry/oh-package-lock.json5 +++ b/entry/oh-package-lock.json5 @@ -6,13 +6,13 @@ "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": { - "libocctrender.so@src/main/cpp/types/libocctrender": "libocctrender.so@src/main/cpp/types/libocctrender" + "libnativeocct.so@src/main/cpp/types/libnativeocct": "libnativeocct.so@src/main/cpp/types/libnativeocct" }, "packages": { - "libocctrender.so@src/main/cpp/types/libocctrender": { - "name": "libocctrender.so", + "libnativeocct.so@src/main/cpp/types/libnativeocct": { + "name": "libnativeocct.so", "version": "1.0.0", - "resolved": "src/main/cpp/types/libocctrender", + "resolved": "src/main/cpp/types/libnativeocct", "registryType": "local" } } diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 index 301af059..230ed243 100644 --- a/entry/oh-package.json5 +++ b/entry/oh-package.json5 @@ -6,6 +6,6 @@ "author": "", "license": "", "dependencies": { - "libocctrender.so": "file:./src/main/cpp/types/libocctrender" + "libnativeocct.so": "file:./src/main/cpp/types/libnativeocct" } } \ No newline at end of file diff --git a/entry/src/main/cpp/CMakeLists.txt b/entry/src/main/cpp/CMakeLists.txt index ecbea014..aae586a5 100644 --- a/entry/src/main/cpp/CMakeLists.txt +++ b/entry/src/main/cpp/CMakeLists.txt @@ -13,8 +13,8 @@ include_directories(${NATIVERENDER_ROOT_PATH} set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -set(CMAKE_INSTALL_RPATH "$ORIGIN") -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) +set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +set(CMAKE_INSTALL_RPATH "\${ORIGIN}") # OCCT 库目录 set(OCCT_VERSION "7.9") @@ -68,7 +68,7 @@ foreach(LIB_NAME ${THIRD_PARTY_LIBS}) endforeach() # 添加源文件 -add_library(occtrender SHARED +add_library(nativeocct SHARED napi_init.cpp # Header EGLCore/EGLCore.h @@ -87,12 +87,8 @@ find_library(hilog-lib hilog_ndk.z) find_library(libace-lib ace_ndk.z) find_library(libuv-lib uv) -set(CMAKE_SKIP_BUILD_RPATH FALSE) -set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -set(CMAKE_INSTALL_RPATH "$ORIGIN") -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # 链接系统库 -target_link_libraries(occtrender PUBLIC +target_link_libraries(nativeocct PUBLIC # EGL Hilog 库 ${EGL-lib} ${GLES-lib} diff --git a/entry/src/main/cpp/types/libocctrender/Index.d.ts b/entry/src/main/cpp/types/libnativeocct/Index.d.ts similarity index 100% rename from entry/src/main/cpp/types/libocctrender/Index.d.ts rename to entry/src/main/cpp/types/libnativeocct/Index.d.ts diff --git a/entry/src/main/cpp/types/libocctrender/oh-package.json5 b/entry/src/main/cpp/types/libnativeocct/oh-package.json5 similarity index 77% rename from entry/src/main/cpp/types/libocctrender/oh-package.json5 rename to entry/src/main/cpp/types/libnativeocct/oh-package.json5 index f9bec4ec..7030cea1 100644 --- a/entry/src/main/cpp/types/libocctrender/oh-package.json5 +++ b/entry/src/main/cpp/types/libnativeocct/oh-package.json5 @@ -1,5 +1,5 @@ { - "name": "libocctrender.so", + "name": "libnativeocct.so", "types": "./Index.d.ts", "version": "1.0.0", "description": "Please describe the basic information." diff --git a/entry/src/main/ets/pages/modelView.ets b/entry/src/main/ets/pages/modelView.ets index 80a3fc9d..abf14332 100644 --- a/entry/src/main/ets/pages/modelView.ets +++ b/entry/src/main/ets/pages/modelView.ets @@ -65,11 +65,11 @@ export struct ModelView { }) Button('测试库加载').onClick(async()=>{ try { - let OCCTRender = await import("libocctrender.so") - console.info(`[NDK] 模块类型: ${typeof OCCTRender}`); - console.info(`[NDK] 模块值: ${JSON.stringify(OCCTRender)}`); - console.info(`[NDK] 所有属性: ${Object.keys(OCCTRender).join(', ')}`); - if (!OCCTRender) throw new Error("模块为 undefined"); + const nativeocct = await import("libnativeocct.so") + console.info(`[NDK] 模块类型: ${typeof nativeocct}`); + console.info(`[NDK] 模块值: ${JSON.stringify(nativeocct)}`); + console.info(`[NDK] 所有属性: ${Object.keys(nativeocct).join(', ')}`); + if (!nativeocct) throw new Error("模块为 undefined"); } catch (e) { console.error(`[NDK] 加载失败: ${e.message}`, e); // 此处会触发你看到的错误 @@ -81,35 +81,6 @@ export struct ModelView { type: 'surface', controller: this.displayController }) - // .onLoad(() => { - // // 获取 native window(必须在 onLoad 后才能获取) - // this.nativeWindow = this.displayController.getXComponentSurfaceId(); - // if (this.nativeWindow === undefined || this.nativeWindow === '') { - // hilog.error(0x0000, 'ModelView', 'Failed to get native window'); - // return; - // } - // // 获取 XComponent 尺寸 - // let width = 0; - // let height = 0; - // try { - // OCCTRender.initRenderer(this.displayContrId, this.nativeWindow, { width: 800, height: 600 }); - // console.info('Init Render Good'); - // }catch(e){ - // console.info('Init Render Faile'); - // } - // }) - // .onDestroy(() => { - // // 销毁时清理资源 - // OCCTRender.destroyRenderer(this.displayContrId); - // }) - // .onTouch((event) => { - // // 简单鼠标/触摸拖拽旋转 - // if (event.type === TouchType.Move) { - // const dx = event.tiltX; - // const dy = event.tiltY; - // //occt.onMouseEvent(this.xcomponentId, dx, dy); - // } - // }) .width('100%') .height('100%') .backgroundColor('#333333');