@combeenation/3d-viewer 4.0.0-beta2 → 4.0.0-rc1

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 (105) hide show
  1. package/README.md +114 -112
  2. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  3. package/dist/lib-cjs/api/classes/animationInterface.js +1 -1
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +190 -190
  6. package/dist/lib-cjs/api/classes/element.d.ts +130 -126
  7. package/dist/lib-cjs/api/classes/element.js +743 -674
  8. package/dist/lib-cjs/api/classes/element.js.map +1 -1
  9. package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +14 -14
  10. package/dist/lib-cjs/api/classes/elementParameterizable.js +134 -134
  11. package/dist/lib-cjs/api/classes/event.d.ts +326 -312
  12. package/dist/lib-cjs/api/classes/event.js +371 -357
  13. package/dist/lib-cjs/api/classes/event.js.map +1 -1
  14. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  15. package/dist/lib-cjs/api/classes/eventBroadcaster.js +53 -53
  16. package/dist/lib-cjs/api/classes/parameter.d.ts +259 -165
  17. package/dist/lib-cjs/api/classes/parameter.js +387 -267
  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 +101 -126
  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 +149 -149
  24. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +38 -38
  25. package/dist/lib-cjs/api/classes/placementAnimation.js +149 -138
  26. package/dist/lib-cjs/api/classes/placementAnimation.js.map +1 -1
  27. package/dist/lib-cjs/api/classes/variant.d.ts +234 -190
  28. package/dist/lib-cjs/api/classes/variant.js +1147 -873
  29. package/dist/lib-cjs/api/classes/variant.js.map +1 -1
  30. package/dist/lib-cjs/api/classes/variantInstance.d.ts +45 -41
  31. package/dist/lib-cjs/api/classes/variantInstance.js +108 -98
  32. package/dist/lib-cjs/api/classes/variantInstance.js.map +1 -1
  33. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  34. package/dist/lib-cjs/api/classes/variantParameterizable.js +92 -92
  35. package/dist/lib-cjs/api/classes/viewer.d.ts +131 -128
  36. package/dist/lib-cjs/api/classes/viewer.js +567 -486
  37. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  38. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  39. package/dist/lib-cjs/api/classes/viewerLight.js +389 -389
  40. package/dist/lib-cjs/api/internal/debugViewer.d.ts +13 -13
  41. package/dist/lib-cjs/api/internal/debugViewer.js +87 -87
  42. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  43. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  44. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +10 -6
  45. package/dist/lib-cjs/api/internal/sceneSetup.js +231 -227
  46. package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
  47. package/dist/lib-cjs/api/manager/animationManager.d.ts +29 -29
  48. package/dist/lib-cjs/api/manager/animationManager.js +121 -121
  49. package/dist/lib-cjs/api/manager/sceneManager.d.ts +32 -32
  50. package/dist/lib-cjs/api/manager/sceneManager.js +132 -132
  51. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +90 -90
  52. package/dist/lib-cjs/api/manager/variantInstanceManager.js +321 -321
  53. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  54. package/dist/lib-cjs/api/store/specStorage.js +51 -51
  55. package/dist/lib-cjs/api/util/babylonHelper.d.ts +175 -125
  56. package/dist/lib-cjs/api/util/babylonHelper.js +520 -368
  57. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  58. package/dist/lib-cjs/api/util/globalTypes.d.ts +333 -279
  59. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  60. package/dist/lib-cjs/api/util/resourceHelper.d.ts +53 -30
  61. package/dist/lib-cjs/api/util/resourceHelper.js +240 -203
  62. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  63. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
  64. package/dist/lib-cjs/api/util/stringHelper.js +25 -25
  65. package/dist/lib-cjs/buildinfo.json +3 -3
  66. package/dist/lib-cjs/index.d.ts +48 -46
  67. package/dist/lib-cjs/index.js +86 -82
  68. package/dist/lib-cjs/index.js.map +1 -1
  69. package/dist/webpack-stats.json +0 -0
  70. package/package.json +83 -83
  71. package/src/api/classes/animationInterface.ts +11 -11
  72. package/src/api/classes/dottedPath.ts +189 -189
  73. package/src/api/classes/element.ts +644 -606
  74. package/src/api/classes/event.ts +370 -355
  75. package/src/api/classes/eventBroadcaster.ts +54 -54
  76. package/src/api/classes/parameter.ts +408 -277
  77. package/src/api/classes/parameterObservable.ts +99 -121
  78. package/src/api/classes/{elementParameterizable.ts → parameterizable.ts} +89 -78
  79. package/src/api/classes/placementAnimation.ts +143 -133
  80. package/src/api/classes/variant.ts +817 -670
  81. package/src/api/classes/variantInstance.ts +88 -81
  82. package/src/api/classes/variantParameterizable.ts +73 -0
  83. package/src/api/classes/viewer.ts +487 -421
  84. package/src/api/classes/viewerLight.ts +330 -0
  85. package/src/api/internal/debugViewer.ts +81 -81
  86. package/src/api/internal/lensRendering.ts +10 -10
  87. package/src/api/internal/sceneSetup.ts +194 -204
  88. package/src/api/manager/animationManager.ts +116 -116
  89. package/src/api/manager/sceneManager.ts +105 -105
  90. package/src/api/manager/variantInstanceManager.ts +236 -236
  91. package/src/api/store/specStorage.ts +53 -53
  92. package/src/api/util/babylonHelper.ts +555 -392
  93. package/src/api/util/globalTypes.ts +380 -319
  94. package/src/api/util/resourceHelper.ts +184 -155
  95. package/src/api/util/stringHelper.ts +26 -0
  96. package/src/buildinfo.json +2 -2
  97. package/src/commonjs.tsconfig.json +13 -13
  98. package/src/declaration.tsconfig.json +10 -10
  99. package/src/dev.ts +42 -46
  100. package/src/es6.tsconfig.json +13 -13
  101. package/src/index.ts +91 -87
  102. package/src/pagesconfig.json +61 -57
  103. package/src/tsconfig.json +43 -43
  104. package/src/tsconfig.types.json +9 -9
  105. package/src/types.d.ts +4 -4
@@ -1,13 +1,13 @@
1
- /**
2
- * @internal
3
- */
4
- import { Scene } from '@babylonjs/core/scene';
5
- import { VariantInstance } from '../classes/variantInstance';
6
- import { Viewer } from '../classes/viewer';
7
- export declare class DebugViewer extends Viewer {
8
- constructor(canvas: HTMLCanvasElement, data: string | StructureJson);
9
- bootstrap(): Promise<Viewer>;
10
- protected initScene(): Promise<Scene>;
11
- protected instanceDebugger(instance: VariantInstance): void;
12
- protected fpsDebugger(): void;
13
- }
1
+ /**
2
+ * @internal
3
+ */
4
+ import { Scene } from '@babylonjs/core/scene';
5
+ import { VariantInstance } from '../classes/variantInstance';
6
+ import { Viewer } from '../classes/viewer';
7
+ export declare class DebugViewer extends Viewer {
8
+ constructor(canvas: HTMLCanvasElement, data: string | StructureJson);
9
+ bootstrap(): Promise<Viewer>;
10
+ protected initScene(): Promise<Scene>;
11
+ protected instanceDebugger(instance: VariantInstance): void;
12
+ protected fpsDebugger(): void;
13
+ }
@@ -1,88 +1,88 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DebugViewer = void 0;
4
- var tslib_1 = require("tslib");
5
- var viewer_1 = require("../classes/viewer");
6
- var event_1 = require("../classes/event");
7
- var DebugViewer = /** @class */ (function (_super) {
8
- tslib_1.__extends(DebugViewer, _super);
9
- function DebugViewer(canvas, data) {
10
- return _super.call(this, canvas, data) || this;
11
- }
12
- DebugViewer.prototype.bootstrap = function () {
13
- return tslib_1.__awaiter(this, void 0, void 0, function () {
14
- var _loop_1, this_1, _i, _a, event_2, _b, _c, event_3;
15
- return tslib_1.__generator(this, function (_d) {
16
- _loop_1 = function (event_2) {
17
- this_1.eventEmitter.addListener(event_2, function () {
18
- var args = [];
19
- for (var _i = 0; _i < arguments.length; _i++) {
20
- args[_i] = arguments[_i];
21
- }
22
- return console.debug.apply(console, tslib_1.__spreadArrays(["Emitting " + event_2], args));
23
- });
24
- };
25
- this_1 = this;
26
- for (_i = 0, _a = event_1.Event.all; _i < _a.length; _i++) {
27
- event_2 = _a[_i];
28
- _loop_1(event_2);
29
- }
30
- for (_b = 0, _c = [
31
- event_1.Event.VARIANT_INSTANCE_DESTROYED,
32
- event_1.Event.VARIANT_INSTANCE_CREATED,
33
- event_1.Event.VARIANT_INSTANCE_CLONED,
34
- event_1.Event.VARIANT_PARAMETER_COMMITTED
35
- ]; _b < _c.length; _b++) {
36
- event_3 = _c[_b];
37
- this.eventEmitter.addListener(event_3, this.instanceDebugger.bind(this));
38
- }
39
- return [2 /*return*/, _super.prototype.bootstrap.call(this)];
40
- });
41
- });
42
- };
43
- DebugViewer.prototype.initScene = function () {
44
- return tslib_1.__awaiter(this, void 0, void 0, function () {
45
- var scene;
46
- var _this = this;
47
- return tslib_1.__generator(this, function (_a) {
48
- switch (_a.label) {
49
- case 0: return [4 /*yield*/, _super.prototype.initScene.call(this)];
50
- case 1:
51
- scene = _a.sent();
52
- scene.getEngine().runRenderLoop(function () {
53
- _this.fpsDebugger();
54
- });
55
- return [2 /*return*/, scene];
56
- }
57
- });
58
- });
59
- };
60
- DebugViewer.prototype.instanceDebugger = function (instance) {
61
- var instances = [];
62
- this.variantInstances.all.forEach(function (variantInstance) {
63
- instances.push("" + variantInstance.name + (variantInstance.variant.visible ? '' : ' [hidden]') + (variantInstance.variant.highlighted ? ' [highlighted]' : ''));
64
- });
65
- var debugContainer = document.getElementById('cyledge-combeenation-3d-viewer-instance-debugger');
66
- if (!debugContainer) {
67
- debugContainer = document.createElement('pre');
68
- debugContainer.setAttribute('id', 'cyledge-combeenation-3d-viewer-instance-debugger');
69
- debugContainer.setAttribute('style', "\n\t\t\t\tbackground: #454545;\n\t\t\t\tcolor: #fff;\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0;\n\t\t\t\tpadding: 10px;\n\t\t\t\tmargin: 0;\n\t\t\t");
70
- document.body.appendChild(debugContainer);
71
- }
72
- debugContainer.innerHTML = JSON.stringify(instances, null, 2);
73
- };
74
- ;
75
- DebugViewer.prototype.fpsDebugger = function () {
76
- var debugContainer = document.getElementById('cyledge-combeenation-3d-viewer-fps-debugger');
77
- if (!debugContainer) {
78
- debugContainer = document.createElement('pre');
79
- debugContainer.setAttribute('id', 'cyledge-combeenation-3d-viewer-fps-debugger');
80
- debugContainer.setAttribute('style', "\n\t\t\t\tbackground: #454545;\n\t\t\t\tcolor: #fff;\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tpadding: 10px;\n\t\t\t\tmargin: 0;\n\t\t\t");
81
- document.body.appendChild(debugContainer);
82
- }
83
- debugContainer.innerHTML = this.engine.getFps().toFixed(2) + " fps";
84
- };
85
- return DebugViewer;
86
- }(viewer_1.Viewer));
87
- exports.DebugViewer = DebugViewer;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DebugViewer = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var viewer_1 = require("../classes/viewer");
6
+ var event_1 = require("../classes/event");
7
+ var DebugViewer = /** @class */ (function (_super) {
8
+ tslib_1.__extends(DebugViewer, _super);
9
+ function DebugViewer(canvas, data) {
10
+ return _super.call(this, canvas, data) || this;
11
+ }
12
+ DebugViewer.prototype.bootstrap = function () {
13
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
14
+ var _loop_1, this_1, _i, _a, event_2, _b, _c, event_3;
15
+ return tslib_1.__generator(this, function (_d) {
16
+ _loop_1 = function (event_2) {
17
+ this_1.eventEmitter.addListener(event_2, function () {
18
+ var args = [];
19
+ for (var _i = 0; _i < arguments.length; _i++) {
20
+ args[_i] = arguments[_i];
21
+ }
22
+ return console.debug.apply(console, tslib_1.__spreadArrays(["Emitting " + event_2], args));
23
+ });
24
+ };
25
+ this_1 = this;
26
+ for (_i = 0, _a = event_1.Event.all; _i < _a.length; _i++) {
27
+ event_2 = _a[_i];
28
+ _loop_1(event_2);
29
+ }
30
+ for (_b = 0, _c = [
31
+ event_1.Event.VARIANT_INSTANCE_DESTROYED,
32
+ event_1.Event.VARIANT_INSTANCE_CREATED,
33
+ event_1.Event.VARIANT_INSTANCE_CLONED,
34
+ event_1.Event.VARIANT_PARAMETER_COMMITTED
35
+ ]; _b < _c.length; _b++) {
36
+ event_3 = _c[_b];
37
+ this.eventEmitter.addListener(event_3, this.instanceDebugger.bind(this));
38
+ }
39
+ return [2 /*return*/, _super.prototype.bootstrap.call(this)];
40
+ });
41
+ });
42
+ };
43
+ DebugViewer.prototype.initScene = function () {
44
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
45
+ var scene;
46
+ var _this = this;
47
+ return tslib_1.__generator(this, function (_a) {
48
+ switch (_a.label) {
49
+ case 0: return [4 /*yield*/, _super.prototype.initScene.call(this)];
50
+ case 1:
51
+ scene = _a.sent();
52
+ scene.getEngine().runRenderLoop(function () {
53
+ _this.fpsDebugger();
54
+ });
55
+ return [2 /*return*/, scene];
56
+ }
57
+ });
58
+ });
59
+ };
60
+ DebugViewer.prototype.instanceDebugger = function (instance) {
61
+ var instances = [];
62
+ this.variantInstances.all.forEach(function (variantInstance) {
63
+ instances.push("" + variantInstance.name + (variantInstance.variant.visible ? '' : ' [hidden]') + (variantInstance.variant.highlighted ? ' [highlighted]' : ''));
64
+ });
65
+ var debugContainer = document.getElementById('cyledge-combeenation-3d-viewer-instance-debugger');
66
+ if (!debugContainer) {
67
+ debugContainer = document.createElement('pre');
68
+ debugContainer.setAttribute('id', 'cyledge-combeenation-3d-viewer-instance-debugger');
69
+ debugContainer.setAttribute('style', "\n\t\t\t\tbackground: #454545;\n\t\t\t\tcolor: #fff;\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0;\n\t\t\t\tright: 0;\n\t\t\t\tpadding: 10px;\n\t\t\t\tmargin: 0;\n\t\t\t");
70
+ document.body.appendChild(debugContainer);
71
+ }
72
+ debugContainer.innerHTML = JSON.stringify(instances, null, 2);
73
+ };
74
+ ;
75
+ DebugViewer.prototype.fpsDebugger = function () {
76
+ var debugContainer = document.getElementById('cyledge-combeenation-3d-viewer-fps-debugger');
77
+ if (!debugContainer) {
78
+ debugContainer = document.createElement('pre');
79
+ debugContainer.setAttribute('id', 'cyledge-combeenation-3d-viewer-fps-debugger');
80
+ debugContainer.setAttribute('style', "\n\t\t\t\tbackground: #454545;\n\t\t\t\tcolor: #fff;\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tpadding: 10px;\n\t\t\t\tmargin: 0;\n\t\t\t");
81
+ document.body.appendChild(debugContainer);
82
+ }
83
+ debugContainer.innerHTML = this.engine.getFps().toFixed(2) + " fps";
84
+ };
85
+ return DebugViewer;
86
+ }(viewer_1.Viewer));
87
+ exports.DebugViewer = DebugViewer;
88
88
  //# sourceMappingURL=debugViewer.js.map
@@ -1,8 +1,8 @@
1
- /**
2
- * Group the required LensRendering dependencies into a single file to allow a single "import"
3
- *
4
- * @internal
5
- */
6
- import '@babylonjs/core/Rendering/depthRendererSceneComponent';
7
- import { LensRenderingPipeline } from '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline';
8
- export { LensRenderingPipeline };
1
+ /**
2
+ * Group the required LensRendering dependencies into a single file to allow a single "import"
3
+ *
4
+ * @internal
5
+ */
6
+ import '@babylonjs/core/Rendering/depthRendererSceneComponent';
7
+ import { LensRenderingPipeline } from '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline';
8
+ export { LensRenderingPipeline };
@@ -1,12 +1,12 @@
1
- "use strict";
2
- /**
3
- * Group the required LensRendering dependencies into a single file to allow a single "import"
4
- *
5
- * @internal
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.LensRenderingPipeline = void 0;
9
- require("@babylonjs/core/Rendering/depthRendererSceneComponent");
10
- var lensRenderingPipeline_1 = require("@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline");
11
- Object.defineProperty(exports, "LensRenderingPipeline", { enumerable: true, get: function () { return lensRenderingPipeline_1.LensRenderingPipeline; } });
1
+ "use strict";
2
+ /**
3
+ * Group the required LensRendering dependencies into a single file to allow a single "import"
4
+ *
5
+ * @internal
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.LensRenderingPipeline = void 0;
9
+ require("@babylonjs/core/Rendering/depthRendererSceneComponent");
10
+ var lensRenderingPipeline_1 = require("@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline");
11
+ Object.defineProperty(exports, "LensRenderingPipeline", { enumerable: true, get: function () { return lensRenderingPipeline_1.LensRenderingPipeline; } });
12
12
  //# sourceMappingURL=lensRendering.js.map
@@ -1,6 +1,10 @@
1
- import { Engine } from '@babylonjs/core/Engines/engine';
2
- import '@babylonjs/core/Materials/Textures/Loaders/ddsTextureLoader';
3
- import '@babylonjs/core/Helpers/sceneHelpers';
4
- import { Scene } from '@babylonjs/core/scene';
5
- declare const sceneSetup: (engine: Engine, sceneJson: SceneJson) => Promise<Scene>;
6
- export { sceneSetup };
1
+ import { Engine } from '@babylonjs/core/Engines/engine';
2
+ import '@babylonjs/core/Helpers/sceneHelpers';
3
+ import '@babylonjs/core/Materials/Textures/Loaders/ddsTextureLoader';
4
+ import { Scene } from '@babylonjs/core/scene';
5
+ /**
6
+ * @param engine
7
+ * @param sceneJson
8
+ */
9
+ declare const sceneSetup: (engine: Engine, sceneJson: SceneJson) => Promise<Scene>;
10
+ export { sceneSetup };