@thatopen/components 2.4.11 → 3.1.0
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.
- package/README.md +92 -92
- package/dist/index.cjs +18440 -25937
- package/dist/index.d.ts +4537 -6
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.mjs +3 -3
- package/dist/index.mjs +18442 -25939
- package/package.json +58 -60
- package/dist/core/Clipper/index.d.ts +0 -142
- package/dist/core/Clipper/src/clipper-config.d.ts +0 -33
- package/dist/core/Clipper/src/index.d.ts +0 -1
- package/dist/core/Clipper/src/simple-plane.d.ts +0 -99
- package/dist/core/Components/index.d.ts +0 -93
- package/dist/core/ConfigManager/index.d.ts +0 -21
- package/dist/core/ConfigManager/src/configurator.d.ts +0 -13
- package/dist/core/ConfigManager/src/index.d.ts +0 -1
- package/dist/core/Cullers/index.d.ts +0 -56
- package/dist/core/Cullers/src/culler-renderer-config.d.ts +0 -74
- package/dist/core/Cullers/src/culler-renderer.d.ts +0 -76
- package/dist/core/Cullers/src/index.d.ts +0 -3
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +0 -59
- package/dist/core/Cullers/src/screen-culler-helper.d.ts +0 -1
- package/dist/core/Disposer/index.d.ts +0 -45
- package/dist/core/Grids/index.d.ts +0 -46
- package/dist/core/Grids/src/index.d.ts +0 -2
- package/dist/core/Grids/src/simple-grid-config.d.ts +0 -80
- package/dist/core/Grids/src/simple-grid.d.ts +0 -48
- package/dist/core/MiniMap/index.d.ts +0 -50
- package/dist/core/MiniMap/src/index.d.ts +0 -2
- package/dist/core/MiniMap/src/mini-map-config.d.ts +0 -112
- package/dist/core/MiniMap/src/mini-map.d.ts +0 -100
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +0 -65
- package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +0 -5
- package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -20
- package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +0 -45
- package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +0 -26
- package/dist/core/Raycasters/index.d.ts +0 -43
- package/dist/core/Raycasters/src/index.d.ts +0 -2
- package/dist/core/Raycasters/src/mouse.d.ts +0 -24
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +0 -54
- package/dist/core/ShadowedScene/index.d.ts +0 -57
- package/dist/core/ShadowedScene/src/distance-renderer.d.ts +0 -67
- package/dist/core/ShadowedScene/src/index.d.ts +0 -1
- package/dist/core/Types/index.d.ts +0 -1
- package/dist/core/Types/src/async-event.d.ts +0 -32
- package/dist/core/Types/src/base-camera.d.ts +0 -28
- package/dist/core/Types/src/base-renderer.d.ts +0 -65
- package/dist/core/Types/src/base-scene.d.ts +0 -25
- package/dist/core/Types/src/base-world-item.d.ts +0 -23
- package/dist/core/Types/src/base.d.ts +0 -19
- package/dist/core/Types/src/component-with-ui.d.ts +0 -18
- package/dist/core/Types/src/component.d.ts +0 -13
- package/dist/core/Types/src/config-types.d.ts +0 -47
- package/dist/core/Types/src/data-map.d.ts +0 -73
- package/dist/core/Types/src/data-set.d.ts +0 -58
- package/dist/core/Types/src/event-manager.d.ts +0 -30
- package/dist/core/Types/src/event.d.ts +0 -32
- package/dist/core/Types/src/index.d.ts +0 -15
- package/dist/core/Types/src/interfaces.d.ts +0 -117
- package/dist/core/Types/src/world.d.ts +0 -34
- package/dist/core/Viewpoints/index.d.ts +0 -38
- package/dist/core/Viewpoints/src/index.d.ts +0 -2
- package/dist/core/Viewpoints/src/types.d.ts +0 -36
- package/dist/core/Viewpoints/src/viewpoint.d.ts +0 -197
- package/dist/core/Viewpoints/src/viewpoints-config.d.ts +0 -23
- package/dist/core/Worlds/index.d.ts +0 -54
- package/dist/core/Worlds/src/index.d.ts +0 -5
- package/dist/core/Worlds/src/simple-camera.d.ts +0 -62
- package/dist/core/Worlds/src/simple-renderer.d.ts +0 -54
- package/dist/core/Worlds/src/simple-scene-config.d.ts +0 -59
- package/dist/core/Worlds/src/simple-scene.d.ts +0 -25
- package/dist/core/Worlds/src/simple-world.d.ts +0 -79
- package/dist/core/index.d.ts +0 -13
- package/dist/fragments/BoundingBoxer/index.d.ts +0 -208
- package/dist/fragments/Classifier/index.d.ts +0 -197
- package/dist/fragments/Exploder/index.d.ts +0 -50
- package/dist/fragments/FragmentsManager/index.d.ts +0 -152
- package/dist/fragments/Hider/index.d.ts +0 -38
- package/dist/fragments/IfcGeometryTiler/index.d.ts +0 -103
- package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +0 -29
- package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -2
- package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +0 -20
- package/dist/fragments/IfcLoader/index.d.ts +0 -116
- package/dist/fragments/IfcLoader/src/civil-reader.d.ts +0 -15
- package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +0 -41
- package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/index.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-structure.d.ts +0 -8
- package/dist/fragments/IfcLoader/src/transform-helper.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/units.d.ts +0 -10
- package/dist/fragments/IfcPropertiesTiler/index.d.ts +0 -66
- package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +0 -1
- package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +0 -11
- package/dist/fragments/index.d.ts +0 -8
- package/dist/ifc/IfcFinder/index.d.ts +0 -50
- package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +0 -35
- package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +0 -96
- package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +0 -36
- package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +0 -69
- package/dist/ifc/IfcFinder/src/index.d.ts +0 -4
- package/dist/ifc/IfcFinder/src/types.d.ts +0 -84
- package/dist/ifc/IfcIsolator/index.d.ts +0 -24
- package/dist/ifc/IfcJsonExporter/index.d.ts +0 -26
- package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +0 -4
- package/dist/ifc/IfcJsonExporter/src/index.d.ts +0 -1
- package/dist/ifc/IfcPropertiesManager/index.d.ts +0 -289
- package/dist/ifc/IfcPropertiesManager/src/index.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +0 -7
- package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/types.d.ts +0 -18
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +0 -195
- package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +0 -2
- package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +0 -51
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +0 -5
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +0 -73
- package/dist/ifc/Utils/ifc-categories.d.ts +0 -7
- package/dist/ifc/Utils/ifc-category-case.d.ts +0 -3
- package/dist/ifc/Utils/ifc-category-map.d.ts +0 -6
- package/dist/ifc/Utils/ifc-elements-map.d.ts +0 -11
- package/dist/ifc/Utils/index.d.ts +0 -5
- package/dist/ifc/Utils/properties-utils.d.ts +0 -25
- package/dist/ifc/index.d.ts +0 -6
- package/dist/measurement/MeasurementUtils/index.d.ts +0 -105
- package/dist/measurement/index.d.ts +0 -1
- package/dist/namespace.d.ts +0 -6018
- package/dist/openbim/BCFTopics/index.d.ts +0 -114
- package/dist/openbim/BCFTopics/src/Comment.d.ts +0 -40
- package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -127
- package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +0 -121
- package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +0 -2
- package/dist/openbim/BCFTopics/src/importers/index.d.ts +0 -1
- package/dist/openbim/BCFTopics/src/index.d.ts +0 -5
- package/dist/openbim/BCFTopics/src/types.d.ts +0 -19
- package/dist/openbim/IDSSpecifications/index.d.ts +0 -60
- package/dist/openbim/IDSSpecifications/src/Specification.d.ts +0 -40
- package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +0 -13
- package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +0 -21
- package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +0 -15
- package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +0 -10
- package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +0 -25
- package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +0 -5
- package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/types.d.ts +0 -70
- package/dist/openbim/index.d.ts +0 -2
- package/dist/utils/bbox.d.ts +0 -7
- package/dist/utils/geometry.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/materials.d.ts +0 -4
- package/dist/utils/section-generator.d.ts +0 -31
- package/dist/utils/uuid.d.ts +0 -6
- package/dist/utils/vertex-picker.d.ts +0 -116
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4537 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import CameraControls from 'camera-controls';
|
|
2
|
+
import { DataMap as DataMap_2 } from '@thatopen/fragments';
|
|
3
|
+
import * as FRAGS from '@thatopen/fragments';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { Vector2 } from 'three';
|
|
6
|
+
import * as WEBIFC from 'web-ifc';
|
|
7
|
+
import { XMLBuilder } from 'fast-xml-parser';
|
|
8
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Configuration options for adding a classification.
|
|
12
|
+
*/
|
|
13
|
+
export declare interface AddClassificationConfig {
|
|
14
|
+
/**
|
|
15
|
+
* Optional name of the classification to be added.
|
|
16
|
+
*/
|
|
17
|
+
classificationName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional array of regular expressions representing model IDs.
|
|
20
|
+
*/
|
|
21
|
+
modelIds?: RegExp[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class AmbientLightConfig {
|
|
25
|
+
private _list;
|
|
26
|
+
private _scene;
|
|
27
|
+
constructor(list: SimpleSceneConfigType, scene: SimpleScene);
|
|
28
|
+
get color(): THREE.Color;
|
|
29
|
+
set color(value: THREE.Color);
|
|
30
|
+
get intensity(): number;
|
|
31
|
+
set intensity(value: number);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to `this`, you will need to declare the callback as an arrow function.
|
|
36
|
+
*/
|
|
37
|
+
export declare class AsyncEvent<T> {
|
|
38
|
+
/**
|
|
39
|
+
* Whether this event is active or not. If not, it won't trigger.
|
|
40
|
+
*/
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Add a callback to this event instance.
|
|
44
|
+
* @param handler - the callback to be added to this event.
|
|
45
|
+
*/
|
|
46
|
+
add(handler: T extends void ? {
|
|
47
|
+
(): Promise<void>;
|
|
48
|
+
} : {
|
|
49
|
+
(data: T): Promise<void>;
|
|
50
|
+
}): void;
|
|
51
|
+
/**
|
|
52
|
+
* Removes a callback from this event instance.
|
|
53
|
+
* @param handler - the callback to be removed from this event.
|
|
54
|
+
*/
|
|
55
|
+
remove(handler: T extends void ? {
|
|
56
|
+
(): Promise<void>;
|
|
57
|
+
} : {
|
|
58
|
+
(data: T): Promise<void>;
|
|
59
|
+
}): void;
|
|
60
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
61
|
+
trigger: (data?: T) => Promise<void>;
|
|
62
|
+
/** Gets rid of all the suscribed events. */
|
|
63
|
+
reset(): void;
|
|
64
|
+
private handlers;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
69
|
+
*/
|
|
70
|
+
export declare abstract class Base {
|
|
71
|
+
components: Components;
|
|
72
|
+
constructor(components: Components);
|
|
73
|
+
/** Whether is component is {@link Disposable}. */
|
|
74
|
+
isDisposeable: () => this is Disposable_2;
|
|
75
|
+
/** Whether is component is {@link Resizeable}. */
|
|
76
|
+
isResizeable: () => this is Resizeable;
|
|
77
|
+
/** Whether is component is {@link Updateable}. */
|
|
78
|
+
isUpdateable: () => this is Updateable;
|
|
79
|
+
/** Whether is component is {@link Hideable}. */
|
|
80
|
+
isHideable: () => this is Hideable;
|
|
81
|
+
/** Whether is component is {@link Configurable}. */
|
|
82
|
+
isConfigurable: () => this is Configurable<any, any>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
87
|
+
*/
|
|
88
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
89
|
+
/**
|
|
90
|
+
* Whether the camera is enabled or not.
|
|
91
|
+
*/
|
|
92
|
+
abstract enabled: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The Three.js camera instance.
|
|
95
|
+
*/
|
|
96
|
+
abstract three: THREE.Camera;
|
|
97
|
+
/**
|
|
98
|
+
* Optional CameraControls instance for controlling the camera.
|
|
99
|
+
* This property is only available if the camera is controllable.
|
|
100
|
+
*/
|
|
101
|
+
abstract controls?: CameraControls;
|
|
102
|
+
/**
|
|
103
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
104
|
+
*
|
|
105
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
106
|
+
*/
|
|
107
|
+
hasCameraControls: () => this is CameraControllable;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
|
|
112
|
+
*/
|
|
113
|
+
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable_2, Resizeable {
|
|
114
|
+
/**
|
|
115
|
+
* The three.js WebGLRenderer instance associated with this renderer.
|
|
116
|
+
*
|
|
117
|
+
* @abstract
|
|
118
|
+
* @type {THREE.WebGLRenderer}
|
|
119
|
+
*/
|
|
120
|
+
abstract three: THREE.WebGLRenderer;
|
|
121
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
122
|
+
onAfterUpdate: Event_2<unknown>;
|
|
123
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
124
|
+
onBeforeUpdate: Event_2<unknown>;
|
|
125
|
+
/** {@link Disposable.onDisposed} */
|
|
126
|
+
readonly onDisposed: Event_2<undefined>;
|
|
127
|
+
/** {@link Resizeable.onResize} */
|
|
128
|
+
readonly onResize: Event_2<THREE.Vector2>;
|
|
129
|
+
/**
|
|
130
|
+
* Event that fires when there has been a change to the list of clipping
|
|
131
|
+
* planes used by the active renderer.
|
|
132
|
+
*/
|
|
133
|
+
readonly onClippingPlanesUpdated: Event_2<unknown>;
|
|
134
|
+
/** {@link Updateable.update} */
|
|
135
|
+
abstract update(delta?: number): void | Promise<void>;
|
|
136
|
+
/** {@link Disposable.dispose} */
|
|
137
|
+
abstract dispose(): void;
|
|
138
|
+
/** {@link Resizeable.getSize} */
|
|
139
|
+
abstract getSize(): Vector2;
|
|
140
|
+
/** {@link Resizeable.resize} */
|
|
141
|
+
abstract resize(size: Vector2 | undefined): void;
|
|
142
|
+
/**
|
|
143
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
|
|
144
|
+
*/
|
|
145
|
+
clippingPlanes: THREE.Plane[];
|
|
146
|
+
/**
|
|
147
|
+
* Updates the clipping planes and triggers the `onClippingPlanesUpdated` event.
|
|
148
|
+
*
|
|
149
|
+
* @remarks
|
|
150
|
+
* This method is typically called when there is a change to the list of clipping planes
|
|
151
|
+
* used by the active renderer.
|
|
152
|
+
*/
|
|
153
|
+
updateClippingPlanes(): void;
|
|
154
|
+
/**
|
|
155
|
+
* Sets or removes a clipping plane from the renderer.
|
|
156
|
+
*
|
|
157
|
+
* @param active - A boolean indicating whether the clipping plane should be active or not.
|
|
158
|
+
* @param plane - The clipping plane to be added or removed.
|
|
159
|
+
* @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to `false`.
|
|
160
|
+
*
|
|
161
|
+
* @remarks
|
|
162
|
+
* This method adds or removes a clipping plane from the `clippingPlanes` array.
|
|
163
|
+
* If `active` is `true` and the plane is not already in the array, it is added.
|
|
164
|
+
* If `active` is `false` and the plane is in the array, it is removed.
|
|
165
|
+
* The `three.clippingPlanes` property is then updated to reflect the current state of the `clippingPlanes` array,
|
|
166
|
+
* excluding any planes marked as local.
|
|
167
|
+
*/
|
|
168
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
173
|
+
*/
|
|
174
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable_2 {
|
|
175
|
+
/** {@link Disposable.onDisposed} */
|
|
176
|
+
readonly onDisposed: Event_2<unknown>;
|
|
177
|
+
/**
|
|
178
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
179
|
+
* It should be implemented by subclasses.
|
|
180
|
+
*/
|
|
181
|
+
abstract three: THREE.Object3D;
|
|
182
|
+
/** The set of directional lights managed by this scene component. */
|
|
183
|
+
directionalLights: Map<string, THREE.DirectionalLight>;
|
|
184
|
+
/** The set of ambient lights managed by this scene component. */
|
|
185
|
+
ambientLights: Map<string, THREE.AmbientLight>;
|
|
186
|
+
protected constructor(components: Components);
|
|
187
|
+
/** {@link Disposable.dispose} */
|
|
188
|
+
dispose(): void;
|
|
189
|
+
deleteAllLights(): void;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
194
|
+
*/
|
|
195
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
196
|
+
readonly worlds: DataMap_2<string, World>;
|
|
197
|
+
/**
|
|
198
|
+
* Event that is triggered when a world is added or removed from the `worlds` map.
|
|
199
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
200
|
+
*/
|
|
201
|
+
readonly onWorldChanged: Event_2<{
|
|
202
|
+
world: World;
|
|
203
|
+
action: "added" | "removed";
|
|
204
|
+
}>;
|
|
205
|
+
protected _currentWorld: World | null;
|
|
206
|
+
/**
|
|
207
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
208
|
+
*/
|
|
209
|
+
set currentWorld(value: World | null);
|
|
210
|
+
get currentWorld(): World | null;
|
|
211
|
+
protected constructor(components: Components);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export declare interface BCFApiComment {
|
|
215
|
+
guid: string;
|
|
216
|
+
date: string;
|
|
217
|
+
author: string;
|
|
218
|
+
comment: string;
|
|
219
|
+
topic_guid?: string;
|
|
220
|
+
viewpoint_guid?: string;
|
|
221
|
+
modified_date?: string;
|
|
222
|
+
modified_author?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export declare interface BCFApiTopic {
|
|
226
|
+
guid: string;
|
|
227
|
+
server_assigned_id?: string;
|
|
228
|
+
topic_type?: string;
|
|
229
|
+
topic_status?: string;
|
|
230
|
+
reference_links?: string[];
|
|
231
|
+
title: string;
|
|
232
|
+
priority?: string;
|
|
233
|
+
index?: number;
|
|
234
|
+
labels?: string[];
|
|
235
|
+
creation_date: string;
|
|
236
|
+
creation_author: string;
|
|
237
|
+
modified_date?: string;
|
|
238
|
+
modified_author?: string;
|
|
239
|
+
assigned_to?: string;
|
|
240
|
+
stage?: string;
|
|
241
|
+
description?: string;
|
|
242
|
+
bim_snippet?: {
|
|
243
|
+
snippet_type: string;
|
|
244
|
+
is_external: boolean;
|
|
245
|
+
reference: string;
|
|
246
|
+
reference_schema: string;
|
|
247
|
+
};
|
|
248
|
+
due_date?: string;
|
|
249
|
+
comments?: BCFApiComment[];
|
|
250
|
+
viewpoints?: BCFViewpoint[];
|
|
251
|
+
relatedTopics?: {
|
|
252
|
+
related_topic_guid: string;
|
|
253
|
+
}[];
|
|
254
|
+
document_references?: {
|
|
255
|
+
guid: string;
|
|
256
|
+
document_guid?: string;
|
|
257
|
+
url?: string;
|
|
258
|
+
description?: string;
|
|
259
|
+
}[];
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export declare interface BCFTopic {
|
|
263
|
+
guid: string;
|
|
264
|
+
serverAssignedId?: string;
|
|
265
|
+
type: string;
|
|
266
|
+
status: string;
|
|
267
|
+
title: string;
|
|
268
|
+
priority?: string;
|
|
269
|
+
index?: number;
|
|
270
|
+
labels: Set<string>;
|
|
271
|
+
creationDate: Date;
|
|
272
|
+
creationAuthor: string;
|
|
273
|
+
modifiedDate?: Date;
|
|
274
|
+
modifiedAuthor?: string;
|
|
275
|
+
dueDate?: Date;
|
|
276
|
+
assignedTo?: string;
|
|
277
|
+
description?: string;
|
|
278
|
+
stage?: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* BCFTopics manages Building Collaboration Format (BCF) data the engine. It provides functionality for importing, exporting, and manipulating BCF data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BCFTopics). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BCFTopics).
|
|
283
|
+
*/
|
|
284
|
+
export declare class BCFTopics extends Component implements Disposable_2, Configurable<BCFTopicsConfigManager, BCFTopicsConfig> {
|
|
285
|
+
static uuid: "de977976-e4f6-4e4f-a01a-204727839802";
|
|
286
|
+
enabled: boolean;
|
|
287
|
+
static xmlParser: XMLParser;
|
|
288
|
+
protected _defaultConfig: Required<BCFTopicsConfig>;
|
|
289
|
+
config: BCFTopicsConfigManager;
|
|
290
|
+
readonly list: DataMap<string, Topic>;
|
|
291
|
+
readonly documents: DataMap<string, InternalDocumentReference | ExternalDocumentReference>;
|
|
292
|
+
readonly onSetup: Event_2<unknown>;
|
|
293
|
+
isSetup: boolean;
|
|
294
|
+
setup(config?: Partial<BCFTopicsConfig>): void;
|
|
295
|
+
readonly onBCFImported: Event_2<Topic[]>;
|
|
296
|
+
/**
|
|
297
|
+
* Creates a new BCFTopic instance and adds it to the list.
|
|
298
|
+
*
|
|
299
|
+
* @param data - Optional partial BCFTopic object to initialize the new topic with.
|
|
300
|
+
* If not provided, default values will be used.
|
|
301
|
+
* @returns The newly created BCFTopic instance.
|
|
302
|
+
*/
|
|
303
|
+
create(data?: Partial<BCFTopic>): Topic;
|
|
304
|
+
readonly onDisposed: Event_2<unknown>;
|
|
305
|
+
/**
|
|
306
|
+
* Disposes of the BCFTopics component and triggers the onDisposed event.
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* This method clears the list of topics and triggers the onDisposed event.
|
|
310
|
+
* It also resets the onDisposed event listener.
|
|
311
|
+
*/
|
|
312
|
+
dispose(): void;
|
|
313
|
+
/**
|
|
314
|
+
* Retrieves the unique set of topic types used across all topics.
|
|
315
|
+
*
|
|
316
|
+
* @returns A Set containing the unique topic types.
|
|
317
|
+
*/
|
|
318
|
+
get usedTypes(): Set<string>;
|
|
319
|
+
/**
|
|
320
|
+
* Retrieves the unique set of topic statuses used across all topics.
|
|
321
|
+
*
|
|
322
|
+
* @returns A Set containing the unique topic statuses.
|
|
323
|
+
*/
|
|
324
|
+
get usedStatuses(): Set<string>;
|
|
325
|
+
/**
|
|
326
|
+
* Retrieves the unique set of topic priorities used across all topics.
|
|
327
|
+
*
|
|
328
|
+
* @returns A Set containing the unique topic priorities.
|
|
329
|
+
* Note: This method filters out any null or undefined priorities.
|
|
330
|
+
*/
|
|
331
|
+
get usedPriorities(): Set<string | undefined>;
|
|
332
|
+
/**
|
|
333
|
+
* Retrieves the unique set of topic stages used across all topics.
|
|
334
|
+
*
|
|
335
|
+
* @returns A Set containing the unique topic stages.
|
|
336
|
+
* Note: This method filters out any null or undefined stages.
|
|
337
|
+
*/
|
|
338
|
+
get usedStages(): Set<string | undefined>;
|
|
339
|
+
/**
|
|
340
|
+
* Retrieves the unique set of users associated with topics.
|
|
341
|
+
*
|
|
342
|
+
* @returns A Set containing the unique users.
|
|
343
|
+
* Note: This method collects users from the creation author, assigned to, modified author, and comment authors.
|
|
344
|
+
*/
|
|
345
|
+
get usedUsers(): Set<string>;
|
|
346
|
+
/**
|
|
347
|
+
* Retrieves the unique set of labels used across all topics.
|
|
348
|
+
*
|
|
349
|
+
* @returns A Set containing the unique labels.
|
|
350
|
+
*/
|
|
351
|
+
get usedLabels(): Set<string>;
|
|
352
|
+
/**
|
|
353
|
+
* Updates the set of extensions (types, statuses, priorities, labels, stages, users) based on the current topics.
|
|
354
|
+
* This method iterates through each topic in the list and adds its properties to the corresponding sets in the config.
|
|
355
|
+
*/
|
|
356
|
+
updateExtensions(): void;
|
|
357
|
+
/**
|
|
358
|
+
* Updates the references to viewpoints in the topics.
|
|
359
|
+
* This function iterates through each topic and checks if the viewpoints exist in the viewpoints list.
|
|
360
|
+
* If a viewpoint does not exist, it is removed from the topic's viewpoints.
|
|
361
|
+
*/
|
|
362
|
+
updateViewpointReferences(): void;
|
|
363
|
+
/**
|
|
364
|
+
* Exports the given topics to a BCF (Building Collaboration Format) zip file.
|
|
365
|
+
*
|
|
366
|
+
* @param topics - The topics to export. Defaults to all topics in the list.
|
|
367
|
+
* @returns A promise that resolves to a Blob containing the exported BCF zip file.
|
|
368
|
+
*/
|
|
369
|
+
export(topics?: Iterable<Topic>): Promise<Blob>;
|
|
370
|
+
private serializeExtensions;
|
|
371
|
+
private processMarkupComment;
|
|
372
|
+
private getMarkupComments;
|
|
373
|
+
private getMarkupLabels;
|
|
374
|
+
private getMarkupViewpoints;
|
|
375
|
+
private getMarkupRelatedTopics;
|
|
376
|
+
private getMarkupDocumentReferences;
|
|
377
|
+
/**
|
|
378
|
+
* Loads BCF (Building Collaboration Format) data into the engine.
|
|
379
|
+
*
|
|
380
|
+
* @param world - The default world where the viewpoints are going to be created.
|
|
381
|
+
* @param data - The BCF data to load.
|
|
382
|
+
*
|
|
383
|
+
* @returns A promise that resolves to an object containing the created viewpoints and topics.
|
|
384
|
+
*
|
|
385
|
+
* @throws An error if the BCF version is not supported.
|
|
386
|
+
*/
|
|
387
|
+
load(data: Uint8Array): Promise<{
|
|
388
|
+
viewpoints: Viewpoint[];
|
|
389
|
+
topics: Topic[];
|
|
390
|
+
}>;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Configuration settings for managing BCF topics. This interface defines the properties and their meanings used to control the behavior of exporting and importing BCF topics.
|
|
395
|
+
*/
|
|
396
|
+
export declare interface BCFTopicsConfig {
|
|
397
|
+
/**
|
|
398
|
+
* The BCF version used during export.
|
|
399
|
+
*/
|
|
400
|
+
version: BCFVersion;
|
|
401
|
+
/**
|
|
402
|
+
* The email of the user creating topics using this component.
|
|
403
|
+
*/
|
|
404
|
+
author: string;
|
|
405
|
+
/**
|
|
406
|
+
* The set of allowed topic types. This is exported inside the
|
|
407
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
408
|
+
*/
|
|
409
|
+
types: Set<string>;
|
|
410
|
+
/**
|
|
411
|
+
* The set of allowed topic statuses. This is exported inside the
|
|
412
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
413
|
+
*/
|
|
414
|
+
statuses: Set<string>;
|
|
415
|
+
/**
|
|
416
|
+
* The set of allowed topic priorities. This is exported inside the
|
|
417
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
418
|
+
*/
|
|
419
|
+
priorities: Set<string>;
|
|
420
|
+
/**
|
|
421
|
+
* The set of allowed topic labels. This is exported inside the
|
|
422
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
423
|
+
*/
|
|
424
|
+
labels: Set<string>;
|
|
425
|
+
/**
|
|
426
|
+
* The set of allowed topic stages. This is exported inside the
|
|
427
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
428
|
+
*/
|
|
429
|
+
stages: Set<string>;
|
|
430
|
+
/**
|
|
431
|
+
* The set of allowed topic users. This is exported inside the
|
|
432
|
+
* [bcf.extensions](https://github.com/buildingSMART/BCF-XML/tree/release_3_0/Documentation#bcf-file-structure).
|
|
433
|
+
*/
|
|
434
|
+
users: Set<string>;
|
|
435
|
+
/**
|
|
436
|
+
* Whether or not to include the AuthoringSoftwareId in the viewpoint components during export.
|
|
437
|
+
*/
|
|
438
|
+
includeSelectionTag: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Updates the types, statuses, users, etc., after importing an external BCF.
|
|
441
|
+
*/
|
|
442
|
+
updateExtensionsOnImport: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* Only allow to use the extensions (types, statuses, etc.) defined in the config when setting the corresponding data in a topic.
|
|
445
|
+
*/
|
|
446
|
+
strict: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* If true, export the extensions (types, status, etc.) based on topics data. This doesn't update the extensions in the config.
|
|
449
|
+
* If false, only export the extensions defined in each collection of possibilities set in the config.
|
|
450
|
+
* In all cases, all the values from each collection of extensions defined in the config are going to be exported.
|
|
451
|
+
*/
|
|
452
|
+
includeAllExtensionsOnExport: boolean;
|
|
453
|
+
/**
|
|
454
|
+
* Version to be used when importing if no bcf.version file is present in the incoming data.
|
|
455
|
+
* When null, the importer will throw an error if the version is missing or is not supported.
|
|
456
|
+
*/
|
|
457
|
+
fallbackVersionOnImport: BCFVersion | null;
|
|
458
|
+
/**
|
|
459
|
+
* If true, do not import a topic with missing information (guid, type, status, title, creationDate or creationAuthor).
|
|
460
|
+
* If false, use default values for missing data.
|
|
461
|
+
*/
|
|
462
|
+
ignoreIncompleteTopicsOnImport: boolean;
|
|
463
|
+
exportCustomDataAsLabels: boolean;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export declare class BCFTopicsConfigManager extends Configurator<BCFTopics, BCFTopicsConfigType> {
|
|
467
|
+
protected _config: BCFTopicsConfigType;
|
|
468
|
+
get version(): string;
|
|
469
|
+
set version(value: string);
|
|
470
|
+
get author(): string;
|
|
471
|
+
set author(value: string);
|
|
472
|
+
get types(): Set<string>;
|
|
473
|
+
set types(value: Set<string>);
|
|
474
|
+
get statuses(): Set<string>;
|
|
475
|
+
set statuses(value: Set<string>);
|
|
476
|
+
get priorities(): Set<string>;
|
|
477
|
+
set priorities(value: Set<string>);
|
|
478
|
+
get labels(): Set<string>;
|
|
479
|
+
set labels(value: Set<string>);
|
|
480
|
+
get stages(): Set<string>;
|
|
481
|
+
set stages(value: Set<string>);
|
|
482
|
+
get users(): Set<string>;
|
|
483
|
+
set users(value: Set<string>);
|
|
484
|
+
get includeSelectionTag(): boolean;
|
|
485
|
+
set includeSelectionTag(value: boolean);
|
|
486
|
+
get updateExtensionsOnImport(): boolean;
|
|
487
|
+
set updateExtensionsOnImport(value: boolean);
|
|
488
|
+
get strict(): boolean;
|
|
489
|
+
set strict(value: boolean);
|
|
490
|
+
get includeAllExtensionsOnExport(): boolean;
|
|
491
|
+
set includeAllExtensionsOnExport(value: boolean);
|
|
492
|
+
get fallbackVersionOnImport(): string;
|
|
493
|
+
set fallbackVersionOnImport(value: string);
|
|
494
|
+
get ignoreIncompleteTopicsOnImport(): boolean;
|
|
495
|
+
set ignoreIncompleteTopicsOnImport(value: boolean);
|
|
496
|
+
get exportCustomDataAsLabels(): boolean;
|
|
497
|
+
set exportCustomDataAsLabels(value: boolean);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
declare type BCFTopicsConfigType = {
|
|
501
|
+
version: SelectSettingControl;
|
|
502
|
+
author: TextSettingsControl;
|
|
503
|
+
types: TextSetSettingControl;
|
|
504
|
+
statuses: TextSetSettingControl;
|
|
505
|
+
priorities: TextSetSettingControl;
|
|
506
|
+
labels: TextSetSettingControl;
|
|
507
|
+
stages: TextSetSettingControl;
|
|
508
|
+
users: TextSetSettingControl;
|
|
509
|
+
includeSelectionTag: BooleanSettingsControl;
|
|
510
|
+
updateExtensionsOnImport: BooleanSettingsControl;
|
|
511
|
+
strict: BooleanSettingsControl;
|
|
512
|
+
includeAllExtensionsOnExport: BooleanSettingsControl;
|
|
513
|
+
fallbackVersionOnImport: SelectSettingControl;
|
|
514
|
+
ignoreIncompleteTopicsOnImport: BooleanSettingsControl;
|
|
515
|
+
exportCustomDataAsLabels: BooleanSettingsControl;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
export declare type BCFVersion = "2.1" | "3";
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Represents a Building Collaboration Format (BCF) viewpoint. This interface is compliant with the BCF API specifications.
|
|
522
|
+
*/
|
|
523
|
+
export declare interface BCFViewpoint {
|
|
524
|
+
/**
|
|
525
|
+
* Optional title of the viewpoint.
|
|
526
|
+
*/
|
|
527
|
+
title?: string;
|
|
528
|
+
/**
|
|
529
|
+
* Optional index of the viewpoint.
|
|
530
|
+
*/
|
|
531
|
+
index?: number;
|
|
532
|
+
/**
|
|
533
|
+
* Unique identifier for the viewpoint.
|
|
534
|
+
*/
|
|
535
|
+
guid: string;
|
|
536
|
+
/**
|
|
537
|
+
* Optional perspective camera settings for the viewpoint.
|
|
538
|
+
*/
|
|
539
|
+
perspective_camera?: ViewpointPerspectiveCamera;
|
|
540
|
+
/**
|
|
541
|
+
* Optional orthogonal camera settings for the viewpoint.
|
|
542
|
+
*/
|
|
543
|
+
orthogonal_camera?: ViewpointOrthogonalCamera;
|
|
544
|
+
/**
|
|
545
|
+
* Optional components associated with the viewpoint.
|
|
546
|
+
*/
|
|
547
|
+
components?: ViewpointComponents;
|
|
548
|
+
/**
|
|
549
|
+
* Optional snapshot image of the viewpoint.
|
|
550
|
+
*/
|
|
551
|
+
snapshot?: ViewpointSnapshot;
|
|
552
|
+
/**
|
|
553
|
+
* Optional array of lines associated with the viewpoint.
|
|
554
|
+
*/
|
|
555
|
+
lines?: ViewpointLine[];
|
|
556
|
+
/**
|
|
557
|
+
* Optional array of clipping planes associated with the viewpoint.
|
|
558
|
+
*/
|
|
559
|
+
clipping_planes?: ViewpointClippingPlane[];
|
|
560
|
+
/**
|
|
561
|
+
* Optional array of bitmaps associated with the viewpoint.
|
|
562
|
+
*/
|
|
563
|
+
bitmaps?: ViewpointBitmap[];
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export declare interface BooleanSettingsControl {
|
|
567
|
+
type: "Boolean";
|
|
568
|
+
value: boolean;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* An implementation of bounding box utilities that works for fragments. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
|
|
573
|
+
*/
|
|
574
|
+
export declare class BoundingBoxer extends Component implements Disposable_2 {
|
|
575
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
576
|
+
/** {@link Component.enabled} */
|
|
577
|
+
enabled: boolean;
|
|
578
|
+
/** {@link Disposable.onDisposed} */
|
|
579
|
+
readonly onDisposed: Event_2<unknown>;
|
|
580
|
+
/**
|
|
581
|
+
* A readonly dataset containing instances of THREE.Box3.
|
|
582
|
+
*/
|
|
583
|
+
readonly list: FRAGS.DataSet<THREE.Box3>;
|
|
584
|
+
constructor(components: Components);
|
|
585
|
+
/** {@link Disposable.dispose} */
|
|
586
|
+
dispose(full?: boolean): void;
|
|
587
|
+
/**
|
|
588
|
+
* Combines all bounding boxes in the `list` property into a single bounding box.
|
|
589
|
+
*
|
|
590
|
+
* @returns A `THREE.Box3` instance representing the union of all bounding boxes in the `list`.
|
|
591
|
+
*/
|
|
592
|
+
get(): THREE.Box3;
|
|
593
|
+
/**
|
|
594
|
+
* Asynchronously adds bounding boxes to the list by merging boxes from models
|
|
595
|
+
* specified in the provided `ModelIdMap`.
|
|
596
|
+
*
|
|
597
|
+
* @param items - A map where keys are model IDs and values are arrays of local IDs
|
|
598
|
+
* representing specific parts of the models to include in the bounding box.
|
|
599
|
+
*/
|
|
600
|
+
addFromModelIdMap(items: ModelIdMap): Promise<void>;
|
|
601
|
+
/**
|
|
602
|
+
* Adds bounding boxes from models to the current list based on optional filtering criteria.
|
|
603
|
+
*
|
|
604
|
+
* @param modelIds - An optional array of regular expressions used to filter models by their IDs.
|
|
605
|
+
* If provided, only models whose IDs match at least one of the regular expressions
|
|
606
|
+
* will have their bounding boxes added to the list. If not, all models will be used.
|
|
607
|
+
*/
|
|
608
|
+
addFromModels(modelIds?: RegExp[]): void;
|
|
609
|
+
/**
|
|
610
|
+
* Calculates and returns the center point of the bounding box derived from the provided model ID map.
|
|
611
|
+
*
|
|
612
|
+
* @param modelIdMap - A mapping of model IDs and localIds used to generate the bounding box.
|
|
613
|
+
* @returns A `THREE.Vector3` object representing the center point of the bounding box.
|
|
614
|
+
*/
|
|
615
|
+
getCenter(modelIdMap: ModelIdMap): Promise<THREE.Vector3>;
|
|
616
|
+
/**
|
|
617
|
+
* Calculates the camera orientation and position based on the specified orientation
|
|
618
|
+
* and an optional offset factor.
|
|
619
|
+
*
|
|
620
|
+
* @param orientation - Specifies the direction of the camera relative to the bounding box.
|
|
621
|
+
* @param offsetFactor - A multiplier applied to the distance between the camera and the bounding box.
|
|
622
|
+
* Defaults to `1`.
|
|
623
|
+
* @returns An object containing:
|
|
624
|
+
* - `position`: A `THREE.Vector3` representing the calculated camera position.
|
|
625
|
+
* - `target`: A `THREE.Vector3` representing the center of the bounding box, which the camera should target.
|
|
626
|
+
*/
|
|
627
|
+
getCameraOrientation(orientation: "front" | "back" | "left" | "right" | "top" | "bottom", offsetFactor?: number): Promise<{
|
|
628
|
+
position: THREE.Vector3;
|
|
629
|
+
target: THREE.Vector3;
|
|
630
|
+
}>;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Whether a camera uses the Camera Controls library.
|
|
635
|
+
*/
|
|
636
|
+
export declare interface CameraControllable {
|
|
637
|
+
/**
|
|
638
|
+
* An instance of CameraControls that provides camera control functionalities.
|
|
639
|
+
* This instance is used to manipulate the camera.
|
|
640
|
+
*/
|
|
641
|
+
controls: CameraControls;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* The projection system of the camera.
|
|
646
|
+
*/
|
|
647
|
+
export declare type CameraProjection = "Perspective" | "Orthographic";
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Represents the data structure for a classification group.
|
|
651
|
+
*/
|
|
652
|
+
export declare interface ClassificationGroupData {
|
|
653
|
+
/**
|
|
654
|
+
* The ModelIdMap that represents the static collection of items within the group.
|
|
655
|
+
*/
|
|
656
|
+
map: ModelIdMap;
|
|
657
|
+
/**
|
|
658
|
+
* Optional query used to dynamically find items using the ItemsFinder. Some groups may only rely on static items.
|
|
659
|
+
*/
|
|
660
|
+
query?: ClassificationGroupQuery;
|
|
661
|
+
/**
|
|
662
|
+
* Asynchronously retrieves the combined map of static and dynamically found items.
|
|
663
|
+
*/
|
|
664
|
+
get(): Promise<ModelIdMap>;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Represents a query for a classification group.
|
|
669
|
+
*/
|
|
670
|
+
export declare interface ClassificationGroupQuery {
|
|
671
|
+
/**
|
|
672
|
+
* The name of the query from the finder to use in the group.
|
|
673
|
+
*/
|
|
674
|
+
name: string;
|
|
675
|
+
/**
|
|
676
|
+
* Optional configuration for the query.
|
|
677
|
+
*/
|
|
678
|
+
config?: QueryTestConfig;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* The Classifier component is responsible for grouping items from different models based on criteria. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
|
|
683
|
+
*/
|
|
684
|
+
export declare class Classifier extends Component implements Disposable_2 {
|
|
685
|
+
/**
|
|
686
|
+
* A unique identifier for the component.
|
|
687
|
+
* This UUID is used to register the component within the Components system.
|
|
688
|
+
*/
|
|
689
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
690
|
+
/** {@link Component.enabled} */
|
|
691
|
+
enabled: boolean;
|
|
692
|
+
/** {@link Disposable.onDisposed} */
|
|
693
|
+
readonly onDisposed: Event_2<unknown>;
|
|
694
|
+
/**
|
|
695
|
+
* A nested data map that organizes classification groups.
|
|
696
|
+
* The outer map uses strings as keys, and the inner map contains ClassificationGroupData, also keyed by strings.
|
|
697
|
+
*/
|
|
698
|
+
readonly list: FRAGS.DataMap<string, FRAGS.DataMap<string, ClassificationGroupData>>;
|
|
699
|
+
constructor(components: Components);
|
|
700
|
+
private setupEvents;
|
|
701
|
+
private getClassificationGroups;
|
|
702
|
+
private getModelItems;
|
|
703
|
+
/**
|
|
704
|
+
* Retrieves data associated with a specific group within a classification.
|
|
705
|
+
* If the group data does not exist, it creates a new entry.
|
|
706
|
+
*
|
|
707
|
+
* @param classification - The classification string.
|
|
708
|
+
* @param group - The group string within the classification.
|
|
709
|
+
* @returns The data object associated with the group, containing a map and a `get` method.
|
|
710
|
+
*/
|
|
711
|
+
getGroupData(classification: string, group: string): ClassificationGroupData;
|
|
712
|
+
/**
|
|
713
|
+
* The default save function used by the classifier.
|
|
714
|
+
* It extracts the 'value' property from the item's Name and returns it as a string.
|
|
715
|
+
* If the 'value' property does not exist, it returns null.
|
|
716
|
+
*
|
|
717
|
+
* @param item - The item data to extract the value from.
|
|
718
|
+
* @returns The extracted value as a string, or null if the value does not exist.
|
|
719
|
+
*/
|
|
720
|
+
defaultSaveFunction: (item: FRAGS.ItemData) => string | null;
|
|
721
|
+
/**
|
|
722
|
+
* Aggregates items based on a classification and query, applying a provided function to each item.
|
|
723
|
+
*
|
|
724
|
+
* @param classification - The classification string used to categorize the items.
|
|
725
|
+
* @param query - The query parameters used to find items.
|
|
726
|
+
* @param config - Optional configuration for data and item processing.
|
|
727
|
+
* @param config.data - Optional data configuration to pass to the item retrieval.
|
|
728
|
+
* @param config.aggregationCallback - Optional function to apply to each item; defaults to `this.defaultSaveFunction` if not provided.
|
|
729
|
+
* This function receives the item data and a register function to associate item local IDs with names.
|
|
730
|
+
* If no function is provided, the default save function is used.
|
|
731
|
+
*
|
|
732
|
+
* @remarks
|
|
733
|
+
* The `register` function within the `config.func` allows associating item local IDs with a given name under the specified classification.
|
|
734
|
+
* It is used to keep track of which items belong to which classification.
|
|
735
|
+
*/
|
|
736
|
+
aggregateItems(classification: string, query: FRAGS.ItemsQueryParams, config?: {
|
|
737
|
+
modelIds?: RegExp[];
|
|
738
|
+
data?: Partial<FRAGS.ItemsDataConfig>;
|
|
739
|
+
aggregationCallback?: (item: FRAGS.ItemData, register: (name: string, ...localIds: number[]) => void) => void;
|
|
740
|
+
}): Promise<void>;
|
|
741
|
+
/**
|
|
742
|
+
* Adds items to a specific group within a classification.
|
|
743
|
+
*
|
|
744
|
+
* @param classification - The classification to which the group belongs.
|
|
745
|
+
* @param group - The group to which the items will be added.
|
|
746
|
+
* @param items - A map of model IDs to add to the group.
|
|
747
|
+
*/
|
|
748
|
+
addGroupItems(classification: string, group: string, items: ModelIdMap): void;
|
|
749
|
+
/**
|
|
750
|
+
* Sets the query for a specific group within a classification.
|
|
751
|
+
*
|
|
752
|
+
* @param classification - The classification to target.
|
|
753
|
+
* @param group - The group within the classification to target.
|
|
754
|
+
* @param query - The query to set for the group.
|
|
755
|
+
*/
|
|
756
|
+
setGroupQuery(classification: string, group: string, query: ClassificationGroupQuery): void;
|
|
757
|
+
/**
|
|
758
|
+
* Asynchronously finds a set of ModelIdMaps based on the provided classification data.
|
|
759
|
+
* @param data An object with classifications as keys and an array of groups as values.
|
|
760
|
+
* @returns A promise that resolves to a ModelIdMap representing the intersection of all ModelIdMaps found.
|
|
761
|
+
*/
|
|
762
|
+
find(data: ClassifierIntersectionInput): Promise<ModelIdMap>;
|
|
763
|
+
/**
|
|
764
|
+
* From the items passing the query, use the specified relation to create groupings
|
|
765
|
+
* This method retrieves and processes related items, applying a custom aggregation callback to register
|
|
766
|
+
* relations between items based on their attributes and local IDs.
|
|
767
|
+
*
|
|
768
|
+
* @param classification - The classification type used to filter items.
|
|
769
|
+
* @param query - Query parameters for filtering items, defined by `FRAGS.ItemsQueryParams`.
|
|
770
|
+
* @param relation - The type of relation to aggregate (e.g., "ContainedInStructure", "HasAssociations").
|
|
771
|
+
* @param config - Optional configuration for the aggregation process.
|
|
772
|
+
* @returns A promise that resolves when the aggregation process is complete.
|
|
773
|
+
* @remarks
|
|
774
|
+
* - The `aggregationCallback` function processes each item and registers relations based on the item's
|
|
775
|
+
* attribute value and the local ID of its relations.
|
|
776
|
+
* - Items without the specified attribute or relations are ignored during aggregation.
|
|
777
|
+
*/
|
|
778
|
+
aggregateItemRelations(classification: string, query: FRAGS.ItemsQueryParams, relation: string, config?: ClassifyItemRelationsConfig): Promise<void>;
|
|
779
|
+
/**
|
|
780
|
+
* Asynchronously processes and adds classifications by IfcBuildingStorey.
|
|
781
|
+
* @param config - Optional configuration for adding classifications.
|
|
782
|
+
* @returns A promise that resolves once the storeys have been processed and added.
|
|
783
|
+
*/
|
|
784
|
+
byIfcBuildingStorey(config?: AddClassificationConfig): Promise<void>;
|
|
785
|
+
/**
|
|
786
|
+
* Asynchronously processes and adds classifications by category.
|
|
787
|
+
* @param config - Optional configuration for adding classifications.
|
|
788
|
+
* @returns A promise that resolves once the categories have been processed and added.
|
|
789
|
+
*/
|
|
790
|
+
byCategory(config?: AddClassificationConfig): Promise<void>;
|
|
791
|
+
private onBeforeFragmentsDispose;
|
|
792
|
+
/** {@link Disposable.dispose} */
|
|
793
|
+
dispose(): void;
|
|
794
|
+
/**
|
|
795
|
+
* Removes items from the classifier based on the provided model ID map and configuration.
|
|
796
|
+
*
|
|
797
|
+
* @param modelIdMap - A map containing model IDs to be removed.
|
|
798
|
+
* @param config - Optional configuration for removing items.s.
|
|
799
|
+
* @remarks If no configuration is provided, items will be removed from all classifications
|
|
800
|
+
*/
|
|
801
|
+
removeItems(modelIdMap: ModelIdMap, config?: RemoveClassifierItemsConfig): void;
|
|
802
|
+
/**
|
|
803
|
+
* Asynchronously processes models based on the provided configuration and updates classification groups.
|
|
804
|
+
*
|
|
805
|
+
* @param config - Optional configuration for adding classifications. Contains the following properties.
|
|
806
|
+
* @returns A promise that resolves when the processing is complete.
|
|
807
|
+
*/
|
|
808
|
+
byModel(config?: AddClassificationConfig): Promise<void>;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Represents the input structure for a classifier intersection operation. Defines a record where the keys are classification names and the values are arrays of group names within those classifications.
|
|
813
|
+
*/
|
|
814
|
+
export declare type ClassifierIntersectionInput = Record<string, string[]>;
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Configuration interface for classifying item by relation values.
|
|
818
|
+
*/
|
|
819
|
+
export declare interface ClassifyItemRelationsConfig {
|
|
820
|
+
/**
|
|
821
|
+
* The attribute whose value will be used to create the group.
|
|
822
|
+
*/
|
|
823
|
+
attribute?: string;
|
|
824
|
+
/**
|
|
825
|
+
* An array of regular expressions representing model IDs to be used in the aggregation process.
|
|
826
|
+
*/
|
|
827
|
+
modelIds?: RegExp[];
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
832
|
+
*/
|
|
833
|
+
export declare class Clipper extends Component implements Createable, Disposable_2, Hideable, Configurable<ClipperConfigManager, ClipperConfig> {
|
|
834
|
+
/**
|
|
835
|
+
* A unique identifier for the component.
|
|
836
|
+
* This UUID is used to register the component within the Components system.
|
|
837
|
+
*/
|
|
838
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
839
|
+
/** {@link Configurable.onSetup} */
|
|
840
|
+
readonly onSetup: Event_2<unknown>;
|
|
841
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
842
|
+
readonly onBeforeDrag: Event_2<void>;
|
|
843
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
844
|
+
readonly onAfterDrag: Event_2<void>;
|
|
845
|
+
/**
|
|
846
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
847
|
+
*/
|
|
848
|
+
readonly onBeforeCreate: Event_2<unknown>;
|
|
849
|
+
/**
|
|
850
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
851
|
+
*/
|
|
852
|
+
readonly onBeforeCancel: Event_2<unknown>;
|
|
853
|
+
/**
|
|
854
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
855
|
+
*/
|
|
856
|
+
readonly onAfterCancel: Event_2<unknown>;
|
|
857
|
+
/**
|
|
858
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
859
|
+
*/
|
|
860
|
+
readonly onBeforeDelete: Event_2<unknown>;
|
|
861
|
+
/**
|
|
862
|
+
* Event that fires after a clipping plane has been created.
|
|
863
|
+
* @param plane - The newly created clipping plane.
|
|
864
|
+
*/
|
|
865
|
+
readonly onAfterCreate: Event_2<SimplePlane>;
|
|
866
|
+
/**
|
|
867
|
+
* Event that fires after a clipping plane has been deleted.
|
|
868
|
+
* @param plane - The deleted clipping plane.
|
|
869
|
+
*/
|
|
870
|
+
readonly onAfterDelete: Event_2<SimplePlane>;
|
|
871
|
+
/** {@link Disposable.onDisposed} */
|
|
872
|
+
readonly onDisposed: Event_2<string>;
|
|
873
|
+
/** {@link Configurable.isSetup} */
|
|
874
|
+
isSetup: boolean;
|
|
875
|
+
/**
|
|
876
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
877
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
878
|
+
* clipping plane is created in its roof, which might have a slight
|
|
879
|
+
* slope for draining purposes.
|
|
880
|
+
*/
|
|
881
|
+
orthogonalY: boolean;
|
|
882
|
+
/**
|
|
883
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
884
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
885
|
+
* has to be `true` for this to apply.
|
|
886
|
+
*/
|
|
887
|
+
toleranceOrthogonalY: number;
|
|
888
|
+
/**
|
|
889
|
+
* The type of clipping plane to be created.
|
|
890
|
+
* Default is {@link SimplePlane}.
|
|
891
|
+
*/
|
|
892
|
+
Type: new (...args: any) => SimplePlane;
|
|
893
|
+
/**
|
|
894
|
+
* A list of all the clipping planes created by this component.
|
|
895
|
+
*/
|
|
896
|
+
readonly list: FRAGS.DataMap<string, SimplePlane>;
|
|
897
|
+
/** {@link Configurable.config} */
|
|
898
|
+
config: ClipperConfigManager;
|
|
899
|
+
protected _defaultConfig: ClipperConfig;
|
|
900
|
+
/** The material used in all the clipping planes. */
|
|
901
|
+
private _material;
|
|
902
|
+
private _size;
|
|
903
|
+
private _enabled;
|
|
904
|
+
private _visible;
|
|
905
|
+
/** {@link Component.enabled} */
|
|
906
|
+
get enabled(): boolean;
|
|
907
|
+
/** {@link Component.enabled} */
|
|
908
|
+
set enabled(state: boolean);
|
|
909
|
+
/** {@link Hideable.visible } */
|
|
910
|
+
get visible(): boolean;
|
|
911
|
+
/** {@link Hideable.visible } */
|
|
912
|
+
set visible(state: boolean);
|
|
913
|
+
/** The material of the clipping plane representation. */
|
|
914
|
+
get material(): THREE.MeshBasicMaterial;
|
|
915
|
+
/** The material of the clipping plane representation. */
|
|
916
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
917
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
918
|
+
get size(): number;
|
|
919
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
920
|
+
set size(size: number);
|
|
921
|
+
constructor(components: Components);
|
|
922
|
+
private setEvents;
|
|
923
|
+
/** {@link Disposable.dispose} */
|
|
924
|
+
dispose(): void;
|
|
925
|
+
/** {@link Createable.create} */
|
|
926
|
+
create(world: World): Promise<SimplePlane | null>;
|
|
927
|
+
/**
|
|
928
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
929
|
+
* without the need of the mouse.
|
|
930
|
+
*
|
|
931
|
+
* @param world - the world where this plane should be created.
|
|
932
|
+
* @param normal - the orientation of the clipping plane.
|
|
933
|
+
* @param point - the position of the clipping plane.
|
|
934
|
+
* navigation.
|
|
935
|
+
*/
|
|
936
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): string;
|
|
937
|
+
/**
|
|
938
|
+
* {@link Createable.delete}
|
|
939
|
+
*
|
|
940
|
+
* @param world - the world where the plane to delete is.
|
|
941
|
+
* @param planeId - the plane to delete. If undefined, the first plane
|
|
942
|
+
* found under the cursor will be deleted.
|
|
943
|
+
*/
|
|
944
|
+
delete(world: World, planeId?: string): Promise<void>;
|
|
945
|
+
/**
|
|
946
|
+
* Deletes all the existing clipping planes.
|
|
947
|
+
*
|
|
948
|
+
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
949
|
+
*/
|
|
950
|
+
deleteAll(types?: Set<string>): void;
|
|
951
|
+
/** {@link Configurable.setup} */
|
|
952
|
+
setup(config?: Partial<ClipperConfig>): void;
|
|
953
|
+
private pickPlane;
|
|
954
|
+
private getAllPlaneMeshes;
|
|
955
|
+
private createPlaneFromIntersection;
|
|
956
|
+
private getWorldNormal;
|
|
957
|
+
private normalizePlaneDirectionY;
|
|
958
|
+
private newPlane;
|
|
959
|
+
private updateMaterialsAndPlanes;
|
|
960
|
+
private _onStartDragging;
|
|
961
|
+
private _onEndDragging;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Configuration interface for the {@link Clipper}.
|
|
966
|
+
*/
|
|
967
|
+
declare interface ClipperConfig {
|
|
968
|
+
color: THREE.Color;
|
|
969
|
+
opacity: number;
|
|
970
|
+
size: number;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
declare class ClipperConfigManager extends Configurator<Clipper, ClipperConfigType> {
|
|
974
|
+
protected _config: ClipperConfigType;
|
|
975
|
+
get enabled(): boolean;
|
|
976
|
+
set enabled(value: boolean);
|
|
977
|
+
get visible(): boolean;
|
|
978
|
+
set visible(value: boolean);
|
|
979
|
+
get color(): THREE.Color;
|
|
980
|
+
set color(value: THREE.Color);
|
|
981
|
+
get opacity(): number;
|
|
982
|
+
set opacity(value: number);
|
|
983
|
+
get size(): number;
|
|
984
|
+
set size(value: number);
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
declare type ClipperConfigType = {
|
|
988
|
+
enabled: BooleanSettingsControl;
|
|
989
|
+
visible: BooleanSettingsControl;
|
|
990
|
+
color: ColorSettingsControl;
|
|
991
|
+
opacity: NumberSettingControl;
|
|
992
|
+
size: NumberSettingControl;
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
export declare interface ColorSettingsControl {
|
|
996
|
+
type: "Color";
|
|
997
|
+
value: THREE.Color;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Represents a comment in a BCF Topic.
|
|
1002
|
+
*/
|
|
1003
|
+
declare class Comment_2 {
|
|
1004
|
+
date: Date;
|
|
1005
|
+
author: string;
|
|
1006
|
+
guid: string;
|
|
1007
|
+
viewpoint?: string;
|
|
1008
|
+
modifiedAuthor?: string;
|
|
1009
|
+
modifiedDate?: Date;
|
|
1010
|
+
topic?: Topic;
|
|
1011
|
+
private _components;
|
|
1012
|
+
private _comment;
|
|
1013
|
+
/**
|
|
1014
|
+
* Sets the comment text and updates the modified date and author.
|
|
1015
|
+
* The author will be the one defined in BCFTopics.config.author
|
|
1016
|
+
* @param value - The new comment text.
|
|
1017
|
+
*/
|
|
1018
|
+
set comment(value: string);
|
|
1019
|
+
/**
|
|
1020
|
+
* Gets the comment text.
|
|
1021
|
+
* @returns The comment text.
|
|
1022
|
+
*/
|
|
1023
|
+
get comment(): string;
|
|
1024
|
+
/**
|
|
1025
|
+
* Constructs a new BCF Topic Comment instance.
|
|
1026
|
+
* @param components - The Components instance.
|
|
1027
|
+
* @param text - The initial comment text.
|
|
1028
|
+
*/
|
|
1029
|
+
constructor(components: Components, text: string);
|
|
1030
|
+
toJSON(): BCFApiComment;
|
|
1031
|
+
}
|
|
1032
|
+
export { Comment_2 as Comment }
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
1036
|
+
*/
|
|
1037
|
+
export declare abstract class Component extends Base {
|
|
1038
|
+
/**
|
|
1039
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
1040
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1041
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1042
|
+
* will not be updated automatically each frame.
|
|
1043
|
+
*/
|
|
1044
|
+
abstract enabled: boolean;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
1049
|
+
*/
|
|
1050
|
+
export declare class Components implements Disposable_2 {
|
|
1051
|
+
/**
|
|
1052
|
+
* The version of the @thatopen/components library.
|
|
1053
|
+
*/
|
|
1054
|
+
static readonly release = "2.4.3";
|
|
1055
|
+
/** {@link Disposable.onDisposed} */
|
|
1056
|
+
readonly onDisposed: Event_2<void>;
|
|
1057
|
+
/**
|
|
1058
|
+
* The list of components created in this app.
|
|
1059
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
1060
|
+
*/
|
|
1061
|
+
readonly list: Map<string, Component>;
|
|
1062
|
+
/**
|
|
1063
|
+
* If disabled, the animation loop will be stopped.
|
|
1064
|
+
* Default value is false.
|
|
1065
|
+
*/
|
|
1066
|
+
enabled: boolean;
|
|
1067
|
+
private _clock;
|
|
1068
|
+
/**
|
|
1069
|
+
* Event that triggers the Components instance is initialized.
|
|
1070
|
+
*
|
|
1071
|
+
* @remarks
|
|
1072
|
+
* This event is triggered once when the {@link Components.init} method has been called and finish processing.
|
|
1073
|
+
* This is useful to set configuration placeholders that need to be executed when the components instance is initialized.
|
|
1074
|
+
* For example, enabling and configuring custom effects in a post-production renderer.
|
|
1075
|
+
*
|
|
1076
|
+
* @example
|
|
1077
|
+
* ```typescript
|
|
1078
|
+
* const components = new Components();
|
|
1079
|
+
* components.onInit.add(() => {
|
|
1080
|
+
* // Enable custom effects in the post-production renderer
|
|
1081
|
+
* // or any other operation dependant on the component initialization
|
|
1082
|
+
* });
|
|
1083
|
+
* components.init();
|
|
1084
|
+
* ```
|
|
1085
|
+
*/
|
|
1086
|
+
readonly onInit: Event_2<undefined>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Adds a component to the list of components.
|
|
1089
|
+
* Throws an error if a component with the same UUID already exists.
|
|
1090
|
+
*
|
|
1091
|
+
* @param uuid - The unique identifier of the component.
|
|
1092
|
+
* @param instance - The instance of the component to be added.
|
|
1093
|
+
*
|
|
1094
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
1095
|
+
*/
|
|
1096
|
+
add(uuid: string, instance: Component): void;
|
|
1097
|
+
/**
|
|
1098
|
+
* Retrieves a component instance by its constructor function.
|
|
1099
|
+
* If the component does not exist in the list, it will be created and added.
|
|
1100
|
+
*
|
|
1101
|
+
* @template U - The type of the component to retrieve.
|
|
1102
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
1103
|
+
*
|
|
1104
|
+
* @returns The instance of the requested component.
|
|
1105
|
+
*
|
|
1106
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
1107
|
+
*/
|
|
1108
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
1109
|
+
constructor();
|
|
1110
|
+
/**
|
|
1111
|
+
* Initializes the Components instance.
|
|
1112
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
1113
|
+
* and calls the update method.
|
|
1114
|
+
*/
|
|
1115
|
+
init(): void;
|
|
1116
|
+
/**
|
|
1117
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
1118
|
+
* the library. A memory leak will be created if:
|
|
1119
|
+
*
|
|
1120
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
1121
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
1122
|
+
* Angular, Vue, etc).
|
|
1123
|
+
*
|
|
1124
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
1125
|
+
* referenced by a reference type (object or array).
|
|
1126
|
+
*
|
|
1127
|
+
* You can learn more about how Three.js handles memory leaks
|
|
1128
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1129
|
+
*
|
|
1130
|
+
*/
|
|
1131
|
+
dispose(): void;
|
|
1132
|
+
private update;
|
|
1133
|
+
private static setupBVH;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* A tool to manage all the configuration from the app centrally. 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/ConfigManager).
|
|
1138
|
+
*/
|
|
1139
|
+
export declare class ConfigManager extends Component {
|
|
1140
|
+
/**
|
|
1141
|
+
* The list of all configurations of this app.
|
|
1142
|
+
*/
|
|
1143
|
+
list: DataMap<string, Configurator<any, any>>;
|
|
1144
|
+
/** {@link Component.enabled} */
|
|
1145
|
+
enabled: boolean;
|
|
1146
|
+
/**
|
|
1147
|
+
* A unique identifier for the component.
|
|
1148
|
+
* This UUID is used to register the component within the Components system.
|
|
1149
|
+
*/
|
|
1150
|
+
static readonly uuid: "b8c764e0-6b24-4e77-9a32-35fa728ee5b4";
|
|
1151
|
+
constructor(components: Components);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* Whether this component supports to be configured.
|
|
1156
|
+
*/
|
|
1157
|
+
export declare interface Configurable<T, U> {
|
|
1158
|
+
/** Wether this components has been already configured. */
|
|
1159
|
+
isSetup: boolean;
|
|
1160
|
+
/** Use the provided configuration to set up the tool. */
|
|
1161
|
+
setup: (config?: Partial<U>) => void | Promise<void>;
|
|
1162
|
+
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
1163
|
+
readonly onSetup: Event_2<any>;
|
|
1164
|
+
/** Object holding the tool configuration. You can edit this directly to change the object.
|
|
1165
|
+
*/
|
|
1166
|
+
config: Required<T>;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
export declare abstract class Configurator<T = any, U extends ControlsSchema = ControlsSchema> {
|
|
1170
|
+
protected abstract _config: U;
|
|
1171
|
+
protected _component: T;
|
|
1172
|
+
name: string;
|
|
1173
|
+
uuid: string;
|
|
1174
|
+
get controls(): U;
|
|
1175
|
+
constructor(component: T, components: Components, name: string, uuid?: string);
|
|
1176
|
+
set(data: Partial<U>): void;
|
|
1177
|
+
export(controls?: ControlsSchema, exported?: any): any;
|
|
1178
|
+
import(exported: any, imported?: any, first?: boolean): void;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
export declare type ControlEntry = BooleanSettingsControl | ColorSettingsControl | TextSettingsControl | NumberSettingControl | SelectSettingControl | Vector3SettingControl | TextSetSettingControl | NoControl;
|
|
1182
|
+
|
|
1183
|
+
export declare interface ControlsSchema {
|
|
1184
|
+
[name: string]: ControlEntry | ControlsSchema;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
export declare class ControlsUtils {
|
|
1188
|
+
static isEntry(item: any): boolean;
|
|
1189
|
+
static copySchema<T extends ControlsSchema = ControlsSchema>(schema: T, copy?: ControlsSchema): T;
|
|
1190
|
+
static copyEntry(controlEntry: ControlEntry): ControlEntry;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions.
|
|
1195
|
+
*/
|
|
1196
|
+
export declare interface Createable {
|
|
1197
|
+
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
1198
|
+
create: (data: any) => void;
|
|
1199
|
+
/**
|
|
1200
|
+
* Finish the creation process of the component, successfully creating an
|
|
1201
|
+
* instance of whatever the component creates.
|
|
1202
|
+
*/
|
|
1203
|
+
endCreation?: (data: any) => void;
|
|
1204
|
+
/**
|
|
1205
|
+
* Cancels the creation process of the component, going back to the state
|
|
1206
|
+
* before starting to create.
|
|
1207
|
+
*/
|
|
1208
|
+
cancelCreation?: (data: any) => void;
|
|
1209
|
+
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
1210
|
+
delete: (data: any) => void;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Configuration options for creating views from bounding boxes.
|
|
1215
|
+
*/
|
|
1216
|
+
export declare interface CreateElevationViewsConfig {
|
|
1217
|
+
/**
|
|
1218
|
+
* Determines whether to combine all models into a single bounding box. If `true`, a single bounding box will be created from all models. If `false`, each model will be treated separately. Defaults to `false`.
|
|
1219
|
+
*/
|
|
1220
|
+
combine?: boolean;
|
|
1221
|
+
/**
|
|
1222
|
+
* An optional array of regular expressions to match model IDs. If not provided, all models will be used.
|
|
1223
|
+
*/
|
|
1224
|
+
modelIds?: RegExp[];
|
|
1225
|
+
/**
|
|
1226
|
+
* Optional world instance to use when creating the view. If not set, the component's default world will be used.
|
|
1227
|
+
*/
|
|
1228
|
+
world?: World;
|
|
1229
|
+
/**
|
|
1230
|
+
* A callback function to generate names for the views based on the model ID. Defaults to a function that generates names in the format: `<modelId>: Front`, `<modelId>: Back`, `<modelId>: Left`, `<modelId>: Right`.
|
|
1231
|
+
*/
|
|
1232
|
+
namingCallback?: (modelId: string) => {
|
|
1233
|
+
front: string;
|
|
1234
|
+
back: string;
|
|
1235
|
+
left: string;
|
|
1236
|
+
right: string;
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Configuration options for creating views from a plane.
|
|
1242
|
+
*/
|
|
1243
|
+
export declare interface CreateViewConfig {
|
|
1244
|
+
/**
|
|
1245
|
+
* Optional identifier for the view. If not provided, a random ID will be generated.
|
|
1246
|
+
*/
|
|
1247
|
+
id?: string;
|
|
1248
|
+
/**
|
|
1249
|
+
* Optional world instance to use when creating the view. If not set, the component's default world will be used.
|
|
1250
|
+
*/
|
|
1251
|
+
world?: World;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* Configuration options for creating a view from IFC storeys.
|
|
1256
|
+
*/
|
|
1257
|
+
export declare interface CreateViewFromIfcStoreysConfig {
|
|
1258
|
+
/**
|
|
1259
|
+
* An optional array of regular expressions to match model IDs. If not provided, all models will be used.
|
|
1260
|
+
*/
|
|
1261
|
+
modelIds?: RegExp[];
|
|
1262
|
+
/**
|
|
1263
|
+
* An optional array of regular expressions to match storey names. If not provided, all storeys will be used.
|
|
1264
|
+
*/
|
|
1265
|
+
storeyNames?: RegExp[];
|
|
1266
|
+
/**
|
|
1267
|
+
* An optional offset value to displace the storey plane upward. Defaults to `0.25`.
|
|
1268
|
+
*/
|
|
1269
|
+
offset?: number;
|
|
1270
|
+
/**
|
|
1271
|
+
* Optional world instance to use when creating the view. If not set, the component's default world will be used.
|
|
1272
|
+
*/
|
|
1273
|
+
world?: World;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* A class that extends the built-in Map class and provides additional events for item set, update, delete, and clear operations.
|
|
1278
|
+
*
|
|
1279
|
+
* @template K - The type of keys in the map.
|
|
1280
|
+
* @template V - The type of values in the map.
|
|
1281
|
+
*/
|
|
1282
|
+
export declare class DataMap<K, V> extends Map<K, V> {
|
|
1283
|
+
/**
|
|
1284
|
+
* An event triggered when a new item is set in the map.
|
|
1285
|
+
*/
|
|
1286
|
+
readonly onItemSet: Event_2<{
|
|
1287
|
+
key: K;
|
|
1288
|
+
value: V;
|
|
1289
|
+
}>;
|
|
1290
|
+
/**
|
|
1291
|
+
* An event triggered when an existing item in the map is updated.
|
|
1292
|
+
*/
|
|
1293
|
+
readonly onItemUpdated: Event_2<{
|
|
1294
|
+
key: K;
|
|
1295
|
+
value: V;
|
|
1296
|
+
}>;
|
|
1297
|
+
/**
|
|
1298
|
+
* An event triggered when an item is deleted from the map.
|
|
1299
|
+
*/
|
|
1300
|
+
readonly onItemDeleted: Event_2<K>;
|
|
1301
|
+
/**
|
|
1302
|
+
* An event triggered when the map is cleared.
|
|
1303
|
+
*/
|
|
1304
|
+
readonly onCleared: Event_2<unknown>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Constructs a new DataMap instance.
|
|
1307
|
+
*
|
|
1308
|
+
* @param iterable - An iterable object containing key-value pairs to populate the map.
|
|
1309
|
+
*/
|
|
1310
|
+
constructor(iterable?: Iterable<readonly [K, V]> | null | undefined);
|
|
1311
|
+
/**
|
|
1312
|
+
* Clears the map and triggers the onCleared event.
|
|
1313
|
+
*/
|
|
1314
|
+
clear(): void;
|
|
1315
|
+
/**
|
|
1316
|
+
* Sets the value for the specified key in the map.
|
|
1317
|
+
* If the item is new, then onItemSet is triggered.
|
|
1318
|
+
* If the item is already in the map, then onItemUpdated is triggered.
|
|
1319
|
+
*
|
|
1320
|
+
* @param key - The key of the item to set.
|
|
1321
|
+
* @param value - The value of the item to set.
|
|
1322
|
+
* @returns The DataMap instance.
|
|
1323
|
+
*/
|
|
1324
|
+
set(key: K, value: V): this;
|
|
1325
|
+
/**
|
|
1326
|
+
* Sets the value in the map with a randomly generated uuidv4 key.
|
|
1327
|
+
* Only use this if your keys are strings
|
|
1328
|
+
*
|
|
1329
|
+
* @param value - The value of the item to set.
|
|
1330
|
+
* @returns The key used.
|
|
1331
|
+
*/
|
|
1332
|
+
add(value: V): K;
|
|
1333
|
+
/**
|
|
1334
|
+
* A function that acts as a guard for adding items to the set.
|
|
1335
|
+
* It determines whether a given value should be allowed to be added to the set.
|
|
1336
|
+
*
|
|
1337
|
+
* @param key - The key of the entry to be checked against the guard.
|
|
1338
|
+
* @param value - The value of the entry to be checked against the guard.
|
|
1339
|
+
* @returns A boolean indicating whether the value should be allowed to be added to the set.
|
|
1340
|
+
* By default, this function always returns true, allowing all values to be added.
|
|
1341
|
+
* You can override this behavior by providing a custom implementation.
|
|
1342
|
+
*/
|
|
1343
|
+
guard: (key: K, value: V) => boolean;
|
|
1344
|
+
/**
|
|
1345
|
+
* Deletes the specified key from the map and triggers the onItemDeleted event if the key was found.
|
|
1346
|
+
*
|
|
1347
|
+
* @param key - The key of the item to delete.
|
|
1348
|
+
* @returns True if the key was found and deleted; otherwise, false.
|
|
1349
|
+
*/
|
|
1350
|
+
delete(key: K): boolean;
|
|
1351
|
+
/**
|
|
1352
|
+
* Clears the map and resets the events.
|
|
1353
|
+
*/
|
|
1354
|
+
dispose(): void;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* A class that extends the built-in Set class and provides additional functionality. It triggers events when items are added, deleted, or the set is cleared.
|
|
1359
|
+
*
|
|
1360
|
+
* @template T - The type of elements in the set.
|
|
1361
|
+
*/
|
|
1362
|
+
export declare class DataSet<T> extends Set<T> {
|
|
1363
|
+
/**
|
|
1364
|
+
* An event that is triggered when a new item is added to the set.
|
|
1365
|
+
*/
|
|
1366
|
+
readonly onItemAdded: Event_2<T>;
|
|
1367
|
+
/**
|
|
1368
|
+
* An event that is triggered when an item is deleted from the set.
|
|
1369
|
+
*/
|
|
1370
|
+
readonly onItemDeleted: Event_2<unknown>;
|
|
1371
|
+
/**
|
|
1372
|
+
* An event that is triggered when the set is cleared.
|
|
1373
|
+
*/
|
|
1374
|
+
readonly onCleared: Event_2<unknown>;
|
|
1375
|
+
/**
|
|
1376
|
+
* Constructs a new instance of the DataSet class.
|
|
1377
|
+
*
|
|
1378
|
+
* @param iterable - An optional iterable object to initialize the set with.
|
|
1379
|
+
*/
|
|
1380
|
+
constructor(iterable?: Iterable<T> | null);
|
|
1381
|
+
/**
|
|
1382
|
+
* Clears the set and triggers the onCleared event.
|
|
1383
|
+
*/
|
|
1384
|
+
clear(): void;
|
|
1385
|
+
/**
|
|
1386
|
+
* Adds one or multiple values to the set and triggers the onItemAdded event per each.
|
|
1387
|
+
*
|
|
1388
|
+
* @param value - The value to add to the set.
|
|
1389
|
+
* @returns - The set instance.
|
|
1390
|
+
*/
|
|
1391
|
+
add(...value: T[]): this;
|
|
1392
|
+
/**
|
|
1393
|
+
* A function that acts as a guard for adding items to the set.
|
|
1394
|
+
* It determines whether a given value should be allowed to be added to the set.
|
|
1395
|
+
*
|
|
1396
|
+
* @param value - The value to be checked against the guard.
|
|
1397
|
+
* @returns A boolean indicating whether the value should be allowed to be added to the set.
|
|
1398
|
+
* By default, this function always returns true, allowing all values to be added.
|
|
1399
|
+
* You can override this behavior by providing a custom implementation.
|
|
1400
|
+
*/
|
|
1401
|
+
guard: (value: T) => boolean;
|
|
1402
|
+
/**
|
|
1403
|
+
* Deletes a value from the set and triggers the onItemDeleted event.
|
|
1404
|
+
*
|
|
1405
|
+
* @param value - The value to delete from the set.
|
|
1406
|
+
* @returns - True if the value was successfully deleted, false otherwise.
|
|
1407
|
+
*/
|
|
1408
|
+
delete(value: T): boolean;
|
|
1409
|
+
/**
|
|
1410
|
+
* Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
|
|
1411
|
+
*/
|
|
1412
|
+
dispose(): void;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
declare class DirectionalLightConfig {
|
|
1416
|
+
private _list;
|
|
1417
|
+
private _scene;
|
|
1418
|
+
constructor(list: SimpleSceneConfigType, scene: SimpleScene);
|
|
1419
|
+
get color(): THREE.Color;
|
|
1420
|
+
set color(value: THREE.Color);
|
|
1421
|
+
get intensity(): number;
|
|
1422
|
+
set intensity(value: number);
|
|
1423
|
+
get position(): THREE.Vector3;
|
|
1424
|
+
set position(value: THREE.Vector3);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* Whether this component has to be manually destroyed once you are done with it to prevent [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). This also ensures that the DOM events created by that component will be cleaned up.
|
|
1429
|
+
*/
|
|
1430
|
+
declare interface Disposable_2 {
|
|
1431
|
+
/**
|
|
1432
|
+
* Destroys the object from memory to prevent a
|
|
1433
|
+
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1434
|
+
*/
|
|
1435
|
+
dispose: () => void | Promise<void>;
|
|
1436
|
+
/** Fired after the tool has been disposed. */
|
|
1437
|
+
readonly onDisposed: Event_2<any>;
|
|
1438
|
+
}
|
|
1439
|
+
export { Disposable_2 as Disposable }
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Disposer).
|
|
1443
|
+
*/
|
|
1444
|
+
export declare class Disposer extends Component {
|
|
1445
|
+
private _disposedComponents;
|
|
1446
|
+
/** {@link Component.enabled} */
|
|
1447
|
+
enabled: boolean;
|
|
1448
|
+
/**
|
|
1449
|
+
* A unique identifier for the component.
|
|
1450
|
+
* This UUID is used to register the component within the Components system.
|
|
1451
|
+
*/
|
|
1452
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
1453
|
+
constructor(components: Components);
|
|
1454
|
+
/**
|
|
1455
|
+
* Return the UUIDs of all disposed components.
|
|
1456
|
+
*/
|
|
1457
|
+
get(): Set<string>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
1460
|
+
* using any of these in other parts of the application, make sure that you
|
|
1461
|
+
* remove them from the mesh before disposing it.
|
|
1462
|
+
*
|
|
1463
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
1464
|
+
* to remove.
|
|
1465
|
+
*
|
|
1466
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
1467
|
+
*
|
|
1468
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
1469
|
+
*/
|
|
1470
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
1471
|
+
/**
|
|
1472
|
+
* Disposes a geometry from memory.
|
|
1473
|
+
*
|
|
1474
|
+
* @param geometry - the
|
|
1475
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
1476
|
+
* to remove.
|
|
1477
|
+
*/
|
|
1478
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
1479
|
+
private disposeGeometryAndMaterials;
|
|
1480
|
+
private disposeChildren;
|
|
1481
|
+
private static disposeMaterial;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
/**
|
|
1485
|
+
* A base renderer to determine visibility on screen.
|
|
1486
|
+
*/
|
|
1487
|
+
declare class DistanceRenderer {
|
|
1488
|
+
/** {@link Disposable.onDisposed} */
|
|
1489
|
+
readonly onDisposed: Event_2<string>;
|
|
1490
|
+
/**
|
|
1491
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1492
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1493
|
+
* just before but not anymore.
|
|
1494
|
+
*/
|
|
1495
|
+
readonly onDistanceComputed: Event_2<number>;
|
|
1496
|
+
/**
|
|
1497
|
+
* Objects that won't be taken into account in the distance check.
|
|
1498
|
+
*/
|
|
1499
|
+
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
1500
|
+
/**
|
|
1501
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
1502
|
+
*/
|
|
1503
|
+
enabled: boolean;
|
|
1504
|
+
/**
|
|
1505
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1506
|
+
* for debugging purposes.
|
|
1507
|
+
*/
|
|
1508
|
+
renderDebugFrame: boolean;
|
|
1509
|
+
/** The components instance to which this renderer belongs. */
|
|
1510
|
+
components: Components;
|
|
1511
|
+
/**
|
|
1512
|
+
* The scene where the distance is computed.
|
|
1513
|
+
*/
|
|
1514
|
+
scene: THREE.Scene;
|
|
1515
|
+
/**
|
|
1516
|
+
* The camera used to compute the distance.
|
|
1517
|
+
*/
|
|
1518
|
+
camera: THREE.OrthographicCamera;
|
|
1519
|
+
/**
|
|
1520
|
+
* The material used to compute the distance.
|
|
1521
|
+
*/
|
|
1522
|
+
depthMaterial: THREE.ShaderMaterial;
|
|
1523
|
+
/** The world instance to which this renderer belongs. */
|
|
1524
|
+
readonly world: World;
|
|
1525
|
+
protected readonly worker: Worker;
|
|
1526
|
+
private _width;
|
|
1527
|
+
private _height;
|
|
1528
|
+
private readonly _postQuad;
|
|
1529
|
+
private readonly tempRT;
|
|
1530
|
+
private readonly resultRT;
|
|
1531
|
+
private readonly bufferSize;
|
|
1532
|
+
private readonly _buffer;
|
|
1533
|
+
protected _isWorkerBusy: boolean;
|
|
1534
|
+
constructor(components: Components, world: World);
|
|
1535
|
+
/** {@link Disposable.dispose} */
|
|
1536
|
+
dispose(): void;
|
|
1537
|
+
/**
|
|
1538
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1539
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1540
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1541
|
+
* not true.
|
|
1542
|
+
*/
|
|
1543
|
+
compute: () => Promise<void>;
|
|
1544
|
+
private handleWorkerMessage;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
export declare interface DocumentReference {
|
|
1548
|
+
type: "internal" | "external";
|
|
1549
|
+
description?: string;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to `this`, you will need to declare the callback as an arrow function.
|
|
1554
|
+
*/
|
|
1555
|
+
declare class Event_2<T> {
|
|
1556
|
+
/**
|
|
1557
|
+
* Whether this event is active or not. If not, it won't trigger.
|
|
1558
|
+
*/
|
|
1559
|
+
enabled: boolean;
|
|
1560
|
+
/**
|
|
1561
|
+
* Add a callback to this event instance.
|
|
1562
|
+
* @param handler - the callback to be added to this event.
|
|
1563
|
+
*/
|
|
1564
|
+
add(handler: T extends void ? {
|
|
1565
|
+
(): void;
|
|
1566
|
+
} : {
|
|
1567
|
+
(data: T): void;
|
|
1568
|
+
}): void;
|
|
1569
|
+
/**
|
|
1570
|
+
* Removes a callback from this event instance.
|
|
1571
|
+
* @param handler - the callback to be removed from this event.
|
|
1572
|
+
*/
|
|
1573
|
+
remove(handler: T extends void ? {
|
|
1574
|
+
(): void;
|
|
1575
|
+
} : {
|
|
1576
|
+
(data: T): void;
|
|
1577
|
+
}): void;
|
|
1578
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1579
|
+
trigger: (data?: T) => void;
|
|
1580
|
+
/** Gets rid of all the suscribed events. */
|
|
1581
|
+
reset(): void;
|
|
1582
|
+
private handlers;
|
|
1583
|
+
}
|
|
1584
|
+
export { Event_2 as Event }
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* Whether it has events or not.
|
|
1588
|
+
*/
|
|
1589
|
+
export declare interface Eventable {
|
|
1590
|
+
/**
|
|
1591
|
+
* The object in charge of managing all the events.
|
|
1592
|
+
*/
|
|
1593
|
+
eventManager: EventManager;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
/**
|
|
1597
|
+
* Simple class to easily toggle and reset event lists.
|
|
1598
|
+
*/
|
|
1599
|
+
export declare class EventManager {
|
|
1600
|
+
/**
|
|
1601
|
+
* The list of events managed by this instance.
|
|
1602
|
+
*/
|
|
1603
|
+
list: Set<Event_2<any> | AsyncEvent<any>>;
|
|
1604
|
+
/**
|
|
1605
|
+
* Adds events to this manager.
|
|
1606
|
+
* @param events the events to add.
|
|
1607
|
+
*/
|
|
1608
|
+
add(events: Iterable<Event_2<any> | AsyncEvent<any>>): void;
|
|
1609
|
+
/**
|
|
1610
|
+
* Removes events from this manager.
|
|
1611
|
+
* @param events the events to remove.
|
|
1612
|
+
*/
|
|
1613
|
+
remove(events: Iterable<Event_2<any> | AsyncEvent<any>>): void;
|
|
1614
|
+
/**
|
|
1615
|
+
* Sets all the events managed by this instance as enabled or disabled.
|
|
1616
|
+
* @param active whether to turn on or off the events.
|
|
1617
|
+
*/
|
|
1618
|
+
set(active: boolean): void;
|
|
1619
|
+
/**
|
|
1620
|
+
* Resets all the events managed by this instance.
|
|
1621
|
+
*/
|
|
1622
|
+
reset(): void;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
export declare const extensionsImporter: (manager: BCFTopics, extensionsXML: string) => void;
|
|
1626
|
+
|
|
1627
|
+
export declare interface ExternalDocumentReference extends DocumentReference {
|
|
1628
|
+
type: "external";
|
|
1629
|
+
url: string;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* Represents a finder query for retrieving items based on specified parameters.
|
|
1634
|
+
* This class encapsulates the query logic, caching mechanism, and result management.
|
|
1635
|
+
*/
|
|
1636
|
+
export declare class FinderQuery {
|
|
1637
|
+
description?: string;
|
|
1638
|
+
private _components;
|
|
1639
|
+
private _queries;
|
|
1640
|
+
/**
|
|
1641
|
+
* The query parameters used to find items.
|
|
1642
|
+
*/
|
|
1643
|
+
set queries(value: FRAGS.ItemsQueryParams[]);
|
|
1644
|
+
get queries(): FRAGS.ItemsQueryParams[];
|
|
1645
|
+
private _aggregation;
|
|
1646
|
+
/**
|
|
1647
|
+
* Sets the aggregation value (AND/OR) for the query and resets the cache if the new value differs.
|
|
1648
|
+
*/
|
|
1649
|
+
set aggregation(value: QueryResultAggregation);
|
|
1650
|
+
get aggregation(): QueryResultAggregation;
|
|
1651
|
+
/**
|
|
1652
|
+
* The result of the query, a map of modelIds to localIds.
|
|
1653
|
+
* Null if the query has not been executed or has not been cached.
|
|
1654
|
+
*/
|
|
1655
|
+
readonly result: ModelIdMap | null;
|
|
1656
|
+
/**
|
|
1657
|
+
* Determines whether the query results should be cached.
|
|
1658
|
+
*/
|
|
1659
|
+
cache: boolean;
|
|
1660
|
+
constructor(components: Components, queries: FRAGS.ItemsQueryParams[]);
|
|
1661
|
+
/**
|
|
1662
|
+
* Executes the finder query to retrieve items based on the configured query and optional model IDs.
|
|
1663
|
+
*
|
|
1664
|
+
* @param config - Optional configuration object.
|
|
1665
|
+
* @param config.modelIds - Optional array of model IDs to filter the search.
|
|
1666
|
+
* @param config.force - Optional boolean to force a new search, bypassing the cache. Defaults to `false`.
|
|
1667
|
+
* @returns A promise that resolves to a `ModelIdMap` containing the search results.
|
|
1668
|
+
*/
|
|
1669
|
+
test(config?: QueryTestConfig): Promise<ModelIdMap>;
|
|
1670
|
+
/**
|
|
1671
|
+
* Clears the cached result of the query, forcing a re-evaluation on the next access.
|
|
1672
|
+
*/
|
|
1673
|
+
clearCache(): void;
|
|
1674
|
+
private serializeAttributeQuery;
|
|
1675
|
+
private serializeQueryParameters;
|
|
1676
|
+
/**
|
|
1677
|
+
* Serializes the finder query into a JSON-compatible format.
|
|
1678
|
+
* Converts regular expressions to strings.
|
|
1679
|
+
*
|
|
1680
|
+
* @returns A `SerializedFinderQuery` object representing the serialized query.
|
|
1681
|
+
*/
|
|
1682
|
+
toJSON(): SerializedFinderQuery;
|
|
1683
|
+
private deserializeAttributeQuery;
|
|
1684
|
+
private deserializeQueryParameters;
|
|
1685
|
+
/**
|
|
1686
|
+
* Deserializes a JSON object into a `FinderQuery` instance.
|
|
1687
|
+
*
|
|
1688
|
+
* @param data - A `SerializedFinderQuery` object representing the serialized query.
|
|
1689
|
+
* @returns A `FinderQuery` instance.
|
|
1690
|
+
*/
|
|
1691
|
+
fromJSON(data: Omit<SerializedFinderQuery, "name">): this;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
1696
|
+
*/
|
|
1697
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1698
|
+
private camera;
|
|
1699
|
+
/** {@link NavigationMode.enabled} */
|
|
1700
|
+
enabled: boolean;
|
|
1701
|
+
/** {@link NavigationMode.id} */
|
|
1702
|
+
readonly id = "FirstPerson";
|
|
1703
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1704
|
+
/** {@link NavigationMode.set} */
|
|
1705
|
+
set(active: boolean): void;
|
|
1706
|
+
private setupFirstPersonCamera;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
|
|
1711
|
+
*/
|
|
1712
|
+
export declare class FragmentsManager extends Component implements Disposable_2 {
|
|
1713
|
+
/**
|
|
1714
|
+
* A unique identifier for the component.
|
|
1715
|
+
* This UUID is used to register the component within the Components system.
|
|
1716
|
+
*/
|
|
1717
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
1718
|
+
/** {@link Disposable.onDisposed} */
|
|
1719
|
+
readonly onDisposed: Event_2<unknown>;
|
|
1720
|
+
/**
|
|
1721
|
+
* Event triggered when fragments are loaded.
|
|
1722
|
+
*/
|
|
1723
|
+
readonly onFragmentsLoaded: Event_2<any>;
|
|
1724
|
+
baseCoordinationModel: string;
|
|
1725
|
+
baseCoordinationMatrix: THREE.Matrix4;
|
|
1726
|
+
/** {@link Component.enabled} */
|
|
1727
|
+
enabled: boolean;
|
|
1728
|
+
initialized: boolean;
|
|
1729
|
+
private _core?;
|
|
1730
|
+
/**
|
|
1731
|
+
* Map containing all loaded fragment models.
|
|
1732
|
+
* The key is the group's unique identifier, and the value is the model itself.
|
|
1733
|
+
*/
|
|
1734
|
+
get list(): FRAGS.DataMap<string, FRAGS.FragmentsModel>;
|
|
1735
|
+
get core(): FRAGS.FragmentsModels;
|
|
1736
|
+
constructor(components: Components);
|
|
1737
|
+
/** {@link Disposable.dispose} */
|
|
1738
|
+
dispose(): void;
|
|
1739
|
+
init(workerURL: string): void;
|
|
1740
|
+
raycast(data: {
|
|
1741
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1742
|
+
mouse: THREE.Vector2;
|
|
1743
|
+
dom: HTMLCanvasElement;
|
|
1744
|
+
snappingClasses?: FRAGS.SnappingClass[];
|
|
1745
|
+
}): Promise<FRAGS.RaycastResult | undefined>;
|
|
1746
|
+
getPositions(items: ModelIdMap): Promise<THREE.Vector3[]>;
|
|
1747
|
+
getBBoxes(items: ModelIdMap): Promise<THREE.Box3[]>;
|
|
1748
|
+
highlight(style: FRAGS.MaterialDefinition, items?: ModelIdMap): Promise<void>;
|
|
1749
|
+
/**
|
|
1750
|
+
* Retrieves data for specified items from multiple models.
|
|
1751
|
+
*
|
|
1752
|
+
* @param items A map of model IDs to an array of local IDs, specifying which items to retrieve data for.
|
|
1753
|
+
* @param config Optional configuration for data retrieval.
|
|
1754
|
+
* @returns A record mapping model IDs to an array of item data.
|
|
1755
|
+
*/
|
|
1756
|
+
getData(items: ModelIdMap, config?: Partial<FRAGS.ItemsDataConfig>): Promise<Record<string, FRAGS.ItemData[]>>;
|
|
1757
|
+
resetHighlight(items?: ModelIdMap): Promise<void>;
|
|
1758
|
+
private forEachModel;
|
|
1759
|
+
/**
|
|
1760
|
+
* Converts a collection of IFC GUIDs to a fragmentIdMap.
|
|
1761
|
+
*
|
|
1762
|
+
* @param guids - An iterable collection of global IDs to be converted to a fragment ID map.
|
|
1763
|
+
*
|
|
1764
|
+
* @returns A fragment ID map, where the keys are fragment IDs and the values are the corresponding express IDs.
|
|
1765
|
+
*/
|
|
1766
|
+
guidsToModelIdMap(guids: Iterable<string>): Promise<ModelIdMap>;
|
|
1767
|
+
/**
|
|
1768
|
+
* Converts a fragment ID map to a collection of GUIDs.
|
|
1769
|
+
*
|
|
1770
|
+
* @param modelIdMap - A ModelIdMap to be converted to a collection of GUIDs.
|
|
1771
|
+
*
|
|
1772
|
+
* @returns An array of GUIDs.
|
|
1773
|
+
*/
|
|
1774
|
+
modelIdMapToGuids(modelIdMap: ModelIdMap): Promise<string[]>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Applies the base coordinate system to the provided object.
|
|
1777
|
+
*
|
|
1778
|
+
* This function takes an object and its original coordinate system as input.
|
|
1779
|
+
* It then inverts the original coordinate system and applies the base coordinate system
|
|
1780
|
+
* to the object. This ensures that the object's position, rotation, and scale are
|
|
1781
|
+
* transformed to match the base coordinate system (which is taken from the first model loaded).
|
|
1782
|
+
*
|
|
1783
|
+
* @param object - The object to which the base coordinate system will be applied.
|
|
1784
|
+
* This should be an instance of THREE.Object3D.
|
|
1785
|
+
*
|
|
1786
|
+
* @param originalCoordinateSystem - The original coordinate system of the object.
|
|
1787
|
+
* This should be a THREE.Matrix4 representing the object's transformation matrix.
|
|
1788
|
+
*/
|
|
1789
|
+
applyBaseCoordinateSystem(object: THREE.Object3D | THREE.Vector3, originalCoordinateSystem?: THREE.Matrix4): THREE.Matrix4;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
1794
|
+
*/
|
|
1795
|
+
export declare class Grids extends Component implements Disposable_2 {
|
|
1796
|
+
/**
|
|
1797
|
+
* A unique identifier for the component.
|
|
1798
|
+
* This UUID is used to register the component within the Components system.
|
|
1799
|
+
*/
|
|
1800
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
1801
|
+
/**
|
|
1802
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
1803
|
+
*/
|
|
1804
|
+
list: Map<string, SimpleGrid>;
|
|
1805
|
+
/** {@link Disposable.onDisposed} */
|
|
1806
|
+
readonly onDisposed: Event_2<unknown>;
|
|
1807
|
+
/** {@link Component.enabled} */
|
|
1808
|
+
enabled: boolean;
|
|
1809
|
+
constructor(components: Components);
|
|
1810
|
+
/**
|
|
1811
|
+
* Creates a new grid for the given world.
|
|
1812
|
+
* Throws an error if a grid already exists for the world.
|
|
1813
|
+
*
|
|
1814
|
+
* @param world - The world to create the grid for.
|
|
1815
|
+
* @returns The newly created grid.
|
|
1816
|
+
*
|
|
1817
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
1818
|
+
*/
|
|
1819
|
+
create(world: World): SimpleGrid;
|
|
1820
|
+
/**
|
|
1821
|
+
* Deletes the grid associated with the given world.
|
|
1822
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
1823
|
+
*
|
|
1824
|
+
* @param world - The world for which to delete the grid.
|
|
1825
|
+
*
|
|
1826
|
+
* @remarks
|
|
1827
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
1828
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
1829
|
+
*/
|
|
1830
|
+
delete(world: World): void;
|
|
1831
|
+
/** {@link Disposable.dispose} */
|
|
1832
|
+
dispose(): void;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* Whether the geometric representation of this component can be hidden or shown in the [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1837
|
+
*/
|
|
1838
|
+
export declare interface Hideable {
|
|
1839
|
+
/**
|
|
1840
|
+
* Whether the geometric representation of this component is
|
|
1841
|
+
* currently visible or not in the
|
|
1842
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1843
|
+
*/
|
|
1844
|
+
visible: boolean;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
/**
|
|
1848
|
+
* A component that manages visibility of fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1849
|
+
*/
|
|
1850
|
+
export declare class Hider extends Component {
|
|
1851
|
+
/**
|
|
1852
|
+
* A unique identifier for the component.
|
|
1853
|
+
* This UUID is used to register the component within the Components system.
|
|
1854
|
+
*/
|
|
1855
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1856
|
+
/** {@link Component.enabled} */
|
|
1857
|
+
enabled: boolean;
|
|
1858
|
+
constructor(components: Components);
|
|
1859
|
+
/**
|
|
1860
|
+
* Sets the visibility of fragment items within the 3D scene.
|
|
1861
|
+
* If no `modelIdMap` parameter is provided, all fragments will be set to the specified visibility.
|
|
1862
|
+
* If it is provided, only the specified fragment items will be affected.
|
|
1863
|
+
*
|
|
1864
|
+
* @param visible - The visibility state to set for the items.
|
|
1865
|
+
* @param modelIdMap - An optional map of modelIds and their corresponding itemIds to be affected.
|
|
1866
|
+
* If not provided, all fragment items will be affected.
|
|
1867
|
+
*/
|
|
1868
|
+
set(visible: boolean, modelIdMap?: ModelIdMap): Promise<void>;
|
|
1869
|
+
/**
|
|
1870
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1871
|
+
* It calls the `set` method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1872
|
+
*
|
|
1873
|
+
* @param modelIdMap - A map of model IDs and their corresponding itemIds to be isolated.
|
|
1874
|
+
*/
|
|
1875
|
+
isolate(modelIdMap: ModelIdMap): Promise<void>;
|
|
1876
|
+
/**
|
|
1877
|
+
* Toggles the visibility of specified items in the fragments.
|
|
1878
|
+
*
|
|
1879
|
+
* @param modelIdMap - An object where the keys are model IDs and the values are arrays of local IDs representing the fragments to be toggled.
|
|
1880
|
+
* @returns A promise that resolves when all visibility toggles and the core update are complete.
|
|
1881
|
+
*/
|
|
1882
|
+
toggle(modelIdMap: ModelIdMap): Promise<void>;
|
|
1883
|
+
/**
|
|
1884
|
+
* Asynchronously retrieves a map of model IDs to their corresponding item IDs based on visibility state.
|
|
1885
|
+
*
|
|
1886
|
+
* @param state - The visibility state to filter items by.
|
|
1887
|
+
* @param modelIds - Optional array of model IDs to filter the items. If not provided, all models will be considered.
|
|
1888
|
+
* @returns A promise that resolves to a ModelIdMap record where the keys are model IDs and the values are arrays of item IDs that match the visibility state.
|
|
1889
|
+
*/
|
|
1890
|
+
getVisibilityMap(state: boolean, modelIds?: string[]): Promise<Record<string, number[]>>;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
export declare class IDSAttribute extends IDSFacet {
|
|
1894
|
+
facetType: "Attribute";
|
|
1895
|
+
name: IDSFacetParameter;
|
|
1896
|
+
value?: IDSFacetParameter;
|
|
1897
|
+
constructor(components: Components, name: IDSFacetParameter);
|
|
1898
|
+
serialize(type: "applicability" | "requirement"): string;
|
|
1899
|
+
getEntities(): Promise<void>;
|
|
1900
|
+
test(items: ModelIdMap, collector: ModelIdDataMap<IDSItemCheckResult>): Promise<void>;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
export declare interface IDSBoundsParameter {
|
|
1904
|
+
type: "bounds";
|
|
1905
|
+
parameter: {
|
|
1906
|
+
min?: number;
|
|
1907
|
+
minInclusive?: boolean;
|
|
1908
|
+
max?: number;
|
|
1909
|
+
maxInclusive?: boolean;
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
export declare interface IDSCheck {
|
|
1914
|
+
parameter: IDSFacetParameterName | null;
|
|
1915
|
+
currentValue: any;
|
|
1916
|
+
requiredValue?: IDSFacetParameter | string;
|
|
1917
|
+
pass: boolean;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* The result of a check performed by an IDSFacet test.
|
|
1922
|
+
*/
|
|
1923
|
+
export declare type IDSCheckResult = ModelIdDataMap<IDSItemCheckResult>;
|
|
1924
|
+
|
|
1925
|
+
export declare class IDSClassification extends IDSFacet {
|
|
1926
|
+
facetType: "Classification";
|
|
1927
|
+
system: IDSFacetParameter;
|
|
1928
|
+
value?: IDSFacetParameter;
|
|
1929
|
+
uri?: string;
|
|
1930
|
+
constructor(components: Components, system: IDSFacetParameter);
|
|
1931
|
+
serialize(type: "applicability" | "requirement"): string;
|
|
1932
|
+
getEntities(_modelIds: RegExp[], _collector: ModelIdMap): Promise<void>;
|
|
1933
|
+
test(_items: ModelIdMap, _collector: ModelIdDataMap<IDSItemCheckResult>): Promise<void>;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
export declare type IDSConditionalCardinaltiy = IDSSimpleCardinality | "optional";
|
|
1937
|
+
|
|
1938
|
+
export declare class IDSEntity extends IDSFacet {
|
|
1939
|
+
facetType: "Entity";
|
|
1940
|
+
name: IDSFacetParameter;
|
|
1941
|
+
predefinedType?: IDSFacetParameter;
|
|
1942
|
+
constructor(components: Components, name: IDSFacetParameter);
|
|
1943
|
+
serialize(type: "applicability" | "requirement"): string;
|
|
1944
|
+
getEntities(modelIds: RegExp[], collector: ModelIdMap): Promise<void>;
|
|
1945
|
+
test(items: ModelIdMap, collector: ModelIdDataMap<IDSItemCheckResult>): Promise<void>;
|
|
1946
|
+
protected evalName(category: string, checks?: IDSCheck[]): Promise<boolean>;
|
|
1947
|
+
protected evalPredefinedType(modelId: string, itemData: FRAGS.ItemData, checks?: IDSCheck[]): Promise<boolean | null>;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
export declare interface IDSEnumerationParameter {
|
|
1951
|
+
type: "enumeration";
|
|
1952
|
+
parameter: string[] | number[] | boolean[];
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
export declare abstract class IDSFacet {
|
|
1956
|
+
protected _components: Components;
|
|
1957
|
+
abstract facetType: IDSFacetType;
|
|
1958
|
+
cardinality: IDSSimpleCardinality | IDSConditionalCardinaltiy;
|
|
1959
|
+
instructions?: string;
|
|
1960
|
+
constructor(_components: Components);
|
|
1961
|
+
protected addCheckResult(check: IDSCheck, checks: IDSCheck[]): void;
|
|
1962
|
+
protected evalRequirement: (value: string | number | boolean | null, facetParameter: IDSFacetParameter, parameter: IDSFacetParameterName, checks?: IDSCheck[]) => boolean;
|
|
1963
|
+
protected getItemChecks(collector: ModelIdDataMap<IDSItemCheckResult>, modelId: string, item: FRAGS.ItemData): IDSCheck[] | null;
|
|
1964
|
+
/**
|
|
1965
|
+
* Returns the list of expressIDs that pass the criteria of this facet.
|
|
1966
|
+
* @param model - The IFC model to retrieve entities from.
|
|
1967
|
+
* @param collector - An optional object to collect the retrieved entities.
|
|
1968
|
+
* @remarks
|
|
1969
|
+
* If the collector already includes the entity, it won't get processed any further.
|
|
1970
|
+
*
|
|
1971
|
+
* @returns An array of express IDs of the retrieved entities.
|
|
1972
|
+
*/
|
|
1973
|
+
abstract getEntities(modelIds: RegExp[], collector: ModelIdMap): Promise<void>;
|
|
1974
|
+
abstract test(items: ModelIdMap, collector: ModelIdDataMap<IDSItemCheckResult>): Promise<void>;
|
|
1975
|
+
abstract serialize(type: "applicability" | "requirement"): string;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
export declare type IDSFacetParameter = IDSSimpleParameter | IDSRestrictionParameter;
|
|
1979
|
+
|
|
1980
|
+
export declare type IDSFacetParameterName = "Name" | "PredefinedType" | "Value" | "System" | "URI" | "PropertySet" | "BaseName" | "DataType" | "Value" | "Entity" | "Relation";
|
|
1981
|
+
|
|
1982
|
+
export declare type IDSFacetType = "Entity" | "Attribute" | "Property" | "Classification" | "Material" | "PartOf";
|
|
1983
|
+
|
|
1984
|
+
export declare interface IDSInfo {
|
|
1985
|
+
title: string;
|
|
1986
|
+
description?: string;
|
|
1987
|
+
copyright?: string;
|
|
1988
|
+
version?: string;
|
|
1989
|
+
author?: string;
|
|
1990
|
+
date?: Date;
|
|
1991
|
+
purpose?: string;
|
|
1992
|
+
milestone?: string;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
export declare interface IDSItemCheckResult {
|
|
1996
|
+
guid?: string;
|
|
1997
|
+
pass: boolean;
|
|
1998
|
+
checks: IDSItemFacetCheck[];
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
export declare interface IDSItemFacetCheck {
|
|
2002
|
+
facetType: IDSFacetType;
|
|
2003
|
+
cardinality: IDSConditionalCardinaltiy;
|
|
2004
|
+
checks: IDSCheck[];
|
|
2005
|
+
pass: boolean;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
export declare interface IDSLengthParameter {
|
|
2009
|
+
type: "length";
|
|
2010
|
+
parameter: {
|
|
2011
|
+
min?: number;
|
|
2012
|
+
length?: number;
|
|
2013
|
+
max?: number;
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
export declare class IDSMaterial extends IDSFacet {
|
|
2018
|
+
private _ifcMaterialEntities;
|
|
2019
|
+
facetType: "Material";
|
|
2020
|
+
value?: IDSFacetParameter;
|
|
2021
|
+
uri?: string;
|
|
2022
|
+
serialize(type: "applicability" | "requirement"): string;
|
|
2023
|
+
getEntities(modelIds: RegExp[], collector: ModelIdMap): Promise<void>;
|
|
2024
|
+
test(items: ModelIdMap, collector: ModelIdDataMap<IDSItemCheckResult>): Promise<void>;
|
|
2025
|
+
private hasValidMaterial;
|
|
2026
|
+
private evalValue;
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
export declare class IDSPartOf extends IDSFacet {
|
|
2030
|
+
facetType: "PartOf";
|
|
2031
|
+
private _entityFacet;
|
|
2032
|
+
private _entity;
|
|
2033
|
+
set entity(value: {
|
|
2034
|
+
name: IDSFacetParameter;
|
|
2035
|
+
predefinedType?: IDSFacetParameter;
|
|
2036
|
+
});
|
|
2037
|
+
get entity(): {
|
|
2038
|
+
name: IDSFacetParameter;
|
|
2039
|
+
predefinedType?: IDSFacetParameter;
|
|
2040
|
+
};
|
|
2041
|
+
relation?: IDSPartOfRelations;
|
|
2042
|
+
cardinality: IDSSimpleCardinality;
|
|
2043
|
+
constructor(components: Components, entity: {
|
|
2044
|
+
name: IDSFacetParameter;
|
|
2045
|
+
predefinedType?: IDSFacetParameter;
|
|
2046
|
+
});
|
|
2047
|
+
serialize(): string;
|
|
2048
|
+
getEntities(_modelIds: RegExp[], _collector: ModelIdMap): Promise<void>;
|
|
2049
|
+
test(_items: ModelIdMap): Promise<void>;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
export declare type IDSPartOfRelations = "IFCRELAGGREGATES" | "IFCRELASSIGNSTOGROUP" | "IFCRELCONTAINEDINSPATIALSTRUCTURE" | "IFCRELNESTS" | "IFCRELVOIDSELEMENT" | "IFCRELFILLSELEMENT";
|
|
2053
|
+
|
|
2054
|
+
export declare interface IDSPatternParameter {
|
|
2055
|
+
type: "pattern";
|
|
2056
|
+
parameter: string;
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
export declare class IDSProperty extends IDSFacet {
|
|
2060
|
+
facetType: "Property";
|
|
2061
|
+
propertySet: IDSFacetParameter;
|
|
2062
|
+
baseName: IDSFacetParameter;
|
|
2063
|
+
value?: IDSFacetParameter;
|
|
2064
|
+
dataType?: string;
|
|
2065
|
+
uri?: string;
|
|
2066
|
+
private _unsupportedTypes;
|
|
2067
|
+
constructor(components: Components, propertySet: IDSFacetParameter, baseName: IDSFacetParameter);
|
|
2068
|
+
serialize(type: "applicability" | "requirement"): string;
|
|
2069
|
+
getEntities(modelIds: RegExp[], collector: ModelIdMap): Promise<void>;
|
|
2070
|
+
test(items: ModelIdMap, collector: ModelIdDataMap<IDSItemCheckResult>): Promise<void>;
|
|
2071
|
+
private getPropertyListName;
|
|
2072
|
+
private getValueKey;
|
|
2073
|
+
private getTypePsets;
|
|
2074
|
+
private getPsets;
|
|
2075
|
+
private evalValue;
|
|
2076
|
+
private evalDataType;
|
|
2077
|
+
private evalURI;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
export declare type IDSRestrictionParameter = IDSEnumerationParameter | IDSPatternParameter | IDSBoundsParameter | IDSLengthParameter;
|
|
2081
|
+
|
|
2082
|
+
export declare type IDSSimpleCardinality = "required" | "prohibited";
|
|
2083
|
+
|
|
2084
|
+
export declare interface IDSSimpleParameter {
|
|
2085
|
+
type: "simple";
|
|
2086
|
+
parameter: string | number | boolean;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
/**
|
|
2090
|
+
* Represents a single specification from the Information Delivery Specification (IDS) standard.
|
|
2091
|
+
*
|
|
2092
|
+
* @remarks This class provides methods for testing a model against the specification,
|
|
2093
|
+
* as well as serializing the specification into XML format.
|
|
2094
|
+
*/
|
|
2095
|
+
export declare class IDSSpecification implements IDSSpecificationData {
|
|
2096
|
+
name: string;
|
|
2097
|
+
ifcVersion: Set<IfcVersion>;
|
|
2098
|
+
readonly identifier: string;
|
|
2099
|
+
description?: string;
|
|
2100
|
+
instructions?: string;
|
|
2101
|
+
requirementsDescription?: string;
|
|
2102
|
+
applicability: FRAGS.DataSet<IDSFacet>;
|
|
2103
|
+
requirements: FRAGS.DataSet<IDSFacet>;
|
|
2104
|
+
protected components: Components;
|
|
2105
|
+
constructor(components: Components, name: string, ifcVersion: IfcVersion[]);
|
|
2106
|
+
set(data: Partial<IDSSpecificationData>): this;
|
|
2107
|
+
/**
|
|
2108
|
+
* Tests the model to test against the specification's requirements.
|
|
2109
|
+
*
|
|
2110
|
+
* @param modelId - The modelId of the model to be tested.
|
|
2111
|
+
* @returns An array representing the test results.
|
|
2112
|
+
* If no requirements are defined for the specification, an empty array is returned.
|
|
2113
|
+
*/
|
|
2114
|
+
test(modelIds: RegExp[]): Promise<IDSCheckResult>;
|
|
2115
|
+
/**
|
|
2116
|
+
* Serializes the IDSSpecification instance into XML format.
|
|
2117
|
+
*
|
|
2118
|
+
* @remarks This method is not meant to be used directly. It is used by the IDSSpecifications component.
|
|
2119
|
+
*
|
|
2120
|
+
* @returns The XML representation of the IDSSpecification.
|
|
2121
|
+
*/
|
|
2122
|
+
serialize(): string;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
export declare interface IDSSpecificationData {
|
|
2126
|
+
name: string;
|
|
2127
|
+
ifcVersion: Set<IfcVersion>;
|
|
2128
|
+
identifier: string;
|
|
2129
|
+
description?: string;
|
|
2130
|
+
instructions?: string;
|
|
2131
|
+
requirementsDescription?: string;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
/**
|
|
2135
|
+
* Component that manages Information Delivery Specification (IDS) data. It provides functionality for importing, exporting, and manipulating IDS data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IDSSpecifications). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IDSSpecifications).
|
|
2136
|
+
*/
|
|
2137
|
+
export declare class IDSSpecifications extends Component {
|
|
2138
|
+
static uuid: "9f0b9f78-9b2e-481a-b766-2fbfd01f342c";
|
|
2139
|
+
enabled: boolean;
|
|
2140
|
+
static xmlParser: XMLParser;
|
|
2141
|
+
constructor(components: Components);
|
|
2142
|
+
readonly list: DataMap<string, IDSSpecification>;
|
|
2143
|
+
/**
|
|
2144
|
+
* Processes the results of an IDS check and categorizes the items into passing and failing.
|
|
2145
|
+
*
|
|
2146
|
+
* @param result - An `IDSCheckResult` object containing the check results for various model IDs.
|
|
2147
|
+
* @returns An object containing two `ModelIdMap` objects:
|
|
2148
|
+
* - `pass`: A ModelIdMap representing items that passed the check.
|
|
2149
|
+
* - `fail`: A ModelIdMap representing items that failed the check.
|
|
2150
|
+
*/
|
|
2151
|
+
getModelIdMap(result: IDSCheckResult): {
|
|
2152
|
+
pass: ModelIdMap;
|
|
2153
|
+
fail: ModelIdMap;
|
|
2154
|
+
};
|
|
2155
|
+
/**
|
|
2156
|
+
* Creates a new IDSSpecification instance and adds it to the list.
|
|
2157
|
+
*
|
|
2158
|
+
* @param name - The name of the IDSSpecification.
|
|
2159
|
+
* @param ifcVersion - An array of IfcVersion values that the specification supports.
|
|
2160
|
+
*
|
|
2161
|
+
* @returns The newly created IDSSpecification instance.
|
|
2162
|
+
*/
|
|
2163
|
+
create(name: string, ifcVersion: IfcVersion[], identifier?: string): IDSSpecification;
|
|
2164
|
+
/**
|
|
2165
|
+
* Parses and processes an XML string containing Information Delivery Specification (IDS) data.
|
|
2166
|
+
* It creates IDSSpecification instances based on the parsed data and returns them in an array.
|
|
2167
|
+
* Also, the instances are added to the list array.
|
|
2168
|
+
*
|
|
2169
|
+
* @param data - The XML string to parse.
|
|
2170
|
+
*
|
|
2171
|
+
* @returns An array of IDSSpecification instances created from the parsed data.
|
|
2172
|
+
*/
|
|
2173
|
+
load(data: string): IDSSpecification[];
|
|
2174
|
+
/**
|
|
2175
|
+
* Exports the IDSSpecifications data into an XML string.
|
|
2176
|
+
*
|
|
2177
|
+
* @param info - The metadata information for the exported XML.
|
|
2178
|
+
* @param specifications - An optional iterable of IDSSpecification instances to export.
|
|
2179
|
+
* If not provided, all specifications in the list will be exported.
|
|
2180
|
+
*
|
|
2181
|
+
* @returns A string containing the exported IDSSpecifications data in XML format.
|
|
2182
|
+
*/
|
|
2183
|
+
export(info: IDSInfo, specifications?: Iterable<IDSSpecification>): string;
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2187
|
+
export declare class IfcFragmentSettings {
|
|
2188
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2189
|
+
wasm: {
|
|
2190
|
+
path: string;
|
|
2191
|
+
absolute: boolean;
|
|
2192
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2193
|
+
};
|
|
2194
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2195
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2196
|
+
/**
|
|
2197
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2198
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2199
|
+
* If set to false, the path must be provided manually in the `wasm.path` property.
|
|
2200
|
+
* Default value is true.
|
|
2201
|
+
*/
|
|
2202
|
+
autoSetWasm: boolean;
|
|
2203
|
+
/**
|
|
2204
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2205
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2206
|
+
* If set to null, the default file location handler will be used.
|
|
2207
|
+
*
|
|
2208
|
+
* @param url - The URL of the file to locate.
|
|
2209
|
+
* @returns The absolute path of the file.
|
|
2210
|
+
*/
|
|
2211
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
/**
|
|
2215
|
+
* The IfcLoader component is responsible of converting IFC files into Fragments. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
2216
|
+
*/
|
|
2217
|
+
export declare class IfcLoader extends Component implements Disposable_2 {
|
|
2218
|
+
/**
|
|
2219
|
+
* A unique identifier for the component.
|
|
2220
|
+
* This UUID is used to register the component within the Components system.
|
|
2221
|
+
*/
|
|
2222
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
2223
|
+
/** {@link Disposable.onDisposed} */
|
|
2224
|
+
readonly onDisposed: Event_2<string>;
|
|
2225
|
+
/**
|
|
2226
|
+
* An event triggered when the IFC file starts loading.
|
|
2227
|
+
*/
|
|
2228
|
+
readonly onIfcStartedLoading: Event_2<void>;
|
|
2229
|
+
/**
|
|
2230
|
+
* An event triggered when the setup process is completed.
|
|
2231
|
+
*/
|
|
2232
|
+
readonly onSetup: Event_2<void>;
|
|
2233
|
+
/**
|
|
2234
|
+
* The settings for the IfcLoader.
|
|
2235
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
2236
|
+
*/
|
|
2237
|
+
settings: IfcFragmentSettings;
|
|
2238
|
+
/**
|
|
2239
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
2240
|
+
*/
|
|
2241
|
+
webIfc: WEBIFC.IfcAPI;
|
|
2242
|
+
/** {@link Component.enabled} */
|
|
2243
|
+
enabled: boolean;
|
|
2244
|
+
constructor(components: Components);
|
|
2245
|
+
/** {@link Disposable.dispose} */
|
|
2246
|
+
dispose(): void;
|
|
2247
|
+
/**
|
|
2248
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
2249
|
+
*
|
|
2250
|
+
* @param config - Optional configuration settings for the IfcLoader.
|
|
2251
|
+
* If not provided, the existing settings will be used.
|
|
2252
|
+
*
|
|
2253
|
+
* @returns A Promise that resolves when the setup process is completed.
|
|
2254
|
+
*
|
|
2255
|
+
* @remarks
|
|
2256
|
+
* If the `autoSetWasm` option is enabled in the configuration,
|
|
2257
|
+
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
2258
|
+
*
|
|
2259
|
+
* @example
|
|
2260
|
+
* ```typescript
|
|
2261
|
+
* const ifcLoader = new IfcLoader(components);
|
|
2262
|
+
* await ifcLoader.setup({ autoSetWasm: true });
|
|
2263
|
+
* ```
|
|
2264
|
+
*/
|
|
2265
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
2266
|
+
/**
|
|
2267
|
+
* Loads an IFC file and processes it for 3D visualization.
|
|
2268
|
+
*
|
|
2269
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
2270
|
+
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
2271
|
+
* @param name - Optional name for the fragments model.
|
|
2272
|
+
* @param config - Optional extra data for loading the IFC.
|
|
2273
|
+
*
|
|
2274
|
+
* @returns A Promise that resolves to the FragmentsModel containing the loaded and processed IFC data.
|
|
2275
|
+
*
|
|
2276
|
+
* @example
|
|
2277
|
+
* ```typescript
|
|
2278
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
2279
|
+
* const model = await ifcLoader.load(ifcData);
|
|
2280
|
+
* ```
|
|
2281
|
+
*/
|
|
2282
|
+
load(data: Uint8Array, coordinate: boolean, name: string, config?: {
|
|
2283
|
+
userData?: Record<string, any>;
|
|
2284
|
+
processData?: Omit<FRAGS.ProcessData, "bytes">;
|
|
2285
|
+
instanceCallback?: (importer: FRAGS.IfcImporter) => void;
|
|
2286
|
+
}): Promise<FRAGS.FragmentsModel>;
|
|
2287
|
+
/**
|
|
2288
|
+
* Reads an IFC file and initializes the Web-IFC library.
|
|
2289
|
+
*
|
|
2290
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
2291
|
+
*
|
|
2292
|
+
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
2293
|
+
*
|
|
2294
|
+
* @remarks
|
|
2295
|
+
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
2296
|
+
* It also opens the IFC model using the provided data and settings.
|
|
2297
|
+
*
|
|
2298
|
+
* @example
|
|
2299
|
+
* ```typescript
|
|
2300
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
2301
|
+
* await ifcLoader.readIfcFile(ifcData);
|
|
2302
|
+
* ```
|
|
2303
|
+
*/
|
|
2304
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
2305
|
+
/**
|
|
2306
|
+
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
2307
|
+
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
2308
|
+
*
|
|
2309
|
+
* @remarks
|
|
2310
|
+
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
2311
|
+
*
|
|
2312
|
+
* @example
|
|
2313
|
+
* ```typescript
|
|
2314
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
2315
|
+
* ifcLoader.cleanUp();
|
|
2316
|
+
* ```
|
|
2317
|
+
*/
|
|
2318
|
+
cleanUp(): void;
|
|
2319
|
+
private autoSetWasm;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
export declare type IfcVersion = "IFC2X3" | "IFC4" | "IFC4X3_ADD2";
|
|
2323
|
+
|
|
2324
|
+
export declare interface InternalDocumentReference extends DocumentReference {
|
|
2325
|
+
type: "internal";
|
|
2326
|
+
fileName: string;
|
|
2327
|
+
data: Uint8Array;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
/**
|
|
2331
|
+
* Manages and executes queries to find items within models based on specified criteria. This class provides functionalities to create, store, and execute FinderQuery instances, allowing for efficient retrieval of items that match given query parameters. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/ItemsFinder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/ItemsFinder).
|
|
2332
|
+
*/
|
|
2333
|
+
export declare class ItemsFinder extends Component implements Serializable<SerializedFinderQuery> {
|
|
2334
|
+
/**
|
|
2335
|
+
* A unique identifier for the component.
|
|
2336
|
+
* This UUID is used to register the component within the Components system.
|
|
2337
|
+
*/
|
|
2338
|
+
static readonly uuid: "0da7ad77-f734-42ca-942f-a074adfd1e3a";
|
|
2339
|
+
/** {@link Component.enabled} */
|
|
2340
|
+
enabled: boolean;
|
|
2341
|
+
/**
|
|
2342
|
+
* A map of FinderQuery objects, indexed by a string key.
|
|
2343
|
+
*/
|
|
2344
|
+
readonly list: FRAGS.DataMap<string, FinderQuery>;
|
|
2345
|
+
constructor(components: Components);
|
|
2346
|
+
/**
|
|
2347
|
+
* Retrieves items from specified models based on a query.
|
|
2348
|
+
*
|
|
2349
|
+
* @param queries - The query parameters to filter items.
|
|
2350
|
+
* @param modelIds - Optional array of model IDs to include in the search. If not provided, all models are searched.
|
|
2351
|
+
* @returns A map of model IDs to sets of item IDs that match the query.
|
|
2352
|
+
*/
|
|
2353
|
+
getItems(queries: FRAGS.ItemsQueryParams[], config?: {
|
|
2354
|
+
modelIds?: RegExp[];
|
|
2355
|
+
aggregation?: QueryResultAggregation;
|
|
2356
|
+
}): Promise<ModelIdMap>;
|
|
2357
|
+
/**
|
|
2358
|
+
* Creates a new FinderQuery instance and adds it to the list of queries.
|
|
2359
|
+
*
|
|
2360
|
+
* @param name - The name of the query.
|
|
2361
|
+
* @param queries - The queries to use.
|
|
2362
|
+
* @returns The newly created FinderQuery instance.
|
|
2363
|
+
*/
|
|
2364
|
+
create(name: string, queries: FRAGS.ItemsQueryParams[]): FinderQuery;
|
|
2365
|
+
/**
|
|
2366
|
+
* Adds queries based on categories from items that have geometry.
|
|
2367
|
+
*
|
|
2368
|
+
* @param modelIds - An optional array of model IDs to filter fragments. If not provided, all fragments are processed.
|
|
2369
|
+
* @returns An array with the categories used to create the queries
|
|
2370
|
+
*/
|
|
2371
|
+
addFromCategories(modelIds?: RegExp[]): Promise<string[]>;
|
|
2372
|
+
/**
|
|
2373
|
+
* Imports a list of `FinderQuery` instances from a `SerializationResult` containing serialized finder query data.
|
|
2374
|
+
*
|
|
2375
|
+
* @param result - The `SerializationResult` containing the serialized `SerializedFinderQuery` data.
|
|
2376
|
+
* @returns An array of `FinderQuery` instances created from the serialized data. Returns an empty array if the input data is null or undefined.
|
|
2377
|
+
*/
|
|
2378
|
+
import(result: SerializationResult<SerializedFinderQuery>): FinderQuery[];
|
|
2379
|
+
/**
|
|
2380
|
+
* Serializes the ItemsFinder's data into a format suitable for export.
|
|
2381
|
+
*
|
|
2382
|
+
* @returns An object containing an array of serialized finder queries.
|
|
2383
|
+
*/
|
|
2384
|
+
export(): {
|
|
2385
|
+
data: SerializedFinderQuery[];
|
|
2386
|
+
};
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
/**
|
|
2390
|
+
* Represents an edge measurement result.
|
|
2391
|
+
*/
|
|
2392
|
+
export declare interface MeasureEdge {
|
|
2393
|
+
/**
|
|
2394
|
+
* The distance between the two points of the edge.
|
|
2395
|
+
*/
|
|
2396
|
+
distance: number;
|
|
2397
|
+
/**
|
|
2398
|
+
* The two points that define the edge.
|
|
2399
|
+
*/
|
|
2400
|
+
points: THREE.Vector3[];
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
/**
|
|
2404
|
+
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
2405
|
+
*/
|
|
2406
|
+
export declare class MeasurementUtils extends Component {
|
|
2407
|
+
/**
|
|
2408
|
+
* A unique identifier for the component.
|
|
2409
|
+
* This UUID is used to register the component within the Components system.
|
|
2410
|
+
*/
|
|
2411
|
+
static uuid: string;
|
|
2412
|
+
/** {@link Component.enabled} */
|
|
2413
|
+
enabled: boolean;
|
|
2414
|
+
constructor(components: Components);
|
|
2415
|
+
/**
|
|
2416
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
2417
|
+
*
|
|
2418
|
+
* @param point - The point from which to calculate the distance.
|
|
2419
|
+
* @param lineStart - The start point of the line segment.
|
|
2420
|
+
* @param lineEnd - The end point of the line segment.
|
|
2421
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
2422
|
+
* @returns The distance from the point to the line segment.
|
|
2423
|
+
*/
|
|
2424
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
2425
|
+
/**
|
|
2426
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
2427
|
+
* This is used to ensure numerical precision in edge detection.
|
|
2428
|
+
*
|
|
2429
|
+
* @param vector - The vector to round.
|
|
2430
|
+
* @returns The vector with rounded components.
|
|
2431
|
+
*/
|
|
2432
|
+
round(vector: THREE.Vector3): void;
|
|
2433
|
+
/**
|
|
2434
|
+
* @deprecated Use {@link getItemsVolume} instead.
|
|
2435
|
+
*
|
|
2436
|
+
* Calculates the volume of a set of items.
|
|
2437
|
+
*/
|
|
2438
|
+
getVolumeFromFragments(modelIdMap: ModelIdMap): Promise<number>;
|
|
2439
|
+
/**
|
|
2440
|
+
* Calculates the total volume of items for a given map of model IDs to local IDs.
|
|
2441
|
+
* @param modelIdMap A map where the key is the model ID and the value is an array of local IDs.
|
|
2442
|
+
* @returns A promise that resolves to the total volume of the specified items.
|
|
2443
|
+
*/
|
|
2444
|
+
getItemsVolume(modelIdMap: ModelIdMap): Promise<number>;
|
|
2445
|
+
/**
|
|
2446
|
+
* Converts a value from one unit to another for length, area, or volume without using external libraries.
|
|
2447
|
+
*
|
|
2448
|
+
* @param value - The value to convert.
|
|
2449
|
+
* @param fromUnit - The unit of the input value (e.g., "m", "cm", "mm" for lengths; "m2", "cm2" for areas; "m3", "cm3" for volumes).
|
|
2450
|
+
* @param toUnit - The unit to convert to (e.g., "cm", "mm", "m" for lengths; "cm2", "m2" for areas; "cm3", "m3" for volumes).
|
|
2451
|
+
* @param precision - The number of decimal places to round the result to, as number between 0 and 5. (default is 2).
|
|
2452
|
+
* @throws {Error} If the rounding value is not a valid integer or is out of range (0-5).
|
|
2453
|
+
* @returns The converted value rounded to the specified precision.
|
|
2454
|
+
*/
|
|
2455
|
+
static convertUnits(value: number, fromUnit: string, toUnit: string, precision?: number): number;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
export declare type ModelIdDataMap<T> = FRAGS.DataMap<string, FRAGS.DataMap<number, T>>;
|
|
2459
|
+
|
|
2460
|
+
/**
|
|
2461
|
+
* Mapping of model identifiers to a collection of numbers representing localIds.
|
|
2462
|
+
*/
|
|
2463
|
+
export declare type ModelIdMap = Record<string, Set<number>>;
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Utility class for manipulating and managing `ModelIdMap` objects. A `ModelIdMap` is a mapping of model identifiers (strings) to sets of local IDs (numbers). This class provides methods for joining, intersecting, cloning, adding, removing, and comparing `ModelIdMap` objects, as well as converting between `ModelIdMap` and plain JavaScript objects.
|
|
2467
|
+
*/
|
|
2468
|
+
export declare class ModelIdMapUtils {
|
|
2469
|
+
/**
|
|
2470
|
+
* Creates a new ModelIdMap from the union of multiple ModelIdMaps.
|
|
2471
|
+
* @param maps - An array of ModelIdMaps to join.
|
|
2472
|
+
* @returns A new ModelIdMap containing all model identifiers and localIds from all input maps.
|
|
2473
|
+
*/
|
|
2474
|
+
static join(maps: ModelIdMap[]): ModelIdMap;
|
|
2475
|
+
/**
|
|
2476
|
+
* Creates a new ModelIdMap from the intersection of multiple ModelIdMaps.
|
|
2477
|
+
* @param maps - An array of ModelIdMaps.
|
|
2478
|
+
* @returns A new ModelIdMap containing only model identifiers and localIds present in all input maps.
|
|
2479
|
+
*/
|
|
2480
|
+
static intersect(maps: ModelIdMap[]): ModelIdMap;
|
|
2481
|
+
/**
|
|
2482
|
+
* Creates a deep clone of a ModelIdMap.
|
|
2483
|
+
* @param source - The ModelIdMap to clone.
|
|
2484
|
+
* @returns A new ModelIdMap with the same model identifiers and localIds as the original.
|
|
2485
|
+
*/
|
|
2486
|
+
static clone(source: ModelIdMap): ModelIdMap;
|
|
2487
|
+
/**
|
|
2488
|
+
* Remove all entries from one ModelIdMap to another.
|
|
2489
|
+
* @param target - The ModelIdMap to subtract from.
|
|
2490
|
+
* @param source - The ModelIdMap to subtract.
|
|
2491
|
+
*/
|
|
2492
|
+
static remove(target: ModelIdMap, source: ModelIdMap, clone?: boolean): void;
|
|
2493
|
+
/**
|
|
2494
|
+
* Adds all entries from one ModelIdMap to another.
|
|
2495
|
+
* @param target - The ModelIdMap to add to.
|
|
2496
|
+
* @param source - The ModelIdMap to add from.
|
|
2497
|
+
*/
|
|
2498
|
+
static add(target: ModelIdMap, source: ModelIdMap, clone?: boolean): void;
|
|
2499
|
+
static append(target: ModelIdMap, modelId: string, ...localIds: number[]): void;
|
|
2500
|
+
/**
|
|
2501
|
+
* Checks if two ModelIdMaps are equal.
|
|
2502
|
+
* @param a - The first ModelIdMap.
|
|
2503
|
+
* @param b - The second ModelIdMap.
|
|
2504
|
+
* @returns True if the ModelIdMaps are equal, false otherwise.
|
|
2505
|
+
*/
|
|
2506
|
+
static isEqual(a: ModelIdMap, b: ModelIdMap): boolean;
|
|
2507
|
+
/**
|
|
2508
|
+
* Checks if a ModelIdMap is empty.
|
|
2509
|
+
* @param map - The ModelIdMap to check.
|
|
2510
|
+
* @returns True if the ModelIdMap is empty, false otherwise.
|
|
2511
|
+
*/
|
|
2512
|
+
static isEmpty(map: ModelIdMap): boolean;
|
|
2513
|
+
/**
|
|
2514
|
+
* Converts a ModelIdMap into a plain JavaScript object with array values.
|
|
2515
|
+
* @param map - The ModelIdMap to convert.
|
|
2516
|
+
* @returns A plain JavaScript object where each key (model ID) maps to an array of local IDs.
|
|
2517
|
+
*/
|
|
2518
|
+
static toRaw(map: ModelIdMap): {
|
|
2519
|
+
[modelID: string]: number[];
|
|
2520
|
+
};
|
|
2521
|
+
/**
|
|
2522
|
+
* Creates a ModelIdMap from a plain JavaScript object with array values.
|
|
2523
|
+
* @param raw - A plain JavaScript object where each key (model ID) maps to an array of local IDs.
|
|
2524
|
+
* @returns A ModelIdMap.
|
|
2525
|
+
*/
|
|
2526
|
+
static fromRaw(raw: {
|
|
2527
|
+
[modelID: string]: number[];
|
|
2528
|
+
}): ModelIdMap;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
/**
|
|
2532
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
2533
|
+
*/
|
|
2534
|
+
export declare class Mouse implements Disposable_2 {
|
|
2535
|
+
dom: HTMLCanvasElement;
|
|
2536
|
+
private _event?;
|
|
2537
|
+
private _position;
|
|
2538
|
+
/** {@link Disposable.onDisposed} */
|
|
2539
|
+
readonly onDisposed: Event_2<unknown>;
|
|
2540
|
+
constructor(dom: HTMLCanvasElement);
|
|
2541
|
+
/**
|
|
2542
|
+
* The real position of the mouse or touch of the Three.js canvas.
|
|
2543
|
+
*/
|
|
2544
|
+
get position(): THREE.Vector2;
|
|
2545
|
+
/**
|
|
2546
|
+
* The raw position of the mouse or touch of the Three.js canvas.
|
|
2547
|
+
*/
|
|
2548
|
+
get rawPosition(): THREE.Vector2;
|
|
2549
|
+
/** {@link Disposable.dispose} */
|
|
2550
|
+
dispose(): void;
|
|
2551
|
+
private updatePosition;
|
|
2552
|
+
private getPositionY;
|
|
2553
|
+
private getPositionX;
|
|
2554
|
+
private updateMouseInfo;
|
|
2555
|
+
private getDataObject;
|
|
2556
|
+
private setupEvents;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
/**
|
|
2560
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
2561
|
+
*/
|
|
2562
|
+
export declare interface NavigationMode {
|
|
2563
|
+
/** The unique ID of this navigation mode. */
|
|
2564
|
+
id: NavModeID;
|
|
2565
|
+
/**
|
|
2566
|
+
* Enable or disable this navigation mode.
|
|
2567
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
2568
|
+
* must be disabled.
|
|
2569
|
+
*
|
|
2570
|
+
* @param active - whether to enable or disable this mode.
|
|
2571
|
+
* @param options - any additional data required to enable or disable it.
|
|
2572
|
+
* */
|
|
2573
|
+
set: (active: boolean, options?: any) => void;
|
|
2574
|
+
/** Whether this navigation mode is active or not. */
|
|
2575
|
+
enabled: boolean;
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
/**
|
|
2579
|
+
* The extensible list of supported navigation modes.
|
|
2580
|
+
*/
|
|
2581
|
+
export declare type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
2582
|
+
|
|
2583
|
+
export declare interface NoControl {
|
|
2584
|
+
type: "None";
|
|
2585
|
+
value: any;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
export declare interface NumberSettingControl {
|
|
2589
|
+
type: "Number";
|
|
2590
|
+
interpolable: boolean;
|
|
2591
|
+
min?: number;
|
|
2592
|
+
max?: number;
|
|
2593
|
+
value: number;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
/**
|
|
2597
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
2598
|
+
*/
|
|
2599
|
+
export declare class OrbitMode implements NavigationMode {
|
|
2600
|
+
camera: OrthoPerspectiveCamera;
|
|
2601
|
+
/** {@link NavigationMode.enabled} */
|
|
2602
|
+
enabled: boolean;
|
|
2603
|
+
/** {@link NavigationMode.id} */
|
|
2604
|
+
readonly id = "Orbit";
|
|
2605
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2606
|
+
/** {@link NavigationMode.set} */
|
|
2607
|
+
set(active: boolean): void;
|
|
2608
|
+
private activateOrbitControls;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
/**
|
|
2612
|
+
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
|
|
2613
|
+
*/
|
|
2614
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
2615
|
+
/**
|
|
2616
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
2617
|
+
*/
|
|
2618
|
+
readonly projection: ProjectionManager;
|
|
2619
|
+
/**
|
|
2620
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
2621
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
2622
|
+
*/
|
|
2623
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
2624
|
+
/**
|
|
2625
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
2626
|
+
* This camera is used when the projection mode is set to perspective.
|
|
2627
|
+
*/
|
|
2628
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
2629
|
+
protected readonly _userInputButtons: any;
|
|
2630
|
+
protected readonly _frustumSize = 50;
|
|
2631
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
2632
|
+
protected _mode: NavigationMode | null;
|
|
2633
|
+
private previousSize;
|
|
2634
|
+
/**
|
|
2635
|
+
* Getter for the current navigation mode.
|
|
2636
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
2637
|
+
*
|
|
2638
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
2639
|
+
*
|
|
2640
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
2641
|
+
*/
|
|
2642
|
+
get mode(): NavigationMode;
|
|
2643
|
+
constructor(components: Components);
|
|
2644
|
+
/** {@link Disposable.dispose} */
|
|
2645
|
+
dispose(): void;
|
|
2646
|
+
/**
|
|
2647
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
2648
|
+
*
|
|
2649
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
2650
|
+
*/
|
|
2651
|
+
set(mode: NavModeID): void;
|
|
2652
|
+
/**
|
|
2653
|
+
* Make the camera view fit all the specified meshes.
|
|
2654
|
+
*
|
|
2655
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
2656
|
+
* evaluate {@link Components.meshes}.
|
|
2657
|
+
* @param offset the distance to the fit object
|
|
2658
|
+
*/
|
|
2659
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
2660
|
+
/**
|
|
2661
|
+
* Allows or prevents all user input.
|
|
2662
|
+
*
|
|
2663
|
+
* @param active - whether to enable or disable user inputs.
|
|
2664
|
+
*/
|
|
2665
|
+
setUserInput(active: boolean): void;
|
|
2666
|
+
private disableUserInput;
|
|
2667
|
+
private enableUserInput;
|
|
2668
|
+
private newOrthoCamera;
|
|
2669
|
+
private setOrthoPerspCameraAspect;
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
/**
|
|
2673
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
2674
|
+
*/
|
|
2675
|
+
export declare class PlanMode implements NavigationMode {
|
|
2676
|
+
private camera;
|
|
2677
|
+
/** {@link NavigationMode.enabled} */
|
|
2678
|
+
enabled: boolean;
|
|
2679
|
+
/** {@link NavigationMode.id} */
|
|
2680
|
+
readonly id = "Plan";
|
|
2681
|
+
private mouseAction1?;
|
|
2682
|
+
private mouseAction2?;
|
|
2683
|
+
private mouseInitialized;
|
|
2684
|
+
private readonly defaultAzimuthSpeed;
|
|
2685
|
+
private readonly defaultPolarSpeed;
|
|
2686
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2687
|
+
/** {@link NavigationMode.set} */
|
|
2688
|
+
set(active: boolean): void;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
/** Basic type to describe the progress of any kind of process. */
|
|
2692
|
+
export declare interface Progress {
|
|
2693
|
+
/** The amount of things that have been done already. */
|
|
2694
|
+
current: number;
|
|
2695
|
+
/** The total amount of things to be done by the process. */
|
|
2696
|
+
total: number;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
/**
|
|
2700
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2701
|
+
*/
|
|
2702
|
+
export declare class ProjectionManager {
|
|
2703
|
+
/**
|
|
2704
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
2705
|
+
*/
|
|
2706
|
+
readonly onChanged: Event_2<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2707
|
+
/**
|
|
2708
|
+
* Current projection mode of the camera.
|
|
2709
|
+
* Default is "Perspective".
|
|
2710
|
+
*/
|
|
2711
|
+
current: CameraProjection;
|
|
2712
|
+
/**
|
|
2713
|
+
* The camera controlled by this ProjectionManager.
|
|
2714
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2715
|
+
*/
|
|
2716
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2717
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
2718
|
+
matchOrthoDistanceEnabled: boolean;
|
|
2719
|
+
private _component;
|
|
2720
|
+
private _previousDistance;
|
|
2721
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2722
|
+
/**
|
|
2723
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2724
|
+
*
|
|
2725
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
2726
|
+
* it will have no effect.
|
|
2727
|
+
*/
|
|
2728
|
+
set(projection: CameraProjection): Promise<void>;
|
|
2729
|
+
/**
|
|
2730
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
2731
|
+
* and vice versa.
|
|
2732
|
+
*/
|
|
2733
|
+
toggle(): Promise<void>;
|
|
2734
|
+
private setOrthoCamera;
|
|
2735
|
+
private getPerspectiveDims;
|
|
2736
|
+
private setupOrthoCamera;
|
|
2737
|
+
private getDistance;
|
|
2738
|
+
private setPerspectiveCamera;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
/**
|
|
2742
|
+
* Represents the type of aggregation used in a query result. `inclusive`: Equivalent to OR. `exclusive`: Equivalent to AND.
|
|
2743
|
+
*/
|
|
2744
|
+
export declare type QueryResultAggregation = "inclusive" | "exclusive";
|
|
2745
|
+
|
|
2746
|
+
/**
|
|
2747
|
+
* Configuration for testing queries.
|
|
2748
|
+
*/
|
|
2749
|
+
export declare interface QueryTestConfig {
|
|
2750
|
+
/**
|
|
2751
|
+
* An optional array of regular expressions used to know the models to be tested.
|
|
2752
|
+
*/
|
|
2753
|
+
modelIds?: RegExp[];
|
|
2754
|
+
/**
|
|
2755
|
+
* An optional boolean indicating whether to force the query execution no matter if there is a cached result already.
|
|
2756
|
+
*/
|
|
2757
|
+
force?: boolean;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
/**
|
|
2761
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
2762
|
+
*/
|
|
2763
|
+
export declare class Raycasters extends Component implements Disposable_2 {
|
|
2764
|
+
/**
|
|
2765
|
+
* A unique identifier for the component.
|
|
2766
|
+
* This UUID is used to register the component within the Components system.
|
|
2767
|
+
*/
|
|
2768
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
2769
|
+
/** {@link Component.enabled} */
|
|
2770
|
+
enabled: boolean;
|
|
2771
|
+
/**
|
|
2772
|
+
* A Map that stores raycasters for each world.
|
|
2773
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
2774
|
+
*/
|
|
2775
|
+
list: Map<string, SimpleRaycaster>;
|
|
2776
|
+
/** {@link Disposable.onDisposed} */
|
|
2777
|
+
onDisposed: Event_2<unknown>;
|
|
2778
|
+
constructor(components: Components);
|
|
2779
|
+
/**
|
|
2780
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
2781
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
2782
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
2783
|
+
*
|
|
2784
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
2785
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
2786
|
+
*/
|
|
2787
|
+
get(world: World): SimpleRaycaster;
|
|
2788
|
+
/**
|
|
2789
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
2790
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
2791
|
+
*
|
|
2792
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
2793
|
+
* @returns {void}
|
|
2794
|
+
*/
|
|
2795
|
+
delete(world: World): void;
|
|
2796
|
+
/** {@link Disposable.dispose} */
|
|
2797
|
+
dispose(): void;
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
/**
|
|
2801
|
+
* Configuration options for removing items from a classifier.
|
|
2802
|
+
*/
|
|
2803
|
+
export declare interface RemoveClassifierItemsConfig {
|
|
2804
|
+
/**
|
|
2805
|
+
* The name of the classification from which items should be removed.
|
|
2806
|
+
*/
|
|
2807
|
+
classificationName?: string;
|
|
2808
|
+
/**
|
|
2809
|
+
* The name of the group within the classification from which items should be removed.
|
|
2810
|
+
*/
|
|
2811
|
+
groupName?: string;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
/**
|
|
2815
|
+
* Whether this component can be resized. The meaning of this can vary depending on the component: resizing a [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) component could mean changing its resolution, whereas resizing a [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
2816
|
+
*/
|
|
2817
|
+
export declare interface Resizeable {
|
|
2818
|
+
/**
|
|
2819
|
+
* Sets size of this component (e.g. the resolution of a
|
|
2820
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
2821
|
+
* component.
|
|
2822
|
+
*/
|
|
2823
|
+
resize: (size?: THREE.Vector2) => void;
|
|
2824
|
+
/** Event that fires when the component has been resized. */
|
|
2825
|
+
onResize: Event_2<THREE.Vector2>;
|
|
2826
|
+
/**
|
|
2827
|
+
* Gets the current size of this component (e.g. the resolution of a
|
|
2828
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
2829
|
+
* component.
|
|
2830
|
+
*/
|
|
2831
|
+
getSize: () => THREE.Vector2;
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
export declare interface SelectSettingControl {
|
|
2835
|
+
type: "Select";
|
|
2836
|
+
multiple: boolean;
|
|
2837
|
+
options: Set<string>;
|
|
2838
|
+
value: string;
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
export declare interface Serializable<D extends Record<string, any> = Record<string, any>, S extends Record<string, any> = Record<string, any>> {
|
|
2842
|
+
import: (result: SerializationResult<D, S>, ...args: any) => any;
|
|
2843
|
+
export: (...args: any) => SerializationResult<D, S>;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
export declare interface SerializationResult<D extends Record<string, any> = Record<string, any>, S extends Record<string, any> = Record<string, any>> {
|
|
2847
|
+
data?: D[];
|
|
2848
|
+
settings?: S;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
/**
|
|
2852
|
+
* Represents a serialized query for an item finder.
|
|
2853
|
+
*/
|
|
2854
|
+
export declare interface SerializedFinderQuery {
|
|
2855
|
+
/**
|
|
2856
|
+
* The name of the query.
|
|
2857
|
+
*/
|
|
2858
|
+
name: string;
|
|
2859
|
+
/**
|
|
2860
|
+
* An optional description of the query.
|
|
2861
|
+
*/
|
|
2862
|
+
description?: string;
|
|
2863
|
+
/**
|
|
2864
|
+
* An array of serialized query parameters.
|
|
2865
|
+
*/
|
|
2866
|
+
queries: SerializedQueryParameters[];
|
|
2867
|
+
/**
|
|
2868
|
+
* The type of aggregation applied to the query results.
|
|
2869
|
+
*/
|
|
2870
|
+
aggregation: QueryResultAggregation;
|
|
2871
|
+
/**
|
|
2872
|
+
* Indicates whether the query results should be cached.
|
|
2873
|
+
*/
|
|
2874
|
+
cache: boolean;
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
export declare interface SerializedQueryAttribute {
|
|
2878
|
+
/**
|
|
2879
|
+
* The name of the attribute.
|
|
2880
|
+
*/
|
|
2881
|
+
name: string;
|
|
2882
|
+
/**
|
|
2883
|
+
* The value of the attribute, which can be a string, an array of strings, a number, or a boolean. Optional.
|
|
2884
|
+
*/
|
|
2885
|
+
value?: string | string[] | number | boolean;
|
|
2886
|
+
/**
|
|
2887
|
+
* The type of the attribute, typically used to define the data type or category. Optional.
|
|
2888
|
+
*/
|
|
2889
|
+
type?: string;
|
|
2890
|
+
/**
|
|
2891
|
+
* Indicates whether the query should negate this attribute. Optional.
|
|
2892
|
+
*/
|
|
2893
|
+
negate?: boolean;
|
|
2894
|
+
/**
|
|
2895
|
+
* An array of item IDs associated with this attribute. Optional.
|
|
2896
|
+
*/
|
|
2897
|
+
itemIds?: number[];
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
/**
|
|
2901
|
+
* Represents the serialized query parameters used for item finding.
|
|
2902
|
+
*/
|
|
2903
|
+
export declare interface SerializedQueryParameters {
|
|
2904
|
+
/**
|
|
2905
|
+
* An optional array of category strings to filter items.
|
|
2906
|
+
*/
|
|
2907
|
+
categories?: string[];
|
|
2908
|
+
/**
|
|
2909
|
+
* An optional object containing attribute-based queries.
|
|
2910
|
+
*/
|
|
2911
|
+
attributes?: {
|
|
2912
|
+
/**
|
|
2913
|
+
* Specifies the aggregation type for attributes, either "exclusive" or "inclusive".
|
|
2914
|
+
*/
|
|
2915
|
+
aggregation?: "exclusive" | "inclusive";
|
|
2916
|
+
/**
|
|
2917
|
+
* An array of serialized query attributes used for filtering.
|
|
2918
|
+
*/
|
|
2919
|
+
queries: SerializedQueryAttribute[];
|
|
2920
|
+
};
|
|
2921
|
+
/**
|
|
2922
|
+
* An optional object defining a relational query.
|
|
2923
|
+
*/
|
|
2924
|
+
relation?: {
|
|
2925
|
+
/**
|
|
2926
|
+
* The name of the relation.
|
|
2927
|
+
*/
|
|
2928
|
+
name: string;
|
|
2929
|
+
/**
|
|
2930
|
+
* An optional nested query of type SerializedQueryParameters.
|
|
2931
|
+
*/
|
|
2932
|
+
query?: SerializedQueryParameters;
|
|
2933
|
+
};
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
/**
|
|
2937
|
+
* A scene that supports efficient cast shadows. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/ShadowedScene). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/ShadowedScene).
|
|
2938
|
+
*/
|
|
2939
|
+
export declare class ShadowedScene extends SimpleScene implements Disposable_2, Configurable<SimpleSceneConfigManager, ShadowedSceneConfig> {
|
|
2940
|
+
private _distanceRenderer?;
|
|
2941
|
+
/**
|
|
2942
|
+
* Whether the bias property should be set automatically depending on the shadow distance.
|
|
2943
|
+
*/
|
|
2944
|
+
autoBias: boolean;
|
|
2945
|
+
protected _defaultShadowConfig: {
|
|
2946
|
+
cascade: number;
|
|
2947
|
+
resolution: number;
|
|
2948
|
+
};
|
|
2949
|
+
private _lightsWithShadow;
|
|
2950
|
+
private _isComputingShadows;
|
|
2951
|
+
private _shadowsEnabled;
|
|
2952
|
+
private _bias;
|
|
2953
|
+
/**
|
|
2954
|
+
* The getter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
2955
|
+
*/
|
|
2956
|
+
get bias(): number;
|
|
2957
|
+
/**
|
|
2958
|
+
* The setter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
2959
|
+
*/
|
|
2960
|
+
set bias(value: number);
|
|
2961
|
+
/**
|
|
2962
|
+
* Getter to see whether the shadows are enabled or not in this scene instance.
|
|
2963
|
+
*/
|
|
2964
|
+
get shadowsEnabled(): boolean;
|
|
2965
|
+
/**
|
|
2966
|
+
* Setter to control whether the shadows are enabled or not in this scene instance.
|
|
2967
|
+
*/
|
|
2968
|
+
set shadowsEnabled(value: boolean);
|
|
2969
|
+
/**
|
|
2970
|
+
* Getter to get the renderer used to determine the farthest distance from the camera.
|
|
2971
|
+
*/
|
|
2972
|
+
get distanceRenderer(): DistanceRenderer;
|
|
2973
|
+
/** {@link Configurable.setup} */
|
|
2974
|
+
setup(config?: Partial<ShadowedSceneConfig>): void;
|
|
2975
|
+
/** {@link Disposable.dispose} */
|
|
2976
|
+
dispose(): void;
|
|
2977
|
+
/** Update all the shadows of the scene. */
|
|
2978
|
+
updateShadows(): Promise<void>;
|
|
2979
|
+
private recomputeShadows;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
/**
|
|
2983
|
+
* Configuration interface for the {@link ShadowedScene}. Defines properties for directional and ambient lights, as well as shadows.
|
|
2984
|
+
*/
|
|
2985
|
+
export declare interface ShadowedSceneConfig extends SimpleSceneConfig {
|
|
2986
|
+
shadows: {
|
|
2987
|
+
cascade: number;
|
|
2988
|
+
resolution: number;
|
|
2989
|
+
};
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
2994
|
+
*/
|
|
2995
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable_2 {
|
|
2996
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
2997
|
+
readonly onBeforeUpdate: Event_2<SimpleCamera>;
|
|
2998
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
2999
|
+
readonly onAfterUpdate: Event_2<SimpleCamera>;
|
|
3000
|
+
/**
|
|
3001
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
3002
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3003
|
+
*/
|
|
3004
|
+
readonly onAspectUpdated: Event_2<unknown>;
|
|
3005
|
+
/** {@link Disposable.onDisposed} */
|
|
3006
|
+
readonly onDisposed: Event_2<string>;
|
|
3007
|
+
/**
|
|
3008
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3009
|
+
* This camera is used for rendering the scene.
|
|
3010
|
+
*/
|
|
3011
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3012
|
+
private _allControls;
|
|
3013
|
+
/**
|
|
3014
|
+
* The object that controls the camera. An instance of
|
|
3015
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3016
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
3017
|
+
* object to move, rotate, look at objects, etc.
|
|
3018
|
+
*/
|
|
3019
|
+
get controls(): CameraControls;
|
|
3020
|
+
/**
|
|
3021
|
+
* Getter for the enabled state of the camera controls.
|
|
3022
|
+
* If the current world is null, it returns false.
|
|
3023
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
3024
|
+
*
|
|
3025
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
3026
|
+
*/
|
|
3027
|
+
get enabled(): boolean;
|
|
3028
|
+
/**
|
|
3029
|
+
* Setter for the enabled state of the camera controls.
|
|
3030
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3031
|
+
*
|
|
3032
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3033
|
+
*/
|
|
3034
|
+
set enabled(enabled: boolean);
|
|
3035
|
+
set currentWorld(value: World | null);
|
|
3036
|
+
get currentWorld(): World | null;
|
|
3037
|
+
constructor(components: Components);
|
|
3038
|
+
/** {@link Disposable.dispose} */
|
|
3039
|
+
dispose(): void;
|
|
3040
|
+
fitToItems(items?: ModelIdMap): Promise<void>;
|
|
3041
|
+
setOrbitToItems(items?: ModelIdMap): Promise<void>;
|
|
3042
|
+
/** {@link Updateable.update} */
|
|
3043
|
+
update(_delta: number): void;
|
|
3044
|
+
/**
|
|
3045
|
+
* Updates the aspect of the camera to match the size of the
|
|
3046
|
+
* {@link Components.renderer}.
|
|
3047
|
+
*/
|
|
3048
|
+
updateAspect: () => void;
|
|
3049
|
+
private getItemsBounding;
|
|
3050
|
+
private setupCamera;
|
|
3051
|
+
private newCameraControls;
|
|
3052
|
+
private setupEvents;
|
|
3053
|
+
private static getSubsetOfThree;
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
/**
|
|
3057
|
+
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
3058
|
+
*/
|
|
3059
|
+
export declare class SimpleGrid implements Hideable, Disposable_2, Configurable<SimpleGridConfigManager, SimpleGridConfig> {
|
|
3060
|
+
/** {@link Disposable.onDisposed} */
|
|
3061
|
+
readonly onDisposed: Event_2<unknown>;
|
|
3062
|
+
/** {@link Configurable.onSetup} */
|
|
3063
|
+
readonly onSetup: Event_2<unknown>;
|
|
3064
|
+
/** {@link Configurable.isSetup} */
|
|
3065
|
+
isSetup: boolean;
|
|
3066
|
+
/** The world instance to which this Raycaster belongs. */
|
|
3067
|
+
world: World;
|
|
3068
|
+
/** The components instance to which this grid belongs. */
|
|
3069
|
+
components: Components;
|
|
3070
|
+
/** {@link Configurable.config} */
|
|
3071
|
+
config: SimpleGridConfigManager;
|
|
3072
|
+
protected _defaultConfig: SimpleGridConfig;
|
|
3073
|
+
/** {@link Hideable.visible} */
|
|
3074
|
+
get visible(): boolean;
|
|
3075
|
+
/** {@link Hideable.visible} */
|
|
3076
|
+
set visible(visible: boolean);
|
|
3077
|
+
/** The material of the grid. */
|
|
3078
|
+
get material(): THREE.ShaderMaterial;
|
|
3079
|
+
/**
|
|
3080
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3081
|
+
* perspective cameras and false for orthographic cameras.
|
|
3082
|
+
*/
|
|
3083
|
+
get fade(): boolean;
|
|
3084
|
+
/**
|
|
3085
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
3086
|
+
* perspective cameras and false for orthographic cameras.
|
|
3087
|
+
*/
|
|
3088
|
+
set fade(active: boolean);
|
|
3089
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
3090
|
+
readonly three: THREE.Mesh;
|
|
3091
|
+
private _fade;
|
|
3092
|
+
constructor(components: Components, world: World);
|
|
3093
|
+
/** {@link Configurable.setup} */
|
|
3094
|
+
setup(config?: Partial<SimpleGridConfig>): void;
|
|
3095
|
+
/** {@link Disposable.dispose} */
|
|
3096
|
+
dispose(): void;
|
|
3097
|
+
private setupEvents;
|
|
3098
|
+
private updateZoom;
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3101
|
+
/**
|
|
3102
|
+
* Configuration interface for the {@link SimpleGrid}.
|
|
3103
|
+
*/
|
|
3104
|
+
export declare interface SimpleGridConfig {
|
|
3105
|
+
/**
|
|
3106
|
+
* Whether the grid is visible or not.
|
|
3107
|
+
*/
|
|
3108
|
+
visible: boolean;
|
|
3109
|
+
/**
|
|
3110
|
+
* The color of the grid lines.
|
|
3111
|
+
*/
|
|
3112
|
+
color: THREE.Color;
|
|
3113
|
+
/**
|
|
3114
|
+
* The size of the primary grid lines.
|
|
3115
|
+
*/
|
|
3116
|
+
primarySize: number;
|
|
3117
|
+
/**
|
|
3118
|
+
* The size of the secondary grid lines.
|
|
3119
|
+
*/
|
|
3120
|
+
secondarySize: number;
|
|
3121
|
+
/**
|
|
3122
|
+
* The distance at which the grid lines start to fade away.
|
|
3123
|
+
*/
|
|
3124
|
+
distance: number;
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
export declare class SimpleGridConfigManager extends Configurator<SimpleGrid, SimpleGridConfigType> {
|
|
3128
|
+
protected _config: SimpleGridConfigType;
|
|
3129
|
+
/**
|
|
3130
|
+
* Whether the grid is visible or not.
|
|
3131
|
+
*/
|
|
3132
|
+
get visible(): boolean;
|
|
3133
|
+
/**
|
|
3134
|
+
* Whether the grid is visible or not.
|
|
3135
|
+
*/
|
|
3136
|
+
set visible(value: boolean);
|
|
3137
|
+
/**
|
|
3138
|
+
* The color of the grid lines.
|
|
3139
|
+
*/
|
|
3140
|
+
get color(): THREE.Color;
|
|
3141
|
+
/**
|
|
3142
|
+
* The color of the grid lines.
|
|
3143
|
+
*/
|
|
3144
|
+
set color(value: THREE.Color);
|
|
3145
|
+
/**
|
|
3146
|
+
* The size of the primary grid lines.
|
|
3147
|
+
*/
|
|
3148
|
+
get primarySize(): number;
|
|
3149
|
+
/**
|
|
3150
|
+
* The size of the primary grid lines.
|
|
3151
|
+
*/
|
|
3152
|
+
set primarySize(value: number);
|
|
3153
|
+
/**
|
|
3154
|
+
* The size of the secondary grid lines.
|
|
3155
|
+
*/
|
|
3156
|
+
get secondarySize(): number;
|
|
3157
|
+
/**
|
|
3158
|
+
* The size of the secondary grid lines.
|
|
3159
|
+
*/
|
|
3160
|
+
set secondarySize(value: number);
|
|
3161
|
+
/**
|
|
3162
|
+
* The distance at which the grid lines start to fade away.
|
|
3163
|
+
*/
|
|
3164
|
+
get distance(): number;
|
|
3165
|
+
/**
|
|
3166
|
+
* The distance at which the grid lines start to fade away.
|
|
3167
|
+
*/
|
|
3168
|
+
set distance(value: number);
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
declare type SimpleGridConfigType = {
|
|
3172
|
+
visible: BooleanSettingsControl;
|
|
3173
|
+
color: ColorSettingsControl;
|
|
3174
|
+
primarySize: NumberSettingControl;
|
|
3175
|
+
secondarySize: NumberSettingControl;
|
|
3176
|
+
distance: NumberSettingControl;
|
|
3177
|
+
};
|
|
3178
|
+
|
|
3179
|
+
/**
|
|
3180
|
+
* Each of the clipping planes created by the clipper.
|
|
3181
|
+
*/
|
|
3182
|
+
export declare class SimplePlane implements Disposable_2, Hideable {
|
|
3183
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
3184
|
+
readonly onDraggingStarted: Event_2<unknown>;
|
|
3185
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
3186
|
+
readonly onDraggingEnded: Event_2<unknown>;
|
|
3187
|
+
/** {@link Disposable.onDisposed} */
|
|
3188
|
+
readonly onDisposed: Event_2<unknown>;
|
|
3189
|
+
/**
|
|
3190
|
+
* The normal vector of the clipping plane.
|
|
3191
|
+
*/
|
|
3192
|
+
readonly normal: THREE.Vector3;
|
|
3193
|
+
/**
|
|
3194
|
+
* The origin point of the clipping plane.
|
|
3195
|
+
*/
|
|
3196
|
+
readonly origin: THREE.Vector3;
|
|
3197
|
+
/**
|
|
3198
|
+
* The THREE.js Plane object representing the clipping plane.
|
|
3199
|
+
*/
|
|
3200
|
+
readonly three: THREE.Plane;
|
|
3201
|
+
/** The components instance to which this plane belongs. */
|
|
3202
|
+
components: Components;
|
|
3203
|
+
/** The world instance to which this plane belongs. */
|
|
3204
|
+
world: World;
|
|
3205
|
+
/** A custom string to identify what this plane is used for. */
|
|
3206
|
+
type: string;
|
|
3207
|
+
private _title;
|
|
3208
|
+
set title(value: string);
|
|
3209
|
+
get title(): string;
|
|
3210
|
+
protected readonly _helper: THREE.Object3D;
|
|
3211
|
+
protected _visible: boolean;
|
|
3212
|
+
protected _enabled: boolean;
|
|
3213
|
+
private _controlsActive;
|
|
3214
|
+
private readonly _arrowBoundBox;
|
|
3215
|
+
private readonly _planeMesh;
|
|
3216
|
+
private readonly _controls;
|
|
3217
|
+
private readonly _hiddenMaterial;
|
|
3218
|
+
/**
|
|
3219
|
+
* Getter for the enabled state of the clipping plane.
|
|
3220
|
+
* @returns {boolean} The current enabled state.
|
|
3221
|
+
*/
|
|
3222
|
+
get enabled(): boolean;
|
|
3223
|
+
/**
|
|
3224
|
+
* Setter for the enabled state of the clipping plane.
|
|
3225
|
+
* Updates the clipping plane state in the renderer and throws an error if no renderer is found.
|
|
3226
|
+
* @param {boolean} state - The new enabled state.
|
|
3227
|
+
*/
|
|
3228
|
+
set enabled(state: boolean);
|
|
3229
|
+
private _visibilityBeforeDisabled;
|
|
3230
|
+
/** {@link Hideable.visible } */
|
|
3231
|
+
get visible(): boolean;
|
|
3232
|
+
/** {@link Hideable.visible } */
|
|
3233
|
+
set visible(state: boolean);
|
|
3234
|
+
/** The meshes used for raycasting */
|
|
3235
|
+
get meshes(): THREE.Mesh[];
|
|
3236
|
+
/** The material of the clipping plane representation. */
|
|
3237
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
3238
|
+
/** The material of the clipping plane representation. */
|
|
3239
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
3240
|
+
/** The size of the clipping plane representation. */
|
|
3241
|
+
get size(): number;
|
|
3242
|
+
/** Sets the size of the clipping plane representation. */
|
|
3243
|
+
set size(size: number);
|
|
3244
|
+
/**
|
|
3245
|
+
* Getter for the helper object of the clipping plane.
|
|
3246
|
+
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
3247
|
+
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
3248
|
+
*
|
|
3249
|
+
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
3250
|
+
*/
|
|
3251
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3252
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
3253
|
+
private notifyManager;
|
|
3254
|
+
/**
|
|
3255
|
+
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
3256
|
+
* This method resets the clipping plane's state, updates the normal and origin,
|
|
3257
|
+
* and positions the helper object accordingly.
|
|
3258
|
+
*
|
|
3259
|
+
* @param normal - The new normal vector for the clipping plane.
|
|
3260
|
+
* @param point - The new origin point for the clipping plane.
|
|
3261
|
+
*
|
|
3262
|
+
* @returns {void}
|
|
3263
|
+
*/
|
|
3264
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
3265
|
+
/** {@link Updateable.update} */
|
|
3266
|
+
update: () => void;
|
|
3267
|
+
/** {@link Disposable.dispose} */
|
|
3268
|
+
dispose(): void;
|
|
3269
|
+
private reset;
|
|
3270
|
+
protected toggleControls(state: boolean): void;
|
|
3271
|
+
private newTransformControls;
|
|
3272
|
+
private initializeControls;
|
|
3273
|
+
private createArrowBoundingBox;
|
|
3274
|
+
private changeDrag;
|
|
3275
|
+
private notifyDraggingChanged;
|
|
3276
|
+
private preventCameraMovement;
|
|
3277
|
+
private newHelper;
|
|
3278
|
+
private static newPlaneMesh;
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3281
|
+
/**
|
|
3282
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
3283
|
+
*/
|
|
3284
|
+
export declare class SimpleRaycaster implements Disposable_2 {
|
|
3285
|
+
/** {@link Component.enabled} */
|
|
3286
|
+
enabled: boolean;
|
|
3287
|
+
/** The components instance to which this Raycaster belongs. */
|
|
3288
|
+
components: Components;
|
|
3289
|
+
/** {@link Disposable.onDisposed} */
|
|
3290
|
+
readonly onDisposed: Event_2<unknown>;
|
|
3291
|
+
/** The position of the mouse in the screen. */
|
|
3292
|
+
readonly mouse: Mouse;
|
|
3293
|
+
/**
|
|
3294
|
+
* A reference to the Three.js Raycaster instance.
|
|
3295
|
+
* This is used for raycasting operations.
|
|
3296
|
+
*/
|
|
3297
|
+
readonly three: THREE.Raycaster;
|
|
3298
|
+
/**
|
|
3299
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
3300
|
+
* This is used to access the camera and meshes.
|
|
3301
|
+
*/
|
|
3302
|
+
world: World;
|
|
3303
|
+
constructor(components: Components, world: World);
|
|
3304
|
+
/** {@link Disposable.dispose} */
|
|
3305
|
+
dispose(): void;
|
|
3306
|
+
castRayToObjects(items?: THREE.Object3D[], position?: THREE.Vector2): THREE.Intersection | null;
|
|
3307
|
+
/**
|
|
3308
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3309
|
+
* the first item found. This also takes into account the clipping planes
|
|
3310
|
+
* used by the renderer.
|
|
3311
|
+
*
|
|
3312
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3313
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
3314
|
+
* {@link Components.meshes}.
|
|
3315
|
+
* @param position - the screen position to use for raycasting. If not provided,
|
|
3316
|
+
* the last pointer (mouse/touch) position will be used.
|
|
3317
|
+
*/
|
|
3318
|
+
castRay(data?: {
|
|
3319
|
+
snappingClasses?: FRAGS.SnappingClass[];
|
|
3320
|
+
items?: THREE.Object3D[];
|
|
3321
|
+
position?: THREE.Vector2;
|
|
3322
|
+
}): Promise<THREE.Intersection | null>;
|
|
3323
|
+
private intersect;
|
|
3324
|
+
private filterClippingPlanes;
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
/**
|
|
3328
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
3329
|
+
*/
|
|
3330
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
3331
|
+
/**
|
|
3332
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
3333
|
+
* Default is `true`.
|
|
3334
|
+
*/
|
|
3335
|
+
enabled: boolean;
|
|
3336
|
+
/**
|
|
3337
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
3338
|
+
*/
|
|
3339
|
+
container: HTMLElement;
|
|
3340
|
+
/**
|
|
3341
|
+
* The THREE.js WebGLRenderer instance.
|
|
3342
|
+
*/
|
|
3343
|
+
three: THREE.WebGLRenderer;
|
|
3344
|
+
protected _canvas: HTMLCanvasElement;
|
|
3345
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3346
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
3347
|
+
protected onContainerUpdated: Event_2<unknown>;
|
|
3348
|
+
private _resizing;
|
|
3349
|
+
/**
|
|
3350
|
+
* Constructor for the SimpleRenderer class.
|
|
3351
|
+
*
|
|
3352
|
+
* @param components - The components instance.
|
|
3353
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3354
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3355
|
+
*/
|
|
3356
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
3357
|
+
/** {@link Updateable.update} */
|
|
3358
|
+
update(): void;
|
|
3359
|
+
/** {@link Disposable.dispose} */
|
|
3360
|
+
dispose(): void;
|
|
3361
|
+
/** {@link Resizeable.getSize}. */
|
|
3362
|
+
getSize(): THREE.Vector2;
|
|
3363
|
+
/** {@link Resizeable.resize} */
|
|
3364
|
+
resize: (size?: THREE.Vector2) => void;
|
|
3365
|
+
/**
|
|
3366
|
+
* Sets up and manages the event listeners for the renderer.
|
|
3367
|
+
*
|
|
3368
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
3369
|
+
*
|
|
3370
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
3371
|
+
*/
|
|
3372
|
+
setupEvents(active: boolean): void;
|
|
3373
|
+
private resizeEvent;
|
|
3374
|
+
private setupRenderer;
|
|
3375
|
+
private onContextLost;
|
|
3376
|
+
private onContextBack;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
/**
|
|
3380
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
3381
|
+
*/
|
|
3382
|
+
export declare class SimpleScene extends BaseScene implements Configurable<SimpleSceneConfigManager, SimpleSceneConfig> {
|
|
3383
|
+
/** {@link Configurable.onSetup} */
|
|
3384
|
+
readonly onSetup: Event_2<unknown>;
|
|
3385
|
+
/** {@link Configurable.isSetup} */
|
|
3386
|
+
isSetup: boolean;
|
|
3387
|
+
/**
|
|
3388
|
+
* The underlying Three.js scene object.
|
|
3389
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3390
|
+
*/
|
|
3391
|
+
three: THREE.Scene;
|
|
3392
|
+
/** {@link Configurable.config} */
|
|
3393
|
+
config: SimpleSceneConfigManager;
|
|
3394
|
+
protected _defaultConfig: SimpleSceneConfig;
|
|
3395
|
+
constructor(components: Components);
|
|
3396
|
+
/** {@link Configurable.setup} */
|
|
3397
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3398
|
+
dispose(): void;
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
/**
|
|
3402
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3403
|
+
*/
|
|
3404
|
+
export declare interface SimpleSceneConfig {
|
|
3405
|
+
backgroundColor: THREE.Color;
|
|
3406
|
+
directionalLight: {
|
|
3407
|
+
color: THREE.Color;
|
|
3408
|
+
intensity: number;
|
|
3409
|
+
position: THREE.Vector3;
|
|
3410
|
+
};
|
|
3411
|
+
ambientLight: {
|
|
3412
|
+
color: THREE.Color;
|
|
3413
|
+
intensity: number;
|
|
3414
|
+
};
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
export declare class SimpleSceneConfigManager extends Configurator<SimpleScene, SimpleSceneConfigType> {
|
|
3418
|
+
protected _config: SimpleSceneConfigType;
|
|
3419
|
+
ambientLight: AmbientLightConfig;
|
|
3420
|
+
directionalLight: DirectionalLightConfig;
|
|
3421
|
+
get backgroundColor(): THREE.Color;
|
|
3422
|
+
set backgroundColor(value: THREE.Color);
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
declare type SimpleSceneConfigType = {
|
|
3426
|
+
backgroundColor: ColorSettingsControl;
|
|
3427
|
+
ambientLight: {
|
|
3428
|
+
color: ColorSettingsControl;
|
|
3429
|
+
intensity: NumberSettingControl;
|
|
3430
|
+
};
|
|
3431
|
+
directionalLight: {
|
|
3432
|
+
color: ColorSettingsControl;
|
|
3433
|
+
intensity: NumberSettingControl;
|
|
3434
|
+
position: Vector3SettingControl;
|
|
3435
|
+
};
|
|
3436
|
+
};
|
|
3437
|
+
|
|
3438
|
+
/**
|
|
3439
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
3440
|
+
*
|
|
3441
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
3442
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
3443
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
3444
|
+
*/
|
|
3445
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable_2, Updateable {
|
|
3446
|
+
readonly onCameraChanged: Event_2<U>;
|
|
3447
|
+
/**
|
|
3448
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
3449
|
+
*/
|
|
3450
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
3451
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3452
|
+
readonly onAfterUpdate: Event_2<unknown>;
|
|
3453
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3454
|
+
readonly onBeforeUpdate: Event_2<unknown>;
|
|
3455
|
+
/** {@link Disposable.onDisposed} */
|
|
3456
|
+
readonly onDisposed: Event_2<unknown>;
|
|
3457
|
+
/**
|
|
3458
|
+
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
3459
|
+
*/
|
|
3460
|
+
isDisposing: boolean;
|
|
3461
|
+
/**
|
|
3462
|
+
* Indicates whether the world is currently enabled.
|
|
3463
|
+
* When disabled, the world will not be updated.
|
|
3464
|
+
*/
|
|
3465
|
+
enabled: boolean;
|
|
3466
|
+
private _dynamicAnchor;
|
|
3467
|
+
set dynamicAnchor(value: boolean);
|
|
3468
|
+
get dynamicAnchor(): boolean;
|
|
3469
|
+
/**
|
|
3470
|
+
* A unique identifier for the world. Is not meant to be changed at any moment.
|
|
3471
|
+
*/
|
|
3472
|
+
readonly uuid: string;
|
|
3473
|
+
/**
|
|
3474
|
+
* An optional name for the world.
|
|
3475
|
+
*/
|
|
3476
|
+
name?: string;
|
|
3477
|
+
private _scene?;
|
|
3478
|
+
private _camera?;
|
|
3479
|
+
private _renderer;
|
|
3480
|
+
private onPointerDown;
|
|
3481
|
+
private _defaultCamera?;
|
|
3482
|
+
get defaultCamera(): U;
|
|
3483
|
+
set defaultCamera(value: U);
|
|
3484
|
+
/**
|
|
3485
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
3486
|
+
* @returns The current scene.
|
|
3487
|
+
*/
|
|
3488
|
+
get scene(): T;
|
|
3489
|
+
/**
|
|
3490
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
3491
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
3492
|
+
* @param scene - The new scene to be set.
|
|
3493
|
+
*/
|
|
3494
|
+
set scene(scene: T);
|
|
3495
|
+
/**
|
|
3496
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
3497
|
+
* @returns The current camera.
|
|
3498
|
+
*/
|
|
3499
|
+
get camera(): U;
|
|
3500
|
+
/**
|
|
3501
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
3502
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
3503
|
+
* @param camera - The new camera to be set.
|
|
3504
|
+
*/
|
|
3505
|
+
set camera(camera: U);
|
|
3506
|
+
/**
|
|
3507
|
+
* Getter for the renderer.
|
|
3508
|
+
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
3509
|
+
*/
|
|
3510
|
+
get renderer(): S | null;
|
|
3511
|
+
/**
|
|
3512
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
3513
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
3514
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
3515
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
3516
|
+
*/
|
|
3517
|
+
set renderer(renderer: S | null);
|
|
3518
|
+
useDefaultCamera(): void;
|
|
3519
|
+
/** {@link Updateable.update} */
|
|
3520
|
+
update(delta?: number): void;
|
|
3521
|
+
/** {@link Disposable.dispose} */
|
|
3522
|
+
dispose(disposeResources?: boolean): void;
|
|
3523
|
+
}
|
|
3524
|
+
|
|
3525
|
+
export declare interface TextSetSettingControl {
|
|
3526
|
+
type: "TextSet";
|
|
3527
|
+
value: Set<string>;
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
export declare interface TextSettingsControl {
|
|
3531
|
+
type: "Text";
|
|
3532
|
+
value: string;
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
export declare class Topic implements BCFTopic {
|
|
3536
|
+
/**
|
|
3537
|
+
* Default values for a BCF Topic, excluding `guid`, `creationDate`, and `creationAuthor`.
|
|
3538
|
+
*/
|
|
3539
|
+
static default: Omit<Partial<BCFTopic> & {
|
|
3540
|
+
title: string;
|
|
3541
|
+
type: string;
|
|
3542
|
+
status: string;
|
|
3543
|
+
}, "guid" | "creationDate" | "creationAuthor">;
|
|
3544
|
+
/**
|
|
3545
|
+
* A unique identifier for the topic.
|
|
3546
|
+
*
|
|
3547
|
+
* @remarks
|
|
3548
|
+
* The `guid` is automatically generated upon topic creation and by no means it should change.
|
|
3549
|
+
*/
|
|
3550
|
+
guid: string;
|
|
3551
|
+
title: string;
|
|
3552
|
+
creationDate: Date;
|
|
3553
|
+
creationAuthor: string;
|
|
3554
|
+
readonly viewpoints: DataSet<string>;
|
|
3555
|
+
readonly relatedTopics: DataSet<string>;
|
|
3556
|
+
readonly comments: DataMap<string, Comment_2>;
|
|
3557
|
+
readonly documentReferences: DataSet<string>;
|
|
3558
|
+
customData: Record<string, any>;
|
|
3559
|
+
description?: string;
|
|
3560
|
+
serverAssignedId?: string;
|
|
3561
|
+
dueDate?: Date;
|
|
3562
|
+
modifiedAuthor?: string;
|
|
3563
|
+
modifiedDate?: Date;
|
|
3564
|
+
index?: number;
|
|
3565
|
+
private _type;
|
|
3566
|
+
set type(value: string);
|
|
3567
|
+
get type(): string;
|
|
3568
|
+
private _status;
|
|
3569
|
+
set status(value: string);
|
|
3570
|
+
get status(): string;
|
|
3571
|
+
private _priority?;
|
|
3572
|
+
set priority(value: string | undefined);
|
|
3573
|
+
get priority(): string | undefined;
|
|
3574
|
+
private _stage?;
|
|
3575
|
+
set stage(value: string | undefined);
|
|
3576
|
+
get stage(): string | undefined;
|
|
3577
|
+
private _assignedTo?;
|
|
3578
|
+
set assignedTo(value: string | undefined);
|
|
3579
|
+
get assignedTo(): string | undefined;
|
|
3580
|
+
private _labels;
|
|
3581
|
+
set labels(value: Set<string>);
|
|
3582
|
+
get labels(): Set<string>;
|
|
3583
|
+
private _components;
|
|
3584
|
+
private get _managerVersion();
|
|
3585
|
+
/**
|
|
3586
|
+
* Initializes a new instance of the `Topic` class representing a BCF (BIM Collaboration Format) topic.
|
|
3587
|
+
* It provides methods and properties to manage and serialize BCF topics.
|
|
3588
|
+
*
|
|
3589
|
+
* @remarks
|
|
3590
|
+
* The default creationUser is the one set in BCFTopics.config.author
|
|
3591
|
+
* It should not be created manually. Better use BCFTopics.create().
|
|
3592
|
+
*
|
|
3593
|
+
* @param components - The `Components` instance that provides access to other components and services.
|
|
3594
|
+
*/
|
|
3595
|
+
constructor(components: Components);
|
|
3596
|
+
/**
|
|
3597
|
+
* Sets properties of the BCF Topic based on the provided data.
|
|
3598
|
+
*
|
|
3599
|
+
* @remarks
|
|
3600
|
+
* This method iterates over the provided `data` object and updates the corresponding properties of the BCF Topic.
|
|
3601
|
+
* It skips the `guid` property as it should not be modified.
|
|
3602
|
+
*
|
|
3603
|
+
* @param data - An object containing the properties to be updated.
|
|
3604
|
+
* @returns The topic
|
|
3605
|
+
*
|
|
3606
|
+
* @example
|
|
3607
|
+
* ```typescript
|
|
3608
|
+
* const topic = new Topic(components);
|
|
3609
|
+
* topic.set({
|
|
3610
|
+
* title: "New BCF Topic Title",
|
|
3611
|
+
* description: "This is a new description.",
|
|
3612
|
+
* status: "Resolved",
|
|
3613
|
+
* });
|
|
3614
|
+
* ```
|
|
3615
|
+
*/
|
|
3616
|
+
set(data: Partial<BCFTopic>): this;
|
|
3617
|
+
/**
|
|
3618
|
+
* Creates a new comment associated with the current topic.
|
|
3619
|
+
*
|
|
3620
|
+
* @param text - The text content of the comment.
|
|
3621
|
+
* @param viewpoint - (Optional) The viewpoint associated with the comment.
|
|
3622
|
+
*
|
|
3623
|
+
* @returns The newly created comment.
|
|
3624
|
+
*
|
|
3625
|
+
* @example
|
|
3626
|
+
* ```typescript
|
|
3627
|
+
* const viewpoint = viewpoints.create(world); // Created with an instance of Viewpoints
|
|
3628
|
+
* const topic = topics.create(); // Created with an instance of BCFTopics
|
|
3629
|
+
* topic.viewpoints.add(viewpoint);
|
|
3630
|
+
* const comment = topic.createComment("This is a new comment", viewpoint);
|
|
3631
|
+
* ```
|
|
3632
|
+
*/
|
|
3633
|
+
createComment(text: string, viewpoint?: string): Comment_2;
|
|
3634
|
+
private createLabelTags;
|
|
3635
|
+
private createCommentTags;
|
|
3636
|
+
private createViewpointTags;
|
|
3637
|
+
private createRelatedTopicTags;
|
|
3638
|
+
private createDocumentReferencesTag;
|
|
3639
|
+
toJSON(): BCFApiTopic;
|
|
3640
|
+
/**
|
|
3641
|
+
* Serializes the BCF Topic instance into an XML string representation based on the official schema.
|
|
3642
|
+
*
|
|
3643
|
+
* @remarks
|
|
3644
|
+
* This method constructs an XML string based on the properties of the BCF Topic instance.
|
|
3645
|
+
* It includes the topic's guid, type, status, creation date, creation author, priority, index,
|
|
3646
|
+
* modified date, modified author, due date, assigned to, description, stage, labels, related topics,
|
|
3647
|
+
* comments, and viewpoints.
|
|
3648
|
+
*
|
|
3649
|
+
* @returns A string representing the XML serialization of the BCF Topic.
|
|
3650
|
+
*
|
|
3651
|
+
* @example
|
|
3652
|
+
* ```typescript
|
|
3653
|
+
* const topic = bcfTopics.create(); // Created with an instance of BCFTopics
|
|
3654
|
+
* const xml = topic.serialize();
|
|
3655
|
+
* console.log(xml);
|
|
3656
|
+
* ```
|
|
3657
|
+
*/
|
|
3658
|
+
serialize(): string;
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
/** Whether this component should be updated each frame. */
|
|
3662
|
+
export declare interface Updateable {
|
|
3663
|
+
/** Actions that should be executed after updating the component. */
|
|
3664
|
+
onAfterUpdate: Event_2<any>;
|
|
3665
|
+
/** Actions that should be executed before updating the component. */
|
|
3666
|
+
onBeforeUpdate: Event_2<any>;
|
|
3667
|
+
/**
|
|
3668
|
+
* Function used to update the state of this component each frame. For
|
|
3669
|
+
* instance, a renderer component will make a render each frame.
|
|
3670
|
+
*/
|
|
3671
|
+
update(delta?: number): void;
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
export declare class UUID {
|
|
3675
|
+
private static _pattern;
|
|
3676
|
+
private static _lut;
|
|
3677
|
+
static create(): string;
|
|
3678
|
+
static validate(uuid: string): void;
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
export declare interface Vector3SettingControl {
|
|
3682
|
+
type: "Vector3";
|
|
3683
|
+
value: THREE.Vector3;
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
/**
|
|
3687
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
3688
|
+
*/
|
|
3689
|
+
export declare class VertexPicker extends Component implements Disposable_2 {
|
|
3690
|
+
/** {@link Disposable.onDisposed} */
|
|
3691
|
+
readonly onDisposed: Event_2<unknown>;
|
|
3692
|
+
/**
|
|
3693
|
+
* An event that is triggered when a vertex is found.
|
|
3694
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
3695
|
+
*/
|
|
3696
|
+
readonly onVertexFound: Event_2<THREE.Vector3>;
|
|
3697
|
+
/**
|
|
3698
|
+
* An event that is triggered when a vertex is lost.
|
|
3699
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
3700
|
+
*/
|
|
3701
|
+
readonly onVertexLost: Event_2<THREE.Vector3>;
|
|
3702
|
+
/**
|
|
3703
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
3704
|
+
*/
|
|
3705
|
+
readonly onEnabled: Event_2<boolean>;
|
|
3706
|
+
/**
|
|
3707
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
3708
|
+
*/
|
|
3709
|
+
components: Components;
|
|
3710
|
+
/**
|
|
3711
|
+
* A reference to the working plane used for vertex picking.
|
|
3712
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
3713
|
+
* If this value is null, all vertices are considered valid.
|
|
3714
|
+
*/
|
|
3715
|
+
workingPlane: THREE.Plane | null;
|
|
3716
|
+
private _pickedPoint;
|
|
3717
|
+
private _config;
|
|
3718
|
+
private _enabled;
|
|
3719
|
+
/**
|
|
3720
|
+
* Sets the enabled state of the VertexPicker.
|
|
3721
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
3722
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
3723
|
+
*
|
|
3724
|
+
* @param value - The new enabled state.
|
|
3725
|
+
*/
|
|
3726
|
+
set enabled(value: boolean);
|
|
3727
|
+
/**
|
|
3728
|
+
* Gets the current enabled state of the VertexPicker.
|
|
3729
|
+
*
|
|
3730
|
+
* @returns The current enabled state.
|
|
3731
|
+
*/
|
|
3732
|
+
get enabled(): boolean;
|
|
3733
|
+
/**
|
|
3734
|
+
* Sets the configuration for the VertexPicker component.
|
|
3735
|
+
*
|
|
3736
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
3737
|
+
* The properties not provided in the value object will retain their current values.
|
|
3738
|
+
*
|
|
3739
|
+
* @example
|
|
3740
|
+
* ```typescript
|
|
3741
|
+
* vertexPicker.config = {
|
|
3742
|
+
* snapDistance: 0.5,
|
|
3743
|
+
* showOnlyVertex: true,
|
|
3744
|
+
* };
|
|
3745
|
+
* ```
|
|
3746
|
+
*/
|
|
3747
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
3748
|
+
/**
|
|
3749
|
+
* Gets the current configuration for the VertexPicker component.
|
|
3750
|
+
*
|
|
3751
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
3752
|
+
*
|
|
3753
|
+
* @example
|
|
3754
|
+
* ```typescript
|
|
3755
|
+
* const currentConfig = vertexPicker.config;
|
|
3756
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
3757
|
+
* ```
|
|
3758
|
+
*/
|
|
3759
|
+
get config(): Partial<VertexPickerConfig>;
|
|
3760
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
3761
|
+
/** {@link Disposable.dispose} */
|
|
3762
|
+
dispose(): void;
|
|
3763
|
+
/**
|
|
3764
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
3765
|
+
*
|
|
3766
|
+
* @param world - The World instance to use for raycasting.
|
|
3767
|
+
*
|
|
3768
|
+
* @returns The current picked point, or null if no point is picked.
|
|
3769
|
+
*
|
|
3770
|
+
* @remarks
|
|
3771
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
3772
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
3773
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
3774
|
+
* If the picked point is on the working plane (if defined), it triggers the `onVertexFound` event and updates the `pickedPoint`.
|
|
3775
|
+
* If the picked point is not on the working plane, it resets the `pickedPoint`.
|
|
3776
|
+
* If no intersecting object is found, it triggers the `onVertexLost` event and resets the `pickedPoint`.
|
|
3777
|
+
*/
|
|
3778
|
+
get(world: World): Promise<THREE.Vector3 | null>;
|
|
3779
|
+
}
|
|
3780
|
+
|
|
3781
|
+
/**
|
|
3782
|
+
* Configuration interface for the VertexPicker component.
|
|
3783
|
+
*/
|
|
3784
|
+
export declare interface VertexPickerConfig {
|
|
3785
|
+
/**
|
|
3786
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
3787
|
+
*/
|
|
3788
|
+
showOnlyVertex: boolean;
|
|
3789
|
+
/**
|
|
3790
|
+
* The maximum distance for snapping to a vertex.
|
|
3791
|
+
*/
|
|
3792
|
+
snapDistance: number;
|
|
3793
|
+
/**
|
|
3794
|
+
* The HTML element to use for previewing the picked vertex.
|
|
3795
|
+
*/
|
|
3796
|
+
previewElement: HTMLElement;
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3799
|
+
export declare class View implements Disposable_2 {
|
|
3800
|
+
private _components;
|
|
3801
|
+
private _cameraOffset;
|
|
3802
|
+
private _planeHelper;
|
|
3803
|
+
private _farPlaneHelper;
|
|
3804
|
+
private _cameraHelper;
|
|
3805
|
+
private get _planeNormalOpposite();
|
|
3806
|
+
private get _planePosition();
|
|
3807
|
+
private get _cameraPosition();
|
|
3808
|
+
readonly onStateChanged: Event_2<string[]>;
|
|
3809
|
+
readonly onUpdated: Event_2<undefined>;
|
|
3810
|
+
readonly onDisposed: Event_2<undefined>;
|
|
3811
|
+
readonly camera: OrthoPerspectiveCamera;
|
|
3812
|
+
readonly plane: THREE.Plane;
|
|
3813
|
+
readonly farPlane: THREE.Plane;
|
|
3814
|
+
readonly id: string;
|
|
3815
|
+
private _open;
|
|
3816
|
+
set open(value: boolean);
|
|
3817
|
+
get open(): boolean;
|
|
3818
|
+
set planeHelperColor(value: THREE.Color);
|
|
3819
|
+
set farPlaneHelperColor(value: THREE.Color);
|
|
3820
|
+
private _range;
|
|
3821
|
+
set range(value: number);
|
|
3822
|
+
get range(): number;
|
|
3823
|
+
set distance(value: number);
|
|
3824
|
+
get distance(): number;
|
|
3825
|
+
private _world;
|
|
3826
|
+
set world(value: World | null);
|
|
3827
|
+
get world(): World | null;
|
|
3828
|
+
private _helpersVisible;
|
|
3829
|
+
set helpersVisible(value: boolean);
|
|
3830
|
+
get helpersVisible(): boolean;
|
|
3831
|
+
private _planesEnabled;
|
|
3832
|
+
set planesEnabled(value: boolean);
|
|
3833
|
+
get planesEnabled(): boolean;
|
|
3834
|
+
constructor(components: Components, config?: {
|
|
3835
|
+
id?: string;
|
|
3836
|
+
normal?: THREE.Vector3;
|
|
3837
|
+
point?: THREE.Vector3;
|
|
3838
|
+
});
|
|
3839
|
+
dispose(): void;
|
|
3840
|
+
update(): void;
|
|
3841
|
+
flip(): void;
|
|
3842
|
+
}
|
|
3843
|
+
|
|
3844
|
+
/**
|
|
3845
|
+
* Represents a BCF compliant viewpoint from BuildingSMART.
|
|
3846
|
+
*
|
|
3847
|
+
* The Viewpoint class provides methods for managing and interacting with viewpoints.
|
|
3848
|
+
* It includes functionality for setting viewpoint properties, updating the camera,
|
|
3849
|
+
* applying color to components, and serializing the viewpoint for export.
|
|
3850
|
+
*/
|
|
3851
|
+
export declare class Viewpoint {
|
|
3852
|
+
title?: string;
|
|
3853
|
+
readonly guid: string;
|
|
3854
|
+
/**
|
|
3855
|
+
* ClippingPlanes can be used to define a subsection of a building model that is related to the topic.
|
|
3856
|
+
* Each clipping plane is defined by Location and Direction.
|
|
3857
|
+
* The Direction vector points in the invisible direction meaning the half-space that is clipped.
|
|
3858
|
+
*/
|
|
3859
|
+
readonly clippingPlanes: FRAGS.DataSet<string>;
|
|
3860
|
+
camera: ViewpointPerspectiveCamera | ViewpointOrthogonalCamera;
|
|
3861
|
+
/**
|
|
3862
|
+
* A list of components GUIDs to hide when defaultVisibility = true or to show when defaultVisibility = false
|
|
3863
|
+
*/
|
|
3864
|
+
readonly exceptionComponents: FRAGS.DataSet<string>;
|
|
3865
|
+
/**
|
|
3866
|
+
* A list of components GUIDs that should be selected (highlighted) when displaying a viewpoint.
|
|
3867
|
+
*/
|
|
3868
|
+
readonly selectionComponents: FRAGS.DataSet<string>;
|
|
3869
|
+
/**
|
|
3870
|
+
* A map of colors and components GUIDs that should be colorized when displaying a viewpoint.
|
|
3871
|
+
* For this to work, call viewpoint.colorize()
|
|
3872
|
+
*/
|
|
3873
|
+
readonly componentColors: FRAGS.DataMap<string, string[]>;
|
|
3874
|
+
/**
|
|
3875
|
+
* Boolean flags to allow fine control over the visibility of spaces.
|
|
3876
|
+
* A typical use of these flags is when DefaultVisibility=true but spaces should remain hidden.
|
|
3877
|
+
* @default false
|
|
3878
|
+
*/
|
|
3879
|
+
spacesVisible: boolean;
|
|
3880
|
+
/**
|
|
3881
|
+
* Boolean flags to allow fine control over the visibility of space boundaries.
|
|
3882
|
+
* A typical use of these flags is when DefaultVisibility=true but space boundaries should remain hidden.
|
|
3883
|
+
* @default false
|
|
3884
|
+
*/
|
|
3885
|
+
spaceBoundariesVisible: boolean;
|
|
3886
|
+
/**
|
|
3887
|
+
* Boolean flags to allow fine control over the visibility of openings.
|
|
3888
|
+
* A typical use of these flags is when DefaultVisibility=true but openings should remain hidden.
|
|
3889
|
+
* @default false
|
|
3890
|
+
*/
|
|
3891
|
+
openingsVisible: boolean;
|
|
3892
|
+
/**
|
|
3893
|
+
* When true, all components should be visible unless listed in the exceptions
|
|
3894
|
+
* When false all components should be invisible unless listed in the exceptions
|
|
3895
|
+
*/
|
|
3896
|
+
defaultVisibility: boolean;
|
|
3897
|
+
/**
|
|
3898
|
+
* The snapshotID that will be used for this viewpoint when exported.
|
|
3899
|
+
*/
|
|
3900
|
+
snapshot: string;
|
|
3901
|
+
getSelectionMap(): Promise<ModelIdMap>;
|
|
3902
|
+
getExceptionMap(): Promise<ModelIdMap>;
|
|
3903
|
+
/**
|
|
3904
|
+
* Retrieves the projection type of the viewpoint's camera.
|
|
3905
|
+
*
|
|
3906
|
+
* @returns A string representing the projection type of the viewpoint's camera.
|
|
3907
|
+
* It can be either 'Perspective' or 'Orthographic'.
|
|
3908
|
+
*/
|
|
3909
|
+
get projection(): CameraProjection;
|
|
3910
|
+
/**
|
|
3911
|
+
* Retrieves the position vector of the viewpoint's camera.
|
|
3912
|
+
*
|
|
3913
|
+
* @returns A THREE.Vector3 representing the position of the viewpoint's camera.
|
|
3914
|
+
*/
|
|
3915
|
+
get position(): THREE.Vector3;
|
|
3916
|
+
/**
|
|
3917
|
+
* Sets the position of the viewpoint's camera.
|
|
3918
|
+
* @param value - The new position for the viewpoint's camera.
|
|
3919
|
+
*/
|
|
3920
|
+
set position(value: THREE.Vector3);
|
|
3921
|
+
/**
|
|
3922
|
+
* Retrieves the direction vector of the viewpoint's camera.
|
|
3923
|
+
* @returns A THREE.Vector3 representing the direction of the viewpoint's camera.
|
|
3924
|
+
*/
|
|
3925
|
+
get direction(): THREE.Vector3;
|
|
3926
|
+
private _components;
|
|
3927
|
+
private _world;
|
|
3928
|
+
/**
|
|
3929
|
+
* Represents the world in which the viewpoint will take effect.
|
|
3930
|
+
*/
|
|
3931
|
+
set world(value: World | null);
|
|
3932
|
+
get world(): World | null;
|
|
3933
|
+
private get _managerVersion();
|
|
3934
|
+
/**
|
|
3935
|
+
* Retrieves the list of BCF topics associated with the current viewpoint.
|
|
3936
|
+
*
|
|
3937
|
+
* @remarks
|
|
3938
|
+
* This function retrieves the BCFTopics manager from the components,
|
|
3939
|
+
* then filters the list of topics to find those associated with the current viewpoint.
|
|
3940
|
+
*
|
|
3941
|
+
* @returns An array of BCF topics associated with the current viewpoint.
|
|
3942
|
+
*/
|
|
3943
|
+
get topics(): Topic[];
|
|
3944
|
+
constructor(components: Components, data?: Partial<BCFViewpoint & {
|
|
3945
|
+
title: string;
|
|
3946
|
+
}>);
|
|
3947
|
+
private notifyUpdate;
|
|
3948
|
+
private setEvents;
|
|
3949
|
+
/**
|
|
3950
|
+
* Fully replace the properties of the viewpoint with the provided data.
|
|
3951
|
+
* The properties not included will remain unchanged.
|
|
3952
|
+
*
|
|
3953
|
+
* @remarks The guid will be ommited as it shouldn't change after it has been initially set.
|
|
3954
|
+
*
|
|
3955
|
+
* @param data - An object containing the properties to be set.
|
|
3956
|
+
*/
|
|
3957
|
+
set(data: Partial<BCFViewpoint>): void;
|
|
3958
|
+
/**
|
|
3959
|
+
* Sets the viewpoint of the camera in the world.
|
|
3960
|
+
*
|
|
3961
|
+
* @remarks
|
|
3962
|
+
* This function calculates the target position based on the viewpoint information.
|
|
3963
|
+
* It sets the visibility of the viewpoint components and then applies the viewpoint using the camera's controls.
|
|
3964
|
+
*
|
|
3965
|
+
* @param transition - Indicates whether the camera movement should have a transition effect.
|
|
3966
|
+
* Default value is `true`.
|
|
3967
|
+
*
|
|
3968
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
3969
|
+
*
|
|
3970
|
+
* @returns A Promise that resolves when the camera has been set.
|
|
3971
|
+
*/
|
|
3972
|
+
go(_config?: {
|
|
3973
|
+
transition?: boolean;
|
|
3974
|
+
applyClippings?: boolean;
|
|
3975
|
+
clippingsVisibility?: boolean;
|
|
3976
|
+
applyVisibility?: boolean;
|
|
3977
|
+
}): Promise<void>;
|
|
3978
|
+
/**
|
|
3979
|
+
* Updates the camera settings of the viewpoint based on the current world's camera and renderer.
|
|
3980
|
+
* @returns A boolean indicating if the camera data was updated or not.
|
|
3981
|
+
*/
|
|
3982
|
+
updateCamera(takeSnapshot?: boolean): Promise<boolean>;
|
|
3983
|
+
/**
|
|
3984
|
+
* Captures a snapshot of the current viewpoint and stores it in the snapshots manager.
|
|
3985
|
+
*/
|
|
3986
|
+
takeSnapshot(): Promise<boolean>;
|
|
3987
|
+
/**
|
|
3988
|
+
* Updates the collection of clipping planes by clearing the current set and adding enabled planes
|
|
3989
|
+
* from the associated `Clipper` component.
|
|
3990
|
+
*/
|
|
3991
|
+
updateClippingPlanes(): void;
|
|
3992
|
+
/**
|
|
3993
|
+
* Applies visibility settings to components based on default visibility, exceptions, and selections.
|
|
3994
|
+
*
|
|
3995
|
+
* This method adjusts the visibility of components using the `Hider` instance. It ensures that:
|
|
3996
|
+
* - The default visibility is applied to all components.
|
|
3997
|
+
* - Exceptions are handled to override the default visibility.
|
|
3998
|
+
* - Selected components are always visible.
|
|
3999
|
+
*/
|
|
4000
|
+
applyVisibility(): Promise<void>;
|
|
4001
|
+
/**
|
|
4002
|
+
* Asynchronously sets the colorization state for the viewpoint's components.
|
|
4003
|
+
* When the state is true, it applies the defined component colors to the corresponding fragments.
|
|
4004
|
+
* When the state is false, it resets the highlight for the corresponding fragments.
|
|
4005
|
+
*
|
|
4006
|
+
* @param state - A boolean indicating whether to apply or reset the colorization.
|
|
4007
|
+
* If true, the components will be colorized. If false, the colorization will be reset.
|
|
4008
|
+
* @returns A Promise that resolves when all colorization or reset operations are complete.
|
|
4009
|
+
* @remarks Be careful when using this method along with the Highlighter as it can cause unwanted results
|
|
4010
|
+
*/
|
|
4011
|
+
setColorizationState(state: boolean): Promise<void>;
|
|
4012
|
+
/**
|
|
4013
|
+
* Sets the enabled state of all clipping planes associated with this viewpoint.
|
|
4014
|
+
* @param state A boolean indicating whether the clipping planes should be enabled or disabled.
|
|
4015
|
+
*/
|
|
4016
|
+
setClippingState(state: boolean): void;
|
|
4017
|
+
/**
|
|
4018
|
+
* Sets the visibility of all clipping planes associated with this viewpoint.
|
|
4019
|
+
*
|
|
4020
|
+
* @param visibility - A boolean indicating whether the clipping planes should be visible (`true`) or hidden (`false`).
|
|
4021
|
+
*/
|
|
4022
|
+
setClippingVisibility(visibility: boolean): void;
|
|
4023
|
+
private createComponentTags;
|
|
4024
|
+
private createColorTags;
|
|
4025
|
+
/**
|
|
4026
|
+
* Converts the current viewpoint instance into a JSON representation compliant with the BCFViewpoint format.
|
|
4027
|
+
*
|
|
4028
|
+
* @returns A BCF API JSON complaint object representing the viewpoint, including its GUID, components,
|
|
4029
|
+
* visibility settings, clipping planes, camera configuration, and snapshot data.
|
|
4030
|
+
*/
|
|
4031
|
+
toJSON(): BCFViewpoint;
|
|
4032
|
+
/**
|
|
4033
|
+
* Serializes the viewpoint into a buildingSMART compliant XML string for export.
|
|
4034
|
+
*
|
|
4035
|
+
* @param version - The version of the BCF Manager to use for serialization.
|
|
4036
|
+
* If not provided, the current version of the manager will be used.
|
|
4037
|
+
*
|
|
4038
|
+
* @returns A Promise that resolves to an XML string representing the viewpoint.
|
|
4039
|
+
* The XML string follows the BCF VisualizationInfo schema.
|
|
4040
|
+
*
|
|
4041
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
4042
|
+
* @throws An error if the world's renderer is not available.
|
|
4043
|
+
*/
|
|
4044
|
+
serialize(version?: string): Promise<string>;
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4047
|
+
/**
|
|
4048
|
+
* Represents a bitmap image associated with a viewpoint.
|
|
4049
|
+
* This interface is compliant with the BCF API specifications.
|
|
4050
|
+
*/
|
|
4051
|
+
export declare interface ViewpointBitmap {
|
|
4052
|
+
/**
|
|
4053
|
+
* The type of the bitmap image, either "png" or "jpg".
|
|
4054
|
+
*/
|
|
4055
|
+
bitmap_type: "png" | "jpg";
|
|
4056
|
+
/**
|
|
4057
|
+
* The base64-encoded string representing the bitmap image data.
|
|
4058
|
+
*/
|
|
4059
|
+
bitmap_data: string;
|
|
4060
|
+
/**
|
|
4061
|
+
* The 3D vector specifying the location of the bitmap in space.
|
|
4062
|
+
*/
|
|
4063
|
+
location: ViewpointVector;
|
|
4064
|
+
/**
|
|
4065
|
+
* The 3D vector specifying the normal direction of the bitmap.
|
|
4066
|
+
*/
|
|
4067
|
+
normal: ViewpointVector;
|
|
4068
|
+
/**
|
|
4069
|
+
* The 3D vector specifying the upward direction of the bitmap.
|
|
4070
|
+
*/
|
|
4071
|
+
up: ViewpointVector;
|
|
4072
|
+
/**
|
|
4073
|
+
* The height of the bitmap in units.
|
|
4074
|
+
*/
|
|
4075
|
+
height: number;
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
/**
|
|
4079
|
+
* Represents the properties of a camera viewpoint in a 3D space.
|
|
4080
|
+
* This interface is compliant with the BCF API specifications.
|
|
4081
|
+
*/
|
|
4082
|
+
export declare interface ViewpointCamera {
|
|
4083
|
+
/**
|
|
4084
|
+
* The position of the camera in 3D space, defined by x, y, and z coordinates.
|
|
4085
|
+
*/
|
|
4086
|
+
camera_view_point: {
|
|
4087
|
+
x: number;
|
|
4088
|
+
y: number;
|
|
4089
|
+
z: number;
|
|
4090
|
+
};
|
|
4091
|
+
/**
|
|
4092
|
+
* The direction the camera is pointing towards, represented by x, y, and z components.
|
|
4093
|
+
*/
|
|
4094
|
+
camera_direction: {
|
|
4095
|
+
x: number;
|
|
4096
|
+
y: number;
|
|
4097
|
+
z: number;
|
|
4098
|
+
};
|
|
4099
|
+
/**
|
|
4100
|
+
* The upward direction vector of the camera, used to define the camera's orientation, represented by x, y, and z components.
|
|
4101
|
+
*/
|
|
4102
|
+
camera_up_vector: {
|
|
4103
|
+
x: number;
|
|
4104
|
+
y: number;
|
|
4105
|
+
z: number;
|
|
4106
|
+
};
|
|
4107
|
+
/**
|
|
4108
|
+
* The aspect ratio of the camera's view, typically defined as the ratio of width to height.
|
|
4109
|
+
*/
|
|
4110
|
+
aspect_ratio: number;
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4113
|
+
/**
|
|
4114
|
+
* Represents a clipping plane in a viewpoint, defined by its location and direction. This interface is compliant with the BCF API specifications.
|
|
4115
|
+
*/
|
|
4116
|
+
export declare interface ViewpointClippingPlane {
|
|
4117
|
+
/**
|
|
4118
|
+
* The position vector of the clipping plane.
|
|
4119
|
+
*/
|
|
4120
|
+
location: ViewpointVector;
|
|
4121
|
+
/**
|
|
4122
|
+
* The direction vector indicating the orientation of the clipping plane.
|
|
4123
|
+
*/
|
|
4124
|
+
direction: ViewpointVector;
|
|
4125
|
+
}
|
|
4126
|
+
|
|
4127
|
+
/**
|
|
4128
|
+
* Represents the coloring information for a viewpoint, including the color and associated components. This interface is compliant with the BCF API specifications.
|
|
4129
|
+
*/
|
|
4130
|
+
export declare interface ViewpointColoring {
|
|
4131
|
+
/**
|
|
4132
|
+
* The color associated with the viewpoint, represented as a string (e.g., a hex code or color name).
|
|
4133
|
+
*/
|
|
4134
|
+
color: string;
|
|
4135
|
+
/**
|
|
4136
|
+
* An array of components that are associated with the specified color in the viewpoint.
|
|
4137
|
+
*/
|
|
4138
|
+
components: ViewpointComponent[];
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4141
|
+
/**
|
|
4142
|
+
* Represents a component within a viewpoint, typically used in Building Information Modeling (BIM) workflows. This interface is compliant with the BCF API specifications.
|
|
4143
|
+
*/
|
|
4144
|
+
export declare interface ViewpointComponent {
|
|
4145
|
+
/**
|
|
4146
|
+
* The unique identifier for the component in the IFC format. Can be `null` if not applicable.
|
|
4147
|
+
*/
|
|
4148
|
+
ifc_guid: string | null;
|
|
4149
|
+
/**
|
|
4150
|
+
* The identifier of the component as defined by the authoring tool. Can be `null` if not applicable.
|
|
4151
|
+
*/
|
|
4152
|
+
authoring_tool_id: string | null;
|
|
4153
|
+
/**
|
|
4154
|
+
* (Optional) The name of the system or application that originated the component.
|
|
4155
|
+
*/
|
|
4156
|
+
originating_system?: string;
|
|
4157
|
+
}
|
|
4158
|
+
|
|
4159
|
+
/**
|
|
4160
|
+
* Represents the components of a viewpoint in the BCF API. This interface is compliant with the BCF API specifications.
|
|
4161
|
+
*/
|
|
4162
|
+
export declare interface ViewpointComponents {
|
|
4163
|
+
/**
|
|
4164
|
+
* An array of viewpoint components representing the selection.
|
|
4165
|
+
*/
|
|
4166
|
+
selection: ViewpointComponent[];
|
|
4167
|
+
/**
|
|
4168
|
+
* An array of viewpoint coloring definitions.
|
|
4169
|
+
*/
|
|
4170
|
+
coloring: ViewpointColoring[];
|
|
4171
|
+
/**
|
|
4172
|
+
* Defines the visibility settings for the viewpoint.
|
|
4173
|
+
*/
|
|
4174
|
+
visibility: ViewpointVisibility;
|
|
4175
|
+
}
|
|
4176
|
+
|
|
4177
|
+
/**
|
|
4178
|
+
* Represents a line defined by a start and end point in a viewpoint. This interface is compliant with the BCF API specifications.
|
|
4179
|
+
*/
|
|
4180
|
+
export declare interface ViewpointLine {
|
|
4181
|
+
/**
|
|
4182
|
+
* The starting point of the line, represented as a `ViewpointVector`.
|
|
4183
|
+
*/
|
|
4184
|
+
start_point: ViewpointVector;
|
|
4185
|
+
/**
|
|
4186
|
+
* The ending point of the line, represented as a `ViewpointVector`.
|
|
4187
|
+
*/
|
|
4188
|
+
end_point: ViewpointVector;
|
|
4189
|
+
}
|
|
4190
|
+
|
|
4191
|
+
/**
|
|
4192
|
+
* Represents an orthogonal camera viewpoint, extending the base `ViewpointCamera` type. This interface is compliant with the BCF API specifications.
|
|
4193
|
+
*/
|
|
4194
|
+
export declare type ViewpointOrthogonalCamera = ViewpointCamera & {
|
|
4195
|
+
/**
|
|
4196
|
+
* Defines the scale factor between the view space and the world space.
|
|
4197
|
+
*/
|
|
4198
|
+
view_to_world_scale: number;
|
|
4199
|
+
};
|
|
4200
|
+
|
|
4201
|
+
/**
|
|
4202
|
+
* Represents a perspective camera viewpoint compliant with the BCF API specifications. Extends the `ViewpointCamera` type and includes additional properties specific to perspective cameras.
|
|
4203
|
+
*/
|
|
4204
|
+
export declare type ViewpointPerspectiveCamera = ViewpointCamera & {
|
|
4205
|
+
/**
|
|
4206
|
+
* The field of view of the perspective camera, expressed in degrees.
|
|
4207
|
+
*/
|
|
4208
|
+
field_of_view: number;
|
|
4209
|
+
};
|
|
4210
|
+
|
|
4211
|
+
export declare class Viewpoints extends Component implements Disposable_2, Configurable<ViewpointsConfigManager, ViewpointsConfig> {
|
|
4212
|
+
static readonly uuid: "ee867824-a796-408d-8aa0-4e5962a83c66";
|
|
4213
|
+
enabled: boolean;
|
|
4214
|
+
/**
|
|
4215
|
+
* Represents the default world where all viewpoints will be created.
|
|
4216
|
+
* A viewpoint can specify a different world if necessary.
|
|
4217
|
+
*/
|
|
4218
|
+
world: World | null;
|
|
4219
|
+
/**
|
|
4220
|
+
* A DataMap that stores Viewpoint instances, indexed by their unique identifiers (guid).
|
|
4221
|
+
* This map is used to manage and retrieve Viewpoint instances within the Viewpoints component.
|
|
4222
|
+
*/
|
|
4223
|
+
readonly list: DataMap_2<string, Viewpoint>;
|
|
4224
|
+
/**
|
|
4225
|
+
* A collection of snapshots represented as a mapping between string keys and their corresponding binary data.
|
|
4226
|
+
*/
|
|
4227
|
+
readonly snapshots: DataMap_2<string, Uint8Array>;
|
|
4228
|
+
/**
|
|
4229
|
+
* Creates a new Viewpoint instance and adds it to the list.
|
|
4230
|
+
*
|
|
4231
|
+
* @param data - Optional partial data for the Viewpoint. If not provided, default data will be used.
|
|
4232
|
+
*
|
|
4233
|
+
* @returns The newly created Viewpoint instance.
|
|
4234
|
+
*/
|
|
4235
|
+
create(data?: Partial<BCFViewpoint>): Viewpoint;
|
|
4236
|
+
constructor(components: Components);
|
|
4237
|
+
/**
|
|
4238
|
+
* Determines the file extension of a snapshot based on its header bytes.
|
|
4239
|
+
*
|
|
4240
|
+
* @param name - The name of the snapshot from the list to retrieve its extension.
|
|
4241
|
+
* @returns The file extension as a string. Defaults to "jpeg" if the snapshot
|
|
4242
|
+
* does not exist or the header bytes do not match known formats.
|
|
4243
|
+
*/
|
|
4244
|
+
getSnapshotExtension(name: string): string;
|
|
4245
|
+
isSetup: boolean;
|
|
4246
|
+
setup(): void;
|
|
4247
|
+
onSetup: Event_2<unknown>;
|
|
4248
|
+
config: ViewpointsConfigManager;
|
|
4249
|
+
/** {@link Disposable.onDisposed} */
|
|
4250
|
+
readonly onDisposed: Event_2<unknown>;
|
|
4251
|
+
/**
|
|
4252
|
+
* Disposes of the Viewpoints component and its associated resources.
|
|
4253
|
+
*
|
|
4254
|
+
* This method is responsible for cleaning up any resources held by the Viewpoints component,
|
|
4255
|
+
* such as disposing of the DataMap of Viewpoint instances and triggering and resetting the
|
|
4256
|
+
* onDisposed event.
|
|
4257
|
+
*/
|
|
4258
|
+
dispose(): void;
|
|
4259
|
+
}
|
|
4260
|
+
|
|
4261
|
+
/**
|
|
4262
|
+
* Configuration interface for the Viewpoints general behavior.
|
|
4263
|
+
*/
|
|
4264
|
+
declare interface ViewpointsConfig {
|
|
4265
|
+
/**
|
|
4266
|
+
* Indicates whether to overwrite the fragments colors when applying viewpoints.
|
|
4267
|
+
* @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
|
|
4268
|
+
* @default false
|
|
4269
|
+
*/
|
|
4270
|
+
overwriteColors: boolean;
|
|
4271
|
+
}
|
|
4272
|
+
|
|
4273
|
+
declare class ViewpointsConfigManager extends Configurator<Viewpoints, ViewpointsConfigType> {
|
|
4274
|
+
protected _config: ViewpointsConfigType;
|
|
4275
|
+
get overwriteColors(): boolean;
|
|
4276
|
+
set overwriteColors(value: boolean);
|
|
4277
|
+
}
|
|
4278
|
+
|
|
4279
|
+
declare type ViewpointsConfigType = {
|
|
4280
|
+
overwriteColors: BooleanSettingsControl;
|
|
4281
|
+
};
|
|
4282
|
+
|
|
4283
|
+
/**
|
|
4284
|
+
* Represents a snapshot of a viewpoint, including its type and data. This interface is compliant with the BCF API specifications.
|
|
4285
|
+
*/
|
|
4286
|
+
export declare interface ViewpointSnapshot {
|
|
4287
|
+
/**
|
|
4288
|
+
* The type of the snapshot, either "png" or "jpg".
|
|
4289
|
+
*/
|
|
4290
|
+
snapshot_type: "png" | "jpg";
|
|
4291
|
+
/**
|
|
4292
|
+
* The base64-encoded string representing the snapshot data.
|
|
4293
|
+
*/
|
|
4294
|
+
snapshot_data: string;
|
|
4295
|
+
}
|
|
4296
|
+
|
|
4297
|
+
/**
|
|
4298
|
+
* Represents a 3D vector with x, y, and z coordinates.
|
|
4299
|
+
*/
|
|
4300
|
+
export declare interface ViewpointVector {
|
|
4301
|
+
x: number;
|
|
4302
|
+
y: number;
|
|
4303
|
+
z: number;
|
|
4304
|
+
}
|
|
4305
|
+
|
|
4306
|
+
/**
|
|
4307
|
+
* Represents the visibility settings for a viewpoint. This interface is compliant with the BCF API specifications.
|
|
4308
|
+
*/
|
|
4309
|
+
export declare interface ViewpointVisibility {
|
|
4310
|
+
/**
|
|
4311
|
+
* Indicates whether the default visibility is enabled.
|
|
4312
|
+
*/
|
|
4313
|
+
default_visibility: boolean;
|
|
4314
|
+
/**
|
|
4315
|
+
* A list of viewpoint components that are exceptions to the default visibility.
|
|
4316
|
+
*/
|
|
4317
|
+
exceptions: ViewpointComponent[];
|
|
4318
|
+
/**
|
|
4319
|
+
* Configuration hints for the viewpoint setup.
|
|
4320
|
+
*/
|
|
4321
|
+
view_setup_hints: {
|
|
4322
|
+
/**
|
|
4323
|
+
* Specifies whether spaces are visible.
|
|
4324
|
+
*/
|
|
4325
|
+
spaces_visible: boolean;
|
|
4326
|
+
/**
|
|
4327
|
+
* Specifies whether space boundaries are visible.
|
|
4328
|
+
*/
|
|
4329
|
+
space_boundaries_visible: boolean;
|
|
4330
|
+
/**
|
|
4331
|
+
* Specifies whether openings are visible.
|
|
4332
|
+
*/
|
|
4333
|
+
openings_visible: boolean;
|
|
4334
|
+
};
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
/**
|
|
4338
|
+
* The `Views` class is responsible for managing and interacting with a collection of 2D sections. It provides methods for creating, opening, closing, and managing views, as well as generating views from specific configurations such as IFC storeys or bounding boxes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Views). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Views).
|
|
4339
|
+
*/
|
|
4340
|
+
export declare class Views extends Component {
|
|
4341
|
+
static uuid: "fb22f1f5-6598-4664-a11d-de8963ae420f";
|
|
4342
|
+
/**
|
|
4343
|
+
* The default range value used by the Views component.
|
|
4344
|
+
* This represents the standard range setting applied unless explicitly overridden.
|
|
4345
|
+
*/
|
|
4346
|
+
static defaultRange: number;
|
|
4347
|
+
/**
|
|
4348
|
+
* A readonly map that associates string keys with `View` instances.
|
|
4349
|
+
* This map is used to store and manage a collection of views.
|
|
4350
|
+
*/
|
|
4351
|
+
readonly list: DataMap_2<string, View>;
|
|
4352
|
+
enabled: boolean;
|
|
4353
|
+
/**
|
|
4354
|
+
* The default world to be used when creating views.
|
|
4355
|
+
*
|
|
4356
|
+
* - If `world` is set to `null`, views can still specify another world directly in their instance.
|
|
4357
|
+
* - This property allows views to inherit a default world context unless explicitly overridden.
|
|
4358
|
+
*/
|
|
4359
|
+
world: World | null;
|
|
4360
|
+
private _fragmentsUpdateEvent;
|
|
4361
|
+
/**
|
|
4362
|
+
* Determines whether there are any open views in this component's list.
|
|
4363
|
+
*/
|
|
4364
|
+
get hasOpenViews(): boolean;
|
|
4365
|
+
constructor(components: Components);
|
|
4366
|
+
private setupEvents;
|
|
4367
|
+
/**
|
|
4368
|
+
* Creates a new view with the specified normal vector, point, and optional configuration.
|
|
4369
|
+
*
|
|
4370
|
+
* @param normal - The normal vector defining the orientation of the view.
|
|
4371
|
+
* @param point - The point in space where the view is centered.
|
|
4372
|
+
* @param config - Optional configuration for the view creation.
|
|
4373
|
+
* @returns The newly created `View` instance.
|
|
4374
|
+
* @remarks The created view will be added to the component's list data map.
|
|
4375
|
+
*/
|
|
4376
|
+
create(normal: THREE.Vector3, point: THREE.Vector3, config?: CreateViewConfig): View;
|
|
4377
|
+
/**
|
|
4378
|
+
* Creates a new view from the specified plane and optional configuration.
|
|
4379
|
+
*
|
|
4380
|
+
* @param plane - The `THREE.Plane` object representing the plane to create the view from.
|
|
4381
|
+
* @param config - Optional configuration for creating the view.
|
|
4382
|
+
* @returns The newly created `View` instance.
|
|
4383
|
+
* @remarks The created view will be added to the component's list data map.
|
|
4384
|
+
*/
|
|
4385
|
+
createFromPlane(plane: THREE.Plane, config?: CreateViewConfig): View;
|
|
4386
|
+
/**
|
|
4387
|
+
* Creates views from IFC storeys based on the provided configuration.
|
|
4388
|
+
* This method iterates through the fragments of the model, filters storeys
|
|
4389
|
+
* based on the configuration, and generates views for each storey.
|
|
4390
|
+
*
|
|
4391
|
+
* @param config - Optional configuration for creating views from IFC storeys.
|
|
4392
|
+
* @returns A promise that resolves to an array of `View` objects created from the IFC storeys.
|
|
4393
|
+
*
|
|
4394
|
+
* @remarks Each IfcBuilsingStorey is represented as a plane in 3D space, with its elevation adjusted by the `offset`. The created views will be added to the component's list data map.
|
|
4395
|
+
*/
|
|
4396
|
+
createFromIfcStoreys(config?: CreateViewFromIfcStoreysConfig): Promise<View[]>;
|
|
4397
|
+
/**
|
|
4398
|
+
* Creates views representing the front, back, left, and right sides of bounding boxes for specified models or a combined bounding box of all models.
|
|
4399
|
+
*
|
|
4400
|
+
* @param config - Optional configuration object for creating bounding views.
|
|
4401
|
+
* @returns A promise that resolves to an array of `View` objects created from the boundings.
|
|
4402
|
+
* @remarks The method calculates bounding boxes for the specified models, optionally combines them into a single bounding box, and creates views for the planes representing the bounding box sides.
|
|
4403
|
+
*/
|
|
4404
|
+
createElevations(config?: {
|
|
4405
|
+
combine?: boolean;
|
|
4406
|
+
modelIds?: RegExp[];
|
|
4407
|
+
world?: World;
|
|
4408
|
+
namingCallback?: (modelId: string) => {
|
|
4409
|
+
front: string;
|
|
4410
|
+
back: string;
|
|
4411
|
+
left: string;
|
|
4412
|
+
right: string;
|
|
4413
|
+
};
|
|
4414
|
+
}): View[];
|
|
4415
|
+
/**
|
|
4416
|
+
* Opens a view by its unique identifier. Ensures that no more than one view
|
|
4417
|
+
* is opened in the same world at a time. If the view is already open, the method
|
|
4418
|
+
* returns without performing any action.
|
|
4419
|
+
*
|
|
4420
|
+
* @param id - The unique identifier of the view to open.
|
|
4421
|
+
* @remarks This method changes world camera to use the view's.
|
|
4422
|
+
*/
|
|
4423
|
+
open(id: string): void;
|
|
4424
|
+
/**
|
|
4425
|
+
* Closes a view by its unique identifier and performs necessary cleanup operations.
|
|
4426
|
+
*
|
|
4427
|
+
* @param id - The unique identifier of the view to be closed. If not provided, all opened views across worlds will be closed.
|
|
4428
|
+
* @remarks This method resets the world to use its default camera.
|
|
4429
|
+
*/
|
|
4430
|
+
close(id?: string): void;
|
|
4431
|
+
}
|
|
4432
|
+
|
|
4433
|
+
/**
|
|
4434
|
+
* Whether it has a UI or not.
|
|
4435
|
+
*/
|
|
4436
|
+
export declare interface WithUi {
|
|
4437
|
+
/**
|
|
4438
|
+
* The UI of the component.
|
|
4439
|
+
*/
|
|
4440
|
+
ui: {
|
|
4441
|
+
[key: string]: () => HTMLElement;
|
|
4442
|
+
};
|
|
4443
|
+
}
|
|
4444
|
+
|
|
4445
|
+
/**
|
|
4446
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
4447
|
+
*/
|
|
4448
|
+
export declare interface World extends Disposable_2, Updateable {
|
|
4449
|
+
/**
|
|
4450
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
4451
|
+
*/
|
|
4452
|
+
meshes: Set<THREE.Mesh>;
|
|
4453
|
+
/**
|
|
4454
|
+
* The base scene of the world.
|
|
4455
|
+
*/
|
|
4456
|
+
scene: BaseScene;
|
|
4457
|
+
/**
|
|
4458
|
+
* The default camera of the world.
|
|
4459
|
+
*/
|
|
4460
|
+
defaultCamera: BaseCamera;
|
|
4461
|
+
/**
|
|
4462
|
+
* The base camera of the world.
|
|
4463
|
+
*/
|
|
4464
|
+
camera: BaseCamera;
|
|
4465
|
+
onCameraChanged: Event_2<any>;
|
|
4466
|
+
useDefaultCamera: () => void;
|
|
4467
|
+
/**
|
|
4468
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
4469
|
+
*/
|
|
4470
|
+
renderer: BaseRenderer | null;
|
|
4471
|
+
/**
|
|
4472
|
+
* A unique identifier for the world.
|
|
4473
|
+
*/
|
|
4474
|
+
uuid: string;
|
|
4475
|
+
/**
|
|
4476
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
4477
|
+
*/
|
|
4478
|
+
isDisposing: boolean;
|
|
4479
|
+
}
|
|
4480
|
+
|
|
4481
|
+
/**
|
|
4482
|
+
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
4483
|
+
*/
|
|
4484
|
+
export declare class Worlds extends Component implements Updateable, Disposable_2 {
|
|
4485
|
+
/**
|
|
4486
|
+
* A unique identifier for the component.
|
|
4487
|
+
* This UUID is used to register the component within the Components system.
|
|
4488
|
+
*/
|
|
4489
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
4490
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
4491
|
+
readonly onAfterUpdate: Event_2<unknown>;
|
|
4492
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
4493
|
+
readonly onBeforeUpdate: Event_2<unknown>;
|
|
4494
|
+
/** {@link Disposable.onDisposed} */
|
|
4495
|
+
readonly onDisposed: Event_2<unknown>;
|
|
4496
|
+
/**
|
|
4497
|
+
* A collection of worlds managed by this component.
|
|
4498
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
4499
|
+
*/
|
|
4500
|
+
list: DataMap<string, World>;
|
|
4501
|
+
/** {@link Component.enabled} */
|
|
4502
|
+
enabled: boolean;
|
|
4503
|
+
constructor(components: Components);
|
|
4504
|
+
/**
|
|
4505
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
4506
|
+
*
|
|
4507
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
4508
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
4509
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
4510
|
+
*
|
|
4511
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
4512
|
+
*/
|
|
4513
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
4514
|
+
/**
|
|
4515
|
+
* Deletes a world from the list of worlds.
|
|
4516
|
+
*
|
|
4517
|
+
* @param {World} world - The world to be deleted.
|
|
4518
|
+
*
|
|
4519
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
4520
|
+
*/
|
|
4521
|
+
delete(world: World): void;
|
|
4522
|
+
/**
|
|
4523
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
4524
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
4525
|
+
* and triggers the onDisposed event.
|
|
4526
|
+
*/
|
|
4527
|
+
dispose(): void;
|
|
4528
|
+
/** {@link Updateable.update} */
|
|
4529
|
+
update(delta?: number): void | Promise<void>;
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4532
|
+
export declare class XML {
|
|
4533
|
+
static parser: XMLParser;
|
|
4534
|
+
static builder: XMLBuilder;
|
|
4535
|
+
}
|
|
4536
|
+
|
|
4537
|
+
export { }
|