@thatopen/components 2.3.0-alpha.9 → 2.3.1
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.
- package/dist/core/Components/index.d.ts +20 -3
- package/dist/core/ConfigManager/index.d.ts +2 -2
- package/dist/core/ConfigManager/src/configurator.d.ts +2 -1
- package/dist/core/Grids/src/simple-grid-config.d.ts +34 -0
- package/dist/core/MiniMap/index.d.ts +2 -0
- package/dist/core/MiniMap/src/index.d.ts +2 -89
- package/dist/core/MiniMap/src/mini-map-config.d.ts +112 -0
- package/dist/core/MiniMap/src/mini-map.d.ts +100 -0
- package/dist/core/Viewpoints/index.d.ts +1 -0
- package/dist/core/Viewpoints/src/types.d.ts +3 -0
- package/dist/core/Viewpoints/src/viewpoint.d.ts +12 -5
- package/dist/core/Worlds/index.d.ts +2 -16
- package/dist/core/Worlds/src/simple-world.d.ts +2 -2
- package/dist/fragments/Classifier/index.d.ts +1 -1
- package/dist/fragments/FragmentsManager/index.d.ts +8 -0
- package/dist/fragments/IfcLoader/index.d.ts +1 -1
- package/dist/ifc/IfcFinder/index.d.ts +50 -0
- package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +35 -0
- package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +96 -0
- package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +36 -0
- package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +69 -0
- package/dist/ifc/IfcFinder/src/index.d.ts +4 -0
- package/dist/ifc/IfcFinder/src/types.d.ts +84 -0
- package/dist/ifc/IfcPropertiesManager/index.d.ts +24 -6
- package/dist/ifc/IfcPropertiesManager/src/index.d.ts +3 -0
- package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +7 -0
- package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +3 -0
- package/dist/ifc/IfcPropertiesManager/src/types.d.ts +18 -0
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +36 -6
- package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +2 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +1 -1
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +4 -2
- package/dist/ifc/Utils/ifc-category-case.d.ts +3 -0
- package/dist/ifc/Utils/index.d.ts +1 -0
- package/dist/ifc/index.d.ts +1 -0
- package/dist/index.cjs +100 -57
- package/dist/index.mjs +14291 -11196
- package/dist/namespace.d.ts +4102 -3175
- package/dist/openbim/BCFTopics/index.d.ts +4 -0
- package/dist/openbim/IDSSpecifications/index.d.ts +61 -0
- package/dist/openbim/IDSSpecifications/src/Specification.d.ts +39 -0
- package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +2 -0
- package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +12 -0
- package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +20 -0
- package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +14 -0
- package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +25 -0
- package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +9 -0
- package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +25 -0
- package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +22 -0
- package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +5 -0
- package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +3 -0
- package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +3 -0
- package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +3 -0
- package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +3 -0
- package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +2 -0
- package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +3 -0
- package/dist/openbim/IDSSpecifications/src/index.d.ts +3 -0
- package/dist/openbim/IDSSpecifications/src/types.d.ts +51 -0
- package/dist/openbim/index.d.ts +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2
|
+
import { IfcFinderRule, SerializedQuery } from "./types";
|
|
3
|
+
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
4
|
+
import { Components } from "../../../core";
|
|
5
|
+
/**
|
|
6
|
+
* A query that checks the direct attributes of IFC items.
|
|
7
|
+
*/
|
|
8
|
+
export declare class IfcBasicQuery extends IfcFinderQuery {
|
|
9
|
+
/**
|
|
10
|
+
* {@link IfcFinderQuery.name}
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* The type of this query.
|
|
15
|
+
*/
|
|
16
|
+
static type: "IfcBasicQuery";
|
|
17
|
+
/**
|
|
18
|
+
* {@link IfcFinderQuery.items}
|
|
19
|
+
*/
|
|
20
|
+
get items(): FRAGS.FragmentIdMap;
|
|
21
|
+
constructor(components: Components, data: {
|
|
22
|
+
name: string;
|
|
23
|
+
rules: IfcFinderRule[];
|
|
24
|
+
inclusive: boolean;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* {@link IfcFinderQuery.export}
|
|
28
|
+
*/
|
|
29
|
+
export(): SerializedQuery;
|
|
30
|
+
/**
|
|
31
|
+
* {@link IfcFinderQuery.update}
|
|
32
|
+
*/
|
|
33
|
+
update(modelID: string, file: File): Promise<void>;
|
|
34
|
+
protected findInLines(modelID: string, lines: string[]): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2
|
+
import { IfcFinderRule, SerializedQuery } from "./types";
|
|
3
|
+
import { Components, Event } from "../../../core";
|
|
4
|
+
/**
|
|
5
|
+
* The base class for all queries used by the {@link IfcFinder}.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class IfcFinderQuery {
|
|
8
|
+
/**
|
|
9
|
+
* The list of functions to import the queries. If you create your own custom query, you should add its importer here. See the other queries provided by the library for reference.
|
|
10
|
+
*/
|
|
11
|
+
static importers: Map<string, (components: Components, data: any) => IfcFinderQuery>;
|
|
12
|
+
/**
|
|
13
|
+
* Event used to notify the progress when performing a query on an IFC file.
|
|
14
|
+
*/
|
|
15
|
+
readonly onProgress: Event<number>;
|
|
16
|
+
/**
|
|
17
|
+
* A name given to the instance of the query to identify it.
|
|
18
|
+
*/
|
|
19
|
+
abstract name: string;
|
|
20
|
+
/**
|
|
21
|
+
* The list of IFC items that this query found across all models.
|
|
22
|
+
*/
|
|
23
|
+
abstract items: FRAGS.FragmentIdMap;
|
|
24
|
+
/**
|
|
25
|
+
* If false, ALL rules of the query must comply to make a match. If true, ANY rule will be enough to make a match.
|
|
26
|
+
*/
|
|
27
|
+
inclusive: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The list of rules to be applied by this query.
|
|
30
|
+
*/
|
|
31
|
+
rules: IfcFinderRule[];
|
|
32
|
+
/**
|
|
33
|
+
* The IDs of the match items per model.
|
|
34
|
+
*/
|
|
35
|
+
ids: {
|
|
36
|
+
[modelID: string]: Set<number>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Whether this query is up to date or not per file. If not, when updating the group where it belongs, it will re-process the given file.
|
|
40
|
+
*/
|
|
41
|
+
needsUpdate: Map<string, boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Export the current data of this query in a serializable object to persist it over time.
|
|
44
|
+
*/
|
|
45
|
+
abstract export(): {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Perform the search in the given file and save the result.
|
|
50
|
+
*/
|
|
51
|
+
abstract update(modelID: string, file: File): Promise<void>;
|
|
52
|
+
protected components: Components;
|
|
53
|
+
protected abstract findInLines(modelID: string, lines: string[]): void;
|
|
54
|
+
protected constructor(components: Components);
|
|
55
|
+
/**
|
|
56
|
+
* Imports a query given its data. This data can be generating using its {@link IfcFinderQuery.export} method.
|
|
57
|
+
*
|
|
58
|
+
* @param components the instance of {@link Components} used by this app.
|
|
59
|
+
* @param data the data of the query to import as a serializable object.
|
|
60
|
+
*/
|
|
61
|
+
static import(components: Components, data: {
|
|
62
|
+
[id: string]: any;
|
|
63
|
+
}): IfcFinderQuery | null;
|
|
64
|
+
/**
|
|
65
|
+
* Imports the given serialized rules. Only use this when writing your own custom query. See the other queries provided by the library for reference.
|
|
66
|
+
*
|
|
67
|
+
* @param serializedRules the rules to be parsed.
|
|
68
|
+
*/
|
|
69
|
+
static importRules(serializedRules: {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
}[]): IfcFinderRule[];
|
|
72
|
+
/**
|
|
73
|
+
* Imports the given IDs. Only use this when writing your own custom query. See the other queries provided by the library for reference.
|
|
74
|
+
*
|
|
75
|
+
* @param data the serialized object representing the query whose IDs to parse.
|
|
76
|
+
*/
|
|
77
|
+
static importIds(data: SerializedQuery): {
|
|
78
|
+
[modelID: string]: Set<number>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Clears the data of the given model. If not specified, clears all the data.
|
|
82
|
+
*
|
|
83
|
+
* @param modelID ID of the model whose data to clear.
|
|
84
|
+
*/
|
|
85
|
+
clear(modelID?: string): void;
|
|
86
|
+
protected addID(modelID: string, id: number): void;
|
|
87
|
+
protected getData(): SerializedQuery;
|
|
88
|
+
protected exportRules(): {
|
|
89
|
+
[key: string]: any;
|
|
90
|
+
}[];
|
|
91
|
+
protected findInFile(modelID: string, file: File): Promise<void>;
|
|
92
|
+
protected getIdFromLine(line: string): number;
|
|
93
|
+
protected testRules(line: string): boolean;
|
|
94
|
+
protected getCategoryFromLine(line: string): string | null;
|
|
95
|
+
protected getAttributesFromLine(line: string): string[] | null;
|
|
96
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2
|
+
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
3
|
+
import { IfcOperatorRule, IfcPropertyRule, SerializedQuery } from "./types";
|
|
4
|
+
import { Components } from "../../../core";
|
|
5
|
+
/**
|
|
6
|
+
* A query that checks the properties in the property sets assigned to IFC items.
|
|
7
|
+
*/
|
|
8
|
+
export declare class IfcPropertyQuery extends IfcFinderQuery {
|
|
9
|
+
/**
|
|
10
|
+
* {@link IfcFinderQuery.name}
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* The type of this query.
|
|
15
|
+
*/
|
|
16
|
+
static type: "IfcPropertyQuery";
|
|
17
|
+
private psets;
|
|
18
|
+
/**
|
|
19
|
+
* {@link IfcFinderQuery.items}
|
|
20
|
+
*/
|
|
21
|
+
get items(): FRAGS.FragmentIdMap;
|
|
22
|
+
constructor(components: Components, data: {
|
|
23
|
+
name: string;
|
|
24
|
+
inclusive: boolean;
|
|
25
|
+
rules: (IfcPropertyRule | IfcOperatorRule)[];
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* {@link IfcFinderQuery.export}
|
|
29
|
+
*/
|
|
30
|
+
export(): SerializedQuery;
|
|
31
|
+
/**
|
|
32
|
+
* {@link IfcFinderQuery.update}
|
|
33
|
+
*/
|
|
34
|
+
update(modelID: string, file: File): Promise<void>;
|
|
35
|
+
protected findInLines(modelID: string, lines: string[]): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2
|
+
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
3
|
+
import { Components } from "../../../core";
|
|
4
|
+
/**
|
|
5
|
+
* A group of queries to perform searches in one or many IFC files.
|
|
6
|
+
*/
|
|
7
|
+
export declare class IfcQueryGroup {
|
|
8
|
+
/**
|
|
9
|
+
* The list of queries contained in this group.
|
|
10
|
+
*/
|
|
11
|
+
list: Map<string, IfcFinderQuery>;
|
|
12
|
+
/**
|
|
13
|
+
* A unique string to identify this group instance.
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* The way this group works when retrieving items.
|
|
18
|
+
* - Combine: returns the sum of all items of all queries.
|
|
19
|
+
* - Intersect: returns only the common elements of all queries.
|
|
20
|
+
*/
|
|
21
|
+
mode: "combine" | "intersect";
|
|
22
|
+
private _components;
|
|
23
|
+
/**
|
|
24
|
+
* The list of unique queries contained in this group.
|
|
25
|
+
*/
|
|
26
|
+
get queries(): Set<IfcFinderQuery>;
|
|
27
|
+
/**
|
|
28
|
+
* The items of all the queries contained in this group. The returned data depends on {@link IfcQueryGroup.mode}.
|
|
29
|
+
*/
|
|
30
|
+
get items(): FRAGS.FragmentIdMap;
|
|
31
|
+
constructor(components: Components);
|
|
32
|
+
/**
|
|
33
|
+
* Adds a new query to this group.
|
|
34
|
+
* @param query the query to add.
|
|
35
|
+
*/
|
|
36
|
+
add(query: IfcFinderQuery): void;
|
|
37
|
+
/**
|
|
38
|
+
* Clears the data of the given modelID of all queries contained in this group. If no modelID is provided, clears all data.
|
|
39
|
+
* @param modelID the model whose data to remove.
|
|
40
|
+
*/
|
|
41
|
+
clear(modelID?: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Imports data that has been previously exported through {@link IfcQueryGroup.export}.
|
|
44
|
+
* @param data the serializable object used to persist a group's data.
|
|
45
|
+
*/
|
|
46
|
+
import(data: {
|
|
47
|
+
mode: "combine" | "intersect";
|
|
48
|
+
id: string;
|
|
49
|
+
queries: {
|
|
50
|
+
[guid: string]: any;
|
|
51
|
+
};
|
|
52
|
+
}): void;
|
|
53
|
+
/**
|
|
54
|
+
* Exports all the data of this group, so that it can be persisted and imported later using {@link IfcQueryGroup.import}.
|
|
55
|
+
*/
|
|
56
|
+
export(): {
|
|
57
|
+
mode: "combine" | "intersect";
|
|
58
|
+
id: string;
|
|
59
|
+
queries: {
|
|
60
|
+
[guid: string]: any;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Updates all the queries contained in this group that need an update for the given file. It will skip those where {@link IfcFinderQuery.needsUpdate} is false.
|
|
65
|
+
* @param modelID the identifier used to refer to the given file.
|
|
66
|
+
* @param file the file to process.
|
|
67
|
+
*/
|
|
68
|
+
update(modelID: string, file: File): Promise<void>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A rule for the {@link IfcFinder} to search items based on their category.
|
|
3
|
+
*/
|
|
4
|
+
export interface IfcCategoryRule {
|
|
5
|
+
/**
|
|
6
|
+
* The type of this rule. All rules have a fixed type.
|
|
7
|
+
*/
|
|
8
|
+
type: "category";
|
|
9
|
+
/**
|
|
10
|
+
* The category value. It's a regular expression, so you can make complex queries and use ".*" to match all categories.
|
|
11
|
+
*/
|
|
12
|
+
value: RegExp;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A rule for the {@link IfcFinder} to search items based on the properties defined in their property sets.
|
|
16
|
+
*/
|
|
17
|
+
export interface IfcPropertyRule {
|
|
18
|
+
/**
|
|
19
|
+
* The type of this rule. All rules have a fixed type.
|
|
20
|
+
*/
|
|
21
|
+
type: "property";
|
|
22
|
+
/**
|
|
23
|
+
* The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names.
|
|
24
|
+
*/
|
|
25
|
+
name: RegExp;
|
|
26
|
+
/**
|
|
27
|
+
* The value of the property. It's a regular expression, so you can make complex queries and use ".*" to match all values.
|
|
28
|
+
*/
|
|
29
|
+
value: RegExp;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A rule for the {@link IfcFinder} to search items based on the value of a numeric property defined in their property sets.
|
|
33
|
+
*/
|
|
34
|
+
export interface IfcOperatorRule {
|
|
35
|
+
/**
|
|
36
|
+
* The type of this rule. All rules have a fixed type.
|
|
37
|
+
*/
|
|
38
|
+
type: "operator";
|
|
39
|
+
/**
|
|
40
|
+
* The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names.
|
|
41
|
+
*/
|
|
42
|
+
name: RegExp;
|
|
43
|
+
/**
|
|
44
|
+
* The value of the property.
|
|
45
|
+
*/
|
|
46
|
+
value: number;
|
|
47
|
+
/**
|
|
48
|
+
* The operator to apply to the numeric value.
|
|
49
|
+
*/
|
|
50
|
+
operator: "<" | ">" | "=" | "<=" | ">=";
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The type of rules that can be used in the queries of the {@link IfcFinder}.
|
|
54
|
+
*/
|
|
55
|
+
export type IfcFinderRule = IfcCategoryRule | IfcPropertyRule | IfcOperatorRule;
|
|
56
|
+
/**
|
|
57
|
+
* The data type used when the queries of the {@link IfcFinder} export or import query data to persist it.
|
|
58
|
+
*/
|
|
59
|
+
export type SerializedQuery = {
|
|
60
|
+
/**
|
|
61
|
+
* {@link IfcFinderQuery.name}
|
|
62
|
+
*/
|
|
63
|
+
name: string;
|
|
64
|
+
/**
|
|
65
|
+
* {@link IfcFinderQuery.inclusive}
|
|
66
|
+
*/
|
|
67
|
+
inclusive: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The type of query.
|
|
70
|
+
*/
|
|
71
|
+
type: string;
|
|
72
|
+
/**
|
|
73
|
+
* {@link IfcFinderQuery.ids}
|
|
74
|
+
*/
|
|
75
|
+
ids: {
|
|
76
|
+
[modelID: string]: number[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* {@link IfcFinderQuery.rules}
|
|
80
|
+
*/
|
|
81
|
+
rules: {
|
|
82
|
+
[key: string]: any;
|
|
83
|
+
}[];
|
|
84
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as WEBIFC from "web-ifc";
|
|
2
2
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
3
3
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
4
|
+
import { IfcRelation } from "../IfcRelationsIndexer";
|
|
4
5
|
/**
|
|
5
6
|
* Types for boolean properties in IFC schema.
|
|
6
7
|
*/
|
|
@@ -136,8 +137,8 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
136
137
|
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
137
138
|
*/
|
|
138
139
|
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
139
|
-
pset: WEBIFC.
|
|
140
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.
|
|
140
|
+
pset: WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
141
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties;
|
|
141
142
|
}>;
|
|
142
143
|
/**
|
|
143
144
|
* Removes a Property Set (Pset) from the given model.
|
|
@@ -165,7 +166,7 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
165
166
|
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
166
167
|
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
167
168
|
*/
|
|
168
|
-
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.
|
|
169
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
169
170
|
/**
|
|
170
171
|
* Creates a new single-value property of type numeric in the given model.
|
|
171
172
|
*
|
|
@@ -179,7 +180,7 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
179
180
|
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
180
181
|
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
181
182
|
*/
|
|
182
|
-
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.
|
|
183
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
183
184
|
/**
|
|
184
185
|
* Creates a new single-value property of type boolean in the given model.
|
|
185
186
|
*
|
|
@@ -193,7 +194,7 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
193
194
|
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
194
195
|
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
195
196
|
*/
|
|
196
|
-
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.
|
|
197
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
197
198
|
/**
|
|
198
199
|
* Removes a property from a Property Set (Pset) in the given model.
|
|
199
200
|
*
|
|
@@ -207,7 +208,10 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
207
208
|
* @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
|
|
208
209
|
*/
|
|
209
210
|
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
210
|
-
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated Use indexer.addEntitiesRelation instead. This will be removed in future releases.
|
|
213
|
+
*/
|
|
214
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): void;
|
|
211
215
|
/**
|
|
212
216
|
* Adds elements to a Property Set (Pset) in the given model.
|
|
213
217
|
*
|
|
@@ -222,6 +226,19 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
222
226
|
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
223
227
|
*/
|
|
224
228
|
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Creates a new instance of a relationship between entities in the IFC model.
|
|
231
|
+
*
|
|
232
|
+
* @param model - The FragmentsGroup model in which to create the relationship.
|
|
233
|
+
* @param type - The type of the relationship to create.
|
|
234
|
+
* @param relatingID - The express ID of the entity that is related to the other entities.
|
|
235
|
+
* @param relatedIDs - The express IDs of the entities that are related to the relating entity.
|
|
236
|
+
*
|
|
237
|
+
* @returns A promise that resolves with the newly created relationship.
|
|
238
|
+
*
|
|
239
|
+
* @throws Will throw an error if the relationship type is unsupported.
|
|
240
|
+
*/
|
|
241
|
+
createIfcRel(model: FragmentsGroup, type: IfcRelation, relatingID: number, relatedIDs: number[]): Promise<any>;
|
|
225
242
|
/**
|
|
226
243
|
* Saves the changes made to the model to a new IFC file.
|
|
227
244
|
*
|
|
@@ -265,3 +282,4 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
265
282
|
private registerChange;
|
|
266
283
|
private newSingleProperty;
|
|
267
284
|
}
|
|
285
|
+
export * from "./src";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type IfcRelationNames = [
|
|
2
|
+
"IfcRelAssignsToControl",
|
|
3
|
+
"IfcRelAssignsToGroup",
|
|
4
|
+
"IfcRelAssignsToProduct",
|
|
5
|
+
"IfcRelAssociatesClassification",
|
|
6
|
+
"IfcRelAssociatesMaterial",
|
|
7
|
+
"IfcRelAssociatesDocument",
|
|
8
|
+
"IfcRelContainedInSpatialStructure",
|
|
9
|
+
"IfcRelFlowControlElements",
|
|
10
|
+
"IfcRelConnectsElements",
|
|
11
|
+
"IfcRelDeclares",
|
|
12
|
+
"IfcRelAggregates",
|
|
13
|
+
"IfcRelNests",
|
|
14
|
+
"IfcRelDefinesByProperties",
|
|
15
|
+
"IfcRelDefinesByType",
|
|
16
|
+
"IfcRelDefinesByTemplate"
|
|
17
|
+
];
|
|
18
|
+
export type IfcRelName = IfcRelationNames[number];
|
|
@@ -1,8 +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 } from "./src
|
|
5
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
4
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation } from "./src";
|
|
6
5
|
/**
|
|
7
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).
|
|
8
7
|
*/
|
|
@@ -43,7 +42,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
43
42
|
constructor(components: Components);
|
|
44
43
|
private onFragmentsDisposed;
|
|
45
44
|
private indexRelations;
|
|
46
|
-
|
|
45
|
+
getAttributeIndex(inverseAttribute: InverseAttribute): number | null;
|
|
47
46
|
/**
|
|
48
47
|
* Adds a relation map to the model's relations map.
|
|
49
48
|
*
|
|
@@ -84,13 +83,13 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
84
83
|
* This method searches the indexed relation maps for the specified model and entity,
|
|
85
84
|
* returning the IDs of related entities if a match is found.
|
|
86
85
|
*
|
|
87
|
-
* @param model The `FragmentsGroup` model containing the entity.
|
|
86
|
+
* @param model The `FragmentsGroup` model containing the entity, or its UUID.
|
|
88
87
|
* @param expressID The unique identifier of the entity within the model.
|
|
89
88
|
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
90
89
|
* @returns An array of express IDs representing the related entities, or `null` if no relations are found
|
|
91
90
|
* or the specified relation name is not indexed.
|
|
92
91
|
*/
|
|
93
|
-
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
92
|
+
getEntityRelations(model: FragmentsGroup | string, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
94
93
|
/**
|
|
95
94
|
* Serializes the relations of a given relation map into a JSON string.
|
|
96
95
|
* 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,
|
|
@@ -140,7 +139,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
140
139
|
/** {@link Disposable.dispose} */
|
|
141
140
|
dispose(): void;
|
|
142
141
|
/**
|
|
143
|
-
* Retrieves the entities within a
|
|
142
|
+
* Retrieves the entities within a model that have a specific relation with a given entity.
|
|
144
143
|
*
|
|
145
144
|
* @param model - The BIM model to search for related entities.
|
|
146
145
|
* @param inv - The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
@@ -158,10 +157,40 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
158
157
|
* @param expressID - The expressID of the entity within the model.
|
|
159
158
|
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
160
159
|
* @param relIDs - The expressIDs of the related entities within the model.
|
|
160
|
+
* @deprecated Use addEntitiesRelation instead. This will be removed in future versions.
|
|
161
161
|
*
|
|
162
162
|
* @throws An error if the relation name is not a valid relation name.
|
|
163
163
|
*/
|
|
164
164
|
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
165
|
+
/**
|
|
166
|
+
* Converts the relations made into actual IFC data.
|
|
167
|
+
*
|
|
168
|
+
* @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.
|
|
170
|
+
*
|
|
171
|
+
* @returns A promise that resolves when all the relation changes have been applied.
|
|
172
|
+
*/
|
|
173
|
+
applyRelationChanges(): Promise<void>;
|
|
174
|
+
private readonly _changeMap;
|
|
175
|
+
/**
|
|
176
|
+
* An event that is triggered when entities are related in a BIM model.
|
|
177
|
+
* The event provides information about the type of relation, the inverse attribute,
|
|
178
|
+
* the IDs of the entities related, and the IDs of the entities that are being related.
|
|
179
|
+
*/
|
|
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
|
+
}>;
|
|
190
|
+
addEntitiesRelation(model: FragmentsGroup, relatingID: number, rel: {
|
|
191
|
+
type: IfcRelation;
|
|
192
|
+
inv: InverseAttribute;
|
|
193
|
+
}, ...relatedIDs: number[]): void;
|
|
165
194
|
/**
|
|
166
195
|
* 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.
|
|
167
196
|
*
|
|
@@ -173,3 +202,4 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
173
202
|
*/
|
|
174
203
|
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
175
204
|
}
|
|
205
|
+
export * from "./src";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InverseAttribute } from "./types";
|
|
2
|
-
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585, {
|
|
2
|
+
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
|
|
3
3
|
forRelating: InverseAttribute;
|
|
4
4
|
forRelated: InverseAttribute;
|
|
5
5
|
}>;
|
|
@@ -30,7 +30,8 @@ export type InverseAttributes = [
|
|
|
30
30
|
"HasContext",
|
|
31
31
|
"Controls",
|
|
32
32
|
"IsNestedBy",
|
|
33
|
-
"Nests"
|
|
33
|
+
"Nests",
|
|
34
|
+
"DocumentRefForObjects"
|
|
34
35
|
];
|
|
35
36
|
export type InverseAttribute = InverseAttributes[number];
|
|
36
37
|
/**
|
|
@@ -50,6 +51,7 @@ export type IfcRelations = [
|
|
|
50
51
|
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
|
|
51
52
|
typeof WEBIFC.IFCRELDECLARES,
|
|
52
53
|
typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
|
|
53
|
-
typeof WEBIFC.IFCRELNESTS
|
|
54
|
+
typeof WEBIFC.IFCRELNESTS,
|
|
55
|
+
typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
|
|
54
56
|
];
|
|
55
57
|
export type IfcRelation = IfcRelations[number];
|
package/dist/ifc/index.d.ts
CHANGED