Skip to content

Commit 96eb047

Browse files
authored
Merge pull request #182 from LinkunGao/release/v1.13.18
Release/v1.13.18
2 parents 2d2aa4b + 1102a6b commit 96eb047

File tree

8 files changed

+37
-12
lines changed

8 files changed

+37
-12
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'LinkunGao'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = 'v1.13.15'
25+
release = 'v1.13.18'
2626

2727

2828
# -- General configuration ---------------------------------------------------

docs/source/release/release.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,4 +1440,18 @@ const resetMainAreaSize = (factor: number) => {
14401440

14411441
## Release v1.13.17
14421442

1443-
- add web work in nrrd tools for export/download masks.
1443+
- add web worker in nrrd tools for export/download masks.
1444+
1445+
## Release v1.13.18
1446+
1447+
- reset web worker url
1448+
- add a remove prerender callback function
1449+
```ts
1450+
const a = () => {
1451+
console.log("a");
1452+
};
1453+
const index = scene.addPreRenderCallbackFunction(a);
1454+
setTimeout(() => {
1455+
scene?.removePreRenderCallbackFunction(index);
1456+
}, 3000);
1457+
```

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "copper3d_visualisation",
33
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
4-
"version": "1.13.17",
4+
"version": "1.13.18",
55
"main": "dist/bundle.umd.js",
66
"moudle": "dist/bundle.esm.js",
77
"types": "dist/types/index.d.ts",

src/Scene/commonSceneMethod.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export default class commonScene {
5252
return;
5353
}
5454
},
55+
remove(id) {
56+
if (this.cache[id]) delete this.cache[id];
57+
},
5558
};
5659
}
5760

@@ -87,6 +90,10 @@ export default class commonScene {
8790
return id;
8891
}
8992

93+
removePreRenderCallbackFunction(id: number) {
94+
this.preRenderCallbackFunctions.remove(id);
95+
}
96+
9097
pickModel(
9198
content: THREE.Group,
9299
callback: (selectMesh: THREE.Mesh | undefined) => void,

src/Utils/nrrd_tool.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2434,12 +2434,15 @@ export class nrrd_tools {
24342434
// this.paintImages.y.length
24352435
// );
24362436

2437-
const worker = new Worker(
2438-
new URL("./workers/reformatSaveDataWorker.ts", import.meta.url),
2439-
{
2440-
type: "module",
2441-
}
2442-
);
2437+
// const worker = new Worker(
2438+
// new URL("./workers/reformatSaveDataWorker.ts", import.meta.url),
2439+
// {
2440+
// type: "module",
2441+
// }
2442+
// );
2443+
const worker = new Worker("./workers/reformatSaveDataWorker.ts", {
2444+
type: "module",
2445+
});
24432446
window.alert("Export masks, starting!!!");
24442447
worker.postMessage({
24452448
masksData: this.paintImages.z,

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ import {
3636

3737
import "./css/style.css";
3838

39-
export const REVISION = "v1.13.17";
39+
export const REVISION = "v1.13.18";
4040

4141
console.log(
42-
"%cCopper3D Visualisation %cBeta:v1.13.17",
42+
"%cCopper3D Visualisation %cBeta:v1.13.18",
4343
"padding: 3px;color:white; background:#023047",
4444
"padding: 3px;color:white; background:#f50a25"
4545
);

src/types/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ interface preRenderCallbackFunctionType {
4949
index: number;
5050
cache: cacheType;
5151
add: (fn: any) => void;
52+
remove: (id: number) => void;
5253
}
5354

5455
interface baseStateType {

0 commit comments

Comments
 (0)