@thatopen/components 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.1.1";
9
+ static readonly release = "2.1.2";
10
10
  /** {@link Disposable.onDisposed} */
11
11
  readonly onDisposed: Event<void>;
12
12
  /**
@@ -2,7 +2,7 @@ import * as THREE from "three";
2
2
  import * as FRAGS from "@thatopen/fragments";
3
3
  import { Disposable, Component, Event, Components } from "../../core";
4
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.
5
+ * Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
6
6
  */
7
7
  export interface Classification {
8
8
  /**
@@ -12,9 +12,13 @@ export interface Classification {
12
12
  [system: string]: {
13
13
  /**
14
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.
15
+ * The key is the class name, and the value is an object containing a map of fragment IDs with extra information.
16
16
  */
17
- [className: string]: FRAGS.FragmentIdMap;
17
+ [className: string]: {
18
+ map: FRAGS.FragmentIdMap;
19
+ name: string;
20
+ id: number | null;
21
+ };
18
22
  };
19
23
  }
20
24
  /**
@@ -124,6 +128,7 @@ export declare class Classifier extends Component implements Disposable {
124
128
  * Classifies fragments based on their spatial structure in the IFC model.
125
129
  *
126
130
  * @param model - The FragmentsGroup containing the fragments to be classified.
131
+ * @param config - The configuration for the classifier. It includes "useProperties" (if false, the classification will use the expressIDs instead of the names)
127
132
  *
128
133
  * @remarks
129
134
  * This method iterates through the relations of the fragments in the provided group,
@@ -133,7 +138,9 @@ export declare class Classifier extends Component implements Disposable {
133
138
  *
134
139
  * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
135
140
  */
136
- bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
141
+ bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
142
+ useProperties: boolean;
143
+ }): Promise<void>;
137
144
  /**
138
145
  * Sets the color of the specified fragments.
139
146
  *
@@ -160,5 +167,5 @@ export declare class Classifier extends Component implements Disposable {
160
167
  * @throws Will throw an error if the fragment with the specified ID is not found.
161
168
  */
162
169
  resetColor(items: FRAGS.FragmentIdMap): void;
163
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
170
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
164
171
  }
@@ -138,4 +138,14 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
138
138
  getRelationsMapFromJSON(json: string): RelationsMap;
139
139
  /** {@link Disposable.dispose} */
140
140
  dispose(): void;
141
+ /**
142
+ * Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
143
+ *
144
+ * @param model The BIM model whose children to get.
145
+ * @param id The expressID of the item whose children to get.
146
+ * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
147
+ *
148
+ * @returns A `Set` with the expressIDs of the found items.
149
+ */
150
+ getElementsChildren(model: FragmentsGroup, id: number, found?: Set<number>): Set<number>;
141
151
  }