@thatopen/components 2.0.11 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/core/Clipper/index.d.ts +1 -1
  2. package/dist/core/Clipper/src/simple-plane.d.ts +16 -16
  3. package/dist/core/Components/index.d.ts +2 -2
  4. package/dist/core/Cullers/index.d.ts +3 -3
  5. package/dist/core/Cullers/src/culler-renderer.d.ts +1 -1
  6. package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +6 -6
  7. package/dist/core/Disposer/index.d.ts +1 -1
  8. package/dist/core/Grids/index.d.ts +10 -9
  9. package/dist/core/Grids/src/simple-grid.d.ts +16 -4
  10. package/dist/core/MiniMap/index.d.ts +20 -19
  11. package/dist/core/MiniMap/src/index.d.ts +16 -16
  12. package/dist/core/OrthoPerspectiveCamera/index.d.ts +8 -8
  13. package/dist/core/Raycasters/index.d.ts +2 -1
  14. package/dist/core/Raycasters/src/mouse.d.ts +1 -4
  15. package/dist/core/Raycasters/src/simple-raycaster.d.ts +9 -11
  16. package/dist/core/Types/src/base-camera.d.ts +1 -1
  17. package/dist/core/Types/src/base-renderer.d.ts +19 -19
  18. package/dist/core/Types/src/base-scene.d.ts +3 -3
  19. package/dist/core/Worlds/index.d.ts +15 -15
  20. package/dist/core/Worlds/src/simple-camera.d.ts +1 -1
  21. package/dist/core/Worlds/src/simple-scene.d.ts +3 -3
  22. package/dist/fragments/BoundingBoxer/index.d.ts +151 -1
  23. package/dist/fragments/Classifier/index.d.ts +133 -0
  24. package/dist/fragments/Exploder/index.d.ts +39 -2
  25. package/dist/fragments/FragmentsManager/index.d.ts +45 -6
  26. package/dist/fragments/Hider/index.d.ts +28 -0
  27. package/dist/fragments/IfcGeometryTiler/index.d.ts +62 -4
  28. package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +14 -0
  29. package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -1
  30. package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +11 -5
  31. package/dist/fragments/IfcLoader/index.d.ts +89 -4
  32. package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +14 -0
  33. package/dist/fragments/IfcPropertiesTiler/index.d.ts +44 -4
  34. package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +1 -0
  35. package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +11 -0
  36. package/dist/ifc/IfcJsonExporter/index.d.ts +7 -2
  37. package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +3 -0
  38. package/dist/ifc/IfcJsonExporter/src/index.d.ts +1 -0
  39. package/dist/ifc/IfcPropertiesManager/index.d.ts +195 -11
  40. package/dist/ifc/IfcRelationsIndexer/index.d.ts +20 -11
  41. package/dist/ifc/Utils/ifc-category-map.d.ts +3 -0
  42. package/dist/ifc/Utils/ifc-elements-map.d.ts +8 -0
  43. package/dist/index.cjs +5 -5
  44. package/dist/index.mjs +3564 -2892
  45. package/dist/measurement/MeasurementUtils/index.d.ts +76 -0
  46. package/dist/measurement/index.d.ts +1 -1
  47. package/dist/namespace.d.ts +2578 -1722
  48. package/package.json +1 -1
  49. package/dist/fragments/IfcGeometryTiler/src/fragment-props-stream-converter.d.ts +0 -27
  50. package/dist/measurement/Utils/index.d.ts +0 -24
@@ -3,7 +3,7 @@ import * as FRAGS from "@thatopen/fragments";
3
3
  import { FragmentsGroup } from "@thatopen/fragments";
4
4
  import { Component, Components, Disposable, Event } from "../../core";
5
5
  /**
6
- * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
6
+ * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/BoundingBoxer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/BoundingBoxer).
7
7
  */
8
8
  export declare class BoundingBoxer extends Component implements Disposable {
9
9
  static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
@@ -15,21 +15,171 @@ export declare class BoundingBoxer extends Component implements Disposable {
15
15
  private _absoluteMax;
16
16
  private _meshes;
17
17
  constructor(components: Components);
18
+ /**
19
+ * A static method to calculate the dimensions of a given bounding box.
20
+ *
21
+ * @param bbox - The bounding box to calculate the dimensions for.
22
+ * @returns An object containing the width, height, depth, and center of the bounding box.
23
+ */
18
24
  static getDimensions(bbox: THREE.Box3): {
19
25
  width: number;
20
26
  height: number;
21
27
  depth: number;
22
28
  center: THREE.Vector3;
23
29
  };
30
+ /**
31
+ * A static method to create a new bounding box boundary.
32
+ *
33
+ * @param positive - A boolean indicating whether to create a boundary for positive or negative values.
34
+ * @returns A new THREE.Vector3 representing the boundary.
35
+ *
36
+ * @remarks
37
+ * This method is used to create a new boundary for calculating bounding boxes.
38
+ * It sets the x, y, and z components of the returned vector to positive or negative infinity,
39
+ * depending on the value of the `positive` parameter.
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * const positiveBound = BoundingBoxer.newBound(true);
44
+ * console.log(positiveBound); // Output: Vector3 { x: Infinity, y: Infinity, z: Infinity }
45
+ *
46
+ * const negativeBound = BoundingBoxer.newBound(false);
47
+ * console.log(negativeBound); // Output: Vector3 { x: -Infinity, y: -Infinity, z: -Infinity }
48
+ * ```
49
+ */
24
50
  static newBound(positive: boolean): THREE.Vector3;
51
+ /**
52
+ * A static method to calculate the bounding box of a set of points.
53
+ *
54
+ * @param points - An array of THREE.Vector3 representing the points.
55
+ * @param min - An optional THREE.Vector3 representing the minimum bounds. If not provided, it will be calculated.
56
+ * @param max - An optional THREE.Vector3 representing the maximum bounds. If not provided, it will be calculated.
57
+ * @returns A THREE.Box3 representing the bounding box of the given points.
58
+ *
59
+ * @remarks
60
+ * This method calculates the bounding box of a set of points by iterating through each point and updating the minimum and maximum bounds accordingly.
61
+ * If the `min` or `max` parameters are provided, they will be used as the initial bounds. Otherwise, the initial bounds will be set to positive and negative infinity.
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * const points = [
66
+ * new THREE.Vector3(1, 2, 3),
67
+ * new THREE.Vector3(4, 5, 6),
68
+ * new THREE.Vector3(7, 8, 9),
69
+ * ];
70
+ *
71
+ * const bbox = BoundingBoxer.getBounds(points);
72
+ * console.log(bbox); // Output: Box3 { min: Vector3 { x: 1, y: 2, z: 3 }, max: Vector3 { x: 7, y: 8, z: 9 } }
73
+ * ```
74
+ */
25
75
  static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
26
76
  /** {@link Disposable.dispose} */
27
77
  dispose(): void;
78
+ /**
79
+ * Returns the bounding box of the calculated fragments.
80
+ *
81
+ * @returns A new THREE.Box3 instance representing the bounding box.
82
+ *
83
+ * @remarks
84
+ * This method clones the internal minimum and maximum vectors and returns a new THREE.Box3 instance.
85
+ * The returned box represents the bounding box of the calculated fragments.
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const boundingBox = boundingBoxer.get();
90
+ * console.log(boundingBox); // Output: Box3 { min: Vector3 { x: -10, y: -10, z: -10 }, max: Vector3 { x: 10, y: 10, z: 10 } }
91
+ * ```
92
+ */
28
93
  get(): THREE.Box3;
94
+ /**
95
+ * Calculates and returns a sphere that encompasses the entire bounding box.
96
+ *
97
+ * @returns A new THREE.Sphere instance representing the calculated sphere.
98
+ *
99
+ * @remarks
100
+ * This method calculates the center and radius of a sphere that encompasses the entire bounding box.
101
+ * The center is calculated as the midpoint between the minimum and maximum bounds of the bounding box.
102
+ * The radius is calculated as the distance from the center to the minimum bound.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * const boundingBoxer = components.get(BoundingBoxer);
107
+ * boundingBoxer.add(fragmentsGroup);
108
+ * const boundingSphere = boundingBoxer.getSphere();
109
+ * console.log(boundingSphere); // Output: Sphere { center: Vector3 { x: 0, y: 0, z: 0 }, radius: 10 }
110
+ * ```
111
+ */
29
112
  getSphere(): THREE.Sphere;
113
+ /**
114
+ * Returns a THREE.Mesh instance representing the bounding box.
115
+ *
116
+ * @returns A new THREE.Mesh instance representing the bounding box.
117
+ *
118
+ * @remarks
119
+ * This method calculates the dimensions of the bounding box using the `getDimensions` method.
120
+ * It then creates a new THREE.BoxGeometry with the calculated dimensions.
121
+ * A new THREE.Mesh is created using the box geometry, and it is added to the `_meshes` array.
122
+ * The position of the mesh is set to the center of the bounding box.
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * const boundingBoxer = components.get(BoundingBoxer);
127
+ * boundingBoxer.add(fragmentsGroup);
128
+ * const boundingBoxMesh = boundingBoxer.getMesh();
129
+ * scene.add(boundingBoxMesh);
130
+ * ```
131
+ */
30
132
  getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
133
+ /**
134
+ * Resets the internal minimum and maximum vectors to positive and negative infinity, respectively.
135
+ * This method is used to prepare the BoundingBoxer for a new set of fragments.
136
+ *
137
+ * @remarks
138
+ * This method is called when a new set of fragments is added to the BoundingBoxer.
139
+ * It ensures that the bounding box calculations are accurate and up-to-date.
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * const boundingBoxer = components.get(BoundingBoxer);
144
+ * boundingBoxer.add(fragmentsGroup);
145
+ * // ...
146
+ * boundingBoxer.reset();
147
+ * ```
148
+ */
31
149
  reset(): void;
150
+ /**
151
+ * Adds a FragmentsGroup to the BoundingBoxer.
152
+ *
153
+ * @param group - The FragmentsGroup to add.
154
+ *
155
+ * @remarks
156
+ * This method iterates through each fragment in the provided FragmentsGroup,
157
+ * and calls the `addMesh` method for each fragment's mesh.
158
+ *
159
+ * @example
160
+ * ```typescript
161
+ * const boundingBoxer = components.get(BoundingBoxer);
162
+ * boundingBoxer.add(fragmentsGroup);
163
+ * ```
164
+ */
32
165
  add(group: FragmentsGroup): void;
166
+ /**
167
+ * Adds a mesh to the BoundingBoxer and calculates the bounding box.
168
+ *
169
+ * @param mesh - The mesh to add. It can be an instance of THREE.InstancedMesh, THREE.Mesh, or FRAGS.CurveMesh.
170
+ * @param itemIDs - An optional iterable of numbers representing the item IDs.
171
+ *
172
+ * @remarks
173
+ * This method calculates the bounding box of the provided mesh and updates the internal minimum and maximum vectors.
174
+ * If the mesh is an instance of THREE.InstancedMesh, it calculates the bounding box for each instance.
175
+ * If the mesh is an instance of FRAGS.FragmentMesh and itemIDs are provided, it calculates the bounding box for the specified item IDs.
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * const boundingBoxer = components.get(BoundingBoxer);
180
+ * boundingBoxer.addMesh(mesh);
181
+ * ```
182
+ */
33
183
  addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
34
184
  private static getFragmentBounds;
35
185
  }
@@ -1,31 +1,164 @@
1
1
  import * as THREE from "three";
2
2
  import * as FRAGS from "@thatopen/fragments";
3
3
  import { Disposable, Component, Event, Components } from "../../core";
4
+ /**
5
+ * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs to their respective express IDs.
6
+ */
4
7
  export interface Classification {
8
+ /**
9
+ * A system within the classification.
10
+ * The key is the system name, and the value is an object representing the classes within the system.
11
+ */
5
12
  [system: string]: {
13
+ /**
14
+ * A class within the system.
15
+ * The key is the class name, and the value is a map of fragment IDs to their respective express IDs.
16
+ */
6
17
  [className: string]: FRAGS.FragmentIdMap;
7
18
  };
8
19
  }
20
+ /**
21
+ * The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
22
+ */
9
23
  export declare class Classifier extends Component implements Disposable {
24
+ /**
25
+ * A unique identifier for the component.
26
+ * This UUID is used to register the component within the Components system.
27
+ */
10
28
  static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
11
29
  /** {@link Component.enabled} */
12
30
  enabled: boolean;
31
+ /**
32
+ * A map representing the classification systems.
33
+ * The key is the system name, and the value is an object representing the classes within the system.
34
+ */
13
35
  list: Classification;
14
36
  /** {@link Disposable.onDisposed} */
15
37
  readonly onDisposed: Event<unknown>;
16
38
  constructor(components: Components);
17
39
  private onFragmentsDisposed;
40
+ /** {@link Disposable.dispose} */
18
41
  dispose(): void;
42
+ /**
43
+ * Removes a fragment from the classification based on its unique identifier (guid).
44
+ * This method iterates through all classification systems and classes, and deletes the fragment with the specified guid from the respective group.
45
+ *
46
+ * @param guid - The unique identifier of the fragment to be removed.
47
+ */
19
48
  remove(guid: string): void;
49
+ /**
50
+ * Finds and returns fragments based on the provided filter criteria.
51
+ * If no filter is provided, it returns all fragments.
52
+ *
53
+ * @param filter - An optional object containing filter criteria.
54
+ * The keys of the object represent the classification system names,
55
+ * and the values are arrays of class names to match.
56
+ *
57
+ * @returns A map of fragment GUIDs to their respective express IDs,
58
+ * where the express IDs are filtered based on the provided filter criteria.
59
+ *
60
+ * @throws Will throw an error if the fragments map is malformed.
61
+ */
20
62
  find(filter?: {
21
63
  [name: string]: string[];
22
64
  }): FRAGS.FragmentIdMap;
65
+ /**
66
+ * Classifies fragments based on their modelID.
67
+ *
68
+ * @param modelID - The unique identifier of the model to classify fragments by.
69
+ * @param group - The FragmentsGroup containing the fragments to be classified.
70
+ *
71
+ * @remarks
72
+ * This method iterates through the fragments in the provided group,
73
+ * and classifies them based on their modelID.
74
+ * The classification is stored in the `list.models` property,
75
+ * with the modelID as the key and a map of fragment IDs to their respective express IDs as the value.
76
+ *
77
+ */
23
78
  byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
79
+ /**
80
+ * Classifies fragments based on their PredefinedType property.
81
+ *
82
+ * @param group - The FragmentsGroup containing the fragments to be classified.
83
+ *
84
+ * @remarks
85
+ * This method iterates through the properties of the fragments in the provided group,
86
+ * and classifies them based on their PredefinedType property.
87
+ * The classification is stored in the `list.predefinedTypes` property,
88
+ * with the PredefinedType as the key and a map of fragment IDs to their respective express IDs as the value.
89
+ *
90
+ * @throws Will throw an error if the fragment ID is not found.
91
+ */
24
92
  byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
93
+ /**
94
+ * Classifies fragments based on their entity type.
95
+ *
96
+ * @param group - The FragmentsGroup containing the fragments to be classified.
97
+ *
98
+ * @remarks
99
+ * This method iterates through the relations of the fragments in the provided group,
100
+ * and classifies them based on their entity type.
101
+ * The classification is stored in the `list.entities` property,
102
+ * with the entity type as the key and a map of fragment IDs to their respective express IDs as the value.
103
+ *
104
+ * @throws Will throw an error if the fragment ID is not found.
105
+ */
25
106
  byEntity(group: FRAGS.FragmentsGroup): void;
107
+ /**
108
+ * Classifies fragments based on a specific IFC relationship.
109
+ *
110
+ * @param group - The FragmentsGroup containing the fragments to be classified.
111
+ * @param ifcRel - The IFC relationship number to classify fragments by.
112
+ * @param systemName - The name of the classification system to store the classification.
113
+ *
114
+ * @remarks
115
+ * This method iterates through the relations of the fragments in the provided group,
116
+ * and classifies them based on the specified IFC relationship.
117
+ * The classification is stored in the `list` property under the specified system name,
118
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
119
+ *
120
+ * @throws Will throw an error if the fragment ID is not found or if the IFC relationship is not valid.
121
+ */
26
122
  byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
123
+ /**
124
+ * Classifies fragments based on their spatial structure in the IFC model.
125
+ *
126
+ * @param model - The FragmentsGroup containing the fragments to be classified.
127
+ *
128
+ * @remarks
129
+ * This method iterates through the relations of the fragments in the provided group,
130
+ * and classifies them based on their spatial structure in the IFC model.
131
+ * The classification is stored in the `list` property under the system name "spatialStructures",
132
+ * with the relationship name as the class name and a map of fragment IDs to their respective express IDs as the value.
133
+ *
134
+ * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
135
+ */
27
136
  bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
137
+ /**
138
+ * Sets the color of the specified fragments.
139
+ *
140
+ * @param items - A map of fragment IDs to their respective express IDs.
141
+ * @param color - The color to set for the fragments.
142
+ * @param override - A boolean indicating whether to override the existing color of the fragments.
143
+ *
144
+ * @remarks
145
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
146
+ * and sets their color using the `setColor` method of the FragmentsGroup class.
147
+ *
148
+ * @throws Will throw an error if the fragment with the specified ID is not found.
149
+ */
28
150
  setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
151
+ /**
152
+ * Resets the color of the specified fragments to their original color.
153
+ *
154
+ * @param items - A map of fragment IDs to their respective express IDs.
155
+ *
156
+ * @remarks
157
+ * This method iterates through the provided fragment IDs, retrieves the corresponding fragments,
158
+ * and resets their color using the `resetColor` method of the FragmentsGroup class.
159
+ *
160
+ * @throws Will throw an error if the fragment with the specified ID is not found.
161
+ */
29
162
  resetColor(items: FRAGS.FragmentIdMap): void;
30
163
  protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
31
164
  }
@@ -1,13 +1,50 @@
1
1
  import { Component, Disposable, Event, Components } from "../../core";
2
+ /**
3
+ * The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
4
+ */
2
5
  export declare class Exploder extends Component implements Disposable {
6
+ /**
7
+ * A unique identifier for the component.
8
+ * This UUID is used to register the component within the Components system.
9
+ */
3
10
  static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
11
+ /** {@link Disposable.onDisposed} */
12
+ readonly onDisposed: Event<unknown>;
13
+ /** {@link Component.enabled} */
4
14
  enabled: boolean;
15
+ /**
16
+ * The height of the explosion animation.
17
+ * This property determines the vertical distance by which fragments are moved during the explosion.
18
+ * Default value is 10.
19
+ */
5
20
  height: number;
21
+ /**
22
+ * The group name used for the explosion animation.
23
+ * This property specifies the group of fragments that will be affected by the explosion.
24
+ * Default value is "storeys".
25
+ */
6
26
  groupName: string;
7
- /** {@link Disposable.onDisposed} */
8
- readonly onDisposed: Event<unknown>;
27
+ /**
28
+ * A set of strings representing the exploded items.
29
+ * This set is used to keep track of which items have been exploded.
30
+ */
9
31
  list: Set<string>;
10
32
  constructor(components: Components);
33
+ /** {@link Disposable.dispose} */
11
34
  dispose(): void;
35
+ /**
36
+ * Sets the explosion state of the fragments.
37
+ *
38
+ * @param active - A boolean indicating whether to activate or deactivate the explosion.
39
+ *
40
+ * @remarks
41
+ * This method applies a vertical transformation to the fragments based on the `active` parameter.
42
+ * If `active` is true, the fragments are moved upwards by a distance determined by the `height` property.
43
+ * If `active` is false, the fragments are moved back to their original position.
44
+ *
45
+ * The method also keeps track of the exploded items using the `list` set.
46
+ *
47
+ * @throws Will throw an error if the `Classifier` or `FragmentsManager` components are not found in the `components` system.
48
+ */
12
49
  set(active: boolean): void;
13
50
  }
@@ -4,32 +4,60 @@ import * as FRAGS from "@thatopen/fragments";
4
4
  import { Component, Components, Event, Disposable } from "../../core";
5
5
  import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
6
6
  /**
7
- * Object that can efficiently load binary files that contain [fragment geometry](https://github.com/ThatOpen/engine_fragment).
7
+ * 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).
8
8
  */
9
9
  export declare class FragmentsManager extends Component implements Disposable {
10
+ /**
11
+ * A unique identifier for the component.
12
+ * This UUID is used to register the component within the Components system.
13
+ */
10
14
  static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
11
15
  /** {@link Disposable.onDisposed} */
12
16
  readonly onDisposed: Event<unknown>;
17
+ /**
18
+ * Event triggered when fragments are loaded.
19
+ */
13
20
  readonly onFragmentsLoaded: Event<FragmentsGroup>;
21
+ /**
22
+ * Event triggered when fragments are disposed.
23
+ */
14
24
  readonly onFragmentsDisposed: Event<{
15
25
  groupID: string;
16
26
  fragmentIDs: string[];
17
27
  }>;
18
- /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
28
+ /**
29
+ * Map containing all loaded fragments.
30
+ * The key is the fragment's unique identifier, and the value is the fragment itself.
31
+ */
19
32
  readonly list: Map<string, Fragment>;
33
+ /**
34
+ * Map containing all loaded fragment groups.
35
+ * The key is the group's unique identifier, and the value is the group itself.
36
+ */
20
37
  readonly groups: Map<string, FragmentsGroup>;
38
+ baseCoordinationModel: string;
21
39
  /** {@link Component.enabled} */
22
40
  enabled: boolean;
23
- baseCoordinationModel: string;
24
41
  private _loader;
25
- /** The list of meshes of the created fragments. */
42
+ /**
43
+ * Getter for the meshes of all fragments in the FragmentsManager.
44
+ * It iterates over the fragments in the list and pushes their meshes into an array.
45
+ * @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
46
+ */
26
47
  get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
27
48
  constructor(components: Components);
28
49
  /** {@link Disposable.dispose} */
29
50
  dispose(): void;
51
+ /**
52
+ * Dispose of a specific fragment group.
53
+ * This method removes the group from the groups map, deletes all fragments within the group from the list,
54
+ * disposes of the group, and triggers the onFragmentsDisposed event.
55
+ *
56
+ * @param group - The fragment group to be disposed.
57
+ */
30
58
  disposeGroup(group: FragmentsGroup): void;
31
59
  /**
32
- * Loads a binar file that contain fragment geometry.
60
+ * Loads a binary file that contain fragment geometry.
33
61
  * @param data - The binary data to load.
34
62
  * @param config - Optional configuration for loading.
35
63
  * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
@@ -43,7 +71,7 @@ export declare class FragmentsManager extends Component implements Disposable {
43
71
  relationsMap: RelationsMap;
44
72
  }>): FragmentsGroup;
45
73
  /**
46
- * Export the specified fragments.
74
+ * Export the specified fragmentsgroup to binary data.
47
75
  * @param group - the fragments group to be exported.
48
76
  * @returns the exported data as binary buffer.
49
77
  */
@@ -69,5 +97,16 @@ export declare class FragmentsManager extends Component implements Disposable {
69
97
  modelIdToFragmentIdMap(modelIdMap: {
70
98
  [modelID: string]: Set<number>;
71
99
  }): FRAGS.FragmentIdMap;
100
+ /**
101
+ * Applies coordinate transformation to the provided models.
102
+ * If no models are provided, all groups are used.
103
+ * The first model in the list becomes the base model for coordinate transformation.
104
+ * All other models are then transformed to match the base model's coordinate system.
105
+ *
106
+ * @param models - The models to apply coordinate transformation to.
107
+ * If not provided, all groups are used.
108
+ *
109
+ * @returns {void}
110
+ */
72
111
  coordinate(models?: FragmentsGroup[]): void;
73
112
  }
@@ -1,10 +1,38 @@
1
1
  import * as FRAGS from "@thatopen/fragments";
2
2
  import { Components, Component } from "../../core";
3
+ /**
4
+ * A component that hides or isolates 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).
5
+ */
3
6
  export declare class Hider extends Component {
7
+ /**
8
+ * A unique identifier for the component.
9
+ * This UUID is used to register the component within the Components system.
10
+ */
4
11
  static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
12
+ /** {@link Component.enabled} */
5
13
  enabled: boolean;
6
14
  constructor(components: Components);
15
+ /**
16
+ * Sets the visibility of fragments within the 3D scene.
17
+ * If no `items` parameter is provided, all fragments will be set to the specified visibility.
18
+ * If `items` is provided, only the specified fragments will be affected.
19
+ *
20
+ * @param visible - The visibility state to set for the fragments.
21
+ * @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
22
+ * If not provided, all fragments will be affected.
23
+ *
24
+ * @returns {void}
25
+ */
7
26
  set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
27
+ /**
28
+ * Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
29
+ * It calls the `set` method twice: first to hide all fragments, and then to show only the specified ones.
30
+ *
31
+ * @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
32
+ * If not provided, all fragments will be isolated.
33
+ *
34
+ * @returns {void}
35
+ */
8
36
  isolate(items: FRAGS.FragmentIdMap): void;
9
37
  private updateCulledVisibility;
10
38
  }
@@ -2,19 +2,49 @@ import * as WEBIFC from "web-ifc";
2
2
  import { Components, Disposable, Event, Component } from "../../core";
3
3
  import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
4
4
  export * from "./src";
5
+ /**
6
+ * A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
7
+ */
5
8
  export declare class IfcGeometryTiler extends Component implements Disposable {
9
+ /**
10
+ * A unique identifier for the component.
11
+ * This UUID is used to register the component within the Components system.
12
+ */
6
13
  static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
7
- onGeometryStreamed: Event<{
14
+ /**
15
+ * Event triggered when geometry is streamed.
16
+ * Contains the streamed geometry data and its buffer.
17
+ */
18
+ readonly onGeometryStreamed: Event<{
8
19
  buffer: Uint8Array;
9
20
  data: StreamedGeometries;
10
21
  }>;
11
- onAssetStreamed: Event<StreamedAsset[]>;
12
- onProgress: Event<number>;
13
- onIfcLoaded: Event<Uint8Array>;
22
+ /**
23
+ * Event triggered when assets are streamed.
24
+ * Contains the streamed assets.
25
+ */
26
+ readonly onAssetStreamed: Event<StreamedAsset[]>;
27
+ /**
28
+ * Event triggered to indicate the progress of the streaming process.
29
+ * Contains the progress percentage.
30
+ */
31
+ readonly onProgress: Event<number>;
32
+ /**
33
+ * Event triggered when the IFC file is loaded.
34
+ * Contains the loaded IFC file data.
35
+ */
36
+ readonly onIfcLoaded: Event<Uint8Array>;
14
37
  /** {@link Disposable.onDisposed} */
15
38
  readonly onDisposed: Event<unknown>;
39
+ /**
40
+ * Settings for the IfcGeometryTiler.
41
+ */
16
42
  settings: IfcStreamingSettings;
43
+ /** {@link Component.enabled} */
17
44
  enabled: boolean;
45
+ /**
46
+ * The WebIFC API instance used for IFC file processing.
47
+ */
18
48
  webIfc: WEBIFC.IfcAPI;
19
49
  private _spatialTree;
20
50
  private _metaData;
@@ -27,8 +57,36 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
27
57
  private _assets;
28
58
  private _meshesWithHoles;
29
59
  constructor(components: Components);
60
+ /** {@link Disposable.dispose} */
30
61
  dispose(): void;
62
+ /**
63
+ * This method streams the IFC file from a given buffer.
64
+ *
65
+ * @param data - The Uint8Array containing the IFC file data.
66
+ * @returns A Promise that resolves when the streaming process is complete.
67
+ *
68
+ * @remarks
69
+ * This method cleans up any resources after the streaming process is complete.
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const ifcData = await fetch('path/to/ifc/file.ifc');
74
+ * const rawBuffer = await response.arrayBuffer();
75
+ * const ifcBuffer = new Uint8Array(rawBuffer);
76
+ * await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
77
+ * ```
78
+ */
31
79
  streamFromBuffer(data: Uint8Array): Promise<void>;
80
+ /**
81
+ * This method streams the IFC file from a given callback.
82
+ *
83
+ * @param loadCallback - The callback function that will be used to load the IFC file.
84
+ * @returns A Promise that resolves when the streaming process is complete.
85
+ *
86
+ * @remarks
87
+ * This method cleans up any resources after the streaming process is complete.
88
+ *
89
+ */
32
90
  streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
33
91
  private readIfcFile;
34
92
  private streamIfcFile;
@@ -1,15 +1,29 @@
1
+ /**
2
+ * A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
3
+ */
1
4
  export interface StreamedGeometries {
2
5
  [id: number]: {
6
+ /** The bounding box of the geometry as a Float32Array. */
3
7
  boundingBox: Float32Array;
8
+ /** A boolean indicating whether the geometry has holes. */
4
9
  hasHoles: boolean;
10
+ /** An optional file path for the geometry data. */
5
11
  geometryFile?: string;
6
12
  };
7
13
  }
14
+ /**
15
+ * A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
16
+ */
8
17
  export interface StreamedAsset {
18
+ /** The unique identifier of the asset. */
9
19
  id: number;
20
+ /** An array of geometries associated with the asset. */
10
21
  geometries: {
22
+ /** The unique identifier of the geometry. */
11
23
  geometryID: number;
24
+ /** The transformation matrix of the geometry as a number array. */
12
25
  transformation: number[];
26
+ /** The color of the geometry as a number array. */
13
27
  color: number[];
14
28
  }[];
15
29
  }
@@ -1,3 +1,2 @@
1
1
  export * from "./streaming-settings";
2
- export * from "./fragment-props-stream-converter";
3
2
  export * from "./base-types";