@xeokit/xeokit-sdk 2.2.4 → 2.2.5-beta-2

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 (107) hide show
  1. package/dist/xeokit-sdk.cjs.js +77 -40
  2. package/dist/xeokit-sdk.es.js +77 -40
  3. package/dist/xeokit-sdk.min.cjs.js +1 -1
  4. package/dist/xeokit-sdk.min.es.js +1 -1
  5. package/package.json +4 -2
  6. package/types/extras/ContextMenu/ContextMenu.d.ts +125 -0
  7. package/types/extras/ContextMenu/index.d.ts +1 -0
  8. package/types/extras/index.d.ts +1 -0
  9. package/types/index.d.ts +3 -0
  10. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +144 -0
  11. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +42 -0
  12. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +85 -0
  13. package/types/plugins/AngleMeasurementsPlugin/index.d.ts +1 -0
  14. package/types/plugins/AnnotationsPlugin/Annotation.d.ts +134 -0
  15. package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +117 -0
  16. package/types/plugins/AnnotationsPlugin/index.d.ts +1 -0
  17. package/types/plugins/AxisGizmoPlugin/AxisGizmoPlugin.d.ts +28 -0
  18. package/types/plugins/AxisGizmoPlugin/index.d.ts +1 -0
  19. package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +146 -0
  20. package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -0
  21. package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +81 -0
  22. package/types/plugins/CityJSONLoaderPlugin/index.d.ts +1 -0
  23. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +137 -0
  24. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +40 -0
  25. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +120 -0
  26. package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
  27. package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +203 -0
  28. package/types/plugins/FastNavPlugin/index.d.ts +1 -0
  29. package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +140 -0
  30. package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -0
  31. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +146 -0
  32. package/types/plugins/LASLoaderPlugin/index.d.ts +1 -0
  33. package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +160 -0
  34. package/types/plugins/NavCubePlugin/index.d.ts +1 -0
  35. package/types/plugins/OBJLoaderPlugin/OBJLoaderPlugin.d.ts +44 -0
  36. package/types/plugins/OBJLoaderPlugin/index.d.ts +1 -0
  37. package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +88 -0
  38. package/types/plugins/STLLoaderPlugin/index.d.ts +2 -0
  39. package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +103 -0
  40. package/types/plugins/SectionPlanesPlugin/index.d.ts +1 -0
  41. package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +34 -0
  42. package/types/plugins/SkyboxesPlugin/index.d.ts +1 -0
  43. package/types/plugins/StoreyViewsPlugin/Storey.d.ts +47 -0
  44. package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -0
  45. package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +173 -0
  46. package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -0
  47. package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -0
  48. package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +66 -0
  49. package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +136 -0
  50. package/types/plugins/TreeViewPlugin/index.d.ts +1 -0
  51. package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -0
  52. package/types/plugins/ViewCullPlugin/index.d.ts +1 -0
  53. package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +230 -0
  54. package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -0
  55. package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +277 -0
  56. package/types/plugins/XKTLoaderPlugin/index.d.ts +1 -0
  57. package/types/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.d.ts +65 -0
  58. package/types/plugins/XML3DLoaderPlugin/index.d.ts +1 -0
  59. package/types/plugins/index.d.ts +34 -0
  60. package/types/viewer/Configs.d.ts +20 -0
  61. package/types/viewer/Plugin.d.ts +69 -0
  62. package/types/viewer/Viewer.d.ts +212 -0
  63. package/types/viewer/index.d.ts +6 -0
  64. package/types/viewer/localization/LocaleService.d.ts +176 -0
  65. package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -0
  66. package/types/viewer/metadata/MetaModel.d.ts +65 -0
  67. package/types/viewer/metadata/MetaObject.d.ts +74 -0
  68. package/types/viewer/metadata/MetaScene.d.ts +135 -0
  69. package/types/viewer/metadata/Property.d.ts +29 -0
  70. package/types/viewer/metadata/PropertySet.d.ts +31 -0
  71. package/types/viewer/metadata/index.d.ts +6 -0
  72. package/types/viewer/scene/CameraControl/CameraControl.d.ts +591 -0
  73. package/types/viewer/scene/Component.d.ts +155 -0
  74. package/types/viewer/scene/Entity.d.ts +394 -0
  75. package/types/viewer/scene/PerformanceModel/PerformanceModel.d.ts +605 -0
  76. package/types/viewer/scene/PerformanceModel/PerformanceNode.d.ts +302 -0
  77. package/types/viewer/scene/camera/Camera.d.ts +364 -0
  78. package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -0
  79. package/types/viewer/scene/camera/CameraPath.d.ts +28 -0
  80. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -0
  81. package/types/viewer/scene/camera/CustomProjection.d.ts +57 -0
  82. package/types/viewer/scene/camera/Frustum.d.ts +166 -0
  83. package/types/viewer/scene/camera/Ortho.d.ts +115 -0
  84. package/types/viewer/scene/camera/Perspective.d.ts +136 -0
  85. package/types/viewer/scene/camera/index.d.ts +4 -0
  86. package/types/viewer/scene/geometry/Geometry.d.ts +7 -0
  87. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -0
  88. package/types/viewer/scene/geometry/index.d.ts +1 -0
  89. package/types/viewer/scene/index.d.ts +6 -0
  90. package/types/viewer/scene/marker/Marker.d.ts +136 -0
  91. package/types/viewer/scene/marker/index.d.ts +1 -0
  92. package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -0
  93. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -0
  94. package/types/viewer/scene/materials/Fresnel.d.ts +149 -0
  95. package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -0
  96. package/types/viewer/scene/materials/Material.d.ts +3 -0
  97. package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -0
  98. package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -0
  99. package/types/viewer/scene/materials/Texture.d.ts +261 -0
  100. package/types/viewer/scene/materials/index.d.ts +5 -0
  101. package/types/viewer/scene/math/math.d.ts +36 -0
  102. package/types/viewer/scene/postfx/SAO.d.ts +209 -0
  103. package/types/viewer/scene/scene/Scene.d.ts +727 -0
  104. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +93 -0
  105. package/types/viewer/scene/sectionPlane/index.d.ts +1 -0
  106. package/types/viewer/scene/viewport/Viewport.d.ts +23 -0
  107. package/types/viewer/scene/webgl/PickResult.d.ts +103 -0
@@ -0,0 +1,136 @@
1
+ import { Plugin, Viewer } from "../../viewer";
2
+ import { ModelTreeView } from "./ModelTreeView";
3
+ import { TreeViewNode } from "./TreeViewNode";
4
+
5
+ export declare type TreeViewPluginConfiguration = {
6
+ /** DOM element to contain the TreeViewPlugin. */
7
+ containerElement: HTMLElement;
8
+ /** When ````true```` (default), will automatically add each model as it's created. Set this ````false```` if you want to manually add models using {@link TreeViewPlugin#addModel} instead. */
9
+ autoAddModels?: boolean;
10
+ /** Optional depth to which to initially expand the tree. */
11
+ autoExpandDepth?: number;
12
+ /** How to organize the tree nodes: "containment", "storeys" or "types". See the class documentation for details. */
13
+ hierarchy?: "containment" | "storeys" | "types";
14
+ /** When true, will sort the children of each node. */
15
+ sortNodes?: boolean;
16
+ /** When true, will not contain nodes that don't have content in the {@link Scene}. These are nodes whose {@link MetaObject}s don't have {@link Entity}s. */
17
+ pruneEmptyNodes?: boolean;
18
+ };
19
+
20
+ /**
21
+ * A {@link Viewer} plugin that provides an HTML tree view to navigate the IFC elements in models.
22
+ */
23
+ export declare class TreeViewPlugin extends Plugin {
24
+ /**
25
+ * @constructor
26
+ *
27
+ * @param {Viewer} viewer The Viewer.
28
+ * @param {TreeViewPluginConfiguration} cfg Plugin configuration.
29
+ */
30
+ constructor(viewer: Viewer, cfg: TreeViewPluginConfiguration);
31
+
32
+ /**
33
+ * Sets how the nodes are organized within this tree view.
34
+ *
35
+ * Default value is "containment".
36
+ *
37
+ * @type {String}
38
+ */
39
+ set hierarchy(arg: "containment" | "storeys" | "types");
40
+
41
+ /**
42
+ * Gets how the nodes are organized within this tree view.
43
+ *
44
+ * @type {String}
45
+ */
46
+ get hierarchy(): "containment" | "storeys" | "types";
47
+
48
+ /**
49
+ * Returns the map of {@link ModelTreeView}s.
50
+ *
51
+ * Each ModelTreeView is mapped to the ID of its model.
52
+ *
53
+ * @return {*|{}}
54
+ */
55
+ get modelTreeViews(): any;
56
+
57
+ /**
58
+ * Adds a model to this tree view.
59
+ *
60
+ * The model will be automatically removed when destroyed.
61
+ *
62
+ * To automatically add each model as it's created, instead of manually calling this method each time,
63
+ * provide a ````autoAddModels: true```` to the TreeViewPlugin constructor.
64
+ *
65
+ * @param {String} modelId ID of a model {@link Entity} in {@link Scene#models}.
66
+ * @param {Object} [options] Options for model in the tree view.
67
+ * @param {String} [options.rootName] Optional display name for the root node. Ordinary, for "containment"
68
+ * and "storeys" hierarchy types, the tree would derive the root node name from the model's "IfcProject" element
69
+ * name. This option allows to override that name when it is not suitable as a display name.
70
+ * @returns {ModelTreeView} ModelTreeView for the newly-added model. If this method succeeded in adding the model,
71
+ * then {@link ModelTreeView#valid} will equal ````true````. Otherwise, that property will be ````false````
72
+ * and {@link ModelTreeView#errors} will contain error messages.
73
+ */
74
+ addModel(modelId: string, options?: {
75
+ rootName?: string;
76
+ }): ModelTreeView;
77
+
78
+ /**
79
+ * Removes a model from this tree view.
80
+ *
81
+ * Does nothing if model not currently in tree view.
82
+ *
83
+ * @param {String} modelId ID of a model {@link Entity} in {@link Scene#models}.
84
+ */
85
+ removeModel(modelId: string): void;
86
+
87
+ /**
88
+ * Collapses all trees within this tree view.
89
+ */
90
+ collapse(): void;
91
+
92
+ /**
93
+ * Highlights the tree view node that represents the given object {@link Entity}.
94
+ *
95
+ * This causes the tree view to collapse, then expand to reveal the node, then highlight the node.
96
+ *
97
+ * If a node is previously highlighted, de-highlights that node and collapses the tree first.
98
+ *
99
+ * Note that if the TreeViewPlugin was configured with ````pruneEmptyNodes: true```` (default configuration), then the
100
+ * node won't exist in the tree if it has no Entitys in the {@link Scene}. in that case, nothing will happen.
101
+ *
102
+ * Within the DOM, the node is represented by an ````<li>```` element. This method will add a ````.highlighted-node```` class to
103
+ * the element to make it appear highlighted, removing that class when de-highlighting it again. See the CSS rules
104
+ * in the TreeViewPlugin examples for an example of that class.
105
+ *
106
+ * @param {String} objectId ID of the {@link Entity}.
107
+ */
108
+ showNode(objectId: string): void;
109
+
110
+ /**
111
+ * De-highlights the node previously shown with {@link TreeViewPlugin#showNode}.
112
+ *
113
+ * Does nothing if no node is currently shown.
114
+ *
115
+ * If the node is currently scrolled into view, keeps the node in view.
116
+ */
117
+ unShowNode(): void;
118
+
119
+ /**
120
+ * Expands the tree to the given depth.
121
+ *
122
+ * Collapses the tree first.
123
+ *
124
+ * @param {Number} depth Depth to expand to.
125
+ */
126
+ expandToDepth(depth: number): void;
127
+
128
+ /**
129
+ * Iterates over a subtree of the tree view's {@link TreeViewNode}s, calling the given callback for each
130
+ * node in depth-first pre-order.
131
+ *
132
+ * @param {TreeViewNode} node Root of the subtree.
133
+ * @param {Function} callback Callback called at each {@link TreeViewNode}, with the TreeViewNode given as the argument.
134
+ */
135
+ withNodeTree(node: TreeViewNode, callback: (node: TreeViewNode) => void): void;
136
+ }
@@ -0,0 +1 @@
1
+ export * from "./TreeViewPlugin";
@@ -0,0 +1,34 @@
1
+ import { Plugin, Viewer } from "../../viewer";
2
+
3
+ export declare type ViewCullPluginConfiguration = {
4
+ /** Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}. */
5
+ id?: string;
6
+ /** Maximum depth of the kd-tree. */
7
+ maxTreeDepth?: number;
8
+ };
9
+
10
+ /**
11
+ * {@link Viewer} plugin that performs view frustum culling to accelerate rendering performance.
12
+ */
13
+ export class ViewCullPlugin extends Plugin {
14
+ /**
15
+ * @constructor
16
+ * @param {Viewer} viewer The Viewer.
17
+ * @param {ViewCullPluginConfiguration} cfg Plugin configuration.
18
+ */
19
+ constructor(viewer: Viewer, cfg?: ViewCullPluginConfiguration);
20
+
21
+ /**
22
+ * Sets whether view culling is enabled.
23
+ *
24
+ * @param {Boolean} enabled Whether to enable view culling.
25
+ */
26
+ set enabled(arg: boolean);
27
+
28
+ /**
29
+ * Gets whether view culling is enabled.
30
+ *
31
+ * @retutns {Boolean} Whether view culling is enabled.
32
+ */
33
+ get enabled(): boolean;
34
+ }
@@ -0,0 +1 @@
1
+ export * from "./ViewCullPlugin";
@@ -0,0 +1,230 @@
1
+ import { Plugin, Viewer, PerformanceModel, IFCObjectDefaults } from "../../viewer";
2
+ import { ModelStats } from "../index";
3
+
4
+ /**
5
+ * Default data access strategy for {@link WebIFCLoaderPlugin}.
6
+ */
7
+ export declare interface IWebIFCDefaultDataSource {
8
+ /**
9
+ * Gets the contents of the given IFC file in an arraybuffer.
10
+ *
11
+ * @param {String|Number} src Path or ID of an IFC file.
12
+ * @param {Function} ok Callback fired on success, argument is the IFC file in an arraybuffer.
13
+ * @param {Function} error Callback fired on error.
14
+ */
15
+ getIFC(src: string | number, ok: (buffer: ArrayBuffer)=> void, error: (e: Error)=> void): void;
16
+ }
17
+
18
+ export declare type WebIFCLoaderPluginConfiguration = {
19
+ id?: string;
20
+ wasmPath: string;
21
+ objectDefaults?: any;
22
+ dataSource?: IWebIFCDefaultDataSource;
23
+ includeTypes?: string[];
24
+ excludeTypes?: string[];
25
+ excludeUnclassifiedObjects?: boolean;
26
+ };
27
+
28
+ export declare type LoadWebIFCModel = {
29
+ /** ID to assign to the root {@link Entity#id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default. */
30
+ id?: string;
31
+ /** Path to a IFC file, as an alternative to the ````ifc```` parameter. */
32
+ src?: string;
33
+ /** The IFC file data, as an alternative to the ````src```` parameter. */
34
+ ifc?: ArrayBuffer;
35
+ /** Whether to load IFC metadata (metaobjects and property sets). */
36
+ loadMetadata?: boolean;
37
+ /** Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}. */
38
+ objectDefaults?: IFCObjectDefaults;
39
+ /** When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list. */
40
+ includeTypes?: string[];
41
+ /** When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list. */
42
+ excludeTypes?: string[];
43
+ /** Whether or not xeokit renders the model with edges emphasized. */
44
+ edges?: boolean;
45
+ /** The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates. */
46
+ origin?: number[];
47
+ /** The model single-precision 3D position, relative to the ````origin```` parameter. */
48
+ position?: number[];
49
+ /** The model's scale. */
50
+ scale?: number[];
51
+ /** The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis. */
52
+ rotation?: number[];
53
+ /** The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````. */
54
+ matrix?: number[];
55
+ /** Indicates if Scalable Ambient Obscurance (SAO) will apply to the model. SAO is configured by the Scene's {@link SAO} component. Only works when {@link SAO#enabled} is also ````true```` */
56
+ saoEnabled?: boolean;
57
+ /** Indicates if physically-based rendering (PBR) will apply to the model. Only works when {@link Scene#pbrEnabled} is also ````true````. */
58
+ pbrEnabled?: boolean;
59
+ /** When we set this ````true````, then we force rendering of backfaces for the model. When we leave this ````false````, then we allow the Viewer to decide when to render backfaces. In that case, the Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s. */
60
+ backfaces?: boolean;
61
+ /** When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}. */
62
+ excludeUnclassifiedObjects?: boolean;
63
+ /** Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models. */
64
+ globalizeObjectIds?: boolean;
65
+ /** Collects model statistics. */
66
+ stats?: ModelStats;
67
+ };
68
+
69
+ /**
70
+ * {@link Viewer} plugin that uses [web-ifc](https://github.com/tomvandig/web-ifc) to load BIM models directly from IFC files.
71
+ */
72
+ export declare class WebIFCLoaderPlugin extends Plugin {
73
+ /**
74
+ * @constructor
75
+ *
76
+ * @param {Viewer} viewer The Viewer.
77
+ * @param {WebIFCLoaderPluginConfiguration} cfg Plugin configuration.
78
+ */
79
+ constructor(viewer: Viewer, cfg?: WebIFCLoaderPluginConfiguration);
80
+
81
+ /**
82
+ * Sets a custom data source through which the WebIFCLoaderPlugin can load IFC files.
83
+ *
84
+ * Default value is {@link WebIFCDefaultDataSource}, which loads via HTTP.
85
+ *
86
+ * @type {Object}
87
+ */
88
+ set dataSource(arg: IWebIFCDefaultDataSource);
89
+
90
+ /**
91
+ * Gets the custom data source through which the WebIFCLoaderPlugin can load IFC files.
92
+ *
93
+ * Default value is {@link WebIFCDefaultDataSource}, which loads via HTTP.
94
+ *
95
+ * @type {Object}
96
+ */
97
+ get dataSource(): IWebIFCDefaultDataSource;
98
+
99
+ /**
100
+ * Sets map of initial default states for each loaded {@link Entity} that represents an object.
101
+ *
102
+ * Default value is {@link IFCObjectDefaults}.
103
+ *
104
+ * @type {IFCObjectDefaults}
105
+ */
106
+ set objectDefaults(arg: IFCObjectDefaults);
107
+
108
+ /**
109
+ * Gets map of initial default states for each loaded {@link Entity} that represents an object.
110
+ *
111
+ * Default value is {@link IFCObjectDefaults}.
112
+ *
113
+ * @type {IFCObjectDefaults}
114
+ */
115
+ get objectDefaults(): IFCObjectDefaults;
116
+
117
+ /**
118
+ * Sets the whitelist of the IFC types loaded by this WebIFCLoaderPlugin.
119
+ *
120
+ * When loading IFC models, causes this WebIFCLoaderPlugin to only load objects whose types are in this
121
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
122
+ *
123
+ * Default value is ````undefined````.
124
+ *
125
+ * @type {String[]}
126
+ */
127
+ set includeTypes(arg: string[]);
128
+
129
+ /**
130
+ * Gets the whitelist of the IFC types loaded by this WebIFCLoaderPlugin.
131
+ *
132
+ * When loading IFC models, causes this WebIFCLoaderPlugin to only load objects whose types are in this
133
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
134
+ *
135
+ * Default value is ````undefined````.
136
+ *
137
+ * @type {String[]}
138
+ */
139
+ get includeTypes(): string[];
140
+
141
+ /**
142
+ * Sets the blacklist of IFC types that are never loaded by this WebIFCLoaderPlugin.
143
+ *
144
+ * When IFC models, causes this WebIFCLoaderPlugin to **not** load objects whose types are in this
145
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
146
+ *
147
+ * Default value is ````undefined````.
148
+ *
149
+ * @type {String[]}
150
+ */
151
+ set excludeTypes(arg: string[]);
152
+
153
+ /**
154
+ * Gets the blacklist of IFC types that are never loaded by this WebIFCLoaderPlugin.
155
+ *
156
+ * When loading IFC models, causes this WebIFCLoaderPlugin to **not** load objects whose types are in this
157
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
158
+ *
159
+ * Default value is ````undefined````.
160
+ *
161
+ * @type {String[]}
162
+ */
163
+ get excludeTypes(): string[];
164
+
165
+ /**
166
+ * Sets whether we load objects that don't have IFC types.
167
+ *
168
+ * When loading IFC models and this is ````true````, WebIFCLoaderPlugin will not load objects
169
+ * that don't have IFC types.
170
+ *
171
+ * Default value is ````false````.
172
+ *
173
+ * @type {Boolean}
174
+ */
175
+ set excludeUnclassifiedObjects(arg: boolean);
176
+
177
+ /**
178
+ * Gets whether we load objects that don't have IFC types.
179
+ *
180
+ * When loading IFC models and this is ````true````, WebIFCLoaderPlugin will not load objects
181
+ * that don't have IFC types.
182
+ *
183
+ * Default value is ````false````.
184
+ *
185
+ * @type {Boolean}
186
+ */
187
+ get excludeUnclassifiedObjects(): boolean;
188
+
189
+ /**
190
+ * Gets the ````IFC```` format versions supported by this WebIFCLoaderPlugin.
191
+ * @returns {string[]}
192
+ */
193
+ get supportedVersions(): string[];
194
+
195
+ /**
196
+ * Sets whether WebIFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
197
+ *
198
+ * Set this ````true```` when you need to load multiple instances of the same model, to avoid ID clashes
199
+ * between the objects in the different instances.
200
+ *
201
+ * When we load a model with this set ````true````, then each {@link Entity#id} and {@link MetaObject#id} will be
202
+ * prefixed by the ID of the model, ie. ````<modelId>#<objectId>````.
203
+ *
204
+ * {@link Entity#originalSystemId} and {@link MetaObject#originalSystemId} will always hold the original, un-prefixed, ID values.
205
+ *
206
+ * Default value is ````false````.
207
+ *
208
+ * See the main {@link WebIFCLoaderPlugin} class documentation for usage info.
209
+ *
210
+ * @type {Boolean}
211
+ */
212
+ set globalizeObjectIds(arg: boolean);
213
+
214
+ /**
215
+ * Gets whether WebIFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
216
+ *
217
+ * Default value is ````false````.
218
+ *
219
+ * @type {Boolean}
220
+ */
221
+ get globalizeObjectIds(): boolean;
222
+
223
+ /**
224
+ * Loads an ````IFC```` model into this WebIFCLoaderPlugin's {@link Viewer}.
225
+ *
226
+ * @param {LoadWebIFCModel} params Loading parameters.
227
+ * @returns {PerformanceModel} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
228
+ */
229
+ load(params?: LoadWebIFCModel): PerformanceModel;
230
+ }
@@ -0,0 +1 @@
1
+ export * from "./WebIFCLoaderPlugin";
@@ -0,0 +1,277 @@
1
+ import { Plugin, Viewer, PerformanceModel, IFCObjectDefaults } from "../../viewer";
2
+
3
+ export declare type XKTLoaderPluginConfiguration = {
4
+ /** Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}. */
5
+ id?: string;
6
+ /** Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.*/
7
+ objectDefaults?: IFCObjectDefaults;
8
+ /** A custom data source through which the XKTLoaderPlugin can load model and metadata files. Defaults to an instance of {@link XKTDefaultDataSource}, which loads uover HTTP. */
9
+ dataSource?: IXKTDefaultDataSource;
10
+ /** When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list. */
11
+ includeTypes?: string[];
12
+ /** When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list. */
13
+ excludeTypes?: string[];
14
+ /** When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}. */
15
+ excludeUnclassifiedObjects?: boolean;
16
+ /** Indicates whether to enable geometry reuse */
17
+ reuseGeometries?: boolean;
18
+ /** Maximum geometry batch size, as number of vertices. */
19
+ maxGeometryBatchSize?: number;
20
+ };
21
+
22
+ export declare type LoadXKTModel = {
23
+ /** ID to assign to the root {@link Entity#id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default. */
24
+ id?: string;
25
+ /** Path to a *````.xkt````* file, as an alternative to the ````xkt```` parameter. */
26
+ src?: string;
27
+ /** The *````.xkt````* file data, as an alternative to the ````src```` parameter. */
28
+ xkt?: ArrayBuffer;
29
+ /** Path to an optional metadata file, as an alternative to the ````metaModelData```` parameter. */
30
+ metaModelSrc?: string;
31
+ /** JSON model metadata, as an alternative to the ````metaModelSrc```` parameter. */
32
+ metaModelData?: any;
33
+ /** Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}. */
34
+ objectDefaults?: object;
35
+ /** When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list. */
36
+ includeTypes?: string[]
37
+ /** When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list. */
38
+ excludeTypes?: string[];
39
+ /** Whether or not xeokit renders the model with edges emphasized. */
40
+ edges?: boolean;
41
+ /** The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates. */
42
+ origin?: number[];
43
+ /** The model single-precision 3D position, relative to the ````origin```` parameter. */
44
+ position?: number[];
45
+ /** The model's scale. */
46
+ scale?: number[];
47
+ /** The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis. */
48
+ rotation?: number[];
49
+ /** The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.*/
50
+ matrix?: number[];
51
+ /** Indicates if Scalable Ambient Obscurance (SAO) will apply to the model. SAO is configured by the Scene's {@link SAO} component. Only works when {@link SAO#enabled} is also ````true```` */
52
+ saoEnabled?: boolean;
53
+ /** Indicates if physically-based rendering (PBR) will apply to the model. Only works when {@link Scene#pbrEnabled} is also ````true````. */
54
+ pbrEnabled?: boolean;
55
+ /** When we set this ````true````, then we force rendering of backfaces for the model. */
56
+ backfaces?: boolean;
57
+ /** When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). */
58
+ excludeUnclassifiedObjects?: boolean;
59
+ /** Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models. */
60
+ globalizeObjectIds?: boolean;
61
+ /** Indicates whether to enable geometry reuse */
62
+ reuseGeometries?: boolean;
63
+ }
64
+
65
+ export declare interface IXKTDefaultDataSource {
66
+ /**
67
+ * Gets metamodel JSON.
68
+ *
69
+ * @param {String|Number} metaModelSrc Identifies the metamodel JSON asset.
70
+ * @param {Function(*)} ok Fired on successful loading of the metamodel JSON asset.
71
+ * @param {Function(*)} error Fired on error while loading the metamodel JSON asset.
72
+ */
73
+ getMetaModel(metaModelSrc: string | number, ok: (json: any)=> void, error: (e: Error)=> void): void;
74
+
75
+ /**
76
+ * Gets the contents of the given ````.xkt```` file in an arraybuffer.
77
+ *
78
+ * @param {String|Number} src Path or ID of an ````.xkt```` file.
79
+ * @param {Function} ok Callback fired on success, argument is the ````.xkt```` file in an arraybuffer.
80
+ * @param {Function} error Callback fired on error.
81
+ */
82
+ getXKT(src: string | number, ok: (buffer: ArrayBuffer)=> void, error: (e: Error)=> void): void;
83
+ }
84
+
85
+ /**
86
+ * {@link Viewer} plugin that loads models from xeokit's optimized *````.XKT````* format.
87
+ *
88
+ */
89
+ export declare class XKTLoaderPlugin extends Plugin {
90
+ /**
91
+ * @constructor
92
+ *
93
+ * @param {Viewer} viewer The Viewer.
94
+ * @param {XKTLoaderPluginConfiguration} cfg Plugin configuration.
95
+ */
96
+ constructor(viewer: Viewer, cfg?: XKTLoaderPluginConfiguration);
97
+
98
+ /**
99
+ * Sets a custom data source through which the XKTLoaderPlugin can load models and metadata.
100
+ *
101
+ * Default value is {@link XKTDefaultDataSource}, which loads via HTTP.
102
+ *
103
+ * @type {IXKTDefaultDataSource}
104
+ */
105
+ set dataSource(arg: IXKTDefaultDataSource);
106
+
107
+ /**
108
+ * Gets the custom data source through which the XKTLoaderPlugin can load models and metadata.
109
+ *
110
+ * Default value is {@link XKTDefaultDataSource}, which loads via HTTP.
111
+ *
112
+ * @type {IXKTDefaultDataSource}
113
+ */
114
+ get dataSource(): IXKTDefaultDataSource;
115
+
116
+ /**
117
+ * Sets map of initial default states for each loaded {@link Entity} that represents an object.
118
+ *
119
+ * @type {IFCObjectDefaults}
120
+ */
121
+ set objectDefaults(arg: IFCObjectDefaults);
122
+
123
+ /**
124
+ * Gets map of initial default states for each loaded {@link Entity} that represents an object.
125
+ *
126
+ * @type {IFCObjectDefaults}
127
+ */
128
+ get objectDefaults(): IFCObjectDefaults;
129
+
130
+ /**
131
+ * Sets the whitelist of the IFC types loaded by this XKTLoaderPlugin.
132
+ *
133
+ * When loading models with metadata, causes this XKTLoaderPlugin to only load objects whose types are in this
134
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
135
+ *
136
+ * Default value is ````undefined````.
137
+ *
138
+ * @type {String[]}
139
+ */
140
+ set includeTypes(arg: string[]);
141
+
142
+ /**
143
+ * Gets the whitelist of the IFC types loaded by this XKTLoaderPlugin.
144
+ *
145
+ * When loading models with metadata, causes this XKTLoaderPlugin to only load objects whose types are in this
146
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
147
+ *
148
+ * Default value is ````undefined````.
149
+ *
150
+ * @type {String[]}
151
+ */
152
+
153
+ get includeTypes(): string[];
154
+
155
+ /**
156
+ * Sets the blacklist of IFC types that are never loaded by this XKTLoaderPlugin.
157
+ *
158
+ * When loading models with metadata, causes this XKTLoaderPlugin to **not** load objects whose types are in this
159
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
160
+ *
161
+ * Default value is ````undefined````.
162
+ *
163
+ * @type {String[]}
164
+ */
165
+ set excludeTypes(arg: string[]);
166
+
167
+ /**
168
+ * Gets the blacklist of IFC types that are never loaded by this XKTLoaderPlugin.
169
+ *
170
+ * When loading models with metadata, causes this XKTLoaderPlugin to **not** load objects whose types are in this
171
+ * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
172
+ *
173
+ * Default value is ````undefined````.
174
+ *
175
+ * @type {String[]}
176
+ */
177
+ get excludeTypes(): string[];
178
+
179
+ /**
180
+ * Sets whether we load objects that don't have IFC types.
181
+ *
182
+ * When loading models with metadata and this is ````true````, XKTLoaderPlugin will not load objects
183
+ * that don't have IFC types.
184
+ *
185
+ * Default value is ````false````.
186
+ *
187
+ * @type {Boolean}
188
+ */
189
+ set excludeUnclassifiedObjects(arg: boolean);
190
+
191
+ /**
192
+ * Gets whether we load objects that don't have IFC types.
193
+ *
194
+ * When loading models with metadata and this is ````true````, XKTLoaderPlugin will not load objects
195
+ * that don't have IFC types.
196
+ *
197
+ * Default value is ````false````.
198
+ *
199
+ * @type {Boolean}
200
+ */
201
+ get excludeUnclassifiedObjects(): boolean;
202
+
203
+ /**
204
+ * Sets whether XKTLoaderPlugin enables geometry reuse when loading models.
205
+ *
206
+ * Default value is ````true````.
207
+ *
208
+ * Geometry reuse saves memory, but can impact Viewer performance when there are many reused geometries. For
209
+ * this reason, we can set this ````false```` to disable geometry reuse for models loaded by this XKTLoaderPlugin
210
+ * (which will then "expand" the geometry instances into batches instead).
211
+ *
212
+ * The result will be be less WebGL draw calls (which are expensive), at the cost of increased memory footprint.
213
+ *
214
+ * See [#769](https://github.com/xeokit/xeokit-sdk/issues/769) for more info.
215
+ *
216
+ * @type {Boolean}
217
+ */
218
+ set reuseGeometries(arg: boolean);
219
+
220
+ /**
221
+ * Gets whether XKTLoaderPlugin enables geometry reuse when loading models.
222
+ *
223
+ * Default value is ````true````.
224
+ *
225
+ * @type {Boolean}
226
+ */
227
+ get reuseGeometries(): boolean;
228
+
229
+ /**
230
+ * Gets the ````.xkt```` format versions supported by this XKTLoaderPlugin/
231
+ * @returns {string[]}
232
+ */
233
+ get supportedVersions(): string[];
234
+
235
+ /**
236
+ * Sets whether XKTLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
237
+ *
238
+ * Set this ````true```` when you need to load multiple instances of the same model, to avoid ID clashes
239
+ * between the objects in the different instances.
240
+ *
241
+ * When we load a model with this set ````true````, then each {@link Entity#id} and {@link MetaObject#id} will be
242
+ * prefixed by the ID of the model, ie. ````<modelId>#<objectId>````.
243
+ *
244
+ * {@link Entity#originalSystemId} and {@link MetaObject#originalSystemId} will always hold the original, un-prefixed, ID values.
245
+ *
246
+ * Default value is ````false````.
247
+ *
248
+ * See the main {@link XKTLoaderPlugin} class documentation for usage info.
249
+ *
250
+ * @type {Boolean}
251
+ */
252
+ set globalizeObjectIds(arg: boolean);
253
+
254
+ /**
255
+ * Gets whether XKTLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
256
+ *
257
+ * Default value is ````false````.
258
+ *
259
+ * @type {Boolean}
260
+ */
261
+ get globalizeObjectIds(): boolean;
262
+
263
+
264
+ /**
265
+ * Loads an ````.xkt```` model into this XKTLoaderPlugin's {@link Viewer}.
266
+ *
267
+ * Since xeokit/xeokit-sdk 1.9.0, XKTLoaderPlugin has supported XKT 8, which bundles the metamodel
268
+ * data (eg. an IFC element hierarchy) in the XKT file itself. For XKT 8, we therefore no longer need to
269
+ * load the metamodel data from a separate accompanying JSON file, as we did with previous XKT versions.
270
+ * However, if we do choose to specify a separate metamodel JSON file to load (eg. for backward compatibility
271
+ * in data pipelines), then that metamodel will be loaded and the metamodel in the XKT 8 file will be ignored.
272
+ *
273
+ * @param {LoadXKTModel} params Loading parameters.
274
+ * @returns {PerformanceModel} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
275
+ */
276
+ load(params: LoadXKTModel): PerformanceModel;
277
+ }
@@ -0,0 +1 @@
1
+ export * from "./XKTLoaderPlugin";