@kitware/vtk.js 22.5.5 → 22.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import vtkRenderWindow, { IRenderWindowInitialValues } from '@kitware/vtk.js/Rendering/Core/RenderWindow';
|
|
2
2
|
|
|
3
3
|
// Keeps state for client / server scene synchronization.
|
|
4
|
-
export interface
|
|
4
|
+
export interface ISynchronizerContext {
|
|
5
5
|
// Set a function that fetches the data array for the given object.
|
|
6
6
|
setFetchArrayFunction(fetcher: (hash: string, dataType: any) => Promise<ArrayBuffer>): void;
|
|
7
7
|
// Invokes the fetcher registered by setFetchArrayFunction.
|
|
8
|
-
getArray(sha: string, dataType: any, context:
|
|
8
|
+
getArray(sha: string, dataType: any, context: ISynchronizerContext): Promise<ArrayBuffer>;
|
|
9
9
|
emptyCachedArrays(): void;
|
|
10
|
-
freeOldArrays(threshold: number, context:
|
|
10
|
+
freeOldArrays(threshold: number, context: ISynchronizerContext): void;
|
|
11
11
|
|
|
12
12
|
// instanceMap
|
|
13
13
|
getInstance(id: any): any;
|
|
@@ -25,14 +25,14 @@ export interface SynchContext {
|
|
|
25
25
|
// TODO: fill progresshandler
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export interface
|
|
28
|
+
export interface ISynchronizableRenderWindowInitialValues extends IRenderWindowInitialValues {
|
|
29
29
|
synchronizerContextName?: string; // default: 'default':
|
|
30
|
-
synchronizerContext?:
|
|
30
|
+
synchronizerContext?: ISynchronizerContext | null;
|
|
31
31
|
synchronizedViewId?: string | null;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Server-side view state.
|
|
35
|
-
export interface
|
|
35
|
+
export interface IViewState {
|
|
36
36
|
id: string;
|
|
37
37
|
// vtk object type.
|
|
38
38
|
type: string;
|
|
@@ -42,7 +42,7 @@ export interface ViewState {
|
|
|
42
42
|
parent?: string | null;
|
|
43
43
|
properties?: {[key: string]: any};
|
|
44
44
|
// Child objects.
|
|
45
|
-
dependencies?:
|
|
45
|
+
dependencies?: IViewState[];
|
|
46
46
|
extra?: any;
|
|
47
47
|
// List of [methodName, args] to be invoked on the object.
|
|
48
48
|
calls?: [string, string[]][];
|
|
@@ -50,24 +50,116 @@ export interface ViewState {
|
|
|
50
50
|
[key: string]: any;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
export interface
|
|
54
|
-
|
|
53
|
+
export interface vtkSynchronizableRenderWindow extends vtkRenderWindow {
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
getSynchronizerContext(): ISynchronizerContext;
|
|
55
59
|
|
|
56
60
|
// methods added by createSyncFunction
|
|
57
|
-
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param {IViewState} state
|
|
65
|
+
*/
|
|
66
|
+
synchronize(state: IViewState): Promise<boolean>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param {String} viewId
|
|
71
|
+
*/
|
|
58
72
|
setSynchronizedViewId(viewId: string): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
59
77
|
getSynchronizedViewId(): string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param {Number} v
|
|
82
|
+
*/
|
|
60
83
|
updateGarbageCollectorThreshold(v: number): void;
|
|
61
|
-
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
getManagedInstanceIds(): string[];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
62
93
|
clearOneTimeUpdaters(): void;
|
|
63
94
|
}
|
|
64
95
|
|
|
65
|
-
|
|
66
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Method used to decorate a given object (publicAPI+model) with vtkCellArray characteristics.
|
|
98
|
+
*
|
|
99
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
100
|
+
* @param model object on which data structure will be bounds (protected)
|
|
101
|
+
* @param {ISynchronizableRenderWindowInitialValues} [initialValues] (default: {})
|
|
102
|
+
*/
|
|
103
|
+
export function extend(publicAPI: object, model: object, initialValues?: ISynchronizableRenderWindowInitialValues): void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Method used to create a new instance of vtkSynchronizableRenderWindow
|
|
107
|
+
* @param {ISynchronizableRenderWindowInitialValues} [initialValues] for pre-setting some of its content
|
|
108
|
+
*/
|
|
109
|
+
export function newInstance(initialValues?: ISynchronizableRenderWindowInitialValues): vtkSynchronizableRenderWindow;
|
|
67
110
|
|
|
68
|
-
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* @param {String} [name]
|
|
114
|
+
*/
|
|
115
|
+
export function getSynchronizerContext(name?: string): ISynchronizerContext;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* @param {String} name
|
|
120
|
+
* @param {ISynchronizerContext} ctx
|
|
121
|
+
*/
|
|
122
|
+
export function setSynchronizerContext(name: string, ctx: ISynchronizerContext): ISynchronizerContext;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @param {vtkRenderWindow} renderWindow
|
|
127
|
+
* @param {String} [name]
|
|
128
|
+
*/
|
|
129
|
+
export function decorate(renderWindow: vtkRenderWindow, name?: string): object;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
*/
|
|
134
|
+
export function createInstanceMap(): object;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
*/
|
|
139
|
+
export function createArrayHandler(): object;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
*/
|
|
144
|
+
export function createProgressHandler(): object;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
export function createSceneMtimeHandler(): object;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
154
|
+
export declare const vtkSynchronizableRenderWindow: {
|
|
69
155
|
newInstance: typeof newInstance;
|
|
70
156
|
getSynchronizerContext: typeof getSynchronizerContext;
|
|
157
|
+
setSynchronizerContext: typeof setSynchronizerContext;
|
|
158
|
+
decorate: typeof decorate,
|
|
159
|
+
createInstanceMap: typeof createInstanceMap,
|
|
160
|
+
createArrayHandler: typeof createArrayHandler,
|
|
161
|
+
createProgressHandler: typeof createProgressHandler,
|
|
162
|
+
createSceneMtimeHandler: typeof createSceneMtimeHandler,
|
|
163
|
+
vtkObjectManager: object
|
|
71
164
|
};
|
|
72
|
-
|
|
73
165
|
export default vtkSynchronizableRenderWindow;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Md5 from 'spark-md5';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkShaderProgram from './ShaderProgram.js';
|
|
4
4
|
|
|
@@ -88,7 +88,7 @@ function vtkShaderCache(publicAPI, model) {
|
|
|
88
88
|
publicAPI.getShaderProgram = function (vertexCode, fragmentCode, geometryCode) {
|
|
89
89
|
// compute the MD5 and the check the map
|
|
90
90
|
var hashInput = "".concat(vertexCode).concat(fragmentCode).concat(geometryCode);
|
|
91
|
-
var result =
|
|
91
|
+
var result = Md5.hash(hashInput); // does it already exist?
|
|
92
92
|
|
|
93
93
|
var loc = Object.keys(model.shaderPrograms).indexOf(result);
|
|
94
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitware/vtk.js",
|
|
3
|
-
"version": "22.5.
|
|
3
|
+
"version": "22.5.6",
|
|
4
4
|
"description": "Visualization Toolkit for the Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"3d",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"module": "./index.js",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "7.16.7",
|
|
34
|
-
"blueimp-md5": "2.19.0",
|
|
35
34
|
"commander": "8.3.0",
|
|
36
35
|
"d3-scale": "4.0.2",
|
|
37
36
|
"gl-matrix": "3.4.3",
|
|
@@ -41,6 +40,7 @@
|
|
|
41
40
|
"seedrandom": "3.0.5",
|
|
42
41
|
"shader-loader": "1.3.1",
|
|
43
42
|
"shelljs": "0.8.5",
|
|
43
|
+
"spark-md5": "^3.0.2",
|
|
44
44
|
"stream-browserify": "3.0.0",
|
|
45
45
|
"webworker-promise": "0.4.4",
|
|
46
46
|
"worker-loader": "3.0.8",
|