@thatopen/components 2.2.9 → 2.2.11

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.
@@ -6,7 +6,7 @@ export declare class Components implements Disposable {
6
6
  /**
7
7
  * The version of the @thatopen/components library.
8
8
  */
9
- static readonly release = "2.2.9";
9
+ static readonly release = "2.2.11";
10
10
  /** {@link Disposable.onDisposed} */
11
11
  readonly onDisposed: Event<void>;
12
12
  /**
@@ -34,6 +34,7 @@ export declare class Viewpoints extends Component implements Disposable, Configu
34
34
  setup(): void;
35
35
  onSetup: Event<unknown>;
36
36
  config: Required<ViewpointsConfig>;
37
+ /** {@link Disposable.onDisposed} */
37
38
  readonly onDisposed: Event<unknown>;
38
39
  /**
39
40
  * Disposes of the Viewpoints component and its associated resources.
@@ -5,13 +5,21 @@ import { CameraProjection } from "../../OrthoPerspectiveCamera";
5
5
  import { Components } from "../../Components";
6
6
  import { DataMap, DataSet, World } from "../../Types";
7
7
  import { SimplePlane } from "../../Clipper";
8
+ /**
9
+ * Represents a BCF compliant viewpoint from BuildingSMART.
10
+ *
11
+ * The Viewpoint class provides methods for managing and interacting with viewpoints.
12
+ * It includes functionality for setting viewpoint properties, updating the camera,
13
+ * applying color to components, and serializing the viewpoint for export.
14
+ */
8
15
  export declare class Viewpoint implements BCFViewpoint {
9
16
  title?: string;
10
- guid: string;
17
+ readonly guid: string;
11
18
  /**
12
19
  * ClippingPlanes can be used to define a subsection of a building model that is related to the topic.
13
20
  * Each clipping plane is defined by Location and Direction.
14
21
  * The Direction vector points in the invisible direction meaning the half-space that is clipped.
22
+ * @experimental
15
23
  */
16
24
  clippingPlanes: DataSet<SimplePlane>;
17
25
  camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
@@ -114,14 +122,13 @@ export declare class Viewpoint implements BCFViewpoint {
114
122
  * Adds components to the viewpoint based on the provided fragment ID map.
115
123
  *
116
124
  * @param fragmentIdMap - A map containing fragment IDs as keys and arrays of express IDs as values.
117
- *
118
- * @returns A Promise that resolves when the components have been added to the viewpoint.
119
125
  */
120
- addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): Promise<void>;
126
+ addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): void;
121
127
  /**
122
- * Sets the properties of the viewpoint with the provided data.
128
+ * Replace the properties of the viewpoint with the provided data.
123
129
  *
124
130
  * @remarks The guid will be ommited as it shouldn't change after it has been initially set.
131
+ * @remarks The existing selection and exception components will be fully replaced in case new ones are provided.
125
132
  *
126
133
  * @param data - An object containing the properties to be set.
127
134
  * The properties not included in the object will remain unchanged.
@@ -19,6 +19,9 @@ export interface ViewpointPerspectiveCamera extends ViewpointCamera {
19
19
  export interface ViewpointOrthographicCamera extends ViewpointCamera {
20
20
  viewToWorldScale: number;
21
21
  }
22
+ /**
23
+ * Represents a viewpoint in a BCF file.
24
+ */
22
25
  export interface BCFViewpoint {
23
26
  title?: string;
24
27
  guid: string;
@@ -1,4 +1,4 @@
1
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
1
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer, DataMap } from "../Types";
2
2
  import { Components } from "../Components";
3
3
  import { SimpleWorld } from "./src";
4
4
  export * from "./src";
@@ -17,21 +17,11 @@ export declare class Worlds extends Component implements Updateable, Disposable
17
17
  readonly onBeforeUpdate: Event<unknown>;
18
18
  /** {@link Disposable.onDisposed} */
19
19
  readonly onDisposed: Event<unknown>;
20
- /**
21
- * An event that is triggered when a new world is created.
22
- * The event passes the newly created world as a parameter.
23
- */
24
- readonly onWorldCreated: Event<World>;
25
- /**
26
- * An event that is triggered when a world is deleted.
27
- * The event passes the UUID of the deleted world as a parameter.
28
- */
29
- readonly onWorldDeleted: Event<string>;
30
20
  /**
31
21
  * A collection of worlds managed by this component.
32
22
  * The key is the unique identifier (UUID) of the world, and the value is the World instance.
33
23
  */
34
- list: Map<string, World>;
24
+ list: DataMap<string, World>;
35
25
  /** {@link Component.enabled} */
36
26
  enabled: boolean;
37
27
  constructor(components: Components);
@@ -51,16 +41,12 @@ export declare class Worlds extends Component implements Updateable, Disposable
51
41
  * @param {World} world - The world to be deleted.
52
42
  *
53
43
  * @throws {Error} - Throws an error if the provided world is not found in the list.
54
- *
55
- * @returns {void}
56
44
  */
57
45
  delete(world: World): void;
58
46
  /**
59
47
  * Disposes of the Worlds component and all its managed worlds.
60
48
  * This method sets the enabled flag to false, disposes of all worlds, clears the list,
61
49
  * and triggers the onDisposed event.
62
- *
63
- * @returns {void}
64
50
  */
65
51
  dispose(): void;
66
52
  /** {@link Updateable.update} */
@@ -28,9 +28,9 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
28
28
  */
29
29
  enabled: boolean;
30
30
  /**
31
- * A unique identifier for the world.
31
+ * A unique identifier for the world. Is not meant to be changed at any moment.
32
32
  */
33
- uuid: string;
33
+ readonly uuid: string;
34
34
  /**
35
35
  * An optional name for the world.
36
36
  */
@@ -108,6 +108,14 @@ export declare class FragmentsManager extends Component implements Disposable {
108
108
  * @returns A fragment ID map, where the keys are fragment IDs and the values are the corresponding express IDs.
109
109
  */
110
110
  guidToFragmentIdMap(guids: Iterable<string>): FRAGS.FragmentIdMap;
111
+ /**
112
+ * Converts a fragment ID map to a collection of IFC GUIDs.
113
+ *
114
+ * @param fragmentIdMap - A fragment ID map to be converted to a collection of IFC GUIDs.
115
+ *
116
+ * @returns An array of IFC GUIDs.
117
+ */
118
+ fragmentIdMapToGuids(fragmentIdMap: FRAGS.FragmentIdMap): string[];
111
119
  /**
112
120
  * Applies coordinate transformation to the provided models.
113
121
  * If no models are provided, all groups are used.
@@ -76,7 +76,7 @@ export declare class IfcLoader extends Component implements Disposable {
76
76
  * const group = await ifcLoader.load(ifcData);
77
77
  * ```
78
78
  */
79
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
79
+ load(data: Uint8Array, coordinate?: boolean, name?: string): Promise<FRAGS.FragmentsGroup>;
80
80
  /**
81
81
  * Reads an IFC file and initializes the Web-IFC library.
82
82
  *