diff --git a/docs/source/conf.py b/docs/source/conf.py index 27974fc..388eefe 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ author = 'LinkunGao' # The full version, including alpha/beta/rc tags -release = 'v1.14.4' +release = 'v1.14.5' # -- General configuration --------------------------------------------------- diff --git a/docs/source/release/release.md b/docs/source/release/release.md index e47eb60..07f7288 100644 --- a/docs/source/release/release.md +++ b/docs/source/release/release.md @@ -1615,3 +1615,7 @@ sceneIn?.loadNrrd(url, loadBar1, false, funa, opts); ## Release v1.14.4 - Fixed bug: draw lines not continuous on label 1, 2, 3. + +## Release v1.14.5 + +- Fixed GUI overload issue in copperNrrdLoader. diff --git a/package-lock.json b/package-lock.json index b99a16f..86098c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "copper3d_visualisation", - "version": "1.14.4", + "version": "1.14.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "copper3d_visualisation", - "version": "1.14.4", + "version": "1.14.5", "license": "Apache-2.0", "dependencies": { "@types/dat.gui": "^0.7.9", diff --git a/package.json b/package.json index 2ccd882..9a0d605 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "copper3d_visualisation", "description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.", - "version": "1.14.4", + "version": "1.14.5", "main": "dist/bundle.umd.js", "moudle": "dist/bundle.esm.js", "types": "dist/types/index.d.ts", diff --git a/src/Loader/copperNrrdLoader.ts b/src/Loader/copperNrrdLoader.ts index af1a103..4cb3691 100644 --- a/src/Loader/copperNrrdLoader.ts +++ b/src/Loader/copperNrrdLoader.ts @@ -20,7 +20,8 @@ loader = new NRRDLoader(); // loader.setSegmentationn(true); let cube: THREE.Mesh; -let gui: GUI; +let gui: GUI | undefined; +let oldGuiDom:HTMLDivElement; let CircleGeometry = new THREE.RingGeometry(5, 6, 30); let CircleMaterial = new THREE.MeshBasicMaterial({ @@ -158,6 +159,7 @@ export function copperNrrdLoader( } else { callback && callback(volume, nrrdMeshes, nrrdSlices); } + gui = undefined }, function (xhr: ProgressEvent) { loadingContainer.style.display = "flex"; @@ -427,13 +429,17 @@ export function addBoxHelper( } function configGui(opts?: optsType) { + if (opts && opts.openGui) { if (opts.container) { + if(oldGuiDom){ + opts.container.removeChild(oldGuiDom); + } gui = new GUI({ width: 260, autoPlace: false, }); - + oldGuiDom = gui.domElement as HTMLDivElement; opts.container.appendChild(gui.domElement); } else { gui = new GUI(); diff --git a/src/index.ts b/src/index.ts index c598586..668f33f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,10 +36,10 @@ import { import "./css/style.css"; -export const REVISION = "v1.14.4"; +export const REVISION = "v1.14.5"; console.log( - "%cCopper3D Visualisation %cBeta:v1.14.4", + "%cCopper3D Visualisation %cBeta:v1.14.5", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25" );