@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,44 @@
1
+ import { Plugin, Viewer, PerformanceModel } from "../../viewer";
2
+
3
+ export declare type LoadOBJModel = {
4
+ /** ID to assign to the model's root {@link Entity}, unique among all components in the Viewer's {@link Scene}. */
5
+ id: string;
6
+ /** Path to an OBJ file. */
7
+ src: string;
8
+ /** Path to an optional metadata file. */
9
+ metaModelSrc?: string;
10
+ /** The model World-space 3D position. */
11
+ position?: number[];
12
+ /** The model's World-space scale. */
13
+ scale?: number[];
14
+ /** The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis. */
15
+ rotation?: number[];
16
+ /** The model's world transform matrix. Overrides the position, scale and rotation parameters. */
17
+ matrix?: number[];
18
+ /** 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. */
19
+ edgeThreshold?: number;
20
+ };
21
+
22
+ /**
23
+ * {@link Viewer} plugin that loads models from [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) files.
24
+ */
25
+ export declare class OBJLoaderPlugin extends Plugin {
26
+ /**
27
+ * @constructor
28
+ *
29
+ * @param {Viewer} viewer The Viewer.
30
+ * @param {Object} cfg Plugin configuration.
31
+ * @param {String} [cfg.id="OBJLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
32
+ */
33
+ constructor(viewer: Viewer, cfg: {
34
+ id?: string;
35
+ });
36
+
37
+ /**
38
+ * Loads an OBJ model from a file into this OBJLoader's {@link Viewer}.
39
+ *
40
+ * @param {LoadOBJModel} params Loading parameters.
41
+ * @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}
42
+ */
43
+ load(params: LoadOBJModel): PerformanceModel;
44
+ }
@@ -0,0 +1 @@
1
+ export * from "./OBJLoaderPlugin";
@@ -0,0 +1,88 @@
1
+ import { Plugin, Viewer, PerformanceModel } from "../../viewer";
2
+
3
+ export declare interface ISTLDefaultDataSource {
4
+ /**
5
+ * Gets STL data.
6
+ *
7
+ * @param {String|Number} src Identifies the STL file.
8
+ * @param {Function} ok Fired on successful loading of the STL file.
9
+ * @param {Function} error Fired on error while loading the STL file.
10
+ */
11
+ getSTL(src: string | number, ok: Function, error: Function): void;
12
+ }
13
+
14
+ export declare type STLLoaderPluginCOnfiguration = {
15
+ /** Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}. */
16
+ id?: string;
17
+ /** A custom data source through which the STLLoaderPlugin can load STL files. Defaults to an instance of {@link STLDefaultDataSource}, which loads over HTTP. */
18
+ dataSource?: ISTLDefaultDataSource;
19
+ };
20
+
21
+ export declare type LoadSTLModel = {
22
+ /** ID to assign to the model's root {@link Entity}, unique among all components in the Viewer's {@link Scene}. */
23
+ id: string;
24
+ /** Path to an STL file. Overrides the ````stl```` parameter. */
25
+ src?: string;
26
+ /** Contents of an STL file, either binary of ASCII. Overridden by the ````src```` parameter. */
27
+ stl?: string;
28
+ /** Whether or not to renders the model with edges emphasized. */
29
+ edges?: boolean;
30
+ /** 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. */
31
+ origin?: number[];
32
+ /** The model single-precision 3D position, relative to the ````origin```` parameter. */
33
+ position?: number[];
34
+ /** The model's scale. */
35
+ scale?: number[];
36
+ /** The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis. */
37
+ rotation?: number[];
38
+ /** The model's world transform matrix. Overrides the position, scale and rotation parameters. */
39
+ matrix?: number[];
40
+ /** When true, allows visible backfaces, wherever specified in the 3DXML. When false, ignores backfaces. */
41
+ backfaces?: boolean;
42
+ /** When true, automatically converts face-oriented normals to vertex normals for a smooth appearance. */
43
+ smoothNormals?: boolean;
44
+ /** 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. */
45
+ smoothNormalsAngleThreshold?: number;
46
+ /** 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. */
47
+ edgeThreshold?: number;
48
+ /** When true, creates a separate {@link Mesh} for each group of faces that share the same vertex colors. Only works with binary STL. */
49
+ splitMeshes?: boolean;
50
+ };
51
+
52
+ /**
53
+ * {@link Viewer} plugin that loads models from <a href="https://en.wikipedia.org/wiki/STL_(file_format)">STL</a> files.
54
+ */
55
+ export declare class STLLoaderPlugin extends Plugin {
56
+ /**
57
+ * @constructor
58
+ * @param {Viewer} viewer The Viewer.
59
+ * @param {STLLoaderPluginCOnfiguration} [cfg] Plugin configuration.
60
+ */
61
+ constructor(viewer: Viewer, cfg?: STLLoaderPluginCOnfiguration);
62
+
63
+ /**
64
+ * Sets a custom data source through which the STLLoaderPlugin can load STL files.
65
+ *
66
+ * Default value is {@link STLDefaultDataSource}, which loads via an XMLHttpRequest.
67
+ *
68
+ * @type {ISTLDefaultDataSource}
69
+ */
70
+ set dataSource(arg: ISTLDefaultDataSource);
71
+
72
+ /**
73
+ * Gets the custom data source through which the STLLoaderPlugin can load STL files.
74
+ *
75
+ * Default value is {@link STLDefaultDataSource}, which loads via an XMLHttpRequest.
76
+ *
77
+ * @type {ISTLDefaultDataSource}
78
+ */
79
+ get dataSource(): ISTLDefaultDataSource;
80
+
81
+ /**
82
+ * Loads an STL model from a file into this STLLoaderPlugin's {@link Viewer}.
83
+ *
84
+ * @param {LoadSTLModel} params Loading parameters.
85
+ * @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}
86
+ */
87
+ load(params: LoadSTLModel): PerformanceModel;
88
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./STLDefaultDataSource.js";
2
+ export * from "./STLLoaderPlugin";
@@ -0,0 +1,103 @@
1
+ import { Plugin, Viewer } from "../../viewer";
2
+ import { SectionPlane } from "../../viewer/scene/sectionPlane";
3
+
4
+ export declare type SectionPlanesPluginConfiguration = {
5
+ /** Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}. */
6
+ id?: string;
7
+ /** ID of a canvas element to display the overview. */
8
+ overviewCanvasId?: string;
9
+ /** Initial visibility of the overview canvas. */
10
+ overviewVisible?: string;
11
+ };
12
+
13
+ /**
14
+ * SectionPlanesPlugin is a {@link Viewer} plugin that manages {@link SectionPlane}s.
15
+ */
16
+ export declare class SectionPlanesPlugin extends Plugin {
17
+ /**
18
+ * @constructor
19
+ * @param {Viewer} viewer The Viewer.
20
+ * @param {SectionPlanesPluginConfiguration} cfg Plugin configuration.
21
+ */
22
+ constructor(viewer: Viewer, cfg?: SectionPlanesPluginConfiguration);
23
+
24
+ /**
25
+ * Sets if the overview canvas is visible.
26
+ *
27
+ * @param {Boolean} visible Whether or not the overview canvas is visible.
28
+ */
29
+ setOverviewVisible(visible: boolean): void;
30
+
31
+ /**
32
+ * Gets if the overview canvas is visible.
33
+ *
34
+ * @return {Boolean} True when the overview canvas is visible.
35
+ */
36
+ getOverviewVisible(): boolean;
37
+
38
+ /**
39
+ * Returns a map of the {@link SectionPlane}s created by this SectionPlanesPlugin.
40
+ *
41
+ * @returns {{String:SectionPlane}} A map containing the {@link SectionPlane}s, each mapped to its {@link SectionPlane#id}.
42
+ */
43
+ get sectionPlanes(): { [key:string]: SectionPlane };
44
+
45
+ /**
46
+ * Creates a {@link SectionPlane}.
47
+ *
48
+ * The {@link SectionPlane} will be registered by {@link SectionPlane#id} in {@link SectionPlanesPlugin#sectionPlanes}.
49
+ *
50
+ * @param {Object} params {@link SectionPlane} configuration.
51
+ * @param {String} [params.id] Unique ID to assign to the {@link SectionPlane}. Must be unique among all components in the {@link Viewer}'s {@link Scene}. Auto-generated when omitted.
52
+ * @param {Number[]} [params.pos=[0,0,0]] World-space position of the {@link SectionPlane}.
53
+ * @param {Number[]} [params.dir=[0,0,-1]] World-space vector indicating the orientation of the {@link SectionPlane}.
54
+ * @param {Boolean} [params.active=true] Whether the {@link SectionPlane} is initially active. Only clips while this is true.
55
+ * @returns {SectionPlane} The new {@link SectionPlane}.
56
+ */
57
+ createSectionPlane(params?: {
58
+ id?: string;
59
+ pos?: number[];
60
+ dir?: number[];
61
+ active?: boolean;
62
+ }): SectionPlane;
63
+
64
+ /**
65
+ * Inverts the direction of {@link SectionPlane#dir} on every existing SectionPlane.
66
+ *
67
+ * Inverts all SectionPlanes, including those that were not created with SectionPlanesPlugin.
68
+ */
69
+ flipSectionPlanes(): void;
70
+
71
+ /**
72
+ * Shows the 3D editing gizmo for a {@link SectionPlane}.
73
+ *
74
+ * @param {String} id ID of the {@link SectionPlane}.
75
+ */
76
+ showControl(id: string): void;
77
+
78
+ /**
79
+ * Gets the ID of the {@link SectionPlane} that the 3D editing gizmo is shown for.
80
+ *
81
+ * Returns ````null```` when the editing gizmo is not shown.
82
+ *
83
+ * @returns {String} ID of the the {@link SectionPlane} that the 3D editing gizmo is shown for, if shown, else ````null````.
84
+ */
85
+ getShownControl(): string;
86
+
87
+ /**
88
+ * Hides the 3D {@link SectionPlane} editing gizmo if shown.
89
+ */
90
+ hideControl(): void;
91
+
92
+ /**
93
+ * Destroys a {@link SectionPlane} created by this SectionPlanesPlugin.
94
+ *
95
+ * @param {String} id ID of the {@link SectionPlane}.
96
+ */
97
+ destroySectionPlane(id: string): void;
98
+
99
+ /**
100
+ * Destroys all {@link SectionPlane}s created by this SectionPlanesPlugin.
101
+ */
102
+ clear(): void;
103
+ }
@@ -0,0 +1 @@
1
+ export * from "./SectionPlanesPlugin";
@@ -0,0 +1,34 @@
1
+ import { Plugin, Viewer } from "../../viewer";
2
+
3
+ /**
4
+ * {@link Viewer} plugin that manages skyboxes
5
+ */
6
+ export class SkyboxesPlugin extends Plugin {
7
+ /**
8
+ * @constructor
9
+ * @param {Viewer} viewer The Viewer.
10
+ */
11
+ constructor(viewer: Viewer);
12
+
13
+ /**
14
+ * Creates a skybox.
15
+ * @param {String} id Unique ID to assign to the skybox.
16
+ * @param {Object} params Skybox configuration.
17
+ * @param {Boolean} [params.active=true] Whether the skybox plane is initially active. Only skyboxes while this is true.
18
+ * @returns {Skybox} The new skybox.
19
+ */
20
+ createSkybox(id: string, params: {
21
+ active?: boolean;
22
+ }): any; //Skybox;
23
+
24
+ /**
25
+ * Destroys a skybox.
26
+ * @param id
27
+ */
28
+ destroySkybox(id: string): void;
29
+
30
+ /**
31
+ Destroys all skyboxes.
32
+ */
33
+ clear(): void;
34
+ }
@@ -0,0 +1 @@
1
+ export * from "./SkyboxesPlugin";
@@ -0,0 +1,47 @@
1
+ import { StoreyViewsPlugin } from "./StoreyViewsPlugin";
2
+
3
+ /**
4
+ * Information about an ````IfcBuildingStorey````.
5
+ */
6
+ export declare class Storey {
7
+ /**
8
+ * The {@link StoreyViewsPlugin} this Storey belongs to.
9
+ *
10
+ * @type {StoreyViewsPlugin}
11
+ */
12
+ plugin: StoreyViewsPlugin;
13
+
14
+ /**
15
+ * ID of the IfcBuildingStorey.
16
+ *
17
+ * This matches IDs of the IfcBuildingStorey's {@link MetaObject} and {@link Entity}.
18
+ *
19
+ * @type {String}
20
+ */
21
+ storeyId: string;
22
+
23
+ /**
24
+ * ID of the model.
25
+ *
26
+ * This matches the ID of the {@link MetaModel} that contains the IfcBuildingStorey's {@link MetaObject}.
27
+ *
28
+ * @type {String|Number}
29
+ */
30
+ modelId: string | number;
31
+
32
+ /**
33
+ * Axis-aligned World-space boundary of the {@link Entity}s that represent the IfcBuildingStorey.
34
+ *
35
+ * The boundary is a six-element Float32Array containing the min/max extents of the
36
+ * axis-aligned boundary, ie. ````[xmin, ymin, zmin, xmax, ymax, zmax]````
37
+ *
38
+ * @type {Number[]}
39
+ */
40
+ aabb: number[];
41
+
42
+ /** Number of {@link Entity}s within the IfcBuildingStorey.
43
+ *
44
+ * @type {Number}
45
+ */
46
+ numObjects: number;
47
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @desc A 2D plan view image of an ````IfcBuildingStorey````.
3
+ */
4
+ export declare class StoreyMap {
5
+ /**
6
+ * ID of the IfcBuildingStorey.
7
+ *
8
+ * This matches IDs of the IfcBuildingStorey's {@link MetaObject} and {@link Entity}.
9
+ *
10
+ * @type {String}
11
+ */
12
+ storeyId: string;
13
+
14
+ /**
15
+ * Base64-encoded plan view image.
16
+ *
17
+ * @type {String}
18
+ */
19
+ imageData: string;
20
+
21
+ /**
22
+ * The image format - "png" or "jpeg".
23
+ *
24
+ * @type {String}
25
+ */
26
+ format: string;
27
+
28
+ /**
29
+ * Width of the image, in pixels.
30
+ *
31
+ * @type {Number}
32
+ */
33
+ width: number;
34
+
35
+ /**
36
+ * Height of the image, in pixels.
37
+ *
38
+ * @type {Number}
39
+ */
40
+ height: number;
41
+ }
@@ -0,0 +1,173 @@
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
+ }
@@ -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
+ }