@thatopen/components 2.0.0-alpha.11 → 2.0.0-alpha.13

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.
@@ -1,6 +1,8 @@
1
1
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
2
2
  import * as THREE from "three";
3
+ import * as FRAGS from "@thatopen/fragments";
3
4
  import { Component, Components, Event, Disposable } from "../../core";
5
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
4
6
  /**
5
7
  * Object that can efficiently load binary files that contain
6
8
  * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
@@ -28,12 +30,18 @@ export declare class FragmentManager extends Component implements Disposable {
28
30
  dispose(): void;
29
31
  disposeGroup(group: FragmentsGroup): void;
30
32
  /**
31
- * Loads one or many fragments into the scene.
32
- * @param data - the bytes containing the data for the fragments to load.
33
- * @param coordinate - whether this fragmentsgroup should be federated with the others.
34
- * @returns the list of IDs of the loaded fragments.
33
+ * Loads a binar file that contain fragment geometry.
34
+ * @param data - The binary data to load.
35
+ * @param config - Optional configuration for loading.
36
+ * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
37
+ * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
38
+ * @returns The loaded FragmentsGroup.
35
39
  */
36
- load(data: Uint8Array, coordinate?: boolean): FragmentsGroup;
40
+ load(data: Uint8Array, config?: Partial<{
41
+ coordinate: boolean;
42
+ properties: FRAGS.IfcProperties;
43
+ relationsMap: RelationsMap;
44
+ }>): FragmentsGroup;
37
45
  /**
38
46
  * Export the specified fragments.
39
47
  * @param group - the fragments group to be exported.
@@ -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, InverseAttributes, InverseAttribute } from "./src/types";
4
+ import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
5
5
  /**
6
6
  * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
7
7
  * 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.
@@ -16,11 +16,8 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
16
16
  relationsMap: RelationsMap;
17
17
  }>;
18
18
  private _relToAttributesMap;
19
- /**
20
- * Array of inverse attribute names.
21
- * This array is used to define the inverse attributes that the indexer will process and index.
22
- */
23
- readonly inverseAttributes: InverseAttributes;
19
+ private _inverseAttributes;
20
+ private _ifcRels;
24
21
  /**
25
22
  * Holds the relationship mappings for each model processed by the indexer.
26
23
  * The structure is a map where each key is a model's UUID, and the value is another map.
@@ -32,7 +29,6 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
32
29
  readonly relationMaps: ModelsRelationMap;
33
30
  constructor(components: Components);
34
31
  private onFragmentsDisposed;
35
- private getAttributeRels;
36
32
  /**
37
33
  * Adds a relation map to the model's relations map.
38
34
  *
@@ -60,7 +56,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
60
56
  */
61
57
  process(model: FragmentsGroup): Promise<RelationsMap>;
62
58
  /**
63
- * Processes a given model from a WebIfc API to index its IFC entities relations based on predefined inverse attributes.
59
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
64
60
  *
65
61
  * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
66
62
  * @param modelID - The unique identifier of the model within the WebIfc API.
@@ -133,3 +129,4 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
133
129
  */
134
130
  dispose(): void;
135
131
  }
132
+ export type { InverseAttribute } from "./src/types";
@@ -1,4 +1,5 @@
1
+ import { InverseAttribute } from "./types";
1
2
  export declare const relToAttributesMap: Map<number, {
2
- forRelating?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
3
- forRelated?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
3
+ forRelating: InverseAttribute;
4
+ forRelated: InverseAttribute;
4
5
  }>;