@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 @@
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";
@@ -0,0 +1,65 @@
1
+ import { Plugin, Viewer, PerformanceModel } from "../../viewer";
2
+
3
+ export declare type XML3DLoaderPluginConfiguration = {
4
+ /** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
5
+ id?: string;
6
+ /** Path to the directory that contains the bundled [zip.js](https://gildas-lormeau.github.io/zip.js/) archive */
7
+ workerScriptsPath: string;
8
+ /** What type of materials to create while loading */
9
+ materialType?: "MetallicMaterial" | "SpecularMaterial" | "PhongMaterial";
10
+ /** When true, will create a {@link MetaModel} for the model in {@link MetaScene.metaModels}. */
11
+ createMetaModel?: boolean;
12
+ }
13
+
14
+ export declare type LoadXML3DModel = {
15
+ /** ID to assign to the model's root {@link Entity}, unique among all components in the Viewer's {@link Scene}. */
16
+ id: string;
17
+ /** Path to a 3DXML file. */
18
+ src: string;
19
+ /** Whether or not xeokit renders the {@link Entity} with edges emphasized. */
20
+ edges?: boolean;
21
+ /** The model's World-space 3D position. */
22
+ position?: number[];
23
+ /** The model's World-space scale. */
24
+ scale?: number[];
25
+ /** The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis. */
26
+ rotation?: number[];
27
+ /** The model's world transform matrix. Overrides the position, scale and rotation parameters. */
28
+ matrix?: number[];
29
+ /** When true, allows visible backfaces, wherever specified in the 3DXML. When false, ignores backfaces. */
30
+ backfaces?: boolean;
31
+ /** When xraying, highlighting, selecting or edging, this is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn. */
32
+ edgeThreshold?: number;
33
+ /** What type of materials to create while loading: "MetallicMaterial" to create {@link MetallicMaterial}s, "SpecularMaterial" to create {@link SpecularMaterial}s or "PhongMaterial" to create {@link PhongMaterial}s. As it loads XML3D's Phong materials, the XMLLoaderPlugin will do its best approximate conversion of those to the specified workflow. */
34
+ materialType?: "MetallicMaterial" | "SpecularMaterial" | "PhongMaterial";
35
+ /** When true, will create a {@link MetaModel} for the model in {@link MetaScene.metaModels}. */
36
+ createMetaModel?: boolean;
37
+ };
38
+
39
+ /**
40
+ * {@link Viewer} plugin that loads models from [3DXML](https://en.wikipedia.org/wiki/3DXML) files.
41
+ */
42
+ export declare class XML3DLoaderPlugin extends Plugin {
43
+ /**
44
+ * @constructor
45
+ * @param {Viewer} viewer The Viewer.
46
+ * @param {XML3DLoaderPluginConfiguration} cfg Plugin configuration.
47
+ */
48
+ constructor(viewer: Viewer, cfg?:XML3DLoaderPluginConfiguration );
49
+
50
+ /**
51
+ * Supported 3DXML schema versions
52
+ * @type {string[]}
53
+ */
54
+ supportedSchemas: string[];
55
+
56
+ /**
57
+ * Loads a 3DXML model from a file into this XML3DLoaderPlugin's {@link Viewer}.
58
+ *
59
+ * Creates a tree of {@link Entity}s within the Viewer's {@link Scene} that represents the model.
60
+ *
61
+ * @param {LoadXML3DModel} params Loading parameters.
62
+ * @returns {Entity} Entity representing the model, which will have {@link Entity.isModel} set ````true```` and will be registered by {@link Entity.id} in {@link Scene.models}
63
+ */
64
+ load(params: LoadXML3DModel): PerformanceModel;
65
+ }
@@ -0,0 +1 @@
1
+ export * from "./XML3DLoaderPlugin";
@@ -0,0 +1,34 @@
1
+ export * from "./AngleMeasurementsPlugin";
2
+ export * from "./AnnotationsPlugin";
3
+ export * from "./AxisGizmoPlugin";
4
+ export * from "./BCFViewpointsPlugin";
5
+ export * from "./CityJSONLoaderPlugin";
6
+ export * from "./DistanceMeasurementsPlugin";
7
+ export * from "./FastNavPlugin";
8
+ export * from "./GLTFLoaderPlugin";
9
+ export * from "./LASLoaderPlugin";
10
+ export * from "./NavCubePlugin";
11
+ export * from "./OBJLoaderPlugin";
12
+ export * from "./SectionPlanesPlugin";
13
+ export * from "./SkyboxesPlugin";
14
+ export * from "./STLLoaderPlugin";
15
+ export * from "./StoreyViewsPlugin";
16
+ export * from "./TreeViewPlugin";
17
+ export * from "./ViewCullPlugin";
18
+ export * from "./XKTLoaderPlugin";
19
+ export * from "./WebIFCLoaderPlugin";
20
+ export * from "./XML3DLoaderPlugin";
21
+
22
+ export declare type ModelStats = {
23
+ sourceFormat: string;
24
+ schemaVersion: string;
25
+ title: string;
26
+ author: string;
27
+ created: string;
28
+ numMetaObjects: number;
29
+ numPropertySets: number;
30
+ numObjects: number;
31
+ numGeometries: number;
32
+ numTriangles: number;
33
+ numVertices: number;
34
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Manages global configurations for all {@link Viewer}s.
3
+ */
4
+ export declare abstract class Configs {
5
+ /**
6
+ * Sets whether double precision mode is enabled for Viewers.
7
+ *
8
+ * When double precision mode is enabled (default), Viewers will accurately render models that contain
9
+ * double-precision coordinates, without jittering.
10
+ *
11
+ */
12
+ set doublePrecisionEnabled(doublePrecision: boolean);
13
+
14
+ /**
15
+ * Gets whether double precision mode is enabled for all Viewers.
16
+ *
17
+ * @returns {boolean}
18
+ */
19
+ get doublePrecisionEnabled(): boolean;
20
+ }
@@ -0,0 +1,69 @@
1
+ import { Viewer } from "./Viewer";
2
+
3
+ /**
4
+ @desc Base class for {@link Viewer} plugin classes.
5
+ */
6
+ export declare abstract class Plugin {
7
+ /**
8
+ * Creates this Plugin and installs it into the given {@link Viewer}.
9
+ *
10
+ * @param {string} id ID for this plugin, unique among all plugins in the viewer.
11
+ * @param {Viewer} viewer The viewer.
12
+ * @param {Object} [cfg] Options
13
+ */
14
+ constructor(id: string, viewer: Viewer, cfg?: {});
15
+
16
+ /**
17
+ * ID for this Plugin, unique within its {@link Viewer}.
18
+ *
19
+ * @type {string}
20
+ */
21
+ id: string;
22
+
23
+ /**
24
+ * The Viewer that contains this Plugin.
25
+ *
26
+ * @type {Viewer}
27
+ */
28
+ viewer: Viewer;
29
+
30
+ /**
31
+ * Subscribes to an event fired at this Plugin.
32
+ * @param {String} event The event
33
+ * @param {Function} callback Callback fired on the event
34
+ */
35
+ on(event: string, callback: ()=> void): void;
36
+
37
+ /**
38
+ * Fires an event at this Plugin.
39
+ * @param {String} event The event type name
40
+ * @param {Object} value The event parameters
41
+ */
42
+ fire(event: string, value: any): void;
43
+
44
+ /**
45
+ * Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.
46
+ *
47
+ * @param {String} msg The error message
48
+ */
49
+ log(msg: string): void;
50
+
51
+ /**
52
+ * Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin.
53
+ *
54
+ * @param {String} msg The error message
55
+ */
56
+ warn(msg: string): void;
57
+
58
+ /**
59
+ * Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.
60
+ *
61
+ * @param {String} msg The error message
62
+ */
63
+ error(msg: string): void;
64
+
65
+ /**
66
+ * Destroys this Plugin and removes it from its {@link Viewer}.
67
+ */
68
+ destroy(): void;
69
+ }
@@ -0,0 +1,212 @@
1
+ import { LocaleService } from "./localization/LocaleService";
2
+ import { Scene } from "./scene/scene/Scene";
3
+ import { MetaScene } from "./metadata/MetaScene";
4
+ import { Camera } from "./scene/camera/Camera";
5
+ import { CameraFlightAnimation } from "./scene/camera/CameraFlightAnimation";
6
+ import { CameraControl } from "./scene/CameraControl/CameraControl";
7
+ import { Plugin } from "./Plugin";
8
+
9
+ export declare type ViewerConfiguration = {
10
+ /** Optional ID for this Viewer, defaults to the ID of {@link Viewer.scene}, which xeokit automatically generates. */
11
+ id?: string;
12
+ /** ID of an existing HTML canvas for the {@link Viewer.scene} - either this or canvasElement is mandatory. When both values are given, the element reference is always preferred to the ID. */
13
+ canvasId?: string;
14
+ /** Reference of an existing HTML canvas for the {@link Viewer.scene} - either this or canvasId is mandatory. When both values are given, the element reference is always preferred to the ID. */
15
+ canvasElement?: HTMLCanvasElement;
16
+ /** Optional reference to HTML element on which key events should be handled. Defaults to the HTML Document. */
17
+ keyboardEventsElement?: HTMLElement;
18
+ /** ID of existing HTML element to show the {@link Spinner} - internally creates a default element automatically if this is omitted. */
19
+ spinnerElementId?: string;
20
+ /** The number of times the {@link Viewer.scene} renders per frame. */
21
+ passes?: number;
22
+ /** When doing multiple passes per frame, specifies if to clear the canvas before each pass (true) or just before the first pass (false). */
23
+ clearEachPass?: boolean;
24
+ /** Whether or not to preserve the WebGL drawing buffer. This needs to be ````true```` for {@link Viewer.getSnapshot} to work.*/
25
+ preserveDrawingBuffer?: boolean;
26
+ /** Whether or not the canvas is transparent. */
27
+ transparent?: boolean;
28
+ /** Whether or not you want alpha composition with premultiplied alpha. Highlighting and selection works best when this is ````false````. */
29
+ premultipliedAlpha?: boolean;
30
+ /** When true, expects that all textures and colors are premultiplied gamma. */
31
+ gammaInput?: boolean;
32
+ /** Whether or not to render with pre-multiplied gama. */
33
+ gammaOutput?: boolean;
34
+ /** The gamma factor to use when rendering with pre-multiplied gamma. */
35
+ gammaFactor?: number;
36
+ /** Sets the canvas background color to use when ````transparent```` is false. */
37
+ backgroundColor?: number[];
38
+ /**When ````transparent```` is false, set this ````true```` to derive the canvas background color from {@link AmbientLight.color}, or ````false```` to set the canvas background to ````backgroundColor````. */
39
+ backgroundColorFromAmbientLight?: boolean;
40
+ /** The measurement unit type. */
41
+ units?: "meters" | "centimeters" | "millimeters" | "yards" | "feet" | "inches" ;
42
+ /** The number of Real-space units in each World-space coordinate system unit. */
43
+ scale?: number;
44
+ /** The Real-space 3D origin, in current measurement units, at which the World-space coordinate origin ````[0,0,0]```` sits. */
45
+ origin?: number[];
46
+ /** Whether to enable Scalable Ambient Obscurance (SAO) effect. See {@link SAO} for more info. */
47
+ saoEnabled?: boolean;
48
+ /** Whether to enable anti-aliasing. */
49
+ antialias?: boolean;
50
+ /** Whether writing into the depth buffer is enabled or disabled when rendering transparent objects. */
51
+ alphaDepthMask?: boolean;
52
+ /** Whether to enable {@link Entity.offset}. For best performance, only set this ````true```` when you need to use {@link Entity.offset}. */
53
+ entityOffsetsEnabled?: boolean;
54
+ /** Whether to enable full-precision accuracy when surface picking with {@link Scene.pick}. */
55
+ pickSurfacePrecisionEnabled?: boolean;
56
+ /** Whether to enable logarithmic depth buffer. */
57
+ logarithmicDepthBufferEnabled?: boolean;
58
+ /** Whether to enable physically-based rendering. */
59
+ pbrEnabled?: boolean;
60
+ /** Optional locale-based translation service. */
61
+ localeService?: LocaleService;
62
+ };
63
+
64
+ /**
65
+ * The 3D Viewer at the heart of the xeokit SDK.
66
+ */
67
+ export declare class Viewer {
68
+ /**
69
+ * @constructor
70
+ * @param {ViewerConfiguration} cfg Viewer configuration.
71
+ */
72
+ constructor(cfg: ViewerConfiguration);
73
+
74
+ /**
75
+ * The viewer's locale service.
76
+ *
77
+ * This is configured via the Viewer's constructor.
78
+ *
79
+ * By default, this service will be an instance of {@link LocaleService}, which will just return
80
+ * null translations for all given strings and phrases.
81
+ *
82
+ * @property localeService
83
+ * @type {LocaleService}
84
+ * @since 2.0
85
+ */
86
+ localeService: LocaleService;
87
+
88
+ /**
89
+ * The Viewer's {@link Scene}.
90
+ * @property scene
91
+ * @type {Scene}
92
+ */
93
+ scene: Scene;
94
+
95
+ /**
96
+ * Metadata about the {@link Scene} and the models and objects within it.
97
+ * @property metaScene
98
+ * @type {MetaScene}
99
+ * @readonly
100
+ */
101
+ readonly metaScene: MetaScene;
102
+
103
+ /**
104
+ * The Viewer's ID.
105
+ * @property id
106
+ *
107
+ * @type {String|Number}
108
+ */
109
+ id: string | number;
110
+
111
+ /**
112
+ * The Viewer's {@link Camera}. This is also found on {@link Scene.camera}.
113
+ * @property camera
114
+ * @type {Camera}
115
+ */
116
+ camera: Camera;
117
+
118
+ /**
119
+ * The Viewer's {@link CameraFlightAnimation}, which
120
+ * is used to fly the {@link Scene}'s {@link Camera} to given targets.
121
+ * @property cameraFlight
122
+ * @type {CameraFlightAnimation}
123
+ */
124
+ cameraFlight: CameraFlightAnimation;
125
+
126
+ /**
127
+ * The Viewer's {@link CameraControl}, which
128
+ * controls the {@link Scene}'s {@link Camera} with mouse, touch and keyboard input.
129
+ * @property cameraControl
130
+ * @type {CameraControl}
131
+ */
132
+ cameraControl: CameraControl;
133
+
134
+ /**
135
+ * Subscribes to an event fired at this Viewer.
136
+ *
137
+ * @param {String} event The event
138
+ * @param {Function} callback Callback fired on the event
139
+ */
140
+ on(event: string, callback: Function): void;
141
+
142
+ /**
143
+ * Fires an event at this Viewer.
144
+ *
145
+ * @param {String} event Event name
146
+ * @param {Object} value Event parameters
147
+ */
148
+ fire(event: string, value: any): void;
149
+
150
+ /**
151
+ * Logs a message to the JavaScript developer console, prefixed with the ID of this Viewer.
152
+ *
153
+ * @param {String} msg The message
154
+ */
155
+ log(msg: string): void;
156
+
157
+ /**
158
+ * Logs an error message to the JavaScript developer console, prefixed with the ID of this Viewer.
159
+ *
160
+ * @param {String} msg The error message
161
+ */
162
+ error(msg: string): void;
163
+
164
+ /**
165
+ * Installs a Plugin.
166
+ *
167
+ * @private
168
+ */
169
+ addPlugin(plugin: Plugin): void;
170
+
171
+ /**
172
+ * Enter snapshot mode.
173
+ *
174
+ * Switches rendering to a hidden snapshot canvas.
175
+ *
176
+ * Exit snapshot mode using {@link Viewer.endSnapshot}.
177
+ */
178
+ beginSnapshot(): void;
179
+
180
+ /**
181
+ * Gets a snapshot of this Viewer's {@link Scene} as a Base64-encoded image.
182
+ *
183
+ * #### Usage:
184
+ *
185
+ * ````javascript
186
+ * const imageData = viewer.getSnapshot({
187
+ * width: 500,
188
+ * height: 500,
189
+ * format: "png"
190
+ * });
191
+ * ````
192
+ * @param {*} [params] Capture options.
193
+ * @param {Number} [params.width] Desired width of result in pixels - defaults to width of canvas.
194
+ * @param {Number} [params.height] Desired height of result in pixels - defaults to height of canvas.
195
+ * @param {String} [params.format="jpeg"] Desired format; "jpeg", "png" or "bmp".
196
+ * @param {Boolean} [params.includeGizmos=false] When true, will include gizmos like {@link SectionPlane} in the snapshot.
197
+ * @returns {String} String-encoded image data URI.
198
+ */
199
+ getSnapshot(params: { width?: number, height?: number, format?: "jpeg" | "png"| "bmp", includeGizmos?: boolean }): string;
200
+
201
+ /**
202
+ * Exits snapshot mode.
203
+ *
204
+ * Switches rendering back to the main canvas.
205
+ *
206
+ */
207
+ endSnapshot(): void;
208
+
209
+ /** Destroys this Viewer.
210
+ */
211
+ destroy(): void;
212
+ }