@thatopen/components 2.3.14 → 2.3.16

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.3.14";
9
+ static readonly release = "2.3.16";
10
10
  /** {@link Disposable.onDisposed} */
11
11
  readonly onDisposed: Event<void>;
12
12
  /**
@@ -143,6 +143,7 @@ export declare class Classifier extends Component implements Disposable {
143
143
  bySpatialStructure(model: FRAGS.FragmentsGroup, config?: {
144
144
  useProperties?: boolean;
145
145
  isolate?: Set<number>;
146
+ systemName?: string;
146
147
  }): Promise<void>;
147
148
  /**
148
149
  * Sets the color of the specified fragments.
@@ -1,7 +1,7 @@
1
1
  import * as WEBIFC from "web-ifc";
2
2
  import { FragmentsGroup } from "@thatopen/fragments";
3
3
  import { Disposable, Event, Component, Components } from "../../core";
4
- import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation } from "./src";
4
+ import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation, RelationsProcessingConfig, EntitiesRelatedEvent } from "./src";
5
5
  /**
6
6
  * Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
7
7
  */
@@ -42,7 +42,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
42
42
  constructor(components: Components);
43
43
  private onFragmentsDisposed;
44
44
  private indexRelations;
45
- getAttributeIndex(inverseAttribute: InverseAttribute): number | null;
45
+ getAttributeIndex(inverseAttribute: InverseAttribute): number;
46
46
  /**
47
47
  * Adds a relation map to the model's relations map.
48
48
  *
@@ -68,7 +68,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
68
68
  * representation of the relations indexed by entity expressIDs and relation types.
69
69
  * @throws An error if the model does not have properties loaded.
70
70
  */
71
- process(model: FragmentsGroup): Promise<RelationsMap>;
71
+ process(model: FragmentsGroup, config?: Partial<RelationsProcessingConfig>): Promise<RelationsMap>;
72
72
  /**
73
73
  * Processes a given model from a WebIfc API to index its IFC entities relations.
74
74
  *
@@ -85,11 +85,10 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
85
85
  *
86
86
  * @param model The `FragmentsGroup` model containing the entity, or its UUID.
87
87
  * @param expressID The unique identifier of the entity within the model.
88
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
89
- * @returns An array of express IDs representing the related entities, or `null` if no relations are found
90
- * or the specified relation name is not indexed.
88
+ * @param attribute The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
89
+ * @returns An array of express IDs representing the related entities. If the array is empty, no relations were found.
91
90
  */
92
- getEntityRelations(model: FragmentsGroup | string, expressID: number, relationName: InverseAttribute): number[] | null;
91
+ getEntityRelations(model: FragmentsGroup | string | RelationsMap, expressID: number, attribute: InverseAttribute): number[];
93
92
  /**
94
93
  * Serializes the relations of a given relation map into a JSON string.
95
94
  * This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
@@ -166,7 +165,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
166
165
  * Converts the relations made into actual IFC data.
167
166
  *
168
167
  * @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
169
- * It only make sense to use if the relations need to be write in the IFC file.
168
+ * It only make sense to use it if the relations need to be write in the IFC file.
170
169
  *
171
170
  * @returns A promise that resolves when all the relation changes have been applied.
172
171
  */
@@ -177,16 +176,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
177
176
  * The event provides information about the type of relation, the inverse attribute,
178
177
  * the IDs of the entities related, and the IDs of the entities that are being related.
179
178
  */
180
- readonly onEntitiesRelated: Event<{
181
- /** The type of the IFC relation. */
182
- relType: IfcRelation;
183
- /** The inverse attribute of the relation. */
184
- invAttribute: InverseAttribute;
185
- /** The IDs of the entities that are relating. */
186
- relatingIDs: number[];
187
- /** The IDs of the entities that are being related. */
188
- relatedIDs: number[];
189
- }>;
179
+ readonly onEntitiesRelated: Event<EntitiesRelatedEvent>;
190
180
  addEntitiesRelation(model: FragmentsGroup, relatingID: number, rel: {
191
181
  type: IfcRelation;
192
182
  inv: InverseAttribute;
@@ -0,0 +1,51 @@
1
+ declare const actual: {
2
+ 186: {
3
+ 7: number[];
4
+ };
5
+ 250: {
6
+ 8: number[];
7
+ };
8
+ 253: {
9
+ 8: number[];
10
+ };
11
+ 257: {
12
+ 8: number[];
13
+ };
14
+ };
15
+ declare const newVersion: {
16
+ 186: {
17
+ 7: ({
18
+ 259: number[];
19
+ 263?: undefined;
20
+ 266?: undefined;
21
+ } | {
22
+ 263: number[];
23
+ 259?: undefined;
24
+ 266?: undefined;
25
+ } | {
26
+ 266: number[];
27
+ 259?: undefined;
28
+ 263?: undefined;
29
+ })[];
30
+ };
31
+ 190: {
32
+ 7: {
33
+ 259: number[];
34
+ }[];
35
+ };
36
+ 250: {
37
+ 8: {
38
+ 259: number[];
39
+ }[];
40
+ };
41
+ };
42
+ interface V2Schema {
43
+ [expressID: number]: {
44
+ [invAttrIndex: number]: {
45
+ [IfcRelationship: number]: number[];
46
+ };
47
+ };
48
+ }
49
+ type RelationsMap = Map<number, Map<number, {
50
+ [ifcRel: number]: number[];
51
+ }>>;
@@ -55,3 +55,20 @@ export type IfcRelations = [
55
55
  typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
56
56
  ];
57
57
  export type IfcRelation = IfcRelations[number];
58
+ export interface RelationsProcessingConfig {
59
+ relationsToProcess: IfcRelation[];
60
+ }
61
+ /**
62
+ * Interface definition of an Entities Related Event from the IfcRelationsIndexer.
63
+ * This event gets triggered when two or more entities has been related with each other.
64
+ */
65
+ export interface EntitiesRelatedEvent {
66
+ /** The type of the IFC relation. */
67
+ relType: IfcRelation;
68
+ /** The inverse attribute of the relation. */
69
+ invAttribute: InverseAttribute;
70
+ /** The IDs of the entities that are relating. */
71
+ relatingIDs: number[];
72
+ /** The IDs of the entities that are being related. */
73
+ relatedIDs: number[];
74
+ }