@combeenation/3d-viewer 9.3.0 → 10.0.0-alpha3

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 (111) hide show
  1. package/README.md +9 -111
  2. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  3. package/dist/lib-cjs/api/classes/animationInterface.js +2 -2
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +166 -166
  6. package/dist/lib-cjs/api/classes/element.d.ts +153 -153
  7. package/dist/lib-cjs/api/classes/element.js +666 -667
  8. package/dist/lib-cjs/api/classes/element.js.map +1 -1
  9. package/dist/lib-cjs/api/classes/event.d.ts +401 -401
  10. package/dist/lib-cjs/api/classes/event.js +424 -424
  11. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  12. package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -49
  13. package/dist/lib-cjs/api/classes/fuzzyMap.d.ts +7 -7
  14. package/dist/lib-cjs/api/classes/fuzzyMap.js +21 -21
  15. package/dist/lib-cjs/api/classes/parameter.d.ts +410 -410
  16. package/dist/lib-cjs/api/classes/parameter.js +642 -642
  17. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  18. package/dist/lib-cjs/api/classes/parameterObservable.js +72 -72
  19. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  20. package/dist/lib-cjs/api/classes/parameterizable.js +102 -102
  21. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -45
  22. package/dist/lib-cjs/api/classes/placementAnimation.js +176 -176
  23. package/dist/lib-cjs/api/classes/variant.d.ts +261 -261
  24. package/dist/lib-cjs/api/classes/variant.js +871 -871
  25. package/dist/lib-cjs/api/classes/variantInstance.d.ts +53 -53
  26. package/dist/lib-cjs/api/classes/variantInstance.js +125 -125
  27. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  28. package/dist/lib-cjs/api/classes/variantParameterizable.js +86 -86
  29. package/dist/lib-cjs/api/classes/viewer.d.ts +211 -213
  30. package/dist/lib-cjs/api/classes/viewer.js +736 -717
  31. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  32. package/dist/lib-cjs/api/classes/viewerError.d.ts +43 -43
  33. package/dist/lib-cjs/api/classes/viewerError.js +55 -55
  34. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  35. package/dist/lib-cjs/api/classes/viewerLight.js +344 -348
  36. package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
  37. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  38. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  39. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
  40. package/dist/lib-cjs/api/internal/sceneSetup.js +224 -226
  41. package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
  42. package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -30
  43. package/dist/lib-cjs/api/manager/animationManager.js +126 -126
  44. package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +102 -102
  45. package/dist/lib-cjs/api/manager/gltfExportManager.js +322 -322
  46. package/dist/lib-cjs/api/manager/sceneManager.d.ts +33 -33
  47. package/dist/lib-cjs/api/manager/sceneManager.js +128 -128
  48. package/dist/lib-cjs/api/manager/tagManager.d.ts +118 -118
  49. package/dist/lib-cjs/api/manager/tagManager.js +535 -535
  50. package/dist/lib-cjs/api/manager/textureLoadManager.d.ts +22 -22
  51. package/dist/lib-cjs/api/manager/textureLoadManager.js +98 -98
  52. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +106 -106
  53. package/dist/lib-cjs/api/manager/variantInstanceManager.js +290 -290
  54. package/dist/lib-cjs/api/store/specStorage.d.ts +32 -32
  55. package/dist/lib-cjs/api/store/specStorage.js +65 -65
  56. package/dist/lib-cjs/api/util/babylonHelper.d.ts +238 -238
  57. package/dist/lib-cjs/api/util/babylonHelper.js +826 -826
  58. package/dist/lib-cjs/api/util/geometryHelper.d.ts +7 -7
  59. package/dist/lib-cjs/api/util/geometryHelper.js +115 -115
  60. package/dist/lib-cjs/api/util/globalTypes.d.ts +484 -484
  61. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  62. package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
  63. package/dist/lib-cjs/api/util/resourceHelper.js +214 -214
  64. package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +44 -44
  65. package/dist/lib-cjs/api/util/sceneLoaderHelper.js +175 -175
  66. package/dist/lib-cjs/api/util/stringHelper.d.ts +13 -13
  67. package/dist/lib-cjs/api/util/stringHelper.js +32 -32
  68. package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
  69. package/dist/lib-cjs/api/util/structureHelper.js +64 -64
  70. package/dist/lib-cjs/buildinfo.json +3 -3
  71. package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
  72. package/dist/lib-cjs/index.d.ts +54 -54
  73. package/dist/lib-cjs/index.js +117 -117
  74. package/package.json +84 -82
  75. package/src/api/classes/animationInterface.ts +10 -10
  76. package/src/api/classes/dottedPath.ts +181 -181
  77. package/src/api/classes/element.ts +723 -723
  78. package/src/api/classes/event.ts +457 -457
  79. package/src/api/classes/eventBroadcaster.ts +52 -52
  80. package/src/api/classes/fuzzyMap.ts +21 -21
  81. package/src/api/classes/parameter.ts +686 -686
  82. package/src/api/classes/parameterObservable.ts +73 -73
  83. package/src/api/classes/parameterizable.ts +87 -87
  84. package/src/api/classes/placementAnimation.ts +162 -162
  85. package/src/api/classes/variant.ts +964 -964
  86. package/src/api/classes/variantInstance.ts +123 -123
  87. package/src/api/classes/variantParameterizable.ts +83 -83
  88. package/src/api/classes/viewer.ts +786 -770
  89. package/src/api/classes/viewerError.ts +63 -63
  90. package/src/api/classes/viewerLight.ts +335 -339
  91. package/src/api/internal/debugViewer.ts +90 -90
  92. package/src/api/internal/lensRendering.ts +9 -9
  93. package/src/api/internal/sceneSetup.ts +203 -205
  94. package/src/api/manager/animationManager.ts +143 -143
  95. package/src/api/manager/gltfExportManager.ts +312 -312
  96. package/src/api/manager/sceneManager.ts +134 -134
  97. package/src/api/manager/tagManager.ts +576 -576
  98. package/src/api/manager/textureLoadManager.ts +96 -96
  99. package/src/api/manager/variantInstanceManager.ts +306 -306
  100. package/src/api/store/specStorage.ts +68 -68
  101. package/src/api/util/babylonHelper.ts +915 -915
  102. package/src/api/util/geometryHelper.ts +140 -140
  103. package/src/api/util/globalTypes.ts +560 -560
  104. package/src/api/util/resourceHelper.ts +201 -201
  105. package/src/api/util/sceneLoaderHelper.ts +170 -170
  106. package/src/api/util/stringHelper.ts +30 -30
  107. package/src/api/util/structureHelper.ts +63 -63
  108. package/src/buildinfo.json +3 -3
  109. package/src/dev.ts +70 -62
  110. package/src/index.ts +103 -103
  111. package/src/types.d.ts +49 -38
@@ -1,66 +1,66 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SpecStorage = void 0;
4
- const lodash_es_1 = require("lodash-es");
5
- class SpecStorage {
6
- /**
7
- * Constructor.
8
- */
9
- constructor(spec) {
10
- this.spec = spec;
11
- }
12
- /**
13
- * Creates {@link SpecStorage} from spec.
14
- */
15
- static createFromSpec(structureJson) {
16
- if (this.instance) {
17
- throw new Error(`SpecStorage has already been created.`);
18
- }
19
- return (this.instance = new this(structureJson));
20
- }
21
- /**
22
- * Gets the {@link SpecStorage} instance.
23
- */
24
- static getInstance() {
25
- if (!this.instance || !this.instance.spec) {
26
- throw new Error(`SpecStore has not been properly created.`);
27
- }
28
- return this.instance;
29
- }
30
- /**
31
- * Gets the spec from the {@link SpecStorage}.
32
- */
33
- static getSpec() {
34
- return this.getInstance().spec;
35
- }
36
- /**
37
- * Destroys the current instance to allow reinstantiating the SpecStorage.
38
- */
39
- static destroy() {
40
- this.instance = undefined;
41
- }
42
- /**
43
- * Gets spec from key.
44
- */
45
- static get(key) {
46
- if (!this.instance || !this.instance.spec) {
47
- throw new Error(`SpecStore has not been properly created.`);
48
- }
49
- if (key) {
50
- return (0, lodash_es_1.get)(this.instance.spec, key);
51
- }
52
- return this.instance.spec;
53
- }
54
- /**
55
- * Sets value for spec for given key.
56
- */
57
- static set(key, value) {
58
- if (!this.instance || !this.instance.spec) {
59
- throw new Error(`SpecStore has not been properly created.`);
60
- }
61
- (0, lodash_es_1.set)(this.instance.spec, key, value);
62
- return SpecStorage;
63
- }
64
- }
65
- exports.SpecStorage = SpecStorage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpecStorage = void 0;
4
+ const lodash_es_1 = require("lodash-es");
5
+ class SpecStorage {
6
+ /**
7
+ * Constructor.
8
+ */
9
+ constructor(spec) {
10
+ this.spec = spec;
11
+ }
12
+ /**
13
+ * Creates {@link SpecStorage} from spec.
14
+ */
15
+ static createFromSpec(structureJson) {
16
+ if (this.instance) {
17
+ throw new Error(`SpecStorage has already been created.`);
18
+ }
19
+ return (this.instance = new this(structureJson));
20
+ }
21
+ /**
22
+ * Gets the {@link SpecStorage} instance.
23
+ */
24
+ static getInstance() {
25
+ if (!this.instance || !this.instance.spec) {
26
+ throw new Error(`SpecStore has not been properly created.`);
27
+ }
28
+ return this.instance;
29
+ }
30
+ /**
31
+ * Gets the spec from the {@link SpecStorage}.
32
+ */
33
+ static getSpec() {
34
+ return this.getInstance().spec;
35
+ }
36
+ /**
37
+ * Destroys the current instance to allow reinstantiating the SpecStorage.
38
+ */
39
+ static destroy() {
40
+ this.instance = undefined;
41
+ }
42
+ /**
43
+ * Gets spec from key.
44
+ */
45
+ static get(key) {
46
+ if (!this.instance || !this.instance.spec) {
47
+ throw new Error(`SpecStore has not been properly created.`);
48
+ }
49
+ if (key) {
50
+ return (0, lodash_es_1.get)(this.instance.spec, key);
51
+ }
52
+ return this.instance.spec;
53
+ }
54
+ /**
55
+ * Sets value for spec for given key.
56
+ */
57
+ static set(key, value) {
58
+ if (!this.instance || !this.instance.spec) {
59
+ throw new Error(`SpecStore has not been properly created.`);
60
+ }
61
+ (0, lodash_es_1.set)(this.instance.spec, key, value);
62
+ return SpecStorage;
63
+ }
64
+ }
65
+ exports.SpecStorage = SpecStorage;
66
66
  //# sourceMappingURL=specStorage.js.map
@@ -1,238 +1,238 @@
1
- import { DottedPath } from '../classes/dottedPath';
2
- import { HighlightLayer } from '@babylonjs/core/Layers/highlightLayer';
3
- import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator';
4
- import { BaseTexture } from '@babylonjs/core/Materials/Textures/baseTexture';
5
- import { Texture } from '@babylonjs/core/Materials/Textures/texture';
6
- import { Material } from '@babylonjs/core/Materials/material';
7
- import { Color3 } from '@babylonjs/core/Maths/math.color';
8
- import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
9
- import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
10
- import { Observable } from '@babylonjs/core/Misc/observable';
11
- import { Node } from '@babylonjs/core/node';
12
- import { Scene } from '@babylonjs/core/scene';
13
- declare const backgroundDomeName = "BackgroundDome_ViewerGenerated";
14
- declare const envHelperMetadataName = "viewerEnvHelper";
15
- /**
16
- * @param node
17
- * @return Node
18
- */
19
- declare const getRootNode: (node: Node) => Node;
20
- /**
21
- * @param nodes
22
- * @param predicate
23
- * @return Map<DottedPath, T>
24
- */
25
- declare const mapToDottedNodes: <T>(nodes: Node[], predicate?: ((node: Node) => boolean) | undefined) => Map<DottedPath, T>;
26
- /**
27
- * @param node
28
- * @return DottedPath
29
- */
30
- declare const getDottedPathForNode: (node: Node) => DottedPath;
31
- /**
32
- * @param node
33
- * @param nodeNamingStrategy
34
- * @param predicate
35
- * @param deep
36
- * @return TransformNode | null
37
- */
38
- declare const cloneTransformNode: (node: TransformNode, nodeNamingStrategy: NodeNamingStrategy, predicate?: ((node: TransformNode) => boolean) | undefined, deep?: boolean) => TransformNode | null;
39
- /**
40
- * @param node
41
- */
42
- declare const cloneNodeWithParents: (node: Node | null) => Node | null;
43
- /**
44
- * @param node
45
- * @param deep
46
- * @param prefix
47
- * @return TransformNode
48
- */
49
- declare const cloneTransformNodeMaterial: (node: TransformNode, prefix?: DottedPathArgument, deep?: boolean) => TransformNode;
50
- /**
51
- * @param object
52
- * @param deep
53
- * @param metadata
54
- */
55
- declare const injectMetadata: (object: Node | Material, metadata: {}, deep?: boolean) => void;
56
- /**
57
- * @param node
58
- * @param assertCallable
59
- * @param callableParameters
60
- * @param deep
61
- */
62
- declare const assertTransformNode: (node: TransformNode, assertCallable: (node: TransformNode, ...args: any[]) => void, callableParameters?: any[], deep?: boolean) => void;
63
- /**
64
- * @param node
65
- * @param parameter
66
- */
67
- declare const assertMeshCapability: (node: TransformNode, parameter: string) => void;
68
- /**
69
- * @param node
70
- * @param deep
71
- */
72
- declare const activateTransformNode: (node: TransformNode, deep?: boolean) => void;
73
- /**
74
- * @param node
75
- * @param deep
76
- */
77
- declare const deactivateTransformNode: (node: TransformNode, deep?: boolean) => void;
78
- /**
79
- * @param node
80
- */
81
- declare const enableNodeWithParents: (node: Node) => void;
82
- /**
83
- * @param node
84
- */
85
- declare const disableNodeWithParents: (node: Node) => void;
86
- /**
87
- * Applies a {@link TransformationDefinition} consecutively to ensure dependencies in positioning etc.
88
- * @param node
89
- * @param transformation
90
- */
91
- declare const transformTransformNode: (node: TransformNode, transformation: TransformationDefinition) => void;
92
- /**
93
- * Apply changes of environment (background texture, etc.) consecutively in order to avoid dependency related issues.
94
- * @param scene
95
- * @param envDef
96
- */
97
- declare const changeEnvironment: (scene: Scene, envDef: EnvironmentDefinition) => void;
98
- /**
99
- * Sets a material by a given material id as material property on the given node.
100
- *
101
- * If the material is not already available in the scene, the viewer tries to create a material based on a Combeenation
102
- * [material asset](https://docs.combeenation.com/docs/howto-create-and-use-babylon-and-material-asset).
103
- * This of course only works if the viewer is used inside a Combeenation configurator.
104
- *
105
- * Furthermore this function also defers the material creation if the node is not visible yet to improve network &
106
- * viewer bootstrap performance as textures are automatically being lazy loaded only when they are actually visible in
107
- * the scene.
108
- *
109
- * Finally the material will not be applied before all its textures have been loaded. In this way "flickering" effects
110
- * will be avoided, since the material would be incomplete without its loaded textures.
111
- */
112
- declare const setMaterial: (node: TransformNode, materialId: string, deep?: boolean, variant?: Variant) => void;
113
- /**
114
- * Gets the Material either from the given {@link Variant}, the given scene or tries to create it from an Combeenation
115
- * material asset when inside a Combeenation configurator.
116
- */
117
- declare const getOrCreateMaterial: (scene: Scene, materialId: string, variant?: Variant) => Promise<Material>;
118
- /**
119
- * Waits until the materials textures are loaded and shaders are compiled.
120
- * Then sets the material on the node if there is no newer "set material" request
121
- */
122
- declare const applyMaterial: (material: Material, node: AbstractMesh) => Promise<void>;
123
- /**
124
- * !!! Warning !!!
125
- * This function is not public API. Whilst it can help solving certain problems, it only works reliably in well defined
126
- * situations and can cause unwanted side effects under some conditions. Use carefully at your own risk!
127
- *
128
- * See https://combeenation.myjetbrains.com/youtrack/issue/CB-5906 for further details regarding this warning.
129
- *
130
- * Set material of an instanced meshes source mesh.
131
- * Changes the material of all instanced meshes which have the same source mesh.
132
- *
133
- * @param node
134
- * @param material
135
- * @param deep
136
- *
137
- * @ignore
138
- */
139
- declare const setSourceNodeMaterial: (node: TransformNode, material: Material, deep?: boolean) => void;
140
- /**
141
- * @param node
142
- * @param color
143
- * @param deep
144
- */
145
- declare const setMaterialColor: (node: TransformNode, color: Color3, deep?: boolean) => void;
146
- /**
147
- * @param node
148
- * @param texture
149
- * @param deep
150
- */
151
- declare const setMaterialTexture: (node: TransformNode, texture: Texture, deep?: boolean) => void;
152
- /**
153
- * @param node
154
- * @param metallness
155
- * @param deep
156
- */
157
- declare const setMaterialMetallness: (node: TransformNode, metallness: number, deep?: boolean) => void;
158
- /**
159
- * @param node
160
- * @param roughness
161
- * @param deep
162
- */
163
- declare const setMaterialRoughness: (node: TransformNode, roughness: number, deep?: boolean) => void;
164
- /**
165
- * @param node
166
- * @param layer
167
- * @param color
168
- * @param deep
169
- */
170
- declare const addToHighlightLayer: (layer: HighlightLayer, color: Color3, node: TransformNode, deep?: boolean) => void;
171
- /**
172
- * @param node
173
- * @param layer
174
- * @param deep
175
- */
176
- declare const removeFromHighlightLayer: (layer: HighlightLayer, node: TransformNode, deep?: boolean) => void;
177
- /**
178
- * @param node
179
- * @param receiveShadows
180
- * @param deep
181
- */
182
- declare const setReceiveShadows: (node: TransformNode, receiveShadows: boolean, deep?: boolean) => void;
183
- /**
184
- * @param node
185
- * @param generator
186
- * @param deep
187
- */
188
- declare const addToShadowGenerator: (generator: ShadowGenerator, node: TransformNode, deep?: boolean) => void;
189
- /**
190
- * @param node
191
- * @param generator
192
- * @param deep
193
- */
194
- declare const removeFromShadowGenerator: (generator: ShadowGenerator, node: TransformNode, deep?: boolean) => void;
195
- /**
196
- * https://forum.babylonjs.com/t/get-mesh-bounding-box-position-and-size-in-2d-screen-coordinates/1058/3
197
- * @param mesh
198
- * @param scene
199
- * @param canvas
200
- */
201
- declare const getClientRectFromMesh: (mesh: AbstractMesh, scene: Scene, canvas: HTMLCanvasElement) => ClientRect;
202
- declare type LoadableBaseTexture = BaseTexture & {
203
- url: string;
204
- onLoadObservable: Observable<BaseTexture>;
205
- };
206
- /**
207
- * This type guard checks whether the given `BaseTextures` is any of its subtypes which comes with an url and
208
- * `onLoadObservable`.
209
- *
210
- * !!! Timing of when this function is called is important !!!
211
- * See the following for more details: https://forum.babylonjs.com/t/basetexture-whenallready-returns-too-early/34501/6
212
- */
213
- declare const isLoadableTexture: (texture: BaseTexture) => texture is LoadableBaseTexture;
214
- /**
215
- * @param objects
216
- * @param tagMapping
217
- */
218
- declare const mapTags: (objects: object[], tagMapping: TagMapping) => string[];
219
- /**
220
- * Gets an array of ids for nodeIds that exist in both TransformNode arrays.
221
- * @param nodes1
222
- * @param nodes2
223
- * @param predicate
224
- */
225
- declare const intersectingNodeNames: (nodes1: Node[], nodes2: Node[], predicate?: ((node: Node) => boolean) | undefined) => string[];
226
- /**
227
- * Gets an array of ids for duplicate nodeIds in given node array.
228
- * @param nodes
229
- * @param predicate
230
- */
231
- declare const duplicateNodeNames: (nodes: Node[], predicate?: ((node: Node) => boolean) | undefined) => string[];
232
- /**
233
- * Reports duplicate nodeIds.
234
- * @param nodeNames
235
- */
236
- declare const reportDuplicateNodeNames: (nodeNames: string[]) => void;
237
- declare const drawPaintableOnMaterial: (material: Material, imageSource: CanvasImageSource, scene: Scene, options?: PaintableOptions) => void;
238
- export { getRootNode, isLoadableTexture, mapToDottedNodes, getDottedPathForNode, cloneTransformNode, cloneNodeWithParents, cloneTransformNodeMaterial, getOrCreateMaterial, applyMaterial, injectMetadata, assertTransformNode, assertMeshCapability, activateTransformNode, deactivateTransformNode, enableNodeWithParents, disableNodeWithParents, transformTransformNode, setMaterial, setSourceNodeMaterial, setMaterialColor, setMaterialTexture, setMaterialMetallness, setMaterialRoughness, addToHighlightLayer, removeFromHighlightLayer, setReceiveShadows, addToShadowGenerator, removeFromShadowGenerator, getClientRectFromMesh, changeEnvironment, backgroundDomeName, envHelperMetadataName, mapTags, intersectingNodeNames, duplicateNodeNames, reportDuplicateNodeNames, drawPaintableOnMaterial, };
1
+ import { DottedPath } from '../classes/dottedPath';
2
+ import { HighlightLayer } from '@babylonjs/core/Layers/highlightLayer';
3
+ import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator';
4
+ import { BaseTexture } from '@babylonjs/core/Materials/Textures/baseTexture';
5
+ import { Texture } from '@babylonjs/core/Materials/Textures/texture';
6
+ import { Material } from '@babylonjs/core/Materials/material';
7
+ import { Color3 } from '@babylonjs/core/Maths/math.color';
8
+ import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
9
+ import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
10
+ import { Observable } from '@babylonjs/core/Misc/observable';
11
+ import { Node } from '@babylonjs/core/node';
12
+ import { Scene } from '@babylonjs/core/scene';
13
+ declare const backgroundDomeName = "BackgroundDome_ViewerGenerated";
14
+ declare const envHelperMetadataName = "viewerEnvHelper";
15
+ /**
16
+ * @param node
17
+ * @return Node
18
+ */
19
+ declare const getRootNode: (node: Node) => Node;
20
+ /**
21
+ * @param nodes
22
+ * @param predicate
23
+ * @return Map<DottedPath, T>
24
+ */
25
+ declare const mapToDottedNodes: <T>(nodes: Node[], predicate?: ((node: Node) => boolean) | undefined) => Map<DottedPath, T>;
26
+ /**
27
+ * @param node
28
+ * @return DottedPath
29
+ */
30
+ declare const getDottedPathForNode: (node: Node) => DottedPath;
31
+ /**
32
+ * @param node
33
+ * @param nodeNamingStrategy
34
+ * @param predicate
35
+ * @param deep
36
+ * @return TransformNode | null
37
+ */
38
+ declare const cloneTransformNode: (node: TransformNode, nodeNamingStrategy: NodeNamingStrategy, predicate?: ((node: TransformNode) => boolean) | undefined, deep?: boolean) => TransformNode | null;
39
+ /**
40
+ * @param node
41
+ */
42
+ declare const cloneNodeWithParents: (node: Node | null) => Node | null;
43
+ /**
44
+ * @param node
45
+ * @param deep
46
+ * @param prefix
47
+ * @return TransformNode
48
+ */
49
+ declare const cloneTransformNodeMaterial: (node: TransformNode, prefix?: DottedPathArgument, deep?: boolean) => TransformNode;
50
+ /**
51
+ * @param object
52
+ * @param deep
53
+ * @param metadata
54
+ */
55
+ declare const injectMetadata: (object: Node | Material, metadata: {}, deep?: boolean) => void;
56
+ /**
57
+ * @param node
58
+ * @param assertCallable
59
+ * @param callableParameters
60
+ * @param deep
61
+ */
62
+ declare const assertTransformNode: (node: TransformNode, assertCallable: (node: TransformNode, ...args: any[]) => void, callableParameters?: any[], deep?: boolean) => void;
63
+ /**
64
+ * @param node
65
+ * @param parameter
66
+ */
67
+ declare const assertMeshCapability: (node: TransformNode, parameter: string) => void;
68
+ /**
69
+ * @param node
70
+ * @param deep
71
+ */
72
+ declare const activateTransformNode: (node: TransformNode, deep?: boolean) => void;
73
+ /**
74
+ * @param node
75
+ * @param deep
76
+ */
77
+ declare const deactivateTransformNode: (node: TransformNode, deep?: boolean) => void;
78
+ /**
79
+ * @param node
80
+ */
81
+ declare const enableNodeWithParents: (node: Node) => void;
82
+ /**
83
+ * @param node
84
+ */
85
+ declare const disableNodeWithParents: (node: Node) => void;
86
+ /**
87
+ * Applies a {@link TransformationDefinition} consecutively to ensure dependencies in positioning etc.
88
+ * @param node
89
+ * @param transformation
90
+ */
91
+ declare const transformTransformNode: (node: TransformNode, transformation: TransformationDefinition) => void;
92
+ /**
93
+ * Apply changes of environment (background texture, etc.) consecutively in order to avoid dependency related issues.
94
+ * @param scene
95
+ * @param envDef
96
+ */
97
+ declare const changeEnvironment: (scene: Scene, envDef: EnvironmentDefinition) => void;
98
+ /**
99
+ * Sets a material by a given material id as material property on the given node.
100
+ *
101
+ * If the material is not already available in the scene, the viewer tries to create a material based on a Combeenation
102
+ * [material asset](https://docs.combeenation.com/docs/howto-create-and-use-babylon-and-material-asset).
103
+ * This of course only works if the viewer is used inside a Combeenation configurator.
104
+ *
105
+ * Furthermore this function also defers the material creation if the node is not visible yet to improve network &
106
+ * viewer bootstrap performance as textures are automatically being lazy loaded only when they are actually visible in
107
+ * the scene.
108
+ *
109
+ * Finally the material will not be applied before all its textures have been loaded. In this way "flickering" effects
110
+ * will be avoided, since the material would be incomplete without its loaded textures.
111
+ */
112
+ declare const setMaterial: (node: TransformNode, materialId: string, deep?: boolean, variant?: Variant) => void;
113
+ /**
114
+ * Gets the Material either from the given {@link Variant}, the given scene or tries to create it from an Combeenation
115
+ * material asset when inside a Combeenation configurator.
116
+ */
117
+ declare const getOrCreateMaterial: (scene: Scene, materialId: string, variant?: Variant) => Promise<Material>;
118
+ /**
119
+ * Waits until the materials textures are loaded and shaders are compiled.
120
+ * Then sets the material on the node if there is no newer "set material" request
121
+ */
122
+ declare const applyMaterial: (material: Material, node: AbstractMesh) => Promise<void>;
123
+ /**
124
+ * !!! Warning !!!
125
+ * This function is not public API. Whilst it can help solving certain problems, it only works reliably in well defined
126
+ * situations and can cause unwanted side effects under some conditions. Use carefully at your own risk!
127
+ *
128
+ * See https://combeenation.myjetbrains.com/youtrack/issue/CB-5906 for further details regarding this warning.
129
+ *
130
+ * Set material of an instanced meshes source mesh.
131
+ * Changes the material of all instanced meshes which have the same source mesh.
132
+ *
133
+ * @param node
134
+ * @param material
135
+ * @param deep
136
+ *
137
+ * @ignore
138
+ */
139
+ declare const setSourceNodeMaterial: (node: TransformNode, material: Material, deep?: boolean) => void;
140
+ /**
141
+ * @param node
142
+ * @param color
143
+ * @param deep
144
+ */
145
+ declare const setMaterialColor: (node: TransformNode, color: Color3, deep?: boolean) => void;
146
+ /**
147
+ * @param node
148
+ * @param texture
149
+ * @param deep
150
+ */
151
+ declare const setMaterialTexture: (node: TransformNode, texture: Texture, deep?: boolean) => void;
152
+ /**
153
+ * @param node
154
+ * @param metallness
155
+ * @param deep
156
+ */
157
+ declare const setMaterialMetallness: (node: TransformNode, metallness: number, deep?: boolean) => void;
158
+ /**
159
+ * @param node
160
+ * @param roughness
161
+ * @param deep
162
+ */
163
+ declare const setMaterialRoughness: (node: TransformNode, roughness: number, deep?: boolean) => void;
164
+ /**
165
+ * @param node
166
+ * @param layer
167
+ * @param color
168
+ * @param deep
169
+ */
170
+ declare const addToHighlightLayer: (layer: HighlightLayer, color: Color3, node: TransformNode, deep?: boolean) => void;
171
+ /**
172
+ * @param node
173
+ * @param layer
174
+ * @param deep
175
+ */
176
+ declare const removeFromHighlightLayer: (layer: HighlightLayer, node: TransformNode, deep?: boolean) => void;
177
+ /**
178
+ * @param node
179
+ * @param receiveShadows
180
+ * @param deep
181
+ */
182
+ declare const setReceiveShadows: (node: TransformNode, receiveShadows: boolean, deep?: boolean) => void;
183
+ /**
184
+ * @param node
185
+ * @param generator
186
+ * @param deep
187
+ */
188
+ declare const addToShadowGenerator: (generator: ShadowGenerator, node: TransformNode, deep?: boolean) => void;
189
+ /**
190
+ * @param node
191
+ * @param generator
192
+ * @param deep
193
+ */
194
+ declare const removeFromShadowGenerator: (generator: ShadowGenerator, node: TransformNode, deep?: boolean) => void;
195
+ /**
196
+ * https://forum.babylonjs.com/t/get-mesh-bounding-box-position-and-size-in-2d-screen-coordinates/1058/3
197
+ * @param mesh
198
+ * @param scene
199
+ * @param canvas
200
+ */
201
+ declare const getClientRectFromMesh: (mesh: AbstractMesh, scene: Scene, canvas: HTMLCanvasElement) => ClientRect;
202
+ declare type LoadableBaseTexture = BaseTexture & {
203
+ url: string;
204
+ onLoadObservable: Observable<BaseTexture>;
205
+ };
206
+ /**
207
+ * This type guard checks whether the given `BaseTextures` is any of its subtypes which comes with an url and
208
+ * `onLoadObservable`.
209
+ *
210
+ * !!! Timing of when this function is called is important !!!
211
+ * See the following for more details: https://forum.babylonjs.com/t/basetexture-whenallready-returns-too-early/34501/6
212
+ */
213
+ declare const isLoadableTexture: (texture: BaseTexture) => texture is LoadableBaseTexture;
214
+ /**
215
+ * @param objects
216
+ * @param tagMapping
217
+ */
218
+ declare const mapTags: (objects: object[], tagMapping: TagMapping) => string[];
219
+ /**
220
+ * Gets an array of ids for nodeIds that exist in both TransformNode arrays.
221
+ * @param nodes1
222
+ * @param nodes2
223
+ * @param predicate
224
+ */
225
+ declare const intersectingNodeNames: (nodes1: Node[], nodes2: Node[], predicate?: ((node: Node) => boolean) | undefined) => string[];
226
+ /**
227
+ * Gets an array of ids for duplicate nodeIds in given node array.
228
+ * @param nodes
229
+ * @param predicate
230
+ */
231
+ declare const duplicateNodeNames: (nodes: Node[], predicate?: ((node: Node) => boolean) | undefined) => string[];
232
+ /**
233
+ * Reports duplicate nodeIds.
234
+ * @param nodeNames
235
+ */
236
+ declare const reportDuplicateNodeNames: (nodeNames: string[]) => void;
237
+ declare const drawPaintableOnMaterial: (material: Material, imageSource: CanvasImageSource, scene: Scene, options?: PaintableOptions) => void;
238
+ export { getRootNode, isLoadableTexture, mapToDottedNodes, getDottedPathForNode, cloneTransformNode, cloneNodeWithParents, cloneTransformNodeMaterial, getOrCreateMaterial, applyMaterial, injectMetadata, assertTransformNode, assertMeshCapability, activateTransformNode, deactivateTransformNode, enableNodeWithParents, disableNodeWithParents, transformTransformNode, setMaterial, setSourceNodeMaterial, setMaterialColor, setMaterialTexture, setMaterialMetallness, setMaterialRoughness, addToHighlightLayer, removeFromHighlightLayer, setReceiveShadows, addToShadowGenerator, removeFromShadowGenerator, getClientRectFromMesh, changeEnvironment, backgroundDomeName, envHelperMetadataName, mapTags, intersectingNodeNames, duplicateNodeNames, reportDuplicateNodeNames, drawPaintableOnMaterial, };