@xeokit/xeokit-sdk 2.2.5 → 2.3.0-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 (120) hide show
  1. package/dist/web-ifc.wasm +0 -0
  2. package/dist/xeokit-sdk.cjs.js +87051 -79967
  3. package/dist/xeokit-sdk.es.js +87051 -79967
  4. package/dist/xeokit-sdk.min.cjs.js +1 -1
  5. package/dist/xeokit-sdk.min.es.js +1 -1
  6. package/package.json +18 -22
  7. package/types/extras/ContextMenu/ContextMenu.d.ts +125 -0
  8. package/types/extras/ContextMenu/index.d.ts +1 -0
  9. package/types/extras/index.d.ts +1 -0
  10. package/types/index.d.ts +3 -0
  11. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +144 -0
  12. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +67 -0
  13. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +99 -0
  14. package/types/plugins/AngleMeasurementsPlugin/index.d.ts +1 -0
  15. package/types/plugins/AnnotationsPlugin/Annotation.d.ts +135 -0
  16. package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +150 -0
  17. package/types/plugins/AnnotationsPlugin/index.d.ts +2 -0
  18. package/types/plugins/AxisGizmoPlugin/AxisGizmoPlugin.d.ts +28 -0
  19. package/types/plugins/AxisGizmoPlugin/index.d.ts +1 -0
  20. package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +146 -0
  21. package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -0
  22. package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +81 -0
  23. package/types/plugins/CityJSONLoaderPlugin/index.d.ts +1 -0
  24. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +137 -0
  25. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +65 -0
  26. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +135 -0
  27. package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
  28. package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +203 -0
  29. package/types/plugins/FastNavPlugin/index.d.ts +1 -0
  30. package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +140 -0
  31. package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -0
  32. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +146 -0
  33. package/types/plugins/LASLoaderPlugin/index.d.ts +1 -0
  34. package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +160 -0
  35. package/types/plugins/NavCubePlugin/index.d.ts +1 -0
  36. package/types/plugins/OBJLoaderPlugin/OBJLoaderPlugin.d.ts +44 -0
  37. package/types/plugins/OBJLoaderPlugin/index.d.ts +1 -0
  38. package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +88 -0
  39. package/types/plugins/STLLoaderPlugin/index.d.ts +1 -0
  40. package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +103 -0
  41. package/types/plugins/SectionPlanesPlugin/index.d.ts +1 -0
  42. package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +34 -0
  43. package/types/plugins/SkyboxesPlugin/index.d.ts +1 -0
  44. package/types/plugins/StoreyViewsPlugin/Storey.d.ts +47 -0
  45. package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -0
  46. package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +180 -0
  47. package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -0
  48. package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -0
  49. package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +66 -0
  50. package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +150 -0
  51. package/types/plugins/TreeViewPlugin/index.d.ts +1 -0
  52. package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -0
  53. package/types/plugins/ViewCullPlugin/index.d.ts +1 -0
  54. package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +230 -0
  55. package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -0
  56. package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +277 -0
  57. package/types/plugins/XKTLoaderPlugin/index.d.ts +1 -0
  58. package/types/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.d.ts +65 -0
  59. package/types/plugins/XML3DLoaderPlugin/index.d.ts +1 -0
  60. package/types/plugins/index.d.ts +34 -0
  61. package/types/viewer/Configs.d.ts +20 -0
  62. package/types/viewer/Plugin.d.ts +69 -0
  63. package/types/viewer/Viewer.d.ts +212 -0
  64. package/types/viewer/index.d.ts +6 -0
  65. package/types/viewer/localization/LocaleService.d.ts +183 -0
  66. package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -0
  67. package/types/viewer/metadata/MetaModel.d.ts +65 -0
  68. package/types/viewer/metadata/MetaObject.d.ts +74 -0
  69. package/types/viewer/metadata/MetaScene.d.ts +135 -0
  70. package/types/viewer/metadata/Property.d.ts +29 -0
  71. package/types/viewer/metadata/PropertySet.d.ts +31 -0
  72. package/types/viewer/metadata/index.d.ts +6 -0
  73. package/types/viewer/scene/CameraControl/CameraControl.d.ts +681 -0
  74. package/types/viewer/scene/Component.d.ts +155 -0
  75. package/types/viewer/scene/Entity.d.ts +394 -0
  76. package/types/viewer/scene/camera/Camera.d.ts +364 -0
  77. package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -0
  78. package/types/viewer/scene/camera/CameraPath.d.ts +28 -0
  79. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -0
  80. package/types/viewer/scene/camera/CustomProjection.d.ts +57 -0
  81. package/types/viewer/scene/camera/Frustum.d.ts +166 -0
  82. package/types/viewer/scene/camera/Ortho.d.ts +115 -0
  83. package/types/viewer/scene/camera/Perspective.d.ts +136 -0
  84. package/types/viewer/scene/camera/index.d.ts +4 -0
  85. package/types/viewer/scene/geometry/Geometry.d.ts +7 -0
  86. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -0
  87. package/types/viewer/scene/geometry/index.d.ts +1 -0
  88. package/types/viewer/scene/index.d.ts +17 -0
  89. package/types/viewer/scene/marker/Marker.d.ts +136 -0
  90. package/types/viewer/scene/marker/index.d.ts +1 -0
  91. package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -0
  92. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -0
  93. package/types/viewer/scene/materials/Fresnel.d.ts +148 -0
  94. package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -0
  95. package/types/viewer/scene/materials/Material.d.ts +3 -0
  96. package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -0
  97. package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -0
  98. package/types/viewer/scene/materials/Texture.d.ts +260 -0
  99. package/types/viewer/scene/materials/index.d.ts +6 -0
  100. package/types/viewer/scene/math/math.d.ts +56 -0
  101. package/types/viewer/scene/mementos/CameraMemento.d.ts +28 -0
  102. package/types/viewer/scene/mementos/ModelMemento.d.ts +44 -0
  103. package/types/viewer/scene/mementos/ObjectsMemento.d.ts +39 -0
  104. package/types/viewer/scene/mementos/index.d.ts +3 -0
  105. package/types/viewer/scene/mesh/Mesh.d.ts +786 -0
  106. package/types/viewer/scene/mesh/index.d.ts +1 -0
  107. package/types/viewer/scene/models/PerformanceModel/PerformanceModel.d.ts +622 -0
  108. package/types/viewer/scene/models/PerformanceModel/PerformanceNode.d.ts +302 -0
  109. package/types/viewer/scene/models/PerformanceModel/index.d.ts +2 -0
  110. package/types/viewer/scene/models/index.d.ts +1 -0
  111. package/types/viewer/scene/nodes/Node.d.ts +664 -0
  112. package/types/viewer/scene/nodes/index.d.ts +1 -0
  113. package/types/viewer/scene/postfx/SAO.d.ts +209 -0
  114. package/types/viewer/scene/scene/Scene.d.ts +771 -0
  115. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +93 -0
  116. package/types/viewer/scene/sectionPlane/index.d.ts +1 -0
  117. package/types/viewer/scene/viewport/Viewport.d.ts +23 -0
  118. package/types/viewer/scene/viewport/index.d.ts +1 -0
  119. package/types/viewer/scene/webgl/PickResult.d.ts +103 -0
  120. package/types/viewer/scene/webgl/index.d.ts +1 -0
@@ -0,0 +1,180 @@
1
+ import { PickResult } from "../../viewer/scene/webgl/PickResult";
2
+ import { Plugin, Viewer } from "../../viewer";
3
+ import { Storey } from "./Storey";
4
+ import { StoreyMap } from "./StoreyMap";
5
+
6
+ export declare type IFCStoreyPlanObjectStates = {
7
+ [key: string] : {
8
+ visible: boolean;
9
+ edges?: boolean;
10
+ colorize?: number[]
11
+ }
12
+ };
13
+
14
+ export declare type StoreyViewsPluginConfiguration = {
15
+ /** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
16
+ id?: string;
17
+ /** Map of visual states for the {@link Entity}s as rendered within each {@link Storey}. Default value is {@link IFCStoreyPlanObjectStates}. */
18
+ objectStates?: IFCStoreyPlanObjectStates;
19
+ };
20
+
21
+ /**
22
+ * A {@link Viewer} plugin that provides methods for visualizing IfcBuildingStoreys.
23
+ */
24
+ export declare class StoreyViewsPlugin extends Plugin {
25
+ /**
26
+ * @constructor
27
+ *
28
+ * @param {Viewer} viewer The Viewer.
29
+ * @param {StoreyViewsPluginConfiguration} cfg Plugin configuration.
30
+ */
31
+ constructor(viewer: Viewer, cfg?: StoreyViewsPluginConfiguration);
32
+
33
+ /**
34
+ * A {@link Storey} for each ````IfcBuildingStorey```.
35
+ *
36
+ * There will be a {@link Storey} for every existing {@link MetaObject} whose {@link MetaObject.type} equals "IfcBuildingStorey".
37
+ *
38
+ * These are created and destroyed automatically as models are loaded and destroyed.
39
+ *
40
+ * @type {{String:Storey}}
41
+ */
42
+ storeys: {[key: string]: Storey };
43
+
44
+ /**
45
+ * A set of {@link Storey}s for each {@link MetaModel}.
46
+ *
47
+ * These are created and destroyed automatically as models are loaded and destroyed.
48
+ *
49
+ * @type {{String: {String:Storey}}}
50
+ */
51
+ modelStoreys: {[key: string]: { [key: string]: Storey} };
52
+
53
+ /**
54
+ * Sets map of visual states for the {@link Entity}s as rendered within each {@link Storey}.
55
+ *
56
+ * Default value is {@link IFCStoreyPlanObjectStates}.
57
+ *
58
+ * @type {IFCStoreyPlanObjectStates}
59
+ */
60
+ set objectStates(arg: IFCStoreyPlanObjectStates);
61
+
62
+ /**
63
+ * Gets map of visual states for the {@link Entity}s as rendered within each {@link Storey}.
64
+ *
65
+ * Default value is {@link IFCStoreyPlanObjectStates}.
66
+ *
67
+ * @type {IFCStoreyPlanObjectStates}
68
+ */
69
+ get objectStates(): IFCStoreyPlanObjectStates;
70
+
71
+ /**
72
+ * Arranges the {@link Camera} for a 3D orthographic view of the {@link Entity}s within the given storey.
73
+ *
74
+ * See also: {@link CameraMemento}, which saves and restores the state of the {@link Scene}'s {@link Camera}
75
+ *
76
+ * @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
77
+ * @param {*} [options] Options for arranging the Camera.
78
+ * @param {String} [options.projection] Projection type to transition the Camera to. Accepted values are "perspective" and "ortho".
79
+ * @param {Function} [options.done] Callback to fire when the Camera has arrived. When provided, causes an animated flight to the saved state. Otherwise jumps to the saved state.
80
+ */
81
+ gotoStoreyCamera(storeyId: string, options?: {
82
+ projection?: string;
83
+ done?: Function
84
+ }): void;
85
+
86
+ /**
87
+ * Shows the {@link Entity}s within the given storey.
88
+ *
89
+ * Optionally hides all other Entitys.
90
+ *
91
+ * Optionally sets the visual appearance of each of the Entitys according to its IFC type. The appearance of
92
+ * IFC types in plan views is configured by {@link StoreyViewsPlugin.objectStates}.
93
+ *
94
+ * See also: {@link ObjectsMemento}, which saves and restores a memento of the visual state
95
+ * of the {@link Entity}'s that represent objects within a {@link Scene}.
96
+ *
97
+ * @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
98
+ * @param {*} [options] Options for showing the Entitys within the storey.
99
+ * @param {Boolean} [options.hideOthers=false] When ````true````, hide all other {@link Entity}s.
100
+ * @param {Boolean} [options.useObjectStates=false] When ````true````, apply the custom visibilities and appearances configured for IFC types in {@link StoreyViewsPlugin.objectStates}.
101
+ */
102
+ showStoreyObjects(storeyId: string, options?: {
103
+ hideOthers?: boolean;
104
+ useObjectStates?: boolean
105
+ }): void;
106
+
107
+ /**
108
+ * Executes a callback on each of the objects within the given storey.
109
+ *
110
+ *
111
+ * @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
112
+ * @param {Function} callback The callback.
113
+ */
114
+ withStoreyObjects(storeyId: string, callback: Function): void;
115
+
116
+ /**
117
+ * Creates a 2D map of the given storey.
118
+ *
119
+ * @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
120
+ * @param {*} [options] Options for creating the image.
121
+ * @param {Number} [options.width=300] Image width in pixels. Height will be automatically determined from this, if not given.
122
+ * @param {Number} [options.height=300] Image height in pixels, as an alternative to width. Width will be automatically determined from this, if not given.
123
+ * @param {String} [options.format="png"] Image format. Accepted values are "png" and "jpeg".
124
+ * @returns {StoreyMap} The StoreyMap.
125
+ */
126
+ createStoreyMap(storeyId: string, options?: {
127
+ width?: number;
128
+ height?: number;
129
+ format?: "png" | "jpeg";
130
+ }): StoreyMap;
131
+
132
+ /**
133
+ * Attempts to pick an {@link Entity} at the given pixel coordinates within a StoreyMap image.
134
+ *
135
+ * @param {StoreyMap} storeyMap The StoreyMap.
136
+ * @param {Number[]} imagePos 2D pixel coordinates within the bounds of {@link StoreyMap.imageData}.
137
+ * @param {*} [options] Picking options.
138
+ * @param {Boolean} [options.pickSurface=false] Whether to return the picked position on the surface of the Entity.
139
+ * @returns {PickResult} The pick result, if an Entity was successfully picked, else null.
140
+ */
141
+ pickStoreyMap(storeyMap: StoreyMap, imagePos: number[], options?: {
142
+ pickSurface?: boolean;
143
+ }): PickResult;
144
+
145
+ /**
146
+ * Gets the ID of the storey that contains the given 3D World-space position.
147
+ *.
148
+ * @param {Number[]} worldPos 3D World-space position.
149
+ * @returns {String} ID of the storey containing the position, or null if the position falls outside all the storeys.
150
+ */
151
+ getStoreyContainingWorldPos(worldPos: number[]): string;
152
+
153
+ /**
154
+ * Converts a 3D World-space position to a 2D position within a StoreyMap image.
155
+ *
156
+ * Use {@link StoreyViewsPlugin.pickStoreyMap} to convert 2D image positions to 3D world-space.
157
+ *
158
+ * @param {StoreyMap} storeyMap The StoreyMap.
159
+ * @param {Number[]} worldPos 3D World-space position within the storey.
160
+ * @param {Number[]} imagePos 2D pixel position within the {@link StoreyMap.imageData}.
161
+ * @returns {Boolean} True if ````imagePos```` is within the bounds of the {@link StoreyMap.imageData}, else ````false```` if it falls outside.
162
+ */
163
+ worldPosToStoreyMap(storeyMap: StoreyMap, worldPos: number[], imagePos: number[]): boolean;
164
+
165
+ /**
166
+ * Converts a 3D World-space direction vector to a 2D vector within a StoreyMap image.
167
+ *
168
+ * @param {StoreyMap} storeyMap The StoreyMap.
169
+ * @param {Number[]} worldDir 3D World-space direction vector.
170
+ * @param {Number[]} imageDir Normalized 2D direction vector.
171
+ */
172
+ worldDirToStoreyMap(storeyMap: StoreyMap, worldDir: number[], imageDir: number[]): void;
173
+
174
+ /**
175
+ * Fires when the storeys are updated (after a model is added or removed).
176
+ * @param {String} event The storeys event
177
+ * @param {Function} callback Callback fired on the event
178
+ */
179
+ on(event: "storeys", callback: (storyes: {[key: string]: Storey })=> void): void;
180
+ }
@@ -0,0 +1 @@
1
+ export * from "./StoreyViewsPlugin";
@@ -0,0 +1,24 @@
1
+ import { MetaModel } from "../../viewer/metadata";
2
+
3
+ /**
4
+ * Represents a model tree view within a {@link TreeViewPlugin}.
5
+ */
6
+ export declare class ModelTreeView {
7
+ /**
8
+ * Contains messages for any errors found in the MetaModel for this ModelTreeView.
9
+ * @type {String[]}
10
+ */
11
+ errors: string[];
12
+
13
+ /**
14
+ * True if errors were found in the MetaModel for this ModelTreeView.
15
+ * @type {boolean}
16
+ */
17
+ valid: boolean;
18
+
19
+ /**
20
+ * The MetaModel corresponding to this ModelTreeView.
21
+ * @type {MetaModel}
22
+ */
23
+ metaModel: MetaModel;
24
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * A node within a {@link TreeViewPlugin}.
3
+ */
4
+ export declare class TreeViewNode {
5
+ /**
6
+ * Globally unique node ID.
7
+ *
8
+ * @type {String}
9
+ * @abstract
10
+ */
11
+ get nodeId(): string;
12
+
13
+ /**
14
+ * Title of the TreeViewNode.
15
+ *
16
+ * @type {String}
17
+ * @abstract
18
+ */
19
+ get title(): string;
20
+
21
+ /**
22
+ * ID of the corresponding {@link MetaObject}.
23
+ *
24
+ * This is only defined if the TreeViewNode represents an object.
25
+ *
26
+ * @type {Number|String}
27
+ * @abstract
28
+ */
29
+ get objectId(): string | number;
30
+
31
+ /**
32
+ * The child TreeViewNodes.
33
+ *
34
+ * @type {Array}
35
+ * @abstract
36
+ */
37
+ get children(): any[];
38
+
39
+ /** The parent TreeViewNode.
40
+ *
41
+ * @type {TreeViewNode}
42
+ * @abstract
43
+ */
44
+ get parent(): TreeViewNode;
45
+
46
+ /** The number of {@link Entity}s within the subtree of this TreeViewNode.
47
+ *
48
+ * @type {Number}
49
+ * @abstract
50
+ */
51
+ get numEntities(): number;
52
+
53
+ /** The number of {@link Entity}s that are currently visible within the subtree of this TreeViewNode.
54
+ *
55
+ * @type {Number}
56
+ * @abstract
57
+ */
58
+ get numVisibleEntities(): number;
59
+
60
+ /** Whether or not the TreeViewNode is currently checked.
61
+ *
62
+ * @type {Boolean}
63
+ * @abstract
64
+ */
65
+ get checked(): boolean;
66
+ }
@@ -0,0 +1,150 @@
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
+
137
+ /**
138
+ * Fires on right click to show contextmenu.
139
+ * @param {String} event The contextmenu event
140
+ * @param {Function} callback Callback fired on the event
141
+ */
142
+ on(event: "contextmenu", callback: (data: {event: MouseEvent, viewer: Viewer, treeViewPlugin: TreeViewPlugin, treeViewNode: TreeViewNode })=> void): void;
143
+
144
+ /**
145
+ * Fires when an title is clicked.
146
+ * @param {String} event The nodeTitleClicked event
147
+ * @param {Function} callback Callback fired on the event
148
+ */
149
+ on(event: "nodeTitleClicked", callback: (data: {event: MouseEvent, viewer: Viewer, treeViewPlugin: TreeViewPlugin, treeViewNode: TreeViewNode })=> void): void;
150
+ }
@@ -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 declare 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
+ }