@inweb/viewer-three 25.3.18 → 25.3.19
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.
- package/dist/viewer-three.js +86 -73
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +2 -2
- package/dist/viewer-three.module.js +85 -74
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/Viewer.d.ts +2 -2
- package/lib/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/Viewer/Viewer.ts +3 -3
- package/src/index.ts +1 -1
package/dist/viewer-three.js
CHANGED
|
@@ -65,54 +65,62 @@
|
|
|
65
65
|
|
|
66
66
|
commands("ThreeJS").registerCommand("noop", (() => {}));
|
|
67
67
|
|
|
68
|
+
function defaultOptions() {
|
|
69
|
+
return {
|
|
70
|
+
showWCS: true,
|
|
71
|
+
cameraAnimation: true,
|
|
72
|
+
antialiasing: true,
|
|
73
|
+
groundShadow: false,
|
|
74
|
+
shadows: false,
|
|
75
|
+
cameraAxisXSpeed: 4,
|
|
76
|
+
cameraAxisYSpeed: 1,
|
|
77
|
+
ambientOcclusion: false,
|
|
78
|
+
enableStreamingMode: true,
|
|
79
|
+
enablePartialMode: false,
|
|
80
|
+
memoryLimit: 3294967296,
|
|
81
|
+
cuttingPlaneFillColor: {
|
|
82
|
+
red: 255,
|
|
83
|
+
green: 152,
|
|
84
|
+
blue: 0
|
|
85
|
+
},
|
|
86
|
+
edgesColor: {
|
|
87
|
+
r: 255,
|
|
88
|
+
g: 152,
|
|
89
|
+
b: 0
|
|
90
|
+
},
|
|
91
|
+
facesColor: {
|
|
92
|
+
r: 255,
|
|
93
|
+
g: 152,
|
|
94
|
+
b: 0
|
|
95
|
+
},
|
|
96
|
+
edgesVisibility: true,
|
|
97
|
+
edgesOverlap: true,
|
|
98
|
+
facesOverlap: false,
|
|
99
|
+
facesTransparancy: 200,
|
|
100
|
+
enableCustomHighlight: true,
|
|
101
|
+
sceneGraph: false,
|
|
102
|
+
edgeModel: true,
|
|
103
|
+
reverseZoomWheel: false,
|
|
104
|
+
enableZoomWheel: true,
|
|
105
|
+
enableGestures: true,
|
|
106
|
+
geometryType: "vsfx"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
68
110
|
class Options {
|
|
69
111
|
constructor(emitter) {
|
|
70
112
|
this._emitter = emitter;
|
|
71
|
-
this._data =
|
|
113
|
+
this._data = defaultOptions();
|
|
72
114
|
this.loadFromStorage();
|
|
73
115
|
}
|
|
74
116
|
static defaults() {
|
|
75
|
-
return
|
|
76
|
-
showWCS: true,
|
|
77
|
-
cameraAnimation: true,
|
|
78
|
-
antialiasing: true,
|
|
79
|
-
groundShadow: false,
|
|
80
|
-
shadows: false,
|
|
81
|
-
cameraAxisXSpeed: 4,
|
|
82
|
-
cameraAxisYSpeed: 1,
|
|
83
|
-
ambientOcclusion: false,
|
|
84
|
-
enableStreamingMode: true,
|
|
85
|
-
enablePartialMode: false,
|
|
86
|
-
memoryLimit: 3294967296,
|
|
87
|
-
cuttingPlaneFillColor: {
|
|
88
|
-
red: 255,
|
|
89
|
-
green: 152,
|
|
90
|
-
blue: 0
|
|
91
|
-
},
|
|
92
|
-
edgesColor: {
|
|
93
|
-
r: 255,
|
|
94
|
-
g: 152,
|
|
95
|
-
b: 0
|
|
96
|
-
},
|
|
97
|
-
facesColor: {
|
|
98
|
-
r: 255,
|
|
99
|
-
g: 152,
|
|
100
|
-
b: 0
|
|
101
|
-
},
|
|
102
|
-
edgesVisibility: true,
|
|
103
|
-
edgesOverlap: true,
|
|
104
|
-
facesOverlap: false,
|
|
105
|
-
facesTransparancy: 200,
|
|
106
|
-
enableCustomHighlight: true,
|
|
107
|
-
sceneGraph: false,
|
|
108
|
-
edgeModel: true,
|
|
109
|
-
reverseZoomWheel: false,
|
|
110
|
-
enableZoomWheel: true,
|
|
111
|
-
enableGestures: true,
|
|
112
|
-
geometryType: "vsfx"
|
|
113
|
-
};
|
|
117
|
+
return defaultOptions();
|
|
114
118
|
}
|
|
115
119
|
notifierChangeEvent() {
|
|
120
|
+
console.warn("Options.notifierChangeEvent() has been deprecated since 25.3 and will be removed in a future release, use Options.change() instead.");
|
|
121
|
+
this.change();
|
|
122
|
+
}
|
|
123
|
+
change() {
|
|
116
124
|
if (this._emitter !== undefined) {
|
|
117
125
|
this.saveToStorage();
|
|
118
126
|
this._emitter.emit({
|
|
@@ -163,151 +171,154 @@
|
|
|
163
171
|
return this._data;
|
|
164
172
|
}
|
|
165
173
|
set data(value) {
|
|
166
|
-
const
|
|
174
|
+
const enablePartialMode = value.enableStreamingMode ? value.enablePartialMode : false;
|
|
175
|
+
const sceneGraph = enablePartialMode ? false : value.sceneGraph;
|
|
167
176
|
this._data = {
|
|
168
177
|
...Options.defaults(),
|
|
169
178
|
...this._data,
|
|
170
179
|
...value,
|
|
180
|
+
enablePartialMode: enablePartialMode,
|
|
171
181
|
sceneGraph: sceneGraph
|
|
172
182
|
};
|
|
173
|
-
this.
|
|
183
|
+
this.change();
|
|
174
184
|
}
|
|
175
185
|
get showWCS() {
|
|
176
186
|
return this._data.showWCS;
|
|
177
187
|
}
|
|
178
188
|
set showWCS(value) {
|
|
179
189
|
this._data.showWCS = value;
|
|
180
|
-
this.
|
|
190
|
+
this.change();
|
|
181
191
|
}
|
|
182
192
|
get cameraAnimation() {
|
|
183
193
|
return this._data.cameraAnimation;
|
|
184
194
|
}
|
|
185
195
|
set cameraAnimation(value) {
|
|
186
196
|
this._data.cameraAnimation = value;
|
|
187
|
-
this.
|
|
197
|
+
this.change();
|
|
188
198
|
}
|
|
189
199
|
get antialiasing() {
|
|
190
200
|
return this._data.antialiasing;
|
|
191
201
|
}
|
|
192
202
|
set antialiasing(value) {
|
|
193
203
|
this._data.antialiasing = value;
|
|
194
|
-
this.
|
|
204
|
+
this.change();
|
|
195
205
|
}
|
|
196
206
|
get groundShadow() {
|
|
197
207
|
return this._data.groundShadow;
|
|
198
208
|
}
|
|
199
209
|
set groundShadow(value) {
|
|
200
210
|
this._data.groundShadow = value;
|
|
201
|
-
this.
|
|
211
|
+
this.change();
|
|
202
212
|
}
|
|
203
213
|
get shadows() {
|
|
204
214
|
return this._data.shadows;
|
|
205
215
|
}
|
|
206
216
|
set shadows(value) {
|
|
207
217
|
this._data.shadows = value;
|
|
208
|
-
this.
|
|
218
|
+
this.change();
|
|
209
219
|
}
|
|
210
220
|
get cameraAxisXSpeed() {
|
|
211
221
|
return this._data.cameraAxisXSpeed;
|
|
212
222
|
}
|
|
213
223
|
set cameraAxisXSpeed(value) {
|
|
214
224
|
this._data.cameraAxisXSpeed = value;
|
|
215
|
-
this.
|
|
225
|
+
this.change();
|
|
216
226
|
}
|
|
217
227
|
get cameraAxisYSpeed() {
|
|
218
228
|
return this._data.cameraAxisYSpeed;
|
|
219
229
|
}
|
|
220
230
|
set cameraAxisYSpeed(value) {
|
|
221
231
|
this.cameraAxisYSpeed = value;
|
|
222
|
-
this.
|
|
232
|
+
this.change();
|
|
223
233
|
}
|
|
224
234
|
get ambientOcclusion() {
|
|
225
235
|
return this._data.ambientOcclusion;
|
|
226
236
|
}
|
|
227
237
|
set ambientOcclusion(value) {
|
|
228
238
|
this._data.ambientOcclusion = value;
|
|
229
|
-
this.
|
|
239
|
+
this.change();
|
|
230
240
|
}
|
|
231
241
|
get enableStreamingMode() {
|
|
232
242
|
return this._data.enableStreamingMode;
|
|
233
243
|
}
|
|
234
244
|
set enableStreamingMode(value) {
|
|
235
245
|
this._data.enableStreamingMode = value;
|
|
236
|
-
if (this._data.
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
this.notifierChangeEvent();
|
|
246
|
+
if (!value) this._data.enablePartialMode = false;
|
|
247
|
+
this.change();
|
|
240
248
|
}
|
|
241
249
|
get enablePartialMode() {
|
|
242
250
|
return this._data.enablePartialMode;
|
|
243
251
|
}
|
|
244
252
|
set enablePartialMode(value) {
|
|
245
253
|
this._data.enablePartialMode = value;
|
|
246
|
-
if (value)
|
|
247
|
-
|
|
254
|
+
if (value) {
|
|
255
|
+
this._data.enableStreamingMode = true;
|
|
256
|
+
this._data.sceneGraph = false;
|
|
257
|
+
}
|
|
258
|
+
this.change();
|
|
248
259
|
}
|
|
249
260
|
get memoryLimit() {
|
|
250
261
|
return this._data.memoryLimit;
|
|
251
262
|
}
|
|
252
263
|
set memoryLimit(value) {
|
|
253
264
|
this._data.memoryLimit = value;
|
|
254
|
-
this.
|
|
265
|
+
this.change();
|
|
255
266
|
}
|
|
256
267
|
get cuttingPlaneFillColor() {
|
|
257
268
|
return this._data.cuttingPlaneFillColor;
|
|
258
269
|
}
|
|
259
270
|
set cuttingPlaneFillColor(value) {
|
|
260
271
|
this._data.cuttingPlaneFillColor = value;
|
|
261
|
-
this.
|
|
272
|
+
this.change();
|
|
262
273
|
}
|
|
263
274
|
get edgesColor() {
|
|
264
275
|
return this._data.edgesColor;
|
|
265
276
|
}
|
|
266
277
|
set edgesColor(value) {
|
|
267
278
|
this._data.edgesColor = value;
|
|
268
|
-
this.
|
|
279
|
+
this.change();
|
|
269
280
|
}
|
|
270
281
|
get facesColor() {
|
|
271
282
|
return this._data.facesColor;
|
|
272
283
|
}
|
|
273
284
|
set facesColor(value) {
|
|
274
285
|
this._data.facesColor = value;
|
|
275
|
-
this.
|
|
286
|
+
this.change();
|
|
276
287
|
}
|
|
277
288
|
get edgesVisibility() {
|
|
278
289
|
return this._data.edgesVisibility;
|
|
279
290
|
}
|
|
280
291
|
set edgesVisibility(value) {
|
|
281
292
|
this._data.edgesVisibility = value;
|
|
282
|
-
this.
|
|
293
|
+
this.change();
|
|
283
294
|
}
|
|
284
295
|
get edgesOverlap() {
|
|
285
296
|
return this._data.edgesOverlap;
|
|
286
297
|
}
|
|
287
298
|
set edgesOverlap(value) {
|
|
288
299
|
this._data.edgesOverlap = value;
|
|
289
|
-
this.
|
|
300
|
+
this.change();
|
|
290
301
|
}
|
|
291
302
|
get facesOverlap() {
|
|
292
303
|
return this._data.facesOverlap;
|
|
293
304
|
}
|
|
294
305
|
set facesOverlap(value) {
|
|
295
306
|
this._data.facesOverlap = value;
|
|
296
|
-
this.
|
|
307
|
+
this.change();
|
|
297
308
|
}
|
|
298
309
|
get facesTransparancy() {
|
|
299
310
|
return this._data.facesTransparancy;
|
|
300
311
|
}
|
|
301
312
|
set facesTransparancy(value) {
|
|
302
313
|
this._data.facesTransparancy = value;
|
|
303
|
-
this.
|
|
314
|
+
this.change();
|
|
304
315
|
}
|
|
305
316
|
get enableCustomHighlight() {
|
|
306
317
|
return this._data.enableCustomHighlight;
|
|
307
318
|
}
|
|
308
319
|
set enableCustomHighlight(value) {
|
|
309
320
|
this._data.enableCustomHighlight = value;
|
|
310
|
-
this.
|
|
321
|
+
this.change();
|
|
311
322
|
}
|
|
312
323
|
get sceneGraph() {
|
|
313
324
|
return this._data.sceneGraph;
|
|
@@ -315,42 +326,42 @@
|
|
|
315
326
|
set sceneGraph(value) {
|
|
316
327
|
this._data.sceneGraph = value;
|
|
317
328
|
if (value) this._data.enablePartialMode = false;
|
|
318
|
-
this.
|
|
329
|
+
this.change();
|
|
319
330
|
}
|
|
320
331
|
get edgeModel() {
|
|
321
332
|
return Boolean(this._data.edgeModel);
|
|
322
333
|
}
|
|
323
334
|
set edgeModel(value) {
|
|
324
335
|
this._data.edgeModel = Boolean(value);
|
|
325
|
-
this.
|
|
336
|
+
this.change();
|
|
326
337
|
}
|
|
327
338
|
get reverseZoomWheel() {
|
|
328
339
|
return this._data.reverseZoomWheel;
|
|
329
340
|
}
|
|
330
341
|
set reverseZoomWheel(value) {
|
|
331
342
|
this._data.reverseZoomWheel = !!value;
|
|
332
|
-
this.
|
|
343
|
+
this.change();
|
|
333
344
|
}
|
|
334
345
|
get enableZoomWheel() {
|
|
335
346
|
return this._data.enableZoomWheel;
|
|
336
347
|
}
|
|
337
348
|
set enableZoomWheel(value) {
|
|
338
349
|
this._data.enableZoomWheel = !!value;
|
|
339
|
-
this.
|
|
350
|
+
this.change();
|
|
340
351
|
}
|
|
341
352
|
get enableGestures() {
|
|
342
353
|
return this._data.enableGestures;
|
|
343
354
|
}
|
|
344
355
|
set enableGestures(value) {
|
|
345
356
|
this._data.enableGestures = !!value;
|
|
346
|
-
this.
|
|
357
|
+
this.change();
|
|
347
358
|
}
|
|
348
359
|
get geometryType() {
|
|
349
360
|
return this._data.geometryType;
|
|
350
361
|
}
|
|
351
362
|
set geometryType(value) {
|
|
352
363
|
this._data.geometryType = value;
|
|
353
|
-
this.
|
|
364
|
+
this.change();
|
|
354
365
|
}
|
|
355
366
|
}
|
|
356
367
|
|
|
@@ -42655,7 +42666,7 @@
|
|
|
42655
42666
|
this.components.push(new ResizeCanvasComponent(this));
|
|
42656
42667
|
this.components.push(new RenderLoopComponent(this));
|
|
42657
42668
|
// this.components.push(new ObjectSelectionComponent(this as any));
|
|
42658
|
-
this.
|
|
42669
|
+
this.syncOptions();
|
|
42659
42670
|
this.renderTime = performance.now();
|
|
42660
42671
|
this.render(this.renderTime);
|
|
42661
42672
|
if (typeof onProgress === "function")
|
|
@@ -42700,7 +42711,7 @@
|
|
|
42700
42711
|
this.render(performance.now());
|
|
42701
42712
|
this.emitEvent({ type: "update", data: force });
|
|
42702
42713
|
}
|
|
42703
|
-
syncOptions(options = this.options
|
|
42714
|
+
syncOptions(options = this.options) {
|
|
42704
42715
|
// this.update();
|
|
42705
42716
|
}
|
|
42706
42717
|
loadReferences(model) {
|
|
@@ -42832,9 +42843,11 @@
|
|
|
42832
42843
|
}
|
|
42833
42844
|
}
|
|
42834
42845
|
|
|
42846
|
+
exports.CANVAS_EVENTS = CANVAS_EVENTS;
|
|
42835
42847
|
exports.Options = Options;
|
|
42836
42848
|
exports.Viewer = Viewer;
|
|
42837
42849
|
exports.commands = commands;
|
|
42850
|
+
exports.defaultOptions = defaultOptions;
|
|
42838
42851
|
|
|
42839
42852
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
42840
42853
|
|