@combeenation/3d-viewer 5.1.2 → 5.2.0-alpha4

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 (221) hide show
  1. package/README.md +111 -111
  2. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  3. package/dist/lib-cjs/api/classes/animationInterface.js +2 -1
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +166 -187
  6. package/dist/lib-cjs/api/classes/dottedPath.js.map +1 -1
  7. package/dist/lib-cjs/api/classes/element.d.ts +149 -149
  8. package/dist/lib-cjs/api/classes/element.js +668 -823
  9. package/dist/lib-cjs/api/classes/element.js.map +1 -1
  10. package/dist/lib-cjs/api/classes/event.d.ts +326 -326
  11. package/dist/lib-cjs/api/classes/event.js +349 -371
  12. package/dist/lib-cjs/api/classes/event.js.map +1 -1
  13. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  14. package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -53
  15. package/dist/lib-cjs/api/classes/eventBroadcaster.js.map +1 -1
  16. package/dist/lib-cjs/api/classes/parameter.d.ts +336 -336
  17. package/dist/lib-cjs/api/classes/parameter.js +461 -471
  18. package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
  19. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  20. package/dist/lib-cjs/api/classes/parameterObservable.js +97 -101
  21. package/dist/lib-cjs/api/classes/parameterObservable.js.map +1 -1
  22. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  23. package/dist/lib-cjs/api/classes/parameterizable.js +102 -149
  24. package/dist/lib-cjs/api/classes/parameterizable.js.map +1 -1
  25. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -44
  26. package/dist/lib-cjs/api/classes/placementAnimation.js +175 -163
  27. package/dist/lib-cjs/api/classes/placementAnimation.js.map +1 -1
  28. package/dist/lib-cjs/api/classes/variant.d.ts +234 -234
  29. package/dist/lib-cjs/api/classes/variant.js +836 -1203
  30. package/dist/lib-cjs/api/classes/variant.js.map +1 -1
  31. package/dist/lib-cjs/api/classes/variantInstance.d.ts +45 -45
  32. package/dist/lib-cjs/api/classes/variantInstance.js +101 -108
  33. package/dist/lib-cjs/api/classes/variantInstance.js.map +1 -1
  34. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  35. package/dist/lib-cjs/api/classes/variantParameterizable.js +88 -99
  36. package/dist/lib-cjs/api/classes/variantParameterizable.js.map +1 -1
  37. package/dist/lib-cjs/api/classes/viewer.d.ts +187 -184
  38. package/dist/lib-cjs/api/classes/viewer.js +593 -731
  39. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  40. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  41. package/dist/lib-cjs/api/classes/viewerLight.js +343 -392
  42. package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
  43. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  44. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  45. package/dist/lib-cjs/api/internal/lensRendering.js.map +1 -1
  46. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
  47. package/dist/lib-cjs/api/internal/sceneSetup.js +225 -238
  48. package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
  49. package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -29
  50. package/dist/lib-cjs/api/manager/animationManager.js +126 -130
  51. package/dist/lib-cjs/api/manager/animationManager.js.map +1 -1
  52. package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +65 -65
  53. package/dist/lib-cjs/api/manager/gltfExportManager.js +196 -223
  54. package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
  55. package/dist/lib-cjs/api/manager/sceneManager.d.ts +31 -31
  56. package/dist/lib-cjs/api/manager/sceneManager.js +127 -152
  57. package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
  58. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +92 -92
  59. package/dist/lib-cjs/api/manager/variantInstanceManager.js +260 -335
  60. package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +1 -1
  61. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  62. package/dist/lib-cjs/api/store/specStorage.js +50 -51
  63. package/dist/lib-cjs/api/store/specStorage.js.map +1 -1
  64. package/dist/lib-cjs/api/util/babylonHelper.d.ts +174 -174
  65. package/dist/lib-cjs/api/util/babylonHelper.js +591 -611
  66. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  67. package/dist/lib-cjs/api/util/globalTypes.d.ts +366 -366
  68. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  69. package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
  70. package/dist/lib-cjs/api/util/resourceHelper.js +201 -257
  71. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  72. package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +35 -35
  73. package/dist/lib-cjs/api/util/sceneLoaderHelper.js +141 -140
  74. package/dist/lib-cjs/api/util/sceneLoaderHelper.js.map +1 -1
  75. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
  76. package/dist/lib-cjs/api/util/stringHelper.js +23 -25
  77. package/dist/lib-cjs/api/util/stringHelper.js.map +1 -1
  78. package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
  79. package/dist/lib-cjs/api/util/structureHelper.js +48 -48
  80. package/dist/lib-cjs/api/util/structureHelper.js.map +1 -1
  81. package/dist/lib-cjs/buildinfo.json +3 -3
  82. package/dist/lib-cjs/index.d.ts +51 -49
  83. package/dist/lib-cjs/index.js +110 -89
  84. package/dist/lib-cjs/index.js.map +1 -1
  85. package/dist/lib-es6/api/classes/animationInterface.d.ts +8 -8
  86. package/dist/lib-es6/api/classes/animationInterface.js +1 -1
  87. package/dist/lib-es6/api/classes/dottedPath.d.ts +79 -79
  88. package/dist/lib-es6/api/classes/dottedPath.js +162 -184
  89. package/dist/lib-es6/api/classes/dottedPath.js.map +1 -1
  90. package/dist/lib-es6/api/classes/element.d.ts +149 -149
  91. package/dist/lib-es6/api/classes/element.js +664 -820
  92. package/dist/lib-es6/api/classes/element.js.map +1 -1
  93. package/dist/lib-es6/api/classes/event.d.ts +326 -326
  94. package/dist/lib-es6/api/classes/event.js +345 -368
  95. package/dist/lib-es6/api/classes/event.js.map +1 -1
  96. package/dist/lib-es6/api/classes/eventBroadcaster.d.ts +26 -26
  97. package/dist/lib-es6/api/classes/eventBroadcaster.js +42 -50
  98. package/dist/lib-es6/api/classes/eventBroadcaster.js.map +1 -1
  99. package/dist/lib-es6/api/classes/parameter.d.ts +336 -336
  100. package/dist/lib-es6/api/classes/parameter.js +457 -468
  101. package/dist/lib-es6/api/classes/parameter.js.map +1 -1
  102. package/dist/lib-es6/api/classes/parameterObservable.d.ts +36 -36
  103. package/dist/lib-es6/api/classes/parameterObservable.js +93 -98
  104. package/dist/lib-es6/api/classes/parameterObservable.js.map +1 -1
  105. package/dist/lib-es6/api/classes/parameterizable.d.ts +15 -15
  106. package/dist/lib-es6/api/classes/parameterizable.js +98 -146
  107. package/dist/lib-es6/api/classes/parameterizable.js.map +1 -1
  108. package/dist/lib-es6/api/classes/placementAnimation.d.ts +45 -44
  109. package/dist/lib-es6/api/classes/placementAnimation.js +171 -160
  110. package/dist/lib-es6/api/classes/placementAnimation.js.map +1 -1
  111. package/dist/lib-es6/api/classes/variant.d.ts +234 -234
  112. package/dist/lib-es6/api/classes/variant.js +832 -1198
  113. package/dist/lib-es6/api/classes/variant.js.map +1 -1
  114. package/dist/lib-es6/api/classes/variantInstance.d.ts +45 -45
  115. package/dist/lib-es6/api/classes/variantInstance.js +97 -105
  116. package/dist/lib-es6/api/classes/variantInstance.js.map +1 -1
  117. package/dist/lib-es6/api/classes/variantParameterizable.d.ts +17 -17
  118. package/dist/lib-es6/api/classes/variantParameterizable.js +84 -96
  119. package/dist/lib-es6/api/classes/variantParameterizable.js.map +1 -1
  120. package/dist/lib-es6/api/classes/viewer.d.ts +187 -184
  121. package/dist/lib-es6/api/classes/viewer.js +586 -728
  122. package/dist/lib-es6/api/classes/viewer.js.map +1 -1
  123. package/dist/lib-es6/api/classes/viewerLight.d.ts +66 -66
  124. package/dist/lib-es6/api/classes/viewerLight.js +316 -389
  125. package/dist/lib-es6/api/classes/viewerLight.js.map +1 -1
  126. package/dist/lib-es6/api/internal/lensRendering.d.ts +8 -8
  127. package/dist/lib-es6/api/internal/lensRendering.js +8 -8
  128. package/dist/lib-es6/api/internal/lensRendering.js.map +1 -1
  129. package/dist/lib-es6/api/internal/sceneSetup.d.ts +13 -13
  130. package/dist/lib-es6/api/internal/sceneSetup.js +197 -233
  131. package/dist/lib-es6/api/internal/sceneSetup.js.map +1 -1
  132. package/dist/lib-es6/api/manager/animationManager.d.ts +30 -29
  133. package/dist/lib-es6/api/manager/animationManager.js +122 -127
  134. package/dist/lib-es6/api/manager/animationManager.js.map +1 -1
  135. package/dist/lib-es6/api/manager/gltfExportManager.d.ts +65 -65
  136. package/dist/lib-es6/api/manager/gltfExportManager.js +192 -220
  137. package/dist/lib-es6/api/manager/gltfExportManager.js.map +1 -1
  138. package/dist/lib-es6/api/manager/sceneManager.d.ts +31 -31
  139. package/dist/lib-es6/api/manager/sceneManager.js +123 -149
  140. package/dist/lib-es6/api/manager/sceneManager.js.map +1 -1
  141. package/dist/lib-es6/api/manager/variantInstanceManager.d.ts +92 -92
  142. package/dist/lib-es6/api/manager/variantInstanceManager.js +256 -332
  143. package/dist/lib-es6/api/manager/variantInstanceManager.js.map +1 -1
  144. package/dist/lib-es6/api/store/specStorage.d.ts +24 -24
  145. package/dist/lib-es6/api/store/specStorage.js +46 -48
  146. package/dist/lib-es6/api/store/specStorage.js.map +1 -1
  147. package/dist/lib-es6/api/util/babylonHelper.d.ts +174 -174
  148. package/dist/lib-es6/api/util/babylonHelper.js +561 -581
  149. package/dist/lib-es6/api/util/babylonHelper.js.map +1 -1
  150. package/dist/lib-es6/api/util/globalTypes.d.ts +366 -366
  151. package/dist/lib-es6/api/util/globalTypes.js +1 -1
  152. package/dist/lib-es6/api/util/resourceHelper.d.ts +58 -58
  153. package/dist/lib-es6/api/util/resourceHelper.js +191 -247
  154. package/dist/lib-es6/api/util/resourceHelper.js.map +1 -1
  155. package/dist/lib-es6/api/util/sceneLoaderHelper.d.ts +35 -35
  156. package/dist/lib-es6/api/util/sceneLoaderHelper.js +131 -133
  157. package/dist/lib-es6/api/util/sceneLoaderHelper.js.map +1 -1
  158. package/dist/lib-es6/api/util/stringHelper.d.ts +9 -9
  159. package/dist/lib-es6/api/util/stringHelper.js +19 -21
  160. package/dist/lib-es6/api/util/stringHelper.js.map +1 -1
  161. package/dist/lib-es6/api/util/structureHelper.d.ts +9 -9
  162. package/dist/lib-es6/api/util/structureHelper.js +45 -45
  163. package/dist/lib-es6/api/util/structureHelper.js.map +1 -1
  164. package/dist/lib-es6/buildinfo.json +3 -3
  165. package/dist/lib-es6/index.d.ts +51 -49
  166. package/dist/lib-es6/index.js +48 -50
  167. package/dist/lib-es6/index.js.map +1 -1
  168. package/dist/lib-full/lens-rendering.js +2 -0
  169. package/dist/lib-full/lens-rendering.js.map +1 -0
  170. package/dist/lib-full/main.js +3 -0
  171. package/dist/lib-full/main.js.LICENSE.txt +9 -0
  172. package/dist/lib-full/main.js.map +1 -0
  173. package/package.json +76 -88
  174. package/src/api/classes/animationInterface.ts +10 -10
  175. package/src/api/classes/dottedPath.ts +181 -181
  176. package/src/api/classes/element.ts +716 -716
  177. package/src/api/classes/event.ts +367 -367
  178. package/src/api/classes/eventBroadcaster.ts +52 -52
  179. package/src/api/classes/parameter.ts +494 -494
  180. package/src/api/classes/parameterObservable.ts +100 -100
  181. package/src/api/classes/parameterizable.ts +87 -87
  182. package/src/api/classes/placementAnimation.ts +161 -160
  183. package/src/api/classes/variant.ts +904 -905
  184. package/src/api/classes/variantInstance.ts +97 -97
  185. package/src/api/classes/variantParameterizable.ts +85 -85
  186. package/src/api/classes/viewer.ts +669 -668
  187. package/src/api/classes/viewerLight.ts +334 -334
  188. package/src/api/internal/debugViewer.ts +90 -90
  189. package/src/api/internal/lensRendering.ts +9 -10
  190. package/src/api/internal/sceneSetup.ts +204 -204
  191. package/src/api/manager/animationManager.ts +143 -142
  192. package/src/api/manager/gltfExportManager.ts +191 -191
  193. package/src/api/manager/sceneManager.ts +127 -127
  194. package/src/api/manager/variantInstanceManager.ts +265 -265
  195. package/src/api/store/specStorage.ts +51 -51
  196. package/src/api/util/babylonHelper.ts +663 -663
  197. package/src/api/util/globalTypes.ts +413 -413
  198. package/src/api/util/resourceHelper.ts +189 -189
  199. package/src/api/util/sceneLoaderHelper.ts +148 -147
  200. package/src/api/util/stringHelper.ts +23 -23
  201. package/src/api/util/structureHelper.ts +49 -49
  202. package/src/buildinfo.json +3 -3
  203. package/src/dev.ts +61 -64
  204. package/src/index.ts +96 -94
  205. package/src/types.d.ts +28 -28
  206. package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +0 -14
  207. package/dist/lib-cjs/api/classes/elementParameterizable.js +0 -135
  208. package/dist/lib-cjs/api/classes/elementParameterizable.js.map +0 -1
  209. package/dist/lib-cjs/api/internal/debugViewer.d.ts +0 -13
  210. package/dist/lib-cjs/api/internal/debugViewer.js +0 -87
  211. package/dist/lib-cjs/api/internal/debugViewer.js.map +0 -1
  212. package/dist/lib-es6/api/internal/debugViewer.d.ts +0 -13
  213. package/dist/lib-es6/api/internal/debugViewer.js +0 -84
  214. package/dist/lib-es6/api/internal/debugViewer.js.map +0 -1
  215. package/dist/webpack-stats.json +0 -0
  216. package/src/commonjs.tsconfig.json +0 -10
  217. package/src/declaration.tsconfig.json +0 -8
  218. package/src/es6.tsconfig.json +0 -10
  219. package/src/pagesconfig.json +0 -81
  220. package/src/tsconfig.json +0 -33
  221. package/src/tsconfig.types.json +0 -9
@@ -1,100 +1,89 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VariantParameterizable = void 0;
4
- var tslib_1 = require("tslib");
5
- var lodash_es_1 = require("lodash-es");
6
- var dottedPath_1 = require("./../classes/dottedPath");
7
- var event_1 = require("./../classes/event");
8
- var parameterizable_1 = require("./../classes/parameterizable");
9
- var resourceHelper_1 = require("./../util/resourceHelper");
10
- var stringHelper_1 = require("./../util/stringHelper");
11
- var VariantParameterizable = /** @class */ (function (_super) {
12
- tslib_1.__extends(VariantParameterizable, _super);
13
- function VariantParameterizable(variant, name) {
14
- var _this = _super.call(this) || this;
15
- _this.variant = variant;
16
- _this.name = name;
17
- _this._parameterObservers = new Map();
18
- return _this;
19
- }
20
- Object.defineProperty(VariantParameterizable.prototype, "inheritedParameters", {
21
- /**
22
- * Gets the inherited parameters from the {@link Variant} with cleaned {@link Parameterizable} prefix.
23
- */
24
- get: function () {
25
- var parameterBag = {};
26
- for (var parameter in this.variant.inheritedParameters) {
27
- var dpp = dottedPath_1.DottedPath.create(parameter);
28
- if (dpp.parts.length !== 1) {
29
- continue;
30
- }
31
- parameterBag[parameter] = this.variant.inheritedParameters[parameter];
32
- }
33
- for (var parameter in this.variant.inheritedParameters) {
34
- var dpp = dottedPath_1.DottedPath.create(parameter);
35
- if (dpp.firstPart !== this.name) {
36
- continue;
37
- }
38
- dpp.shiftPart();
39
- parameterBag[dpp.path] = this.variant.inheritedParameters[parameter];
40
- }
41
- return parameterBag;
42
- },
43
- enumerable: false,
44
- configurable: true
45
- });
46
- /**
47
- * Places the given {@link ParameterBag} in the {@link VariantParameterizable}'s parameters, replaces all patterns in the
48
- * {@link StructureJson} and broadcasts all {@link ParameterObserver}s.
49
- */
50
- VariantParameterizable.prototype.commitParameters = function (parameters) {
51
- return tslib_1.__awaiter(this, void 0, void 0, function () {
52
- var oldParameters, observerPromises, _loop_1, this_1, parameter;
53
- var _this = this;
54
- return tslib_1.__generator(this, function (_a) {
55
- switch (_a.label) {
56
- case 0:
57
- if (!parameters) {
58
- parameters = {};
59
- }
60
- oldParameters = lodash_es_1.cloneDeep(this.parameters);
61
- lodash_es_1.merge(this.parameters, parameters);
62
- observerPromises = [];
63
- _loop_1 = function (parameter) {
64
- var oldParameterValue = oldParameters[parameter];
65
- var newParameterValue = this_1.parameters[parameter];
66
- this_1.variant.assertParameter(this_1.variant.inheritedParameterDeclaration, parameter, newParameterValue);
67
- if (oldParameterValue === newParameterValue) {
68
- return "continue";
69
- }
70
- // parameter changed
71
- var parameterObservers = resourceHelper_1.mergeMaps(this_1._parameterObservers, this_1.parameterObservers);
72
- if (parameterObservers.has(parameter)) {
73
- var observers = parameterObservers.get(parameter);
74
- observerPromises = lodash_es_1.concat(observerPromises, observers.map(function (observer) {
75
- var observerResult = observer(_this, oldParameterValue, newParameterValue);
76
- var observerPromise = Promise.resolve(observerResult);
77
- observerPromise.then(function () {
78
- var clsName = stringHelper_1.camelToSnakeCase(_this.constructor.name).toUpperCase();
79
- _this.broadcastEvent(lodash_es_1.get(event_1.Event, clsName + '_PARAMETER_COMMITTED'), _this, parameter, oldParameterValue, newParameterValue);
80
- });
81
- return observerPromise;
82
- }));
83
- }
84
- };
85
- this_1 = this;
86
- for (parameter in this.parameters) {
87
- _loop_1(parameter);
88
- }
89
- return [4 /*yield*/, Promise.all(observerPromises)];
90
- case 1:
91
- _a.sent();
92
- return [2 /*return*/, this];
93
- }
94
- });
95
- });
96
- };
97
- return VariantParameterizable;
98
- }(parameterizable_1.Parameterizable));
99
- exports.VariantParameterizable = VariantParameterizable;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.VariantParameterizable = void 0;
13
+ const dottedPath_1 = require("./../classes/dottedPath");
14
+ const event_1 = require("./../classes/event");
15
+ const parameterizable_1 = require("./../classes/parameterizable");
16
+ const resourceHelper_1 = require("./../util/resourceHelper");
17
+ const stringHelper_1 = require("./../util/stringHelper");
18
+ const lodash_es_1 = require("lodash-es");
19
+ class VariantParameterizable extends parameterizable_1.Parameterizable {
20
+ constructor(variant, name) {
21
+ super();
22
+ this.variant = variant;
23
+ this.name = name;
24
+ this._parameterObservers = new Map();
25
+ }
26
+ /**
27
+ * Gets the inherited parameters from the {@link Variant} with cleaned {@link Parameterizable} prefix.
28
+ */
29
+ get inheritedParameters() {
30
+ const parameterBag = {};
31
+ for (const parameter in this.variant.inheritedParameters) {
32
+ const dpp = dottedPath_1.DottedPath.create(parameter);
33
+ if (dpp.parts.length !== 1) {
34
+ continue;
35
+ }
36
+ parameterBag[parameter] = this.variant.inheritedParameters[parameter];
37
+ }
38
+ for (const parameter in this.variant.inheritedParameters) {
39
+ const dpp = dottedPath_1.DottedPath.create(parameter);
40
+ if (dpp.firstPart !== this.name) {
41
+ continue;
42
+ }
43
+ dpp.shiftPart();
44
+ parameterBag[dpp.path] = this.variant.inheritedParameters[parameter];
45
+ }
46
+ return parameterBag;
47
+ }
48
+ /**
49
+ * Places the given {@link ParameterBag} in the {@link VariantParameterizable}'s parameters, replaces all patterns in the
50
+ * {@link StructureJson} and broadcasts all {@link ParameterObserver}s.
51
+ */
52
+ commitParameters(parameters) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ if (!parameters) {
55
+ parameters = {};
56
+ }
57
+ const oldParameters = (0, lodash_es_1.cloneDeep)(this.parameters);
58
+ (0, lodash_es_1.merge)(this.parameters, parameters);
59
+ // handle parameter observers
60
+ let observerPromises = [];
61
+ for (const parameter in this.parameters) {
62
+ const oldParameterValue = oldParameters[parameter];
63
+ const newParameterValue = this.parameters[parameter];
64
+ this.variant.assertParameter(this.variant.inheritedParameterDeclaration, parameter, newParameterValue);
65
+ if (oldParameterValue === newParameterValue) {
66
+ continue;
67
+ }
68
+ // parameter changed
69
+ const parameterObservers = (0, resourceHelper_1.mergeMaps)(this._parameterObservers, this.parameterObservers);
70
+ if (parameterObservers.has(parameter)) {
71
+ const observers = parameterObservers.get(parameter);
72
+ observerPromises = (0, lodash_es_1.concat)(observerPromises, observers.map(observer => {
73
+ const observerResult = observer(this, oldParameterValue, newParameterValue);
74
+ const observerPromise = Promise.resolve(observerResult);
75
+ observerPromise.then(() => {
76
+ const clsName = (0, stringHelper_1.camelToSnakeCase)(this.constructor.name).toUpperCase();
77
+ this.broadcastEvent((0, lodash_es_1.get)(event_1.Event, clsName + '_PARAMETER_COMMITTED'), this, parameter, oldParameterValue, newParameterValue);
78
+ });
79
+ return observerPromise;
80
+ }));
81
+ }
82
+ }
83
+ yield Promise.all(observerPromises);
84
+ return this;
85
+ });
86
+ }
87
+ }
88
+ exports.VariantParameterizable = VariantParameterizable;
100
89
  //# sourceMappingURL=variantParameterizable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"variantParameterizable.js","sourceRoot":"","sources":["../../../../src/api/classes/variantParameterizable.ts"],"names":[],"mappings":";;;;AAAA,uCAA0D;AAC1D,sDAAqD;AACrD,4CAA2C;AAC3C,gEAA+D;AAE/D,2DAAqD;AACrD,uDAA0D;AAE1D;IAAqD,kDAAe;IAGlE,gCAAsC,OAAgB,EAAkB,IAAY;QAApF,YACE,iBAAO,SACR;QAFqC,aAAO,GAAP,OAAO,CAAS;QAAkB,UAAI,GAAJ,IAAI,CAAQ;QAFjE,yBAAmB,GAAqC,IAAI,GAAG,EAAE,CAAC;;IAIrF,CAAC;IAKD,sBAAI,uDAAmB;QAHvB;;WAEG;aACH;YACE,IAAM,YAAY,GAAiB,EAAE,CAAC;YACtC,KAAK,IAAM,SAAS,IAAI,IAAI,CAAC,OAAO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AiB,EAAE;;6BAE5C;4BACD,oBAAoB;4BACpB,IAAM,kBAAkB,GAAG,0BAAS,CAAC,OAAK,mBAAmB,EAAE,OAAK,kBAAkB,CAAC,CAAC;4BACxF,IAAI,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;gCACrC,IAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAE,CAAC;gCACrD,gBAAgB,GAAG,kBAAM,CACvB,gBAAgB,EAChB,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ;oCACpB,IAAM,cAAc,GAAG,QAAQ,CAAC,KAAI,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;oCAC5E,IAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;oCACxD,eAAe,CAAC,IAAI,CAAC;wCACnB,IAAM,OAAO,GAAG,+BAAgB,CAAC,KAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;wCACtE,KAAI,CAAC,cAAc,CACjB,eAAG,CAAC,aAAK,EAAE,OAAO,GAAG,sBAAsB,CAAC,EAC5C,KAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,iBAAiB,CAClB,CAAC;oCACJ,CAAC,CAAC,CAAC;oCACH,OAAO,eAAe,CAAC;gCACzB,CAAC,CAAC,CACH,CAAC;6BACH;;;wBA7BH,KAAW,SAAS,IAAI,IAAI,CAAC,UAAU;oCAA5B,SAAS;yBA8BnB;wBACD,qBAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAA;;wBAAnC,SAAmC,CAAC;wBACpC,sBAAO,IAAI,EAAC;;;;KACb;IACH,6BAAC;AAAD,CAAC,AA5ED,CAAqD,iCAAe,GA4EnE;AA5EqB,wDAAsB"}
1
+ {"version":3,"file":"variantParameterizable.js","sourceRoot":"","sources":["../../../../src/api/classes/variantParameterizable.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAqD;AACrD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AC,EAC5C,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,iBAAiB,CAClB,CAAC;wBACJ,CAAC,CAAC,CAAC;wBACH,OAAO,eAAe,CAAC;oBACzB,CAAC,CAAC,CACH,CAAC;iBACH;aACF;YACD,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF;AA5ED,wDA4EC"}
@@ -1,184 +1,187 @@
1
- import { Engine } from '@babylonjs/core/Engines/engine';
2
- import { Mesh } from '@babylonjs/core/Meshes/mesh';
3
- import { Scene } from '@babylonjs/core/scene';
4
- import { AnimationManager } from '../manager/animationManager';
5
- import { GltfExportManager } from '../manager/gltfExportManager';
6
- import { SceneManager } from '../manager/sceneManager';
7
- import { VariantInstanceManager } from '../manager/variantInstanceManager';
8
- import { EventBroadcaster } from './eventBroadcaster';
9
- import { VariantInstance } from './variantInstance';
10
- /**
11
- * The main exposed object. This is the entry point into the application
12
- *
13
- * ```js
14
- * const canvas = document.getElementById( 'babylon-canvas' );
15
- * const viewer = Viewer( canvas, '/path/to/index.json' );
16
- * ```
17
- * The class does nothing on its own and needs to {@link bootstrap}
18
- */
19
- export declare class Viewer extends EventBroadcaster {
20
- readonly canvas: HTMLCanvasElement;
21
- protected structureJson: string | StructureJson;
22
- protected _scene: Scene | null;
23
- protected _animationManager: AnimationManager | null;
24
- protected _sceneManager: SceneManager | null;
25
- protected _gltfExportManager: GltfExportManager | null;
26
- protected _variantInstances: VariantInstanceManager | null;
27
- protected _cloneMaterialsOnMutation: boolean;
28
- protected _isRenderLoopPaused: boolean;
29
- protected _inspectorLoaded: boolean;
30
- static version: string;
31
- /**
32
- * Constructor
33
- */
34
- constructor(canvas: HTMLCanvasElement, structureJson: string | StructureJson);
35
- /**
36
- * Gets the BabylonJS Scene that is attached to the instance.
37
- *
38
- * @throws Error if the `scene` has not been initialized.
39
- */
40
- get scene(): Scene;
41
- /**
42
- * Gets the {@link SceneManager} attached to the viewer.
43
- *
44
- * @throws Error if the {@link SceneManager} has not been initialized.
45
- */
46
- get sceneManager(): SceneManager;
47
- /**
48
- * Gets the {@link GltfExportManager} attached to the viewer.
49
- *
50
- * @throws Error if the {@link GltfExportManager} has not been initialized.
51
- */
52
- get gltfExportManager(): GltfExportManager;
53
- /**
54
- * Gets the BabylonJS Engine that is attached to the viewer.
55
- */
56
- get engine(): Engine;
57
- /**
58
- * Gets the {@link VariantInstanceManager} attached to the viewer.
59
- *
60
- * @throws Error if the {@link VariantInstanceManager} has not been initialized.
61
- */
62
- get variantInstances(): VariantInstanceManager;
63
- /**
64
- * Gets the {@link AnimationManager} attached to the viewer.
65
- *
66
- * @throws Error if the {@link AnimationManager} has not been initialized.
67
- */
68
- get animationManager(): AnimationManager;
69
- /**
70
- * Gets the `cloneMaterialsOnMutation` flag, as defined in the spec
71
- */
72
- get cloneMaterialsOnMutation(): boolean;
73
- /**
74
- * Starts the application. This will
75
- * * load the given "index" JSON file
76
- * * setup the scene with the "scene" JSON file
77
- * * create an (optional) default setup with different variant settings
78
- * * sets up resizing by attaching a debounced version of {@link resize}
79
- *
80
- * @throws Error if any of the files is not found/valid
81
- *
82
- * @emits {@link Event.BOOTSTRAP_START}
83
- * @emits {@link Event.BOOTSTRAP_END}
84
- */
85
- bootstrap(): Promise<Viewer>;
86
- /**
87
- * Enables the BabylonJS [Inspector](https://doc.babylonjs.com/toolsAndResources/tools/inspector).\
88
- * Due to the additional size of the inspector, the CDN version is used instead of shipping the required code with the viewer.\
89
- * This means that the code will be downloaded only when needed and calling `enableDebugLayer` can take a little while depending on your internet connection etc.
90
- */
91
- enableDebugLayer(options?: IInspectorOptions): Promise<void>;
92
- /**
93
- * Destroys all registered {@link VariantInstance}s that are registered
94
- */
95
- destroyVariantInstances(): Viewer;
96
- /**
97
- * Trigger a resize event for the `Engine`
98
- */
99
- resize(): Viewer;
100
- /**
101
- * A convenience method for directly getting a Node from a {@link VariantInstance} and an {@link Element} by its
102
- * {@link DottedPath}s.
103
- */
104
- getNode(variantInstanceName: string, elementDottedPath: DottedPathArgument, nodeDottedPath: DottedPathArgument): Promise<TransformNode>;
105
- /**
106
- * A convenience method for directly getting a Node from a {@link VariantInstance} and an {@link Element} by its
107
- * {@link DottedPath}s.
108
- */
109
- getMesh(variantInstanceName: string, elementDottedPath: DottedPathArgument, meshDottedPath: DottedPathArgument): Promise<Mesh | null>;
110
- /**
111
- * Switches the camera
112
- *
113
- * @emits {@link Event.CAMERA_SWITCHED}
114
- */
115
- switchCamera(newCamera: string, reset?: boolean): Viewer;
116
- /**
117
- * Moves or animates the active camera to given `placement`.
118
- */
119
- moveActiveCameraTo(placement: string | PlacementDefinition, animation?: string | AnimationDefinition): Promise<AnimationInterface>;
120
- /**
121
- * Takes a sceenshot the the current scene. The result is a string containing a base64 encoded image
122
- */
123
- screenshot(settings?: ScreenshotSettings): Promise<string>;
124
- /**
125
- * Checks whether the browser is capable of handling XR.
126
- */
127
- isBrowserARCapable(): Promise<boolean>;
128
- /**
129
- * Calculates the bounding box from all visible meshes on the scene.
130
- */
131
- calculateBoundingBox(excludeGeometry?: ExcludedGeometryList): Promise<Mesh>;
132
- /**
133
- * Focuses the camera to see every visible mesh in scene and tries to optimize wheel precision and panning
134
- */
135
- autofocusActiveCamera(settings?: AutofocusSettings): Promise<void>;
136
- /**
137
- * Resets everything by calling {@link destroy} to clear all references and {@link bootstrap} to setup a clean
138
- * environment
139
- */
140
- reset(): Promise<Viewer>;
141
- /**
142
- * Destroys
143
- *
144
- * * all {@link VariantInstance}s using {@link destroyVariantInstances}
145
- * * calling `dispose` on the `Engine` and `Scene`
146
- */
147
- destroy(): Viewer;
148
- /**
149
- * Show coordinate system with given dimension (for debugging purpose).
150
- */
151
- showWorldCoordinates(dimension: number): void;
152
- /**
153
- * Pause render loop.
154
- */
155
- pauseRendering(): void;
156
- /**
157
- * Resume render loop when paused.
158
- */
159
- resumeRendering(): void;
160
- /**
161
- * @emits {@link Event.SCENE_PROCESSING_START}
162
- * @emits {@link Event.SCENE_PROCESSING_END}
163
- */
164
- protected initScene(): Promise<Scene>;
165
- /**
166
- * Register custom file loader for babylon files which adds "missing-material" metadata to meshes which reference
167
- * materials that are not present in the `materials` section of the given babylon file.
168
- *
169
- * Required for babylon files & materials loaded from "Combeenation configurator assets".
170
- */
171
- protected initCbnBabylonLoaderPlugin(): void;
172
- /**
173
- * Batch creation of multiple {@link VariantInstance} objects with a {@link SetupJson} object passed
174
- */
175
- protected createVariantInstances(): Promise<VariantInstance[]>;
176
- /**
177
- * Help function for focusing a helper camera exactly onto the given bounding box
178
- */
179
- private getFocusedHelperCamera;
180
- /**
181
- * Help function for applying the relevant data of the focused helper camera to the real camera
182
- */
183
- private applyFocusedHelperCameraData;
184
- }
1
+ import { AnimationManager } from '../manager/animationManager';
2
+ import { GltfExportManager } from '../manager/gltfExportManager';
3
+ import { SceneManager } from '../manager/sceneManager';
4
+ import { VariantInstanceManager } from '../manager/variantInstanceManager';
5
+ import { AnimationInterface } from './animationInterface';
6
+ import { EventBroadcaster } from './eventBroadcaster';
7
+ import { VariantInstance } from './variantInstance';
8
+ import { Engine } from '@babylonjs/core/Engines/engine';
9
+ import { Mesh } from '@babylonjs/core/Meshes/mesh';
10
+ import { Scene } from '@babylonjs/core/scene';
11
+ /**
12
+ * The main exposed object. This is the entry point into the application
13
+ *
14
+ * ```js
15
+ * const canvas = document.getElementById( 'babylon-canvas' );
16
+ * const viewer = Viewer( canvas, '/path/to/index.json' );
17
+ * ```
18
+ * The class does nothing on its own and needs to {@link bootstrap}
19
+ */
20
+ export declare class Viewer extends EventBroadcaster {
21
+ readonly canvas: HTMLCanvasElement;
22
+ protected structureJson: string | StructureJson;
23
+ protected _scene: Scene | null;
24
+ protected _animationManager: AnimationManager | null;
25
+ protected _sceneManager: SceneManager | null;
26
+ protected _gltfExportManager: GltfExportManager | null;
27
+ protected _variantInstances: VariantInstanceManager | null;
28
+ protected _cloneMaterialsOnMutation: boolean;
29
+ protected _isRenderLoopPaused: boolean;
30
+ protected _inspectorLoaded: boolean;
31
+ static version: {
32
+ version: string;
33
+ };
34
+ /**
35
+ * Constructor
36
+ */
37
+ constructor(canvas: HTMLCanvasElement, structureJson: string | StructureJson);
38
+ /**
39
+ * Gets the BabylonJS Scene that is attached to the instance.
40
+ *
41
+ * @throws Error if the `scene` has not been initialized.
42
+ */
43
+ get scene(): Scene;
44
+ /**
45
+ * Gets the {@link SceneManager} attached to the viewer.
46
+ *
47
+ * @throws Error if the {@link SceneManager} has not been initialized.
48
+ */
49
+ get sceneManager(): SceneManager;
50
+ /**
51
+ * Gets the {@link GltfExportManager} attached to the viewer.
52
+ *
53
+ * @throws Error if the {@link GltfExportManager} has not been initialized.
54
+ */
55
+ get gltfExportManager(): GltfExportManager;
56
+ /**
57
+ * Gets the BabylonJS Engine that is attached to the viewer.
58
+ */
59
+ get engine(): Engine;
60
+ /**
61
+ * Gets the {@link VariantInstanceManager} attached to the viewer.
62
+ *
63
+ * @throws Error if the {@link VariantInstanceManager} has not been initialized.
64
+ */
65
+ get variantInstances(): VariantInstanceManager;
66
+ /**
67
+ * Gets the {@link AnimationManager} attached to the viewer.
68
+ *
69
+ * @throws Error if the {@link AnimationManager} has not been initialized.
70
+ */
71
+ get animationManager(): AnimationManager;
72
+ /**
73
+ * Gets the `cloneMaterialsOnMutation` flag, as defined in the spec
74
+ */
75
+ get cloneMaterialsOnMutation(): boolean;
76
+ /**
77
+ * Starts the application. This will
78
+ * * load the given "index" JSON file
79
+ * * setup the scene with the "scene" JSON file
80
+ * * create an (optional) default setup with different variant settings
81
+ * * sets up resizing by attaching a debounced version of {@link resize}
82
+ *
83
+ * @throws Error if any of the files is not found/valid
84
+ *
85
+ * @emits {@link Event.BOOTSTRAP_START}
86
+ * @emits {@link Event.BOOTSTRAP_END}
87
+ */
88
+ bootstrap(): Promise<Viewer>;
89
+ /**
90
+ * Enables the BabylonJS [Inspector](https://doc.babylonjs.com/toolsAndResources/tools/inspector).\
91
+ * Due to the additional size of the inspector, the CDN version is used instead of shipping the required code with the viewer.\
92
+ * This means that the code will be downloaded only when needed and calling `enableDebugLayer` can take a little while depending on your internet connection etc.
93
+ */
94
+ enableDebugLayer(options?: IInspectorOptions): Promise<void>;
95
+ /**
96
+ * Destroys all registered {@link VariantInstance}s that are registered
97
+ */
98
+ destroyVariantInstances(): Viewer;
99
+ /**
100
+ * Trigger a resize event for the `Engine`
101
+ */
102
+ resize(): Viewer;
103
+ /**
104
+ * A convenience method for directly getting a Node from a {@link VariantInstance} and an {@link Element} by its
105
+ * {@link DottedPath}s.
106
+ */
107
+ getNode(variantInstanceName: string, elementDottedPath: DottedPathArgument, nodeDottedPath: DottedPathArgument): Promise<TransformNode>;
108
+ /**
109
+ * A convenience method for directly getting a Node from a {@link VariantInstance} and an {@link Element} by its
110
+ * {@link DottedPath}s.
111
+ */
112
+ getMesh(variantInstanceName: string, elementDottedPath: DottedPathArgument, meshDottedPath: DottedPathArgument): Promise<Mesh | null>;
113
+ /**
114
+ * Switches the camera
115
+ *
116
+ * @emits {@link Event.CAMERA_SWITCHED}
117
+ */
118
+ switchCamera(newCamera: string, reset?: boolean): Viewer;
119
+ /**
120
+ * Moves or animates the active camera to given `placement`.
121
+ */
122
+ moveActiveCameraTo(placement: string | PlacementDefinition, animation?: string | AnimationDefinition): Promise<AnimationInterface>;
123
+ /**
124
+ * Takes a sceenshot the the current scene. The result is a string containing a base64 encoded image
125
+ */
126
+ screenshot(settings?: ScreenshotSettings): Promise<string>;
127
+ /**
128
+ * Checks whether the browser is capable of handling XR.
129
+ */
130
+ isBrowserARCapable(): Promise<boolean>;
131
+ /**
132
+ * Calculates the bounding box from all visible meshes on the scene.
133
+ */
134
+ calculateBoundingBox(excludeGeometry?: ExcludedGeometryList): Promise<Mesh>;
135
+ /**
136
+ * Focuses the camera to see every visible mesh in scene and tries to optimize wheel precision and panning
137
+ */
138
+ autofocusActiveCamera(settings?: AutofocusSettings): Promise<void>;
139
+ /**
140
+ * Resets everything by calling {@link destroy} to clear all references and {@link bootstrap} to setup a clean
141
+ * environment
142
+ */
143
+ reset(): Promise<Viewer>;
144
+ /**
145
+ * Destroys
146
+ *
147
+ * * all {@link VariantInstance}s using {@link destroyVariantInstances}
148
+ * * calling `dispose` on the `Engine` and `Scene`
149
+ */
150
+ destroy(): Viewer;
151
+ /**
152
+ * Show coordinate system with given dimension (for debugging purpose).
153
+ */
154
+ showWorldCoordinates(dimension: number): void;
155
+ /**
156
+ * Pause render loop.
157
+ */
158
+ pauseRendering(): void;
159
+ /**
160
+ * Resume render loop when paused.
161
+ */
162
+ resumeRendering(): void;
163
+ /**
164
+ * @emits {@link Event.SCENE_PROCESSING_START}
165
+ * @emits {@link Event.SCENE_PROCESSING_END}
166
+ */
167
+ protected initScene(): Promise<Scene>;
168
+ /**
169
+ * Register custom file loader for babylon files which adds "missing-material" metadata to meshes which reference
170
+ * materials that are not present in the `materials` section of the given babylon file.
171
+ *
172
+ * Required for babylon files & materials loaded from "Combeenation configurator assets".
173
+ */
174
+ protected initCbnBabylonLoaderPlugin(): void;
175
+ /**
176
+ * Batch creation of multiple {@link VariantInstance} objects with a {@link SetupJson} object passed
177
+ */
178
+ protected createVariantInstances(): Promise<VariantInstance[]>;
179
+ /**
180
+ * Help function for focusing a helper camera exactly onto the given bounding box
181
+ */
182
+ private getFocusedHelperCamera;
183
+ /**
184
+ * Help function for applying the relevant data of the focused helper camera to the real camera
185
+ */
186
+ private applyFocusedHelperCameraData;
187
+ }