@shapediver/viewer.viewport 3.16.7 → 3.16.9

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.
Files changed (68) hide show
  1. package/dist/implementation/PostProcessingApi.d.ts +37 -37
  2. package/dist/implementation/PostProcessingApi.js +149 -149
  3. package/dist/implementation/PostProcessingApi.js.map +1 -1
  4. package/dist/implementation/ViewportApi.d.ts +217 -217
  5. package/dist/implementation/ViewportApi.js +1003 -993
  6. package/dist/implementation/ViewportApi.js.map +1 -1
  7. package/dist/implementation/camera/AbstractCameraApi.d.ts +140 -140
  8. package/dist/implementation/camera/AbstractCameraApi.js +478 -478
  9. package/dist/implementation/camera/AbstractCameraApi.js.map +1 -1
  10. package/dist/implementation/camera/OrthographicCameraApi.d.ts +10 -10
  11. package/dist/implementation/camera/OrthographicCameraApi.js +47 -47
  12. package/dist/implementation/camera/OrthographicCameraApi.js.map +1 -1
  13. package/dist/implementation/camera/PerspectiveCameraApi.d.ts +10 -10
  14. package/dist/implementation/camera/PerspectiveCameraApi.js +46 -46
  15. package/dist/implementation/camera/PerspectiveCameraApi.js.map +1 -1
  16. package/dist/implementation/lights/AbstractLightApi.d.ts +19 -19
  17. package/dist/implementation/lights/AbstractLightApi.js +80 -80
  18. package/dist/implementation/lights/AbstractLightApi.js.map +1 -1
  19. package/dist/implementation/lights/LightSceneApi.d.ts +68 -68
  20. package/dist/implementation/lights/LightSceneApi.js +171 -171
  21. package/dist/implementation/lights/LightSceneApi.js.map +1 -1
  22. package/dist/implementation/lights/types/AmbientLightApi.d.ts +8 -8
  23. package/dist/implementation/lights/types/AmbientLightApi.js +26 -26
  24. package/dist/implementation/lights/types/AmbientLightApi.js.map +1 -1
  25. package/dist/implementation/lights/types/DirectionalLightApi.d.ts +17 -17
  26. package/dist/implementation/lights/types/DirectionalLightApi.js +76 -76
  27. package/dist/implementation/lights/types/DirectionalLightApi.js.map +1 -1
  28. package/dist/implementation/lights/types/HemisphereLightApi.d.ts +11 -11
  29. package/dist/implementation/lights/types/HemisphereLightApi.js +46 -46
  30. package/dist/implementation/lights/types/HemisphereLightApi.js.map +1 -1
  31. package/dist/implementation/lights/types/PointLightApi.d.ts +15 -15
  32. package/dist/implementation/lights/types/PointLightApi.js +66 -66
  33. package/dist/implementation/lights/types/PointLightApi.js.map +1 -1
  34. package/dist/implementation/lights/types/SpotLightApi.d.ts +21 -21
  35. package/dist/implementation/lights/types/SpotLightApi.js +96 -96
  36. package/dist/implementation/lights/types/SpotLightApi.js.map +1 -1
  37. package/dist/index.d.ts +52 -52
  38. package/dist/index.js +189 -189
  39. package/dist/interfaces/IPostProcessingApi.d.ts +183 -183
  40. package/dist/interfaces/IPostProcessingApi.js +2 -2
  41. package/dist/interfaces/IViewportApi.d.ts +699 -699
  42. package/dist/interfaces/IViewportApi.js +2 -2
  43. package/dist/interfaces/camera/ICameraApi.d.ts +256 -256
  44. package/dist/interfaces/camera/ICameraApi.js +2 -2
  45. package/dist/interfaces/camera/IOrthographicCameraApi.d.ts +13 -13
  46. package/dist/interfaces/camera/IOrthographicCameraApi.js +2 -2
  47. package/dist/interfaces/camera/IPerspectiveCameraApi.d.ts +12 -12
  48. package/dist/interfaces/camera/IPerspectiveCameraApi.js +2 -2
  49. package/dist/interfaces/lights/ILightApi.d.ts +35 -35
  50. package/dist/interfaces/lights/ILightApi.js +2 -2
  51. package/dist/interfaces/lights/ILightSceneApi.d.ts +138 -138
  52. package/dist/interfaces/lights/ILightSceneApi.js +2 -2
  53. package/dist/interfaces/lights/types/IAmbientLightApi.d.ts +6 -6
  54. package/dist/interfaces/lights/types/IAmbientLightApi.d.ts.map +1 -1
  55. package/dist/interfaces/lights/types/IAmbientLightApi.js +2 -2
  56. package/dist/interfaces/lights/types/IDirectionalLightApi.d.ts +24 -24
  57. package/dist/interfaces/lights/types/IDirectionalLightApi.js +2 -2
  58. package/dist/interfaces/lights/types/IHemisphereLightApi.d.ts +12 -12
  59. package/dist/interfaces/lights/types/IHemisphereLightApi.js +2 -2
  60. package/dist/interfaces/lights/types/IPointLightApi.d.ts +20 -20
  61. package/dist/interfaces/lights/types/IPointLightApi.js +2 -2
  62. package/dist/interfaces/lights/types/ISpotLightApi.d.ts +32 -32
  63. package/dist/interfaces/lights/types/ISpotLightApi.js +2 -2
  64. package/dist/main.d.ts +30 -30
  65. package/dist/main.d.ts.map +1 -1
  66. package/dist/main.js +91 -91
  67. package/dist/main.js.map +1 -1
  68. package/package.json +20 -20
@@ -1,994 +1,1004 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
35
- if (kind === "m") throw new TypeError("Private method is not writable");
36
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
37
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
38
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
39
- };
40
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
41
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
42
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
43
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
44
- };
45
- var _ViewportApi_animationEngine, _ViewportApi_cameras, _ViewportApi_creationControlCenterViewport, _ViewportApi_gltfConverter, _ViewportApi_inputValidator, _ViewportApi_lightScenes, _ViewportApi_logger, _ViewportApi_postProcessing, _ViewportApi_renderingEngine, _ViewportApi_stateEngine, _ViewportApi_systemInfo;
46
- Object.defineProperty(exports, "__esModule", { value: true });
47
- exports.ViewportApi = void 0;
48
- const sdk_geometry_api_sdk_v2_1 = require("@shapediver/sdk.geometry-api-sdk-v2");
49
- const viewer_api_general_1 = require("@shapediver/viewer.api.general");
50
- const viewer_creation_control_center_viewport_1 = require("@shapediver/viewer.creation-control-center.viewport");
51
- const viewer_data_engine_gltf_converter_1 = require("@shapediver/viewer.data-engine.gltf-converter");
52
- const viewer_rendering_engine_animation_engine_1 = require("@shapediver/viewer.rendering-engine.animation-engine");
53
- const viewer_rendering_engine_camera_engine_1 = require("@shapediver/viewer.rendering-engine.camera-engine");
54
- const viewer_shared_build_data_1 = require("@shapediver/viewer.shared.build-data");
55
- const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
56
- const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
57
- const viewer_shared_types_1 = require("@shapediver/viewer.shared.types");
58
- const gl_matrix_1 = require("gl-matrix");
59
- const QRCode = __importStar(require("qrcode"));
60
- const OrthographicCameraApi_1 = require("./camera/OrthographicCameraApi");
61
- const PerspectiveCameraApi_1 = require("./camera/PerspectiveCameraApi");
62
- const LightSceneApi_1 = require("./lights/LightSceneApi");
63
- const PostProcessingApi_1 = require("./PostProcessingApi");
64
- class ViewportApi {
65
- // #endregion Properties (11)
66
- // #region Constructors (1)
67
- constructor(renderingEngine) {
68
- // #region Properties (11)
69
- _ViewportApi_animationEngine.set(this, viewer_rendering_engine_animation_engine_1.AnimationEngine.instance);
70
- _ViewportApi_cameras.set(this, {});
71
- _ViewportApi_creationControlCenterViewport.set(this, viewer_creation_control_center_viewport_1.CreationControlCenterViewport.instance);
72
- _ViewportApi_gltfConverter.set(this, viewer_data_engine_gltf_converter_1.GLTFConverter.instance);
73
- _ViewportApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
74
- _ViewportApi_lightScenes.set(this, {});
75
- _ViewportApi_logger.set(this, viewer_shared_services_1.Logger.instance);
76
- _ViewportApi_postProcessing.set(this, void 0);
77
- _ViewportApi_renderingEngine.set(this, void 0);
78
- _ViewportApi_stateEngine.set(this, viewer_shared_services_1.StateEngine.instance);
79
- _ViewportApi_systemInfo.set(this, viewer_shared_services_1.SystemInfo.instance);
80
- __classPrivateFieldSet(this, _ViewportApi_renderingEngine, renderingEngine, "f");
81
- // Whenever a camera is added or removed from the camera engine, this update is called.
82
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.update = () => {
83
- for (const c in __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras) {
84
- if (!__classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c]) {
85
- if (__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c].type ===
86
- viewer_rendering_engine_camera_engine_1.CAMERA_TYPE.PERSPECTIVE) {
87
- __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c] = new PerspectiveCameraApi_1.PerspectiveCameraApi(this, (__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c]));
88
- }
89
- else {
90
- __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c] = new OrthographicCameraApi_1.OrthographicCameraApi(this, (__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c]));
91
- }
92
- }
93
- }
94
- for (const c in __classPrivateFieldGet(this, _ViewportApi_cameras, "f")) {
95
- if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c]) {
96
- delete __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c];
97
- }
98
- }
99
- };
100
- // We call it once in the beginning to get the current state.
101
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.update();
102
- // Whenever a camera is added or removed from the camera engine, this update is called.
103
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.update = () => {
104
- for (const l in __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScenes) {
105
- if (!__classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[l]) {
106
- __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[l] = new LightSceneApi_1.LightSceneApi(this, __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScenes[l]);
107
- }
108
- }
109
- for (const l in __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")) {
110
- if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScenes[l]) {
111
- delete __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[l];
112
- }
113
- }
114
- };
115
- // We call it once in the beginning to get the current state.
116
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.update();
117
- // We create the post processing api
118
- __classPrivateFieldSet(this, _ViewportApi_postProcessing, new PostProcessingApi_1.PostProcessingApi(this, __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f")), "f");
119
- }
120
- // #endregion Constructors (1)
121
- // #region Public Getters And Setters (106)
122
- get animations() {
123
- return __classPrivateFieldGet(this, _ViewportApi_animationEngine, "f").animations;
124
- }
125
- get arRotation() {
126
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arRotation;
127
- }
128
- set arRotation(value) {
129
- const scope = "arRotation";
130
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "vec3");
131
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arRotation = value;
132
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
133
- this.update("arRotation");
134
- }
135
- get arScale() {
136
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arScale;
137
- }
138
- set arScale(value) {
139
- const scope = "arScale";
140
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "vec3");
141
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arScale = gl_matrix_1.vec3.max(gl_matrix_1.vec3.create(), value, gl_matrix_1.vec3.fromValues(0.001, 0.001, 0.001));
142
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
143
- this.update("arScale");
144
- }
145
- get arTranslation() {
146
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arTranslation;
147
- }
148
- set arTranslation(value) {
149
- const scope = "arTranslation";
150
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "vec3");
151
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arTranslation = value;
152
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
153
- this.update("arTranslation");
154
- }
155
- get automaticColorAdjustment() {
156
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticColorAdjustment;
157
- }
158
- set automaticColorAdjustment(value) {
159
- const scope = "automaticColorAdjustment";
160
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
161
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticColorAdjustment = value;
162
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
163
- this.update("automaticColorAdjustment");
164
- }
165
- get automaticResizing() {
166
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticResizing;
167
- }
168
- set automaticResizing(value) {
169
- const scope = "automaticResizing";
170
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
171
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticResizing = value;
172
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
173
- this.update("automaticResizing");
174
- }
175
- get beautyRenderBlendingDuration() {
176
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderBlendingDuration;
177
- }
178
- set beautyRenderBlendingDuration(value) {
179
- const scope = "beautyRenderBlendingDuration";
180
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
181
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderBlendingDuration = value;
182
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
183
- this.update("beautyRenderBlendingDuration");
184
- }
185
- get beautyRenderDelay() {
186
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderDelay;
187
- }
188
- set beautyRenderDelay(value) {
189
- const scope = "beautyRenderDelay";
190
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
191
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderDelay = value;
192
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
193
- this.update("beautyRenderDelay");
194
- }
195
- get camera() {
196
- if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.camera)
197
- return null;
198
- return __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.camera.id];
199
- }
200
- get cameras() {
201
- return __classPrivateFieldGet(this, _ViewportApi_cameras, "f");
202
- }
203
- get canvas() {
204
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").canvas;
205
- }
206
- get clearAlpha() {
207
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearAlpha;
208
- }
209
- set clearAlpha(value) {
210
- const scope = "clearAlpha";
211
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
212
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearAlpha = value;
213
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
214
- this.update("clearAlpha");
215
- }
216
- get clearColor() {
217
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearColor;
218
- }
219
- set clearColor(value) {
220
- const scope = "clearColor";
221
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
222
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearColor = value;
223
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
224
- this.update("clearColor");
225
- }
226
- get contactShadowBlur() {
227
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowBlur;
228
- }
229
- set contactShadowBlur(value) {
230
- const scope = "contactShadowBlur";
231
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
232
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowBlur = value;
233
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
234
- this.update("contactShadowBlur");
235
- }
236
- get contactShadowDarkness() {
237
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowDarkness;
238
- }
239
- set contactShadowDarkness(value) {
240
- const scope = "contactShadowDarkness";
241
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
242
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowDarkness = value;
243
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
244
- this.update("contactShadowDarkness");
245
- }
246
- get contactShadowHeight() {
247
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowHeight;
248
- }
249
- set contactShadowHeight(value) {
250
- const scope = "contactShadowHeight";
251
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
252
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowHeight = value;
253
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
254
- this.update("contactShadowHeight");
255
- }
256
- get contactShadowOpacity() {
257
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowOpacity;
258
- }
259
- set contactShadowOpacity(value) {
260
- const scope = "contactShadowOpacity";
261
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
262
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowOpacity = value;
263
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
264
- this.update("contactShadowOpacity");
265
- }
266
- get contactShadowVisibility() {
267
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowVisibility;
268
- }
269
- set contactShadowVisibility(value) {
270
- const scope = "contactShadowVisibility";
271
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
272
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowVisibility = value;
273
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
274
- this.update("contactShadowVisibility");
275
- }
276
- get defaultLineMaterial() {
277
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultLineMaterial;
278
- }
279
- get defaultMaterial() {
280
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterial;
281
- }
282
- get defaultMaterialColor() {
283
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterialColor;
284
- }
285
- set defaultMaterialColor(value) {
286
- const scope = "defaultMaterialColor";
287
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
288
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterialColor = value;
289
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
290
- this.update("defaultMaterialColor");
291
- }
292
- get defaultPointMaterial() {
293
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultPointMaterial;
294
- }
295
- get enableAR() {
296
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").enableAR;
297
- }
298
- set enableAR(value) {
299
- const scope = "enableAR";
300
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
301
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").enableAR = value;
302
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
303
- this.update("enableAR");
304
- }
305
- get environmentMap() {
306
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMap;
307
- }
308
- set environmentMap(value) {
309
- const scope = "environmentMap";
310
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "cubeMap");
311
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMap = value;
312
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
313
- this.update("environmentMap");
314
- }
315
- get environmentMapAsBackground() {
316
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapAsBackground;
317
- }
318
- set environmentMapAsBackground(value) {
319
- const scope = "environmentMapAsBackground";
320
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
321
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapAsBackground = value;
322
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
323
- this.update("environmentMapAsBackground");
324
- }
325
- get environmentMapBlurriness() {
326
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapBlurriness;
327
- }
328
- set environmentMapBlurriness(value) {
329
- const scope = "environmentMapBlurriness";
330
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
331
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapBlurriness = value;
332
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
333
- this.update("environmentMapBlurriness");
334
- }
335
- get environmentMapForUnlitMaterials() {
336
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapForUnlitMaterials;
337
- }
338
- set environmentMapForUnlitMaterials(value) {
339
- const scope = "environmentMapForUnlitMaterials";
340
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
341
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapForUnlitMaterials = value;
342
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
343
- this.update("environmentMapForUnlitMaterials");
344
- }
345
- get environmentMapIntensity() {
346
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapIntensity;
347
- }
348
- set environmentMapIntensity(value) {
349
- const scope = "environmentMapIntensity";
350
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
351
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapIntensity = value;
352
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
353
- this.update("environmentMapIntensity");
354
- }
355
- get environmentMapResolution() {
356
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapResolution;
357
- }
358
- set environmentMapResolution(value) {
359
- const scope = "environmentMapResolution";
360
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "string");
361
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapResolution = value;
362
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
363
- this.update("environmentMapResolution");
364
- }
365
- get environmentMapRotation() {
366
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapRotation;
367
- }
368
- set environmentMapRotation(value) {
369
- const scope = "environmentMapRotation";
370
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "quat");
371
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapRotation = value;
372
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
373
- this.update("environmentMapRotation");
374
- }
375
- get gridColor() {
376
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridColor;
377
- }
378
- set gridColor(value) {
379
- const scope = "gridColor";
380
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
381
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridColor = value;
382
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
383
- this.update("gridColor");
384
- }
385
- get gridVisibility() {
386
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridVisibility;
387
- }
388
- set gridVisibility(value) {
389
- const scope = "gridVisibility";
390
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
391
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridVisibility = value;
392
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
393
- this.update("gridVisibility");
394
- }
395
- get groundPlaneColor() {
396
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneColor;
397
- }
398
- set groundPlaneColor(value) {
399
- const scope = "groundPlaneColor";
400
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
401
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneColor = value;
402
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
403
- this.update("groundPlaneColor");
404
- }
405
- get groundPlaneShadowColor() {
406
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowColor;
407
- }
408
- set groundPlaneShadowColor(value) {
409
- const scope = "groundPlaneShadowColor";
410
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
411
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowColor = value;
412
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
413
- this.update("groundPlaneShadowColor");
414
- }
415
- get groundPlaneShadowVisibility() {
416
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowVisibility;
417
- }
418
- set groundPlaneShadowVisibility(value) {
419
- const scope = "groundPlaneShadowVisibility";
420
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
421
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowVisibility = value;
422
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
423
- this.update("groundPlaneShadowVisibility");
424
- }
425
- get groundPlaneVisibility() {
426
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneVisibility;
427
- }
428
- set groundPlaneVisibility(value) {
429
- const scope = "groundPlaneVisibility";
430
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
431
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneVisibility = value;
432
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
433
- this.update("groundPlaneVisibility");
434
- }
435
- get id() {
436
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").id;
437
- }
438
- get isBusy() {
439
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").busy;
440
- }
441
- get lightScene() {
442
- if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScene)
443
- return null;
444
- return __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScene.id];
445
- }
446
- get lightScenes() {
447
- return __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f");
448
- }
449
- get lights() {
450
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lights;
451
- }
452
- set lights(value) {
453
- const scope = "lights";
454
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
455
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lights = value;
456
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
457
- this.update("lights");
458
- }
459
- get loadDefaultCameras() {
460
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").loadDefaultCameras;
461
- }
462
- set loadDefaultCameras(value) {
463
- const scope = "loadDefaultCameras";
464
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
465
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").loadDefaultCameras = value;
466
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
467
- this.update("loadDefaultCameras");
468
- }
469
- get materialOverrideType() {
470
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").materialOverrideType;
471
- }
472
- set materialOverrideType(value) {
473
- const scope = "materialOverrideType";
474
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", false, Object.values(viewer_shared_types_1.MATERIAL_TYPE));
475
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").materialOverrideType = value;
476
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
477
- this.update("materialOverrideType");
478
- }
479
- get maximumRenderingSize() {
480
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").maximumRenderingSize;
481
- }
482
- set maximumRenderingSize(value) {
483
- const scope = "maximumRenderingSize";
484
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, "object");
485
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value.width, "number");
486
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value.height, "number");
487
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").maximumRenderingSize = value;
488
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
489
- this.update("maximumRenderingSize");
490
- }
491
- get outputEncoding() {
492
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").outputEncoding;
493
- }
494
- set outputEncoding(value) {
495
- const scope = "outputEncoding";
496
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.TEXTURE_ENCODING));
497
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").outputEncoding = value;
498
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
499
- this.update("outputEncoding");
500
- }
501
- get physicallyCorrectLights() {
502
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").physicallyCorrectLights;
503
- }
504
- set physicallyCorrectLights(value) {
505
- const scope = "physicallyCorrectLights";
506
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
507
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").physicallyCorrectLights = value;
508
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
509
- this.update("physicallyCorrectLights");
510
- }
511
- get pointSize() {
512
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pointSize;
513
- }
514
- set pointSize(value) {
515
- const scope = "pointSize";
516
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
517
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pointSize = value;
518
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
519
- this.update("pointSize");
520
- }
521
- get postProcessing() {
522
- return __classPrivateFieldGet(this, _ViewportApi_postProcessing, "f");
523
- }
524
- get postRenderingCallback() {
525
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").postRenderingCallback;
526
- }
527
- set postRenderingCallback(value) {
528
- const scope = "postRenderingCallback";
529
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "function", false);
530
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").postRenderingCallback = value;
531
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
532
- this.update("postRenderingCallback");
533
- }
534
- get preRenderingCallback() {
535
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").preRenderingCallback;
536
- }
537
- set preRenderingCallback(value) {
538
- const scope = "preRenderingCallback";
539
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "function", false);
540
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").preRenderingCallback = value;
541
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
542
- this.update("preRenderingCallback");
543
- }
544
- get sessionSettingsId() {
545
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sessionSettingsId;
546
- }
547
- get sessionSettingsMode() {
548
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sessionSettingsMode;
549
- }
550
- get shadows() {
551
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").shadows;
552
- }
553
- set shadows(value) {
554
- const scope = "shadows";
555
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
556
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").shadows = value;
557
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
558
- this.update("shadows");
559
- }
560
- get show() {
561
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").show;
562
- }
563
- set show(value) {
564
- const scope = "show";
565
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
566
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").show = value;
567
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
568
- this.update("show");
569
- }
570
- get showStatistics() {
571
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").showStatistics;
572
- }
573
- set showStatistics(value) {
574
- const scope = "showStatistics";
575
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
576
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").showStatistics = value;
577
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
578
- this.update("showStatistics");
579
- }
580
- get softShadows() {
581
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").softShadows;
582
- }
583
- set softShadows(value) {
584
- const scope = "softShadows";
585
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
586
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").softShadows = value;
587
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
588
- this.update("softShadows");
589
- }
590
- get textureEncoding() {
591
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").textureEncoding;
592
- }
593
- set textureEncoding(value) {
594
- const scope = "textureEncoding";
595
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.TEXTURE_ENCODING));
596
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").textureEncoding = value;
597
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
598
- this.update("textureEncoding");
599
- }
600
- get threeJsCoreObjects() {
601
- return {
602
- scene: __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sceneTreeManager.scene,
603
- renderer: __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").renderer,
604
- camera: __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraManager.camera,
605
- };
606
- }
607
- get toneMapping() {
608
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMapping;
609
- }
610
- set toneMapping(value) {
611
- const scope = "toneMapping";
612
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.TONE_MAPPING));
613
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMapping = value;
614
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
615
- this.update("toneMapping");
616
- }
617
- get toneMappingExposure() {
618
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMappingExposure;
619
- }
620
- set toneMappingExposure(value) {
621
- const scope = "toneMappingExposure";
622
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
623
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMappingExposure = value;
624
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
625
- this.update("toneMappingExposure");
626
- }
627
- get type() {
628
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").type;
629
- }
630
- set type(value) {
631
- const scope = "type";
632
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.RENDERER_TYPE));
633
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").type = value;
634
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
635
- this.update("type");
636
- }
637
- get visualizeAttributes() {
638
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").visualizeAttributes;
639
- }
640
- set visualizeAttributes(value) {
641
- const scope = "visualizeAttributes";
642
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "function", false);
643
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").visualizeAttributes = value;
644
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
645
- this.render();
646
- }
647
- // #endregion Public Getters And Setters (106)
648
- // #region Public Methods (41)
649
- addCanvasEventListener(listener) {
650
- const scope = "addCanvasEventListener";
651
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, listener, "object");
652
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.addDomEventListener(listener);
653
- }
654
- addFlag(flag) {
655
- const scope = "addFlag";
656
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, flag, "enum", true, Object.values(viewer_shared_types_1.FLAG_TYPE));
657
- const token = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").addFlag(flag);
658
- return token;
659
- }
660
- addRestrictedCanvasListenerToken(token) {
661
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.addRestrictedListenerToken(token);
662
- }
663
- applyViewportSettings(settings, sections) {
664
- const scope = "applyViewportSettings";
665
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, settings, "object");
666
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, sections, "object", false);
667
- return __classPrivateFieldGet(this, _ViewportApi_creationControlCenterViewport, "f").applyViewportSettings(this.id, settings, sections);
668
- }
669
- assignCamera(id) {
670
- const scope = "assignCamera";
671
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
672
- const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.assignCamera(id);
673
- this.update("assignCamera");
674
- return check;
675
- }
676
- assignLightScene(id) {
677
- const scope = "assignLightScene";
678
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
679
- const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.assignLightScene(id);
680
- this.update("assignLightScene");
681
- return check;
682
- }
683
- close() {
684
- return __awaiter(this, void 0, void 0, function* () {
685
- return yield __classPrivateFieldGet(this, _ViewportApi_creationControlCenterViewport, "f").closeViewportEngine(this.id);
686
- });
687
- }
688
- continueRendering() {
689
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").continueRendering();
690
- }
691
- convert3Dto2D(p) {
692
- const scope = "convert3Dto2D";
693
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, p, "vec3");
694
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").convert3Dto2D(p);
695
- }
696
- convertToGlTF(node = viewer_api_general_1.sceneTree.root, convertForAr = false) {
697
- return __awaiter(this, void 0, void 0, function* () {
698
- const scope = "convertToGlTF";
699
- if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
700
- throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
701
- this.update("convertToGlTF.start");
702
- const result = yield __classPrivateFieldGet(this, _ViewportApi_gltfConverter, "f").convert(node, convertForAr, this.id);
703
- this.update("convertToGlTF.end");
704
- return new Blob([result], { type: "application/octet-stream" });
705
- });
706
- }
707
- createArSessionLink(node, qrCode = true, fallbackUrl) {
708
- var _a, _b;
709
- return __awaiter(this, void 0, void 0, function* () {
710
- const scope = "createArSessionLink";
711
- if (node && !(node instanceof viewer_shared_node_tree_1.TreeNode))
712
- throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
713
- let sessionEngineId = undefined;
714
- for (const s in __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines) {
715
- const state = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[s];
716
- if (state !== undefined && state.canUploadGLTF) {
717
- sessionEngineId = s;
718
- break;
719
- }
720
- }
721
- if (!sessionEngineId)
722
- throw new viewer_shared_services_1.ShapeDiverViewerArError("ViewportApi.createArSessionLink: None of the sessions that are registered are capable of using the AR feature.");
723
- const targetNode = node || viewer_api_general_1.sceneTree.root;
724
- const scalingMatrix = gl_matrix_1.mat4.fromScaling(gl_matrix_1.mat4.create(), this.arScale);
725
- // add scaling matrix to scene tree node
726
- targetNode.transformations.push({
727
- id: "ar_scaling",
728
- matrix: scalingMatrix,
729
- });
730
- // create the gltf
731
- this.update("createArSessionLink.start");
732
- const blob = yield __classPrivateFieldGet(this, _ViewportApi_gltfConverter, "f").convert(targetNode, true, this.id);
733
- // remove scaling the matrix
734
- for (let i = 0; i < targetNode.transformations.length; i++)
735
- if (targetNode.transformations[i].id === "ar_scaling")
736
- targetNode.transformations.splice(i, 1);
737
- this.update("createArSessionLink.end");
738
- const response = yield ((_a = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _a === void 0 ? void 0 : _a.uploadGLTF(new Blob([blob], { type: "application/octet-stream" }), sdk_geometry_api_sdk_v2_1.QueryGltfConversion.SCENE));
739
- const backends = {
740
- sddev3: "https://sddev3.eu-central-1.shapediver.com",
741
- sddev2: "https://sddev2.eu-central-1.shapediver.com",
742
- sddev: "https://sddev.eu-central-1.shapediver.com",
743
- sdtest: "https://sdtest.us-east-1.shapediver.com",
744
- sdeuc1: "https://sdeuc1.eu-central-1.shapediver.com",
745
- sdr7euc1: "https://sdr7euc1.eu-central-1.shapediver.com",
746
- sduse1: "https://model-view.shapediver.com",
747
- };
748
- let backendIdentifier = Object.keys(backends).find((key) => {
749
- var _a;
750
- return backends[key] ===
751
- ((_a = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _a === void 0 ? void 0 : _a.modelViewUrl);
752
- });
753
- if (!backendIdentifier) {
754
- const modelViewUrl = (_b = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _b === void 0 ? void 0 : _b.modelViewUrl;
755
- backendIdentifier = modelViewUrl === null || modelViewUrl === void 0 ? void 0 : modelViewUrl.replace("https://", "").replace(".shapediver.com", "");
756
- }
757
- const fallbackQueryParameter = fallbackUrl
758
- ? `fb=${encodeURIComponent(fallbackUrl)}&`
759
- : "";
760
- if (!response || !response.gltf || !response.gltf.sceneId)
761
- throw new viewer_shared_services_1.ShapeDiverViewerArError("ViewportApi.createArSessionLink: There was an unexpected error with the ar scene response. Please contact us if this happens again.");
762
- const sceneId = response.gltf.sceneId;
763
- const link = `https://viewer.shapediver.com/v3/${viewer_shared_build_data_1.build_data.build_version.replace("3.", "")}/ar.html?${fallbackQueryParameter}b=${encodeURIComponent(backendIdentifier)}&id=${encodeURIComponent(sceneId)}`;
764
- if (qrCode === false) {
765
- return link;
766
- }
767
- else {
768
- const qrCodeLink = yield new Promise((resolve, reject) => {
769
- QRCode.toDataURL(link, (error, url) => {
770
- if (error) {
771
- reject(error);
772
- }
773
- else {
774
- resolve(url);
775
- }
776
- });
777
- });
778
- return qrCodeLink;
779
- }
780
- });
781
- }
782
- createLightScene(properties) {
783
- const scope = "createLightScene";
784
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, properties, "object", false);
785
- const prop = Object.assign({}, properties);
786
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, prop.name, "string", false);
787
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, prop.standard, "boolean", false);
788
- const lightScene = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.createLightScene(properties || {});
789
- this.update("createLightScene");
790
- return __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[lightScene.id];
791
- }
792
- createOrthographicCamera(id) {
793
- const scope = "createOrthographicCamera";
794
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string", false);
795
- const camera = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.createCamera(viewer_rendering_engine_camera_engine_1.CAMERA_TYPE.ORTHOGRAPHIC, id);
796
- this.update("createOrthographicCamera");
797
- return __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[camera.id];
798
- }
799
- createPerspectiveCamera(id) {
800
- const scope = "createPerspectiveCamera";
801
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string", false);
802
- const camera = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.createCamera(viewer_rendering_engine_camera_engine_1.CAMERA_TYPE.PERSPECTIVE, id);
803
- this.update("createPerspectiveCamera");
804
- return __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[camera.id];
805
- }
806
- createSDTFOverview(node) {
807
- const scope = "createSDTFOverview";
808
- if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
809
- throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
810
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").createSDTFOverview(node);
811
- }
812
- displayErrorMessage(message) {
813
- const scope = "displayErrorMessage";
814
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, message, "string");
815
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").displayErrorMessage(message);
816
- this.update("displayErrorMessage");
817
- }
818
- getEnvironmentMapImageUrl() {
819
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").getEnvironmentMapImageUrl();
820
- }
821
- getScreenshot(type, quality) {
822
- const scope = "getScreenshot";
823
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, type, "string", false);
824
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, quality, "number", false);
825
- this.update("getScreenshot");
826
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").getScreenshot(type, quality);
827
- }
828
- getScreenshotAdvanced(type, quality, resolution, camera) {
829
- const scope = "getScreenshotAdvanced";
830
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, type, "string", false);
831
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, quality, "number", false);
832
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, resolution, "object", false);
833
- if (resolution) {
834
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, resolution.width, "number");
835
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, resolution.height, "number");
836
- }
837
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, camera, "object", false);
838
- this.update("getScreenshotAdvanced");
839
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").getScreenshotAdvanced(type, quality, resolution, camera);
840
- }
841
- getViewportSettings() {
842
- return __classPrivateFieldGet(this, _ViewportApi_creationControlCenterViewport, "f").getViewportSettings(this.id);
843
- }
844
- isMobileDeviceWithoutBrowserARSupport() {
845
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").isMobileDeviceWithoutBrowserARSupport();
846
- }
847
- pauseRendering() {
848
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pauseRendering();
849
- }
850
- pointerEventToRay(event) {
851
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pointerEventToRay(event);
852
- }
853
- raytraceScene(origin, direction, filterCriteria) {
854
- const scope = "raytraceScene";
855
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, origin, "vec3");
856
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, direction, "vec3");
857
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").raytraceScene(origin, direction, filterCriteria);
858
- }
859
- removeCamera(id) {
860
- const scope = "removeCamera";
861
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
862
- const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.removeCamera(id);
863
- this.update("removeCamera");
864
- return check;
865
- }
866
- removeCanvasEventListener(token) {
867
- const scope = "removeCanvasEventListener";
868
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, token, "string");
869
- const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.removeDomEventListener(token);
870
- return check;
871
- }
872
- removeFlag(token) {
873
- const scope = "removeFlag";
874
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, token, "string");
875
- const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").removeFlag(token);
876
- return check;
877
- }
878
- removeLightScene(id) {
879
- const scope = "removeLightScene";
880
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
881
- const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.removeLightScene(id);
882
- this.update("removeLightScene");
883
- return check;
884
- }
885
- removeRestrictedCanvasListenerToken(token) {
886
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.removeRestrictedListenerToken(token);
887
- }
888
- render() {
889
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").renderingManager.render();
890
- }
891
- resetToDefaultCameras() {
892
- for (const c in this.cameras)
893
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.removeCamera(c);
894
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.createDefaultCameras();
895
- this.update("resetToDefaultCameras");
896
- }
897
- resize(width, height) {
898
- const scope = "resize";
899
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, width, "number");
900
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, height, "number");
901
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").resize(width, height);
902
- this.update("resize");
903
- }
904
- restrictEventListeners(allowedListeners) {
905
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.allowEventListeners(allowedListeners);
906
- }
907
- update(id) {
908
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").update(id || "ViewportApi");
909
- }
910
- updateDefaultLineMaterial(value) {
911
- const scope = "updateDefaultLineMaterial";
912
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "object");
913
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultLineMaterial = value;
914
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
915
- this.update("updateDefaultLineMaterial");
916
- }
917
- updateDefaultMaterial(value) {
918
- const scope = "updateDefaultMaterial";
919
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "object");
920
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterial = value;
921
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
922
- this.update("updateDefaultMaterial");
923
- }
924
- updateDefaultPointMaterial(value) {
925
- const scope = "updateDefaultPointMaterial";
926
- __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "object");
927
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultPointMaterial = value;
928
- __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
929
- this.update("updateDefaultPointMaterial");
930
- }
931
- updateEnvironmentGeometry() {
932
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").updateEnvironmentGeometry();
933
- }
934
- updateGeometryData(geometryData) {
935
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").geometryLoader.updateGeometryMaterial(geometryData);
936
- }
937
- updateNode(node) {
938
- const scope = "updateNode";
939
- if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
940
- throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
941
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sceneTreeManager.updateNode(node, node.convertedObject[this.id]);
942
- }
943
- updateNodeTransformation(node) {
944
- const scope = "updateNodeTransformation";
945
- if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
946
- throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
947
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sceneTreeManager.updateNode(node, node.convertedObject[this.id], { transformationOnly: true });
948
- }
949
- viewInAR(node) {
950
- var _a, _b;
951
- return __awaiter(this, void 0, void 0, function* () {
952
- const scope = "viewInAR";
953
- if (node && !(node instanceof viewer_shared_node_tree_1.TreeNode))
954
- throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
955
- let sessionEngineId = undefined;
956
- for (const s in __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines) {
957
- const state = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[s];
958
- if (state !== undefined && state.canUploadGLTF) {
959
- sessionEngineId = s;
960
- break;
961
- }
962
- }
963
- if (!sessionEngineId)
964
- throw new viewer_shared_services_1.ShapeDiverViewerArError("Api.viewInAR: None of the sessions that are registered are capable of using the AR feature.");
965
- const targetNode = node || viewer_api_general_1.sceneTree.root;
966
- const scalingMatrix = gl_matrix_1.mat4.fromScaling(gl_matrix_1.mat4.create(), this.arScale);
967
- // add scaling matrix to scene tree node
968
- targetNode.transformations.push({
969
- id: "ar_scaling",
970
- matrix: scalingMatrix,
971
- });
972
- // create the gltf
973
- this.update("viewInAR.start");
974
- const blob = yield __classPrivateFieldGet(this, _ViewportApi_gltfConverter, "f").convert(targetNode, true, this.id);
975
- // remove scaling the matrix
976
- for (let i = 0; i < targetNode.transformations.length; i++)
977
- if (targetNode.transformations[i].id === "ar_scaling")
978
- targetNode.transformations.splice(i, 1);
979
- this.update("viewInAR.end");
980
- const response = yield ((_a = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _a === void 0 ? void 0 : _a.uploadGLTF(new Blob([blob], { type: "application/octet-stream" }), __classPrivateFieldGet(this, _ViewportApi_systemInfo, "f").isIOS
981
- ? sdk_geometry_api_sdk_v2_1.QueryGltfConversion.USDZ
982
- : sdk_geometry_api_sdk_v2_1.QueryGltfConversion.NONE));
983
- const href = (_b = response === null || response === void 0 ? void 0 : response.gltf) === null || _b === void 0 ? void 0 : _b.href;
984
- if (href)
985
- __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").viewInAR(href);
986
- });
987
- }
988
- viewableInAR() {
989
- return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").viewableInAR();
990
- }
991
- }
992
- exports.ViewportApi = ViewportApi;
993
- _ViewportApi_animationEngine = new WeakMap(), _ViewportApi_cameras = new WeakMap(), _ViewportApi_creationControlCenterViewport = new WeakMap(), _ViewportApi_gltfConverter = new WeakMap(), _ViewportApi_inputValidator = new WeakMap(), _ViewportApi_lightScenes = new WeakMap(), _ViewportApi_logger = new WeakMap(), _ViewportApi_postProcessing = new WeakMap(), _ViewportApi_renderingEngine = new WeakMap(), _ViewportApi_stateEngine = new WeakMap(), _ViewportApi_systemInfo = new WeakMap();
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
45
+ if (kind === "m") throw new TypeError("Private method is not writable");
46
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
47
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
48
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
49
+ };
50
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
51
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
52
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
53
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
54
+ };
55
+ var _ViewportApi_animationEngine, _ViewportApi_cameras, _ViewportApi_creationControlCenterViewport, _ViewportApi_gltfConverter, _ViewportApi_inputValidator, _ViewportApi_lightScenes, _ViewportApi_logger, _ViewportApi_postProcessing, _ViewportApi_renderingEngine, _ViewportApi_stateEngine, _ViewportApi_systemInfo;
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.ViewportApi = void 0;
58
+ const sdk_geometry_api_sdk_v2_1 = require("@shapediver/sdk.geometry-api-sdk-v2");
59
+ const viewer_api_general_1 = require("@shapediver/viewer.api.general");
60
+ const viewer_creation_control_center_viewport_1 = require("@shapediver/viewer.creation-control-center.viewport");
61
+ const viewer_data_engine_gltf_converter_1 = require("@shapediver/viewer.data-engine.gltf-converter");
62
+ const viewer_rendering_engine_animation_engine_1 = require("@shapediver/viewer.rendering-engine.animation-engine");
63
+ const viewer_rendering_engine_camera_engine_1 = require("@shapediver/viewer.rendering-engine.camera-engine");
64
+ const viewer_shared_build_data_1 = require("@shapediver/viewer.shared.build-data");
65
+ const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
66
+ const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
67
+ const viewer_shared_types_1 = require("@shapediver/viewer.shared.types");
68
+ const gl_matrix_1 = require("gl-matrix");
69
+ const QRCode = __importStar(require("qrcode"));
70
+ const OrthographicCameraApi_1 = require("./camera/OrthographicCameraApi");
71
+ const PerspectiveCameraApi_1 = require("./camera/PerspectiveCameraApi");
72
+ const LightSceneApi_1 = require("./lights/LightSceneApi");
73
+ const PostProcessingApi_1 = require("./PostProcessingApi");
74
+ class ViewportApi {
75
+ // #endregion Properties (11)
76
+ // #region Constructors (1)
77
+ constructor(renderingEngine) {
78
+ // #region Properties (11)
79
+ _ViewportApi_animationEngine.set(this, viewer_rendering_engine_animation_engine_1.AnimationEngine.instance);
80
+ _ViewportApi_cameras.set(this, {});
81
+ _ViewportApi_creationControlCenterViewport.set(this, viewer_creation_control_center_viewport_1.CreationControlCenterViewport.instance);
82
+ _ViewportApi_gltfConverter.set(this, viewer_data_engine_gltf_converter_1.GLTFConverter.instance);
83
+ _ViewportApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
84
+ _ViewportApi_lightScenes.set(this, {});
85
+ _ViewportApi_logger.set(this, viewer_shared_services_1.Logger.instance);
86
+ _ViewportApi_postProcessing.set(this, void 0);
87
+ _ViewportApi_renderingEngine.set(this, void 0);
88
+ _ViewportApi_stateEngine.set(this, viewer_shared_services_1.StateEngine.instance);
89
+ _ViewportApi_systemInfo.set(this, viewer_shared_services_1.SystemInfo.instance);
90
+ __classPrivateFieldSet(this, _ViewportApi_renderingEngine, renderingEngine, "f");
91
+ // Whenever a camera is added or removed from the camera engine, this update is called.
92
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.update = () => {
93
+ for (const c in __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras) {
94
+ if (!__classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c]) {
95
+ if (__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c].type ===
96
+ viewer_rendering_engine_camera_engine_1.CAMERA_TYPE.PERSPECTIVE) {
97
+ __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c] = new PerspectiveCameraApi_1.PerspectiveCameraApi(this, (__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c]));
98
+ }
99
+ else {
100
+ __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c] = new OrthographicCameraApi_1.OrthographicCameraApi(this, (__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c]));
101
+ }
102
+ }
103
+ }
104
+ for (const c in __classPrivateFieldGet(this, _ViewportApi_cameras, "f")) {
105
+ if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.cameras[c]) {
106
+ delete __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[c];
107
+ }
108
+ }
109
+ };
110
+ // We call it once in the beginning to get the current state.
111
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.update();
112
+ // Whenever a camera is added or removed from the camera engine, this update is called.
113
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.update = () => {
114
+ for (const l in __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScenes) {
115
+ if (!__classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[l]) {
116
+ __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[l] = new LightSceneApi_1.LightSceneApi(this, __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScenes[l]);
117
+ }
118
+ }
119
+ for (const l in __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")) {
120
+ if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScenes[l]) {
121
+ delete __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[l];
122
+ }
123
+ }
124
+ };
125
+ // We call it once in the beginning to get the current state.
126
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.update();
127
+ // We create the post processing api
128
+ __classPrivateFieldSet(this, _ViewportApi_postProcessing, new PostProcessingApi_1.PostProcessingApi(this, __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f")), "f");
129
+ }
130
+ // #endregion Constructors (1)
131
+ // #region Public Getters And Setters (106)
132
+ get animations() {
133
+ return __classPrivateFieldGet(this, _ViewportApi_animationEngine, "f").animations;
134
+ }
135
+ get arRotation() {
136
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arRotation;
137
+ }
138
+ set arRotation(value) {
139
+ const scope = "arRotation";
140
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "vec3");
141
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arRotation = value;
142
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
143
+ this.update("arRotation");
144
+ }
145
+ get arScale() {
146
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arScale;
147
+ }
148
+ set arScale(value) {
149
+ const scope = "arScale";
150
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "vec3");
151
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arScale = gl_matrix_1.vec3.max(gl_matrix_1.vec3.create(), value, gl_matrix_1.vec3.fromValues(0.001, 0.001, 0.001));
152
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
153
+ this.update("arScale");
154
+ }
155
+ get arTranslation() {
156
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arTranslation;
157
+ }
158
+ set arTranslation(value) {
159
+ const scope = "arTranslation";
160
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "vec3");
161
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").arTranslation = value;
162
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
163
+ this.update("arTranslation");
164
+ }
165
+ get automaticColorAdjustment() {
166
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticColorAdjustment;
167
+ }
168
+ set automaticColorAdjustment(value) {
169
+ const scope = "automaticColorAdjustment";
170
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
171
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticColorAdjustment = value;
172
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
173
+ this.update("automaticColorAdjustment");
174
+ }
175
+ get automaticResizing() {
176
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticResizing;
177
+ }
178
+ set automaticResizing(value) {
179
+ const scope = "automaticResizing";
180
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
181
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").automaticResizing = value;
182
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
183
+ this.update("automaticResizing");
184
+ }
185
+ get beautyRenderBlendingDuration() {
186
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderBlendingDuration;
187
+ }
188
+ set beautyRenderBlendingDuration(value) {
189
+ const scope = "beautyRenderBlendingDuration";
190
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
191
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderBlendingDuration = value;
192
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
193
+ this.update("beautyRenderBlendingDuration");
194
+ }
195
+ get beautyRenderDelay() {
196
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderDelay;
197
+ }
198
+ set beautyRenderDelay(value) {
199
+ const scope = "beautyRenderDelay";
200
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
201
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").beautyRenderDelay = value;
202
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
203
+ this.update("beautyRenderDelay");
204
+ }
205
+ get camera() {
206
+ if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.camera)
207
+ return null;
208
+ return __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.camera.id];
209
+ }
210
+ get cameras() {
211
+ return __classPrivateFieldGet(this, _ViewportApi_cameras, "f");
212
+ }
213
+ get canvas() {
214
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").canvas;
215
+ }
216
+ get clearAlpha() {
217
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearAlpha;
218
+ }
219
+ set clearAlpha(value) {
220
+ const scope = "clearAlpha";
221
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
222
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearAlpha = value;
223
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
224
+ this.update("clearAlpha");
225
+ }
226
+ get clearColor() {
227
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearColor;
228
+ }
229
+ set clearColor(value) {
230
+ const scope = "clearColor";
231
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
232
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").clearColor = value;
233
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
234
+ this.update("clearColor");
235
+ }
236
+ get contactShadowBlur() {
237
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowBlur;
238
+ }
239
+ set contactShadowBlur(value) {
240
+ const scope = "contactShadowBlur";
241
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
242
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowBlur = value;
243
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
244
+ this.update("contactShadowBlur");
245
+ }
246
+ get contactShadowDarkness() {
247
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowDarkness;
248
+ }
249
+ set contactShadowDarkness(value) {
250
+ const scope = "contactShadowDarkness";
251
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
252
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowDarkness = value;
253
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
254
+ this.update("contactShadowDarkness");
255
+ }
256
+ get contactShadowHeight() {
257
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowHeight;
258
+ }
259
+ set contactShadowHeight(value) {
260
+ const scope = "contactShadowHeight";
261
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
262
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowHeight = value;
263
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
264
+ this.update("contactShadowHeight");
265
+ }
266
+ get contactShadowOpacity() {
267
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowOpacity;
268
+ }
269
+ set contactShadowOpacity(value) {
270
+ const scope = "contactShadowOpacity";
271
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
272
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowOpacity = value;
273
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
274
+ this.update("contactShadowOpacity");
275
+ }
276
+ get contactShadowVisibility() {
277
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowVisibility;
278
+ }
279
+ set contactShadowVisibility(value) {
280
+ const scope = "contactShadowVisibility";
281
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
282
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").contactShadowVisibility = value;
283
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
284
+ this.update("contactShadowVisibility");
285
+ }
286
+ get defaultLineMaterial() {
287
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultLineMaterial;
288
+ }
289
+ get defaultMaterial() {
290
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterial;
291
+ }
292
+ get defaultMaterialColor() {
293
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterialColor;
294
+ }
295
+ set defaultMaterialColor(value) {
296
+ const scope = "defaultMaterialColor";
297
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
298
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterialColor = value;
299
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
300
+ this.update("defaultMaterialColor");
301
+ }
302
+ get defaultPointMaterial() {
303
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultPointMaterial;
304
+ }
305
+ get enableAR() {
306
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").enableAR;
307
+ }
308
+ set enableAR(value) {
309
+ const scope = "enableAR";
310
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
311
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").enableAR = value;
312
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
313
+ this.update("enableAR");
314
+ }
315
+ get environmentMap() {
316
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMap;
317
+ }
318
+ set environmentMap(value) {
319
+ const scope = "environmentMap";
320
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "cubeMap");
321
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMap = value;
322
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
323
+ this.update("environmentMap");
324
+ }
325
+ get environmentMapAsBackground() {
326
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapAsBackground;
327
+ }
328
+ set environmentMapAsBackground(value) {
329
+ const scope = "environmentMapAsBackground";
330
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
331
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapAsBackground = value;
332
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
333
+ this.update("environmentMapAsBackground");
334
+ }
335
+ get environmentMapBlurriness() {
336
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapBlurriness;
337
+ }
338
+ set environmentMapBlurriness(value) {
339
+ const scope = "environmentMapBlurriness";
340
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
341
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapBlurriness = value;
342
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
343
+ this.update("environmentMapBlurriness");
344
+ }
345
+ get environmentMapForUnlitMaterials() {
346
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapForUnlitMaterials;
347
+ }
348
+ set environmentMapForUnlitMaterials(value) {
349
+ const scope = "environmentMapForUnlitMaterials";
350
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
351
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapForUnlitMaterials = value;
352
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
353
+ this.update("environmentMapForUnlitMaterials");
354
+ }
355
+ get environmentMapIntensity() {
356
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapIntensity;
357
+ }
358
+ set environmentMapIntensity(value) {
359
+ const scope = "environmentMapIntensity";
360
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
361
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapIntensity = value;
362
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
363
+ this.update("environmentMapIntensity");
364
+ }
365
+ get environmentMapResolution() {
366
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapResolution;
367
+ }
368
+ set environmentMapResolution(value) {
369
+ const scope = "environmentMapResolution";
370
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "string");
371
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapResolution = value;
372
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
373
+ this.update("environmentMapResolution");
374
+ }
375
+ get environmentMapRotation() {
376
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapRotation;
377
+ }
378
+ set environmentMapRotation(value) {
379
+ const scope = "environmentMapRotation";
380
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "quat");
381
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").environmentMapRotation = value;
382
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
383
+ this.update("environmentMapRotation");
384
+ }
385
+ get gridColor() {
386
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridColor;
387
+ }
388
+ set gridColor(value) {
389
+ const scope = "gridColor";
390
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
391
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridColor = value;
392
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
393
+ this.update("gridColor");
394
+ }
395
+ get gridVisibility() {
396
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridVisibility;
397
+ }
398
+ set gridVisibility(value) {
399
+ const scope = "gridVisibility";
400
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
401
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").gridVisibility = value;
402
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
403
+ this.update("gridVisibility");
404
+ }
405
+ get groundPlaneColor() {
406
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneColor;
407
+ }
408
+ set groundPlaneColor(value) {
409
+ const scope = "groundPlaneColor";
410
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
411
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneColor = value;
412
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
413
+ this.update("groundPlaneColor");
414
+ }
415
+ get groundPlaneShadowColor() {
416
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowColor;
417
+ }
418
+ set groundPlaneShadowColor(value) {
419
+ const scope = "groundPlaneShadowColor";
420
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "color");
421
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowColor = value;
422
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
423
+ this.update("groundPlaneShadowColor");
424
+ }
425
+ get groundPlaneShadowVisibility() {
426
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowVisibility;
427
+ }
428
+ set groundPlaneShadowVisibility(value) {
429
+ const scope = "groundPlaneShadowVisibility";
430
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
431
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneShadowVisibility = value;
432
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
433
+ this.update("groundPlaneShadowVisibility");
434
+ }
435
+ get groundPlaneVisibility() {
436
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneVisibility;
437
+ }
438
+ set groundPlaneVisibility(value) {
439
+ const scope = "groundPlaneVisibility";
440
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
441
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").groundPlaneVisibility = value;
442
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
443
+ this.update("groundPlaneVisibility");
444
+ }
445
+ get id() {
446
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").id;
447
+ }
448
+ get isBusy() {
449
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").busy;
450
+ }
451
+ get lightScene() {
452
+ if (!__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScene)
453
+ return null;
454
+ return __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[__classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.lightScene.id];
455
+ }
456
+ get lightScenes() {
457
+ return __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f");
458
+ }
459
+ get lights() {
460
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lights;
461
+ }
462
+ set lights(value) {
463
+ const scope = "lights";
464
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
465
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lights = value;
466
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
467
+ this.update("lights");
468
+ }
469
+ get loadDefaultCameras() {
470
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").loadDefaultCameras;
471
+ }
472
+ set loadDefaultCameras(value) {
473
+ const scope = "loadDefaultCameras";
474
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
475
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").loadDefaultCameras = value;
476
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
477
+ this.update("loadDefaultCameras");
478
+ }
479
+ get materialOverrideType() {
480
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").materialOverrideType;
481
+ }
482
+ set materialOverrideType(value) {
483
+ const scope = "materialOverrideType";
484
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", false, Object.values(viewer_shared_types_1.MATERIAL_TYPE));
485
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").materialOverrideType = value;
486
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
487
+ this.update("materialOverrideType");
488
+ }
489
+ get maximumRenderingSize() {
490
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").maximumRenderingSize;
491
+ }
492
+ set maximumRenderingSize(value) {
493
+ const scope = "maximumRenderingSize";
494
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, "object");
495
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value.width, "number");
496
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value.height, "number");
497
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").maximumRenderingSize = value;
498
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
499
+ this.update("maximumRenderingSize");
500
+ }
501
+ get outputEncoding() {
502
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").outputEncoding;
503
+ }
504
+ set outputEncoding(value) {
505
+ const scope = "outputEncoding";
506
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.TEXTURE_ENCODING));
507
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").outputEncoding = value;
508
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
509
+ this.update("outputEncoding");
510
+ }
511
+ get physicallyCorrectLights() {
512
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").physicallyCorrectLights;
513
+ }
514
+ set physicallyCorrectLights(value) {
515
+ const scope = "physicallyCorrectLights";
516
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
517
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").physicallyCorrectLights = value;
518
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
519
+ this.update("physicallyCorrectLights");
520
+ }
521
+ get pointSize() {
522
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pointSize;
523
+ }
524
+ set pointSize(value) {
525
+ const scope = "pointSize";
526
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
527
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pointSize = value;
528
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
529
+ this.update("pointSize");
530
+ }
531
+ get postProcessing() {
532
+ return __classPrivateFieldGet(this, _ViewportApi_postProcessing, "f");
533
+ }
534
+ get postRenderingCallback() {
535
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").postRenderingCallback;
536
+ }
537
+ set postRenderingCallback(value) {
538
+ const scope = "postRenderingCallback";
539
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "function", false);
540
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").postRenderingCallback = value;
541
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
542
+ this.update("postRenderingCallback");
543
+ }
544
+ get preRenderingCallback() {
545
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").preRenderingCallback;
546
+ }
547
+ set preRenderingCallback(value) {
548
+ const scope = "preRenderingCallback";
549
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "function", false);
550
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").preRenderingCallback = value;
551
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
552
+ this.update("preRenderingCallback");
553
+ }
554
+ get sessionSettingsId() {
555
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sessionSettingsId;
556
+ }
557
+ get sessionSettingsMode() {
558
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sessionSettingsMode;
559
+ }
560
+ get shadows() {
561
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").shadows;
562
+ }
563
+ set shadows(value) {
564
+ const scope = "shadows";
565
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
566
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").shadows = value;
567
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
568
+ this.update("shadows");
569
+ }
570
+ get show() {
571
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").show;
572
+ }
573
+ set show(value) {
574
+ const scope = "show";
575
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
576
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").show = value;
577
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
578
+ this.update("show");
579
+ }
580
+ get showStatistics() {
581
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").showStatistics;
582
+ }
583
+ set showStatistics(value) {
584
+ const scope = "showStatistics";
585
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
586
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").showStatistics = value;
587
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
588
+ this.update("showStatistics");
589
+ }
590
+ get softShadows() {
591
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").softShadows;
592
+ }
593
+ set softShadows(value) {
594
+ const scope = "softShadows";
595
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "boolean");
596
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").softShadows = value;
597
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
598
+ this.update("softShadows");
599
+ }
600
+ get textureEncoding() {
601
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").textureEncoding;
602
+ }
603
+ set textureEncoding(value) {
604
+ const scope = "textureEncoding";
605
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.TEXTURE_ENCODING));
606
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").textureEncoding = value;
607
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
608
+ this.update("textureEncoding");
609
+ }
610
+ get threeJsCoreObjects() {
611
+ return {
612
+ scene: __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sceneTreeManager.scene,
613
+ renderer: __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").renderer,
614
+ camera: __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraManager.camera,
615
+ };
616
+ }
617
+ get toneMapping() {
618
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMapping;
619
+ }
620
+ set toneMapping(value) {
621
+ const scope = "toneMapping";
622
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.TONE_MAPPING));
623
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMapping = value;
624
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
625
+ this.update("toneMapping");
626
+ }
627
+ get toneMappingExposure() {
628
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMappingExposure;
629
+ }
630
+ set toneMappingExposure(value) {
631
+ const scope = "toneMappingExposure";
632
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "number");
633
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").toneMappingExposure = value;
634
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
635
+ this.update("toneMappingExposure");
636
+ }
637
+ get type() {
638
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").type;
639
+ }
640
+ set type(value) {
641
+ const scope = "type";
642
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "enum", true, Object.values(viewer_shared_types_1.RENDERER_TYPE));
643
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").type = value;
644
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
645
+ this.update("type");
646
+ }
647
+ get visualizeAttributes() {
648
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").visualizeAttributes;
649
+ }
650
+ set visualizeAttributes(value) {
651
+ const scope = "visualizeAttributes";
652
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "function", false);
653
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").visualizeAttributes = value;
654
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
655
+ this.render();
656
+ }
657
+ // #endregion Public Getters And Setters (106)
658
+ // #region Public Methods (41)
659
+ addCanvasEventListener(listener) {
660
+ const scope = "addCanvasEventListener";
661
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, listener, "object");
662
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.addDomEventListener(listener);
663
+ }
664
+ addFlag(flag) {
665
+ const scope = "addFlag";
666
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, flag, "enum", true, Object.values(viewer_shared_types_1.FLAG_TYPE));
667
+ const token = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").addFlag(flag);
668
+ return token;
669
+ }
670
+ addRestrictedCanvasListenerToken(token) {
671
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.addRestrictedListenerToken(token);
672
+ }
673
+ applyViewportSettings(settings, sections) {
674
+ const scope = "applyViewportSettings";
675
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, settings, "object");
676
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, sections, "object", false);
677
+ return __classPrivateFieldGet(this, _ViewportApi_creationControlCenterViewport, "f").applyViewportSettings(this.id, settings, sections);
678
+ }
679
+ assignCamera(id) {
680
+ const scope = "assignCamera";
681
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
682
+ const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.assignCamera(id);
683
+ this.update("assignCamera");
684
+ return check;
685
+ }
686
+ assignLightScene(id) {
687
+ const scope = "assignLightScene";
688
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
689
+ const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.assignLightScene(id);
690
+ this.update("assignLightScene");
691
+ return check;
692
+ }
693
+ close() {
694
+ return __awaiter(this, void 0, void 0, function* () {
695
+ return yield __classPrivateFieldGet(this, _ViewportApi_creationControlCenterViewport, "f").closeViewportEngine(this.id);
696
+ });
697
+ }
698
+ continueRendering() {
699
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").continueRendering();
700
+ }
701
+ convert3Dto2D(p) {
702
+ const scope = "convert3Dto2D";
703
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, p, "vec3");
704
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").convert3Dto2D(p);
705
+ }
706
+ convertToGlTF() {
707
+ return __awaiter(this, arguments, void 0, function* (node = viewer_api_general_1.sceneTree.root, convertForAr = false) {
708
+ const scope = "convertToGlTF";
709
+ if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
710
+ throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
711
+ this.update("convertToGlTF.start");
712
+ const result = yield __classPrivateFieldGet(this, _ViewportApi_gltfConverter, "f").convert(node, convertForAr, this.id);
713
+ this.update("convertToGlTF.end");
714
+ return new Blob([result], { type: "application/octet-stream" });
715
+ });
716
+ }
717
+ createArSessionLink(node_1) {
718
+ return __awaiter(this, arguments, void 0, function* (node, qrCode = true, fallbackUrl) {
719
+ var _a, _b;
720
+ const scope = "createArSessionLink";
721
+ if (node && !(node instanceof viewer_shared_node_tree_1.TreeNode))
722
+ throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
723
+ let sessionEngineId = undefined;
724
+ for (const s in __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines) {
725
+ const state = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[s];
726
+ if (state !== undefined && state.canUploadGLTF) {
727
+ sessionEngineId = s;
728
+ break;
729
+ }
730
+ }
731
+ if (!sessionEngineId)
732
+ throw new viewer_shared_services_1.ShapeDiverViewerArError("ViewportApi.createArSessionLink: None of the sessions that are registered are capable of using the AR feature.");
733
+ const targetNode = node || viewer_api_general_1.sceneTree.root;
734
+ const scalingMatrix = gl_matrix_1.mat4.fromScaling(gl_matrix_1.mat4.create(), this.arScale);
735
+ // add scaling matrix to scene tree node
736
+ targetNode.transformations.push({
737
+ id: "ar_scaling",
738
+ matrix: scalingMatrix,
739
+ });
740
+ // create the gltf
741
+ this.update("createArSessionLink.start");
742
+ const blob = yield __classPrivateFieldGet(this, _ViewportApi_gltfConverter, "f").convert(targetNode, true, this.id);
743
+ // remove scaling the matrix
744
+ for (let i = 0; i < targetNode.transformations.length; i++)
745
+ if (targetNode.transformations[i].id === "ar_scaling")
746
+ targetNode.transformations.splice(i, 1);
747
+ this.update("createArSessionLink.end");
748
+ const response = yield ((_a = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _a === void 0 ? void 0 : _a.uploadGLTF(new Blob([blob], { type: "application/octet-stream" }), sdk_geometry_api_sdk_v2_1.QueryGltfConversion.SCENE));
749
+ const backends = {
750
+ sddev3: "https://sddev3.eu-central-1.shapediver.com",
751
+ sddev2: "https://sddev2.eu-central-1.shapediver.com",
752
+ sddev: "https://sddev.eu-central-1.shapediver.com",
753
+ sdtest: "https://sdtest.us-east-1.shapediver.com",
754
+ sdeuc1: "https://sdeuc1.eu-central-1.shapediver.com",
755
+ sdr7euc1: "https://sdr7euc1.eu-central-1.shapediver.com",
756
+ sduse1: "https://model-view.shapediver.com",
757
+ };
758
+ let backendIdentifier = Object.keys(backends).find((key) => {
759
+ var _a;
760
+ return backends[key] ===
761
+ ((_a = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _a === void 0 ? void 0 : _a.modelViewUrl);
762
+ });
763
+ if (!backendIdentifier) {
764
+ const modelViewUrl = (_b = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _b === void 0 ? void 0 : _b.modelViewUrl;
765
+ backendIdentifier = modelViewUrl === null || modelViewUrl === void 0 ? void 0 : modelViewUrl.replace("https://", "").replace(".shapediver.com", "");
766
+ }
767
+ const fallbackQueryParameter = fallbackUrl
768
+ ? `fb=${encodeURIComponent(fallbackUrl)}&`
769
+ : "";
770
+ if (!response || !response.gltf || !response.gltf.sceneId)
771
+ throw new viewer_shared_services_1.ShapeDiverViewerArError("ViewportApi.createArSessionLink: There was an unexpected error with the ar scene response. Please contact us if this happens again.");
772
+ const sceneId = response.gltf.sceneId;
773
+ const link = `https://viewer.shapediver.com/v3/${viewer_shared_build_data_1.build_data.build_version.replace("3.", "")}/ar.html?${fallbackQueryParameter}b=${encodeURIComponent(backendIdentifier)}&id=${encodeURIComponent(sceneId)}`;
774
+ if (qrCode === false) {
775
+ return link;
776
+ }
777
+ else {
778
+ const qrCodeLink = yield new Promise((resolve, reject) => {
779
+ QRCode.toDataURL(link, (error, url) => {
780
+ if (error) {
781
+ reject(error);
782
+ }
783
+ else {
784
+ resolve(url);
785
+ }
786
+ });
787
+ });
788
+ return qrCodeLink;
789
+ }
790
+ });
791
+ }
792
+ createLightScene(properties) {
793
+ const scope = "createLightScene";
794
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, properties, "object", false);
795
+ const prop = Object.assign({}, properties);
796
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, prop.name, "string", false);
797
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, prop.standard, "boolean", false);
798
+ const lightScene = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.createLightScene(properties || {});
799
+ this.update("createLightScene");
800
+ return __classPrivateFieldGet(this, _ViewportApi_lightScenes, "f")[lightScene.id];
801
+ }
802
+ createOrthographicCamera(id) {
803
+ const scope = "createOrthographicCamera";
804
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string", false);
805
+ const camera = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.createCamera(viewer_rendering_engine_camera_engine_1.CAMERA_TYPE.ORTHOGRAPHIC, id);
806
+ this.update("createOrthographicCamera");
807
+ return __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[camera.id];
808
+ }
809
+ createPerspectiveCamera(id) {
810
+ const scope = "createPerspectiveCamera";
811
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string", false);
812
+ const camera = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.createCamera(viewer_rendering_engine_camera_engine_1.CAMERA_TYPE.PERSPECTIVE, id);
813
+ this.update("createPerspectiveCamera");
814
+ return __classPrivateFieldGet(this, _ViewportApi_cameras, "f")[camera.id];
815
+ }
816
+ createSDTFOverview(node) {
817
+ const scope = "createSDTFOverview";
818
+ if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
819
+ throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
820
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").createSDTFOverview(node);
821
+ }
822
+ displayErrorMessage(message) {
823
+ const scope = "displayErrorMessage";
824
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, message, "string");
825
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").displayErrorMessage(message);
826
+ this.update("displayErrorMessage");
827
+ }
828
+ getEnvironmentMapImageUrl() {
829
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").getEnvironmentMapImageUrl();
830
+ }
831
+ getScreenshot(type, quality) {
832
+ const scope = "getScreenshot";
833
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, type, "string", false);
834
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, quality, "number", false);
835
+ this.update("getScreenshot");
836
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").getScreenshot(type, quality);
837
+ }
838
+ getScreenshotAdvanced(type, quality, resolution, camera) {
839
+ const scope = "getScreenshotAdvanced";
840
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, type, "string", false);
841
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, quality, "number", false);
842
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, resolution, "object", false);
843
+ if (resolution) {
844
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, resolution.width, "number");
845
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, resolution.height, "number");
846
+ }
847
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, camera, "object", false);
848
+ this.update("getScreenshotAdvanced");
849
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").getScreenshotAdvanced(type, quality, resolution, camera);
850
+ }
851
+ getViewportSettings() {
852
+ return __classPrivateFieldGet(this, _ViewportApi_creationControlCenterViewport, "f").getViewportSettings(this.id);
853
+ }
854
+ isMobileDeviceWithoutBrowserARSupport() {
855
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").isMobileDeviceWithoutBrowserARSupport();
856
+ }
857
+ pauseRendering() {
858
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pauseRendering();
859
+ }
860
+ pointerEventToRay(event) {
861
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").pointerEventToRay(event);
862
+ }
863
+ raytraceScene(origin, direction, filterCriteria) {
864
+ const scope = "raytraceScene";
865
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, origin, "vec3");
866
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, direction, "vec3");
867
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").raytraceScene(origin, direction, filterCriteria);
868
+ }
869
+ removeCamera(id) {
870
+ const scope = "removeCamera";
871
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
872
+ const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.removeCamera(id);
873
+ this.update("removeCamera");
874
+ return check;
875
+ }
876
+ removeCanvasEventListener(token) {
877
+ const scope = "removeCanvasEventListener";
878
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, token, "string");
879
+ const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.removeDomEventListener(token);
880
+ return check;
881
+ }
882
+ removeFlag(token) {
883
+ const scope = "removeFlag";
884
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, token, "string");
885
+ const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").removeFlag(token);
886
+ return check;
887
+ }
888
+ removeLightScene(id) {
889
+ const scope = "removeLightScene";
890
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, id, "string");
891
+ const check = __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").lightEngine.removeLightScene(id);
892
+ this.update("removeLightScene");
893
+ return check;
894
+ }
895
+ removeRestrictedCanvasListenerToken(token) {
896
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.removeRestrictedListenerToken(token);
897
+ }
898
+ render() {
899
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").renderingManager.render();
900
+ }
901
+ resetToDefaultCameras() {
902
+ for (const c in this.cameras)
903
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.removeCamera(c);
904
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").cameraEngine.createDefaultCameras();
905
+ this.update("resetToDefaultCameras");
906
+ }
907
+ resize(width, height) {
908
+ const scope = "resize";
909
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, width, "number");
910
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, height, "number");
911
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").resize(width, height);
912
+ this.update("resize");
913
+ }
914
+ restrictEventListeners(allowedListeners) {
915
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").domEventEngine.allowEventListeners(allowedListeners);
916
+ }
917
+ update(id) {
918
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").update(id || "ViewportApi");
919
+ }
920
+ updateDefaultLineMaterial(value) {
921
+ const scope = "updateDefaultLineMaterial";
922
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "object");
923
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultLineMaterial = value;
924
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
925
+ this.update("updateDefaultLineMaterial");
926
+ }
927
+ updateDefaultMaterial(value) {
928
+ const scope = "updateDefaultMaterial";
929
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "object");
930
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultMaterial = value;
931
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
932
+ this.update("updateDefaultMaterial");
933
+ }
934
+ updateDefaultPointMaterial(value) {
935
+ const scope = "updateDefaultPointMaterial";
936
+ __classPrivateFieldGet(this, _ViewportApi_inputValidator, "f").validateAndError(`ViewportApi.${scope}`, value, "object");
937
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").defaultPointMaterial = value;
938
+ __classPrivateFieldGet(this, _ViewportApi_logger, "f").debug(`ViewportApi.${scope}: ${scope} was set to: ${value}`);
939
+ this.update("updateDefaultPointMaterial");
940
+ }
941
+ updateEnvironmentGeometry() {
942
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").updateEnvironmentGeometry();
943
+ }
944
+ updateGeometryData(geometryData) {
945
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").geometryLoader.updateGeometryMaterial(geometryData);
946
+ }
947
+ updateNode(node) {
948
+ const scope = "updateNode";
949
+ if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
950
+ throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
951
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sceneTreeManager.updateNode(node, node.convertedObject[this.id]);
952
+ }
953
+ updateNodeTransformation(node) {
954
+ const scope = "updateNodeTransformation";
955
+ if (!(node instanceof viewer_shared_node_tree_1.TreeNode))
956
+ throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
957
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").sceneTreeManager.updateNode(node, node.convertedObject[this.id], { transformationOnly: true });
958
+ }
959
+ viewInAR(node) {
960
+ return __awaiter(this, void 0, void 0, function* () {
961
+ var _a, _b;
962
+ const scope = "viewInAR";
963
+ if (node && !(node instanceof viewer_shared_node_tree_1.TreeNode))
964
+ throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${node} is not of type node.`, node, "node");
965
+ let sessionEngineId = undefined;
966
+ for (const s in __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines) {
967
+ const state = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[s];
968
+ if (state !== undefined && state.canUploadGLTF) {
969
+ sessionEngineId = s;
970
+ break;
971
+ }
972
+ }
973
+ if (!sessionEngineId)
974
+ throw new viewer_shared_services_1.ShapeDiverViewerArError("Api.viewInAR: None of the sessions that are registered are capable of using the AR feature.");
975
+ const targetNode = node || viewer_api_general_1.sceneTree.root;
976
+ const scalingMatrix = gl_matrix_1.mat4.fromScaling(gl_matrix_1.mat4.create(), this.arScale);
977
+ // add scaling matrix to scene tree node
978
+ targetNode.transformations.push({
979
+ id: "ar_scaling",
980
+ matrix: scalingMatrix,
981
+ });
982
+ // create the gltf
983
+ this.update("viewInAR.start");
984
+ const blob = yield __classPrivateFieldGet(this, _ViewportApi_gltfConverter, "f").convert(targetNode, true, this.id);
985
+ // remove scaling the matrix
986
+ for (let i = 0; i < targetNode.transformations.length; i++)
987
+ if (targetNode.transformations[i].id === "ar_scaling")
988
+ targetNode.transformations.splice(i, 1);
989
+ this.update("viewInAR.end");
990
+ const response = yield ((_a = __classPrivateFieldGet(this, _ViewportApi_stateEngine, "f").sessionEngines[sessionEngineId]) === null || _a === void 0 ? void 0 : _a.uploadGLTF(new Blob([blob], { type: "application/octet-stream" }), __classPrivateFieldGet(this, _ViewportApi_systemInfo, "f").isIOS
991
+ ? sdk_geometry_api_sdk_v2_1.QueryGltfConversion.USDZ
992
+ : sdk_geometry_api_sdk_v2_1.QueryGltfConversion.NONE));
993
+ const href = (_b = response === null || response === void 0 ? void 0 : response.gltf) === null || _b === void 0 ? void 0 : _b.href;
994
+ if (href)
995
+ __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").viewInAR(href);
996
+ });
997
+ }
998
+ viewableInAR() {
999
+ return __classPrivateFieldGet(this, _ViewportApi_renderingEngine, "f").viewableInAR();
1000
+ }
1001
+ }
1002
+ exports.ViewportApi = ViewportApi;
1003
+ _ViewportApi_animationEngine = new WeakMap(), _ViewportApi_cameras = new WeakMap(), _ViewportApi_creationControlCenterViewport = new WeakMap(), _ViewportApi_gltfConverter = new WeakMap(), _ViewportApi_inputValidator = new WeakMap(), _ViewportApi_lightScenes = new WeakMap(), _ViewportApi_logger = new WeakMap(), _ViewportApi_postProcessing = new WeakMap(), _ViewportApi_renderingEngine = new WeakMap(), _ViewportApi_stateEngine = new WeakMap(), _ViewportApi_systemInfo = new WeakMap();
994
1004
  //# sourceMappingURL=ViewportApi.js.map