@inweb/viewer-three 25.3.17 → 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 +88 -75
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +2 -2
- package/dist/viewer-three.module.js +86 -75
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/{ThreejsViewer/ThreejsViewer.d.ts → Viewer/Viewer.d.ts} +3 -3
- package/lib/{ThreejsViewer → Viewer}/components/BackgroundComponent.d.ts +3 -3
- package/lib/{ThreejsViewer → Viewer}/components/DefaultCameraPositionComponent.d.ts +3 -3
- package/lib/{ThreejsViewer → Viewer}/components/LightComponent.d.ts +3 -3
- package/lib/{ThreejsViewer → Viewer}/components/ObjectSelectionComponent.d.ts +3 -3
- package/lib/{ThreejsViewer → Viewer}/components/RenderLoopComponent.d.ts +3 -3
- package/lib/{ThreejsViewer → Viewer}/components/ResizeCanvasComponent.d.ts +3 -3
- package/lib/{ThreejsViewer → Viewer}/draggers/OrbitDragger.d.ts +2 -2
- package/lib/{ThreejsViewer → Viewer}/draggers/PanDragger.d.ts +2 -2
- package/lib/{ThreejsViewer → Viewer}/draggers/WalkDragger.d.ts +3 -3
- package/lib/{ThreejsViewer → Viewer}/draggers/ZoomDragger.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/package.json +4 -4
- package/src/{ThreejsViewer/ThreejsViewer.ts → Viewer/Viewer.ts} +4 -4
- package/src/{ThreejsViewer → Viewer}/components/BackgroundComponent.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/components/DefaultCameraPositionComponent.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/components/LightComponent.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/components/ObjectSelectionComponent.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/components/RenderLoopComponent.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/components/ResizeCanvasComponent.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/draggers/OrbitDragger.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/draggers/PanDragger.ts +2 -2
- package/src/{ThreejsViewer → Viewer}/draggers/WalkDragger.ts +3 -3
- package/src/{ThreejsViewer → Viewer}/draggers/ZoomDragger.ts +2 -2
- package/src/index.ts +2 -2
- /package/lib/{ThreejsViewer → Viewer}/IComponent.d.ts +0 -0
- /package/lib/{ThreejsViewer → Viewer}/draggers/ClippingPlaneDragger.d.ts +0 -0
- /package/lib/{ThreejsViewer → Viewer}/loaders/GLTFLoadingManager.d.ts +0 -0
- /package/src/{ThreejsViewer → Viewer}/IComponent.ts +0 -0
- /package/src/{ThreejsViewer → Viewer}/draggers/ClippingPlaneDragger.ts +0 -0
- /package/src/{ThreejsViewer → Viewer}/loaders/GLTFLoadingManager.ts +0 -0
|
@@ -67,54 +67,62 @@ commands("VisualizeJS").registerCommand("noop", (() => {}));
|
|
|
67
67
|
|
|
68
68
|
commands("ThreeJS").registerCommand("noop", (() => {}));
|
|
69
69
|
|
|
70
|
+
function defaultOptions() {
|
|
71
|
+
return {
|
|
72
|
+
showWCS: true,
|
|
73
|
+
cameraAnimation: true,
|
|
74
|
+
antialiasing: true,
|
|
75
|
+
groundShadow: false,
|
|
76
|
+
shadows: false,
|
|
77
|
+
cameraAxisXSpeed: 4,
|
|
78
|
+
cameraAxisYSpeed: 1,
|
|
79
|
+
ambientOcclusion: false,
|
|
80
|
+
enableStreamingMode: true,
|
|
81
|
+
enablePartialMode: false,
|
|
82
|
+
memoryLimit: 3294967296,
|
|
83
|
+
cuttingPlaneFillColor: {
|
|
84
|
+
red: 255,
|
|
85
|
+
green: 152,
|
|
86
|
+
blue: 0
|
|
87
|
+
},
|
|
88
|
+
edgesColor: {
|
|
89
|
+
r: 255,
|
|
90
|
+
g: 152,
|
|
91
|
+
b: 0
|
|
92
|
+
},
|
|
93
|
+
facesColor: {
|
|
94
|
+
r: 255,
|
|
95
|
+
g: 152,
|
|
96
|
+
b: 0
|
|
97
|
+
},
|
|
98
|
+
edgesVisibility: true,
|
|
99
|
+
edgesOverlap: true,
|
|
100
|
+
facesOverlap: false,
|
|
101
|
+
facesTransparancy: 200,
|
|
102
|
+
enableCustomHighlight: true,
|
|
103
|
+
sceneGraph: false,
|
|
104
|
+
edgeModel: true,
|
|
105
|
+
reverseZoomWheel: false,
|
|
106
|
+
enableZoomWheel: true,
|
|
107
|
+
enableGestures: true,
|
|
108
|
+
geometryType: "vsfx"
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
70
112
|
class Options {
|
|
71
113
|
constructor(emitter) {
|
|
72
114
|
this._emitter = emitter;
|
|
73
|
-
this._data =
|
|
115
|
+
this._data = defaultOptions();
|
|
74
116
|
this.loadFromStorage();
|
|
75
117
|
}
|
|
76
118
|
static defaults() {
|
|
77
|
-
return
|
|
78
|
-
showWCS: true,
|
|
79
|
-
cameraAnimation: true,
|
|
80
|
-
antialiasing: true,
|
|
81
|
-
groundShadow: false,
|
|
82
|
-
shadows: false,
|
|
83
|
-
cameraAxisXSpeed: 4,
|
|
84
|
-
cameraAxisYSpeed: 1,
|
|
85
|
-
ambientOcclusion: false,
|
|
86
|
-
enableStreamingMode: true,
|
|
87
|
-
enablePartialMode: false,
|
|
88
|
-
memoryLimit: 3294967296,
|
|
89
|
-
cuttingPlaneFillColor: {
|
|
90
|
-
red: 255,
|
|
91
|
-
green: 152,
|
|
92
|
-
blue: 0
|
|
93
|
-
},
|
|
94
|
-
edgesColor: {
|
|
95
|
-
r: 255,
|
|
96
|
-
g: 152,
|
|
97
|
-
b: 0
|
|
98
|
-
},
|
|
99
|
-
facesColor: {
|
|
100
|
-
r: 255,
|
|
101
|
-
g: 152,
|
|
102
|
-
b: 0
|
|
103
|
-
},
|
|
104
|
-
edgesVisibility: true,
|
|
105
|
-
edgesOverlap: true,
|
|
106
|
-
facesOverlap: false,
|
|
107
|
-
facesTransparancy: 200,
|
|
108
|
-
enableCustomHighlight: true,
|
|
109
|
-
sceneGraph: false,
|
|
110
|
-
edgeModel: true,
|
|
111
|
-
reverseZoomWheel: false,
|
|
112
|
-
enableZoomWheel: true,
|
|
113
|
-
enableGestures: true,
|
|
114
|
-
geometryType: "vsfx"
|
|
115
|
-
};
|
|
119
|
+
return defaultOptions();
|
|
116
120
|
}
|
|
117
121
|
notifierChangeEvent() {
|
|
122
|
+
console.warn("Options.notifierChangeEvent() has been deprecated since 25.3 and will be removed in a future release, use Options.change() instead.");
|
|
123
|
+
this.change();
|
|
124
|
+
}
|
|
125
|
+
change() {
|
|
118
126
|
if (this._emitter !== undefined) {
|
|
119
127
|
this.saveToStorage();
|
|
120
128
|
this._emitter.emit({
|
|
@@ -165,151 +173,154 @@ class Options {
|
|
|
165
173
|
return this._data;
|
|
166
174
|
}
|
|
167
175
|
set data(value) {
|
|
168
|
-
const
|
|
176
|
+
const enablePartialMode = value.enableStreamingMode ? value.enablePartialMode : false;
|
|
177
|
+
const sceneGraph = enablePartialMode ? false : value.sceneGraph;
|
|
169
178
|
this._data = {
|
|
170
179
|
...Options.defaults(),
|
|
171
180
|
...this._data,
|
|
172
181
|
...value,
|
|
182
|
+
enablePartialMode: enablePartialMode,
|
|
173
183
|
sceneGraph: sceneGraph
|
|
174
184
|
};
|
|
175
|
-
this.
|
|
185
|
+
this.change();
|
|
176
186
|
}
|
|
177
187
|
get showWCS() {
|
|
178
188
|
return this._data.showWCS;
|
|
179
189
|
}
|
|
180
190
|
set showWCS(value) {
|
|
181
191
|
this._data.showWCS = value;
|
|
182
|
-
this.
|
|
192
|
+
this.change();
|
|
183
193
|
}
|
|
184
194
|
get cameraAnimation() {
|
|
185
195
|
return this._data.cameraAnimation;
|
|
186
196
|
}
|
|
187
197
|
set cameraAnimation(value) {
|
|
188
198
|
this._data.cameraAnimation = value;
|
|
189
|
-
this.
|
|
199
|
+
this.change();
|
|
190
200
|
}
|
|
191
201
|
get antialiasing() {
|
|
192
202
|
return this._data.antialiasing;
|
|
193
203
|
}
|
|
194
204
|
set antialiasing(value) {
|
|
195
205
|
this._data.antialiasing = value;
|
|
196
|
-
this.
|
|
206
|
+
this.change();
|
|
197
207
|
}
|
|
198
208
|
get groundShadow() {
|
|
199
209
|
return this._data.groundShadow;
|
|
200
210
|
}
|
|
201
211
|
set groundShadow(value) {
|
|
202
212
|
this._data.groundShadow = value;
|
|
203
|
-
this.
|
|
213
|
+
this.change();
|
|
204
214
|
}
|
|
205
215
|
get shadows() {
|
|
206
216
|
return this._data.shadows;
|
|
207
217
|
}
|
|
208
218
|
set shadows(value) {
|
|
209
219
|
this._data.shadows = value;
|
|
210
|
-
this.
|
|
220
|
+
this.change();
|
|
211
221
|
}
|
|
212
222
|
get cameraAxisXSpeed() {
|
|
213
223
|
return this._data.cameraAxisXSpeed;
|
|
214
224
|
}
|
|
215
225
|
set cameraAxisXSpeed(value) {
|
|
216
226
|
this._data.cameraAxisXSpeed = value;
|
|
217
|
-
this.
|
|
227
|
+
this.change();
|
|
218
228
|
}
|
|
219
229
|
get cameraAxisYSpeed() {
|
|
220
230
|
return this._data.cameraAxisYSpeed;
|
|
221
231
|
}
|
|
222
232
|
set cameraAxisYSpeed(value) {
|
|
223
233
|
this.cameraAxisYSpeed = value;
|
|
224
|
-
this.
|
|
234
|
+
this.change();
|
|
225
235
|
}
|
|
226
236
|
get ambientOcclusion() {
|
|
227
237
|
return this._data.ambientOcclusion;
|
|
228
238
|
}
|
|
229
239
|
set ambientOcclusion(value) {
|
|
230
240
|
this._data.ambientOcclusion = value;
|
|
231
|
-
this.
|
|
241
|
+
this.change();
|
|
232
242
|
}
|
|
233
243
|
get enableStreamingMode() {
|
|
234
244
|
return this._data.enableStreamingMode;
|
|
235
245
|
}
|
|
236
246
|
set enableStreamingMode(value) {
|
|
237
247
|
this._data.enableStreamingMode = value;
|
|
238
|
-
if (this._data.
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
this.notifierChangeEvent();
|
|
248
|
+
if (!value) this._data.enablePartialMode = false;
|
|
249
|
+
this.change();
|
|
242
250
|
}
|
|
243
251
|
get enablePartialMode() {
|
|
244
252
|
return this._data.enablePartialMode;
|
|
245
253
|
}
|
|
246
254
|
set enablePartialMode(value) {
|
|
247
255
|
this._data.enablePartialMode = value;
|
|
248
|
-
if (value)
|
|
249
|
-
|
|
256
|
+
if (value) {
|
|
257
|
+
this._data.enableStreamingMode = true;
|
|
258
|
+
this._data.sceneGraph = false;
|
|
259
|
+
}
|
|
260
|
+
this.change();
|
|
250
261
|
}
|
|
251
262
|
get memoryLimit() {
|
|
252
263
|
return this._data.memoryLimit;
|
|
253
264
|
}
|
|
254
265
|
set memoryLimit(value) {
|
|
255
266
|
this._data.memoryLimit = value;
|
|
256
|
-
this.
|
|
267
|
+
this.change();
|
|
257
268
|
}
|
|
258
269
|
get cuttingPlaneFillColor() {
|
|
259
270
|
return this._data.cuttingPlaneFillColor;
|
|
260
271
|
}
|
|
261
272
|
set cuttingPlaneFillColor(value) {
|
|
262
273
|
this._data.cuttingPlaneFillColor = value;
|
|
263
|
-
this.
|
|
274
|
+
this.change();
|
|
264
275
|
}
|
|
265
276
|
get edgesColor() {
|
|
266
277
|
return this._data.edgesColor;
|
|
267
278
|
}
|
|
268
279
|
set edgesColor(value) {
|
|
269
280
|
this._data.edgesColor = value;
|
|
270
|
-
this.
|
|
281
|
+
this.change();
|
|
271
282
|
}
|
|
272
283
|
get facesColor() {
|
|
273
284
|
return this._data.facesColor;
|
|
274
285
|
}
|
|
275
286
|
set facesColor(value) {
|
|
276
287
|
this._data.facesColor = value;
|
|
277
|
-
this.
|
|
288
|
+
this.change();
|
|
278
289
|
}
|
|
279
290
|
get edgesVisibility() {
|
|
280
291
|
return this._data.edgesVisibility;
|
|
281
292
|
}
|
|
282
293
|
set edgesVisibility(value) {
|
|
283
294
|
this._data.edgesVisibility = value;
|
|
284
|
-
this.
|
|
295
|
+
this.change();
|
|
285
296
|
}
|
|
286
297
|
get edgesOverlap() {
|
|
287
298
|
return this._data.edgesOverlap;
|
|
288
299
|
}
|
|
289
300
|
set edgesOverlap(value) {
|
|
290
301
|
this._data.edgesOverlap = value;
|
|
291
|
-
this.
|
|
302
|
+
this.change();
|
|
292
303
|
}
|
|
293
304
|
get facesOverlap() {
|
|
294
305
|
return this._data.facesOverlap;
|
|
295
306
|
}
|
|
296
307
|
set facesOverlap(value) {
|
|
297
308
|
this._data.facesOverlap = value;
|
|
298
|
-
this.
|
|
309
|
+
this.change();
|
|
299
310
|
}
|
|
300
311
|
get facesTransparancy() {
|
|
301
312
|
return this._data.facesTransparancy;
|
|
302
313
|
}
|
|
303
314
|
set facesTransparancy(value) {
|
|
304
315
|
this._data.facesTransparancy = value;
|
|
305
|
-
this.
|
|
316
|
+
this.change();
|
|
306
317
|
}
|
|
307
318
|
get enableCustomHighlight() {
|
|
308
319
|
return this._data.enableCustomHighlight;
|
|
309
320
|
}
|
|
310
321
|
set enableCustomHighlight(value) {
|
|
311
322
|
this._data.enableCustomHighlight = value;
|
|
312
|
-
this.
|
|
323
|
+
this.change();
|
|
313
324
|
}
|
|
314
325
|
get sceneGraph() {
|
|
315
326
|
return this._data.sceneGraph;
|
|
@@ -317,42 +328,42 @@ class Options {
|
|
|
317
328
|
set sceneGraph(value) {
|
|
318
329
|
this._data.sceneGraph = value;
|
|
319
330
|
if (value) this._data.enablePartialMode = false;
|
|
320
|
-
this.
|
|
331
|
+
this.change();
|
|
321
332
|
}
|
|
322
333
|
get edgeModel() {
|
|
323
334
|
return Boolean(this._data.edgeModel);
|
|
324
335
|
}
|
|
325
336
|
set edgeModel(value) {
|
|
326
337
|
this._data.edgeModel = Boolean(value);
|
|
327
|
-
this.
|
|
338
|
+
this.change();
|
|
328
339
|
}
|
|
329
340
|
get reverseZoomWheel() {
|
|
330
341
|
return this._data.reverseZoomWheel;
|
|
331
342
|
}
|
|
332
343
|
set reverseZoomWheel(value) {
|
|
333
344
|
this._data.reverseZoomWheel = !!value;
|
|
334
|
-
this.
|
|
345
|
+
this.change();
|
|
335
346
|
}
|
|
336
347
|
get enableZoomWheel() {
|
|
337
348
|
return this._data.enableZoomWheel;
|
|
338
349
|
}
|
|
339
350
|
set enableZoomWheel(value) {
|
|
340
351
|
this._data.enableZoomWheel = !!value;
|
|
341
|
-
this.
|
|
352
|
+
this.change();
|
|
342
353
|
}
|
|
343
354
|
get enableGestures() {
|
|
344
355
|
return this._data.enableGestures;
|
|
345
356
|
}
|
|
346
357
|
set enableGestures(value) {
|
|
347
358
|
this._data.enableGestures = !!value;
|
|
348
|
-
this.
|
|
359
|
+
this.change();
|
|
349
360
|
}
|
|
350
361
|
get geometryType() {
|
|
351
362
|
return this._data.geometryType;
|
|
352
363
|
}
|
|
353
364
|
set geometryType(value) {
|
|
354
365
|
this._data.geometryType = value;
|
|
355
|
-
this.
|
|
366
|
+
this.change();
|
|
356
367
|
}
|
|
357
368
|
}
|
|
358
369
|
|
|
@@ -852,7 +863,7 @@ class RenderLoopComponent {
|
|
|
852
863
|
}
|
|
853
864
|
}
|
|
854
865
|
|
|
855
|
-
class
|
|
866
|
+
class Viewer extends EventEmitter2 {
|
|
856
867
|
constructor(client) {
|
|
857
868
|
super();
|
|
858
869
|
this._options = new Options(this);
|
|
@@ -902,7 +913,7 @@ class ThreejsViewer extends EventEmitter2 {
|
|
|
902
913
|
this.components.push(new DefaultCameraPositionComponent(this));
|
|
903
914
|
this.components.push(new ResizeCanvasComponent(this));
|
|
904
915
|
this.components.push(new RenderLoopComponent(this));
|
|
905
|
-
this.
|
|
916
|
+
this.syncOptions();
|
|
906
917
|
this.renderTime = performance.now();
|
|
907
918
|
this.render(this.renderTime);
|
|
908
919
|
if (typeof onProgress === "function") onProgress(new ProgressEvent("progress", {
|
|
@@ -955,7 +966,7 @@ class ThreejsViewer extends EventEmitter2 {
|
|
|
955
966
|
data: force
|
|
956
967
|
});
|
|
957
968
|
}
|
|
958
|
-
syncOptions(options = this.options
|
|
969
|
+
syncOptions(options = this.options) {}
|
|
959
970
|
loadReferences(model) {
|
|
960
971
|
return Promise.resolve(this);
|
|
961
972
|
}
|
|
@@ -1098,5 +1109,5 @@ class ThreejsViewer extends EventEmitter2 {
|
|
|
1098
1109
|
}
|
|
1099
1110
|
}
|
|
1100
1111
|
|
|
1101
|
-
export { Options,
|
|
1112
|
+
export { CANVAS_EVENTS, Options, Viewer, commands, defaultOptions };
|
|
1102
1113
|
//# sourceMappingURL=viewer-three.module.js.map
|