@thatopen/components 2.4.11 → 3.1.0
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/README.md +92 -92
- package/dist/index.cjs +18440 -25937
- package/dist/index.d.ts +4537 -6
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.mjs +3 -3
- package/dist/index.mjs +18442 -25939
- package/package.json +58 -60
- package/dist/core/Clipper/index.d.ts +0 -142
- package/dist/core/Clipper/src/clipper-config.d.ts +0 -33
- package/dist/core/Clipper/src/index.d.ts +0 -1
- package/dist/core/Clipper/src/simple-plane.d.ts +0 -99
- package/dist/core/Components/index.d.ts +0 -93
- package/dist/core/ConfigManager/index.d.ts +0 -21
- package/dist/core/ConfigManager/src/configurator.d.ts +0 -13
- package/dist/core/ConfigManager/src/index.d.ts +0 -1
- package/dist/core/Cullers/index.d.ts +0 -56
- package/dist/core/Cullers/src/culler-renderer-config.d.ts +0 -74
- package/dist/core/Cullers/src/culler-renderer.d.ts +0 -76
- package/dist/core/Cullers/src/index.d.ts +0 -3
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +0 -59
- package/dist/core/Cullers/src/screen-culler-helper.d.ts +0 -1
- package/dist/core/Disposer/index.d.ts +0 -45
- package/dist/core/Grids/index.d.ts +0 -46
- package/dist/core/Grids/src/index.d.ts +0 -2
- package/dist/core/Grids/src/simple-grid-config.d.ts +0 -80
- package/dist/core/Grids/src/simple-grid.d.ts +0 -48
- package/dist/core/MiniMap/index.d.ts +0 -50
- package/dist/core/MiniMap/src/index.d.ts +0 -2
- package/dist/core/MiniMap/src/mini-map-config.d.ts +0 -112
- package/dist/core/MiniMap/src/mini-map.d.ts +0 -100
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +0 -65
- package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +0 -5
- package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -20
- package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +0 -45
- package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +0 -26
- package/dist/core/Raycasters/index.d.ts +0 -43
- package/dist/core/Raycasters/src/index.d.ts +0 -2
- package/dist/core/Raycasters/src/mouse.d.ts +0 -24
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +0 -54
- package/dist/core/ShadowedScene/index.d.ts +0 -57
- package/dist/core/ShadowedScene/src/distance-renderer.d.ts +0 -67
- package/dist/core/ShadowedScene/src/index.d.ts +0 -1
- package/dist/core/Types/index.d.ts +0 -1
- package/dist/core/Types/src/async-event.d.ts +0 -32
- package/dist/core/Types/src/base-camera.d.ts +0 -28
- package/dist/core/Types/src/base-renderer.d.ts +0 -65
- package/dist/core/Types/src/base-scene.d.ts +0 -25
- package/dist/core/Types/src/base-world-item.d.ts +0 -23
- package/dist/core/Types/src/base.d.ts +0 -19
- package/dist/core/Types/src/component-with-ui.d.ts +0 -18
- package/dist/core/Types/src/component.d.ts +0 -13
- package/dist/core/Types/src/config-types.d.ts +0 -47
- package/dist/core/Types/src/data-map.d.ts +0 -73
- package/dist/core/Types/src/data-set.d.ts +0 -58
- package/dist/core/Types/src/event-manager.d.ts +0 -30
- package/dist/core/Types/src/event.d.ts +0 -32
- package/dist/core/Types/src/index.d.ts +0 -15
- package/dist/core/Types/src/interfaces.d.ts +0 -117
- package/dist/core/Types/src/world.d.ts +0 -34
- package/dist/core/Viewpoints/index.d.ts +0 -38
- package/dist/core/Viewpoints/src/index.d.ts +0 -2
- package/dist/core/Viewpoints/src/types.d.ts +0 -36
- package/dist/core/Viewpoints/src/viewpoint.d.ts +0 -197
- package/dist/core/Viewpoints/src/viewpoints-config.d.ts +0 -23
- package/dist/core/Worlds/index.d.ts +0 -54
- package/dist/core/Worlds/src/index.d.ts +0 -5
- package/dist/core/Worlds/src/simple-camera.d.ts +0 -62
- package/dist/core/Worlds/src/simple-renderer.d.ts +0 -54
- package/dist/core/Worlds/src/simple-scene-config.d.ts +0 -59
- package/dist/core/Worlds/src/simple-scene.d.ts +0 -25
- package/dist/core/Worlds/src/simple-world.d.ts +0 -79
- package/dist/core/index.d.ts +0 -13
- package/dist/fragments/BoundingBoxer/index.d.ts +0 -208
- package/dist/fragments/Classifier/index.d.ts +0 -197
- package/dist/fragments/Exploder/index.d.ts +0 -50
- package/dist/fragments/FragmentsManager/index.d.ts +0 -152
- package/dist/fragments/Hider/index.d.ts +0 -38
- package/dist/fragments/IfcGeometryTiler/index.d.ts +0 -103
- package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +0 -29
- package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -2
- package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +0 -20
- package/dist/fragments/IfcLoader/index.d.ts +0 -116
- package/dist/fragments/IfcLoader/src/civil-reader.d.ts +0 -15
- package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +0 -41
- package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/index.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-structure.d.ts +0 -8
- package/dist/fragments/IfcLoader/src/transform-helper.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/units.d.ts +0 -10
- package/dist/fragments/IfcPropertiesTiler/index.d.ts +0 -66
- package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +0 -1
- package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +0 -11
- package/dist/fragments/index.d.ts +0 -8
- package/dist/ifc/IfcFinder/index.d.ts +0 -50
- package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +0 -35
- package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +0 -96
- package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +0 -36
- package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +0 -69
- package/dist/ifc/IfcFinder/src/index.d.ts +0 -4
- package/dist/ifc/IfcFinder/src/types.d.ts +0 -84
- package/dist/ifc/IfcIsolator/index.d.ts +0 -24
- package/dist/ifc/IfcJsonExporter/index.d.ts +0 -26
- package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +0 -4
- package/dist/ifc/IfcJsonExporter/src/index.d.ts +0 -1
- package/dist/ifc/IfcPropertiesManager/index.d.ts +0 -289
- package/dist/ifc/IfcPropertiesManager/src/index.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +0 -7
- package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/types.d.ts +0 -18
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +0 -195
- package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +0 -2
- package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +0 -51
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +0 -5
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +0 -73
- package/dist/ifc/Utils/ifc-categories.d.ts +0 -7
- package/dist/ifc/Utils/ifc-category-case.d.ts +0 -3
- package/dist/ifc/Utils/ifc-category-map.d.ts +0 -6
- package/dist/ifc/Utils/ifc-elements-map.d.ts +0 -11
- package/dist/ifc/Utils/index.d.ts +0 -5
- package/dist/ifc/Utils/properties-utils.d.ts +0 -25
- package/dist/ifc/index.d.ts +0 -6
- package/dist/measurement/MeasurementUtils/index.d.ts +0 -105
- package/dist/measurement/index.d.ts +0 -1
- package/dist/namespace.d.ts +0 -6018
- package/dist/openbim/BCFTopics/index.d.ts +0 -114
- package/dist/openbim/BCFTopics/src/Comment.d.ts +0 -40
- package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -127
- package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +0 -121
- package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +0 -2
- package/dist/openbim/BCFTopics/src/importers/index.d.ts +0 -1
- package/dist/openbim/BCFTopics/src/index.d.ts +0 -5
- package/dist/openbim/BCFTopics/src/types.d.ts +0 -19
- package/dist/openbim/IDSSpecifications/index.d.ts +0 -60
- package/dist/openbim/IDSSpecifications/src/Specification.d.ts +0 -40
- package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +0 -13
- package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +0 -21
- package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +0 -15
- package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +0 -10
- package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +0 -25
- package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +0 -5
- package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/types.d.ts +0 -70
- package/dist/openbim/index.d.ts +0 -2
- package/dist/utils/bbox.d.ts +0 -7
- package/dist/utils/geometry.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/materials.d.ts +0 -4
- package/dist/utils/section-generator.d.ts +0 -31
- package/dist/utils/uuid.d.ts +0 -6
- package/dist/utils/vertex-picker.d.ts +0 -116
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import * as WEBIFC from "web-ifc";
|
|
2
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
3
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
4
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation, RelationsProcessingConfig, EntitiesRelatedEvent } from "./src";
|
|
5
|
-
/**
|
|
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
|
-
*/
|
|
8
|
-
export declare class IfcRelationsIndexer 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
|
-
*/
|
|
13
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
14
|
-
/** {@link Disposable.onDisposed} */
|
|
15
|
-
readonly onDisposed: Event<string>;
|
|
16
|
-
/**
|
|
17
|
-
* Event triggered when relations for a model have been indexed.
|
|
18
|
-
* This event provides the model's UUID and the relations map generated for that model.
|
|
19
|
-
*
|
|
20
|
-
* @property {string} modelID - The UUID of the model for which relations have been indexed.
|
|
21
|
-
* @property {RelationsMap} relationsMap - The relations map generated for the specified model.
|
|
22
|
-
* The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
23
|
-
*/
|
|
24
|
-
readonly onRelationsIndexed: Event<{
|
|
25
|
-
modelID: string;
|
|
26
|
-
relationsMap: RelationsMap;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Holds the relationship mappings for each model processed by the indexer.
|
|
30
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
31
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
32
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
33
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
34
|
-
* of entity relationships within a model.
|
|
35
|
-
*/
|
|
36
|
-
readonly relationMaps: ModelsRelationMap;
|
|
37
|
-
/** {@link Component.enabled} */
|
|
38
|
-
enabled: boolean;
|
|
39
|
-
private _relToAttributesMap;
|
|
40
|
-
private _inverseAttributes;
|
|
41
|
-
private _ifcRels;
|
|
42
|
-
constructor(components: Components);
|
|
43
|
-
private onFragmentsDisposed;
|
|
44
|
-
private indexRelations;
|
|
45
|
-
getAttributeIndex(inverseAttribute: InverseAttribute): number;
|
|
46
|
-
/**
|
|
47
|
-
* Adds a relation map to the model's relations map.
|
|
48
|
-
*
|
|
49
|
-
* @param model - The `FragmentsGroup` model to which the relation map will be added.
|
|
50
|
-
* @param relationMap - The `RelationsMap` to be added to the model's relations map.
|
|
51
|
-
*
|
|
52
|
-
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
53
|
-
*/
|
|
54
|
-
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
55
|
-
/**
|
|
56
|
-
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
57
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
58
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
59
|
-
*
|
|
60
|
-
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
61
|
-
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
62
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
63
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
64
|
-
* of entities that are related through that attribute.
|
|
65
|
-
*
|
|
66
|
-
* @param model The `FragmentsGroup` model to be processed. It must have properties loaded.
|
|
67
|
-
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
68
|
-
* representation of the relations indexed by entity expressIDs and relation types.
|
|
69
|
-
* @throws An error if the model does not have properties loaded.
|
|
70
|
-
*/
|
|
71
|
-
process(model: FragmentsGroup, config?: Partial<RelationsProcessingConfig>): Promise<RelationsMap>;
|
|
72
|
-
/**
|
|
73
|
-
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
74
|
-
*
|
|
75
|
-
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
76
|
-
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
77
|
-
* @returns A promise that resolves to the relations map for the processed model.
|
|
78
|
-
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
79
|
-
*/
|
|
80
|
-
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
81
|
-
/**
|
|
82
|
-
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
83
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
84
|
-
* returning the IDs of related entities if a match is found.
|
|
85
|
-
*
|
|
86
|
-
* @param model The `FragmentsGroup` model containing the entity, or its UUID.
|
|
87
|
-
* @param expressID The unique identifier of the entity within the model.
|
|
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.
|
|
90
|
-
*/
|
|
91
|
-
getEntityRelations(model: FragmentsGroup | string | RelationsMap, expressID: number, attribute: InverseAttribute): number[];
|
|
92
|
-
/**
|
|
93
|
-
* Serializes the relations of a given relation map into a JSON string.
|
|
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,
|
|
95
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
96
|
-
* The resulting object is then serialized into a JSON string.
|
|
97
|
-
*
|
|
98
|
-
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
99
|
-
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
100
|
-
*/
|
|
101
|
-
serializeRelations(relationMap: RelationsMap): string;
|
|
102
|
-
/**
|
|
103
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
104
|
-
* This method iterates through the relations indexed for the given model,
|
|
105
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
106
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
107
|
-
* The resulting object is then serialized into a JSON string.
|
|
108
|
-
*
|
|
109
|
-
* @param model The `FragmentsGroup` model whose relations are to be serialized.
|
|
110
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
111
|
-
* If the model has no indexed relations, `null` is returned.
|
|
112
|
-
*/
|
|
113
|
-
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
114
|
-
/**
|
|
115
|
-
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
116
|
-
* This method iterates through each model's relations indexed in `relationMaps`, organizing them
|
|
117
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
118
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
119
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
120
|
-
*
|
|
121
|
-
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
122
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
123
|
-
*/
|
|
124
|
-
serializeAllRelations(): string;
|
|
125
|
-
/**
|
|
126
|
-
* Converts a JSON string representing relations between entities into a structured map.
|
|
127
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
128
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
129
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
130
|
-
* of express IDs of entities related through that relation type.
|
|
131
|
-
*
|
|
132
|
-
* @param json The JSON string to be parsed into the relations map.
|
|
133
|
-
* @returns A `Map` where the key is the express ID of an entity as a number, and the value
|
|
134
|
-
* is another `Map`. This inner map's key is the relation type ID as a number, and its value
|
|
135
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
136
|
-
*/
|
|
137
|
-
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
138
|
-
/** {@link Disposable.dispose} */
|
|
139
|
-
dispose(): void;
|
|
140
|
-
/**
|
|
141
|
-
* Retrieves the entities within a model that have a specific relation with a given entity.
|
|
142
|
-
*
|
|
143
|
-
* @param model - The BIM model to search for related entities.
|
|
144
|
-
* @param inv - The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
145
|
-
* @param expressID - The expressID of the entity within the model.
|
|
146
|
-
*
|
|
147
|
-
* @returns A `Set` with the expressIDs of the entities that have the specified relation with the given entity.
|
|
148
|
-
*
|
|
149
|
-
* @throws An error if the model relations are not indexed or if the inverse attribute name is invalid.
|
|
150
|
-
*/
|
|
151
|
-
getEntitiesWithRelation(model: FragmentsGroup, inv: InverseAttribute, expressID: number): Set<number>;
|
|
152
|
-
/**
|
|
153
|
-
* Adds relations between an entity and other entities in a BIM model.
|
|
154
|
-
*
|
|
155
|
-
* @param model - The BIM model to which the relations will be added.
|
|
156
|
-
* @param expressID - The expressID of the entity within the model.
|
|
157
|
-
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
158
|
-
* @param relIDs - The expressIDs of the related entities within the model.
|
|
159
|
-
* @deprecated Use addEntitiesRelation instead. This will be removed in future versions.
|
|
160
|
-
*
|
|
161
|
-
* @throws An error if the relation name is not a valid relation name.
|
|
162
|
-
*/
|
|
163
|
-
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
164
|
-
/**
|
|
165
|
-
* Converts the relations made into actual IFC data.
|
|
166
|
-
*
|
|
167
|
-
* @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
|
|
168
|
-
* It only make sense to use it if the relations need to be write in the IFC file.
|
|
169
|
-
*
|
|
170
|
-
* @returns A promise that resolves when all the relation changes have been applied.
|
|
171
|
-
*/
|
|
172
|
-
applyRelationChanges(): Promise<void>;
|
|
173
|
-
private readonly _changeMap;
|
|
174
|
-
/**
|
|
175
|
-
* An event that is triggered when entities are related in a BIM model.
|
|
176
|
-
* The event provides information about the type of relation, the inverse attribute,
|
|
177
|
-
* the IDs of the entities related, and the IDs of the entities that are being related.
|
|
178
|
-
*/
|
|
179
|
-
readonly onEntitiesRelated: Event<EntitiesRelatedEvent>;
|
|
180
|
-
addEntitiesRelation(model: FragmentsGroup, relatingID: number, rel: {
|
|
181
|
-
type: IfcRelation;
|
|
182
|
-
inv: InverseAttribute;
|
|
183
|
-
}, ...relatedIDs: number[]): void;
|
|
184
|
-
/**
|
|
185
|
-
* 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.
|
|
186
|
-
*
|
|
187
|
-
* @param model The BIM model whose children to get.
|
|
188
|
-
* @param expressID The expressID of the item whose children to get.
|
|
189
|
-
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
190
|
-
*
|
|
191
|
-
* @returns A `Set` with the expressIDs of the found items.
|
|
192
|
-
*/
|
|
193
|
-
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
194
|
-
}
|
|
195
|
-
export * from "./src";
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
}>>;
|
|
@@ -1,5 +0,0 @@
|
|
|
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 | 982818633, {
|
|
3
|
-
forRelating: InverseAttribute;
|
|
4
|
-
forRelated: InverseAttribute;
|
|
5
|
-
}>;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import * as WEBIFC from "web-ifc";
|
|
2
|
-
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3
|
-
export interface ModelsRelationMap {
|
|
4
|
-
[modelID: string]: RelationsMap;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Type alias for an array of inverse attribute names.
|
|
8
|
-
*/
|
|
9
|
-
export type InverseAttributes = [
|
|
10
|
-
"IsDecomposedBy",
|
|
11
|
-
"Decomposes",
|
|
12
|
-
"AssociatedTo",
|
|
13
|
-
"HasAssociations",
|
|
14
|
-
"ClassificationForObjects",
|
|
15
|
-
"IsGroupedBy",
|
|
16
|
-
"HasAssignments",
|
|
17
|
-
"IsDefinedBy",
|
|
18
|
-
"DefinesOcurrence",
|
|
19
|
-
"IsTypedBy",
|
|
20
|
-
"Types",
|
|
21
|
-
"Defines",
|
|
22
|
-
"ContainedInStructure",
|
|
23
|
-
"ContainsElements",
|
|
24
|
-
"HasControlElements",
|
|
25
|
-
"AssignedToFlowElement",
|
|
26
|
-
"ConnectedTo",
|
|
27
|
-
"ConnectedFrom",
|
|
28
|
-
"ReferencedBy",
|
|
29
|
-
"Declares",
|
|
30
|
-
"HasContext",
|
|
31
|
-
"Controls",
|
|
32
|
-
"IsNestedBy",
|
|
33
|
-
"Nests",
|
|
34
|
-
"DocumentRefForObjects"
|
|
35
|
-
];
|
|
36
|
-
export type InverseAttribute = InverseAttributes[number];
|
|
37
|
-
/**
|
|
38
|
-
* Type alias for an array of IfcRelation types from WebIfc.
|
|
39
|
-
*/
|
|
40
|
-
export type IfcRelations = [
|
|
41
|
-
typeof WEBIFC.IFCRELAGGREGATES,
|
|
42
|
-
typeof WEBIFC.IFCRELASSOCIATESMATERIAL,
|
|
43
|
-
typeof WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
|
|
44
|
-
typeof WEBIFC.IFCRELASSIGNSTOGROUP,
|
|
45
|
-
typeof WEBIFC.IFCRELDEFINESBYPROPERTIES,
|
|
46
|
-
typeof WEBIFC.IFCRELDEFINESBYTYPE,
|
|
47
|
-
typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
|
|
48
|
-
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
49
|
-
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
|
|
50
|
-
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
|
|
51
|
-
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
|
|
52
|
-
typeof WEBIFC.IFCRELDECLARES,
|
|
53
|
-
typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
|
|
54
|
-
typeof WEBIFC.IFCRELNESTS,
|
|
55
|
-
typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
|
|
56
|
-
];
|
|
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. This event gets triggered when two or more entities has been related with each other.
|
|
63
|
-
*/
|
|
64
|
-
export interface EntitiesRelatedEvent {
|
|
65
|
-
/** The type of the IFC relation. */
|
|
66
|
-
relType: IfcRelation;
|
|
67
|
-
/** The inverse attribute of the relation. */
|
|
68
|
-
invAttribute: InverseAttribute;
|
|
69
|
-
/** The IDs of the entities that are relating. */
|
|
70
|
-
relatingIDs: number[];
|
|
71
|
-
/** The IDs of the entities that are being related. */
|
|
72
|
-
relatedIDs: number[];
|
|
73
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
3
|
-
*/
|
|
4
|
-
export declare const IfcCategoryMap: {
|
|
5
|
-
[key: number]: string;
|
|
6
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
6
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export declare const IfcElements: {
|
|
10
|
-
[key: number]: string;
|
|
11
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2
|
-
export declare class IfcPropertiesUtils {
|
|
3
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
4
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
5
|
-
[attribute: string]: any;
|
|
6
|
-
} | null>;
|
|
7
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
8
|
-
[relatingID: number]: number[];
|
|
9
|
-
}>;
|
|
10
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
11
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
12
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
13
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
14
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
15
|
-
key: string | null;
|
|
16
|
-
name: string | null;
|
|
17
|
-
}>;
|
|
18
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
19
|
-
key: string | null;
|
|
20
|
-
value: number | null;
|
|
21
|
-
}>;
|
|
22
|
-
static isRel(expressID: number): boolean;
|
|
23
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
24
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
25
|
-
}
|
package/dist/ifc/index.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
3
|
-
import { Component, Components } from "../../core";
|
|
4
|
-
/**
|
|
5
|
-
* Represents an edge measurement result.
|
|
6
|
-
*/
|
|
7
|
-
export interface MeasureEdge {
|
|
8
|
-
/**
|
|
9
|
-
* The distance between the two points of the edge.
|
|
10
|
-
*/
|
|
11
|
-
distance: number;
|
|
12
|
-
/**
|
|
13
|
-
* The two points that define the edge.
|
|
14
|
-
*/
|
|
15
|
-
points: THREE.Vector3[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
19
|
-
*/
|
|
20
|
-
export declare class MeasurementUtils extends Component {
|
|
21
|
-
/**
|
|
22
|
-
* A unique identifier for the component.
|
|
23
|
-
* This UUID is used to register the component within the Components system.
|
|
24
|
-
*/
|
|
25
|
-
static uuid: string;
|
|
26
|
-
/** {@link Component.enabled} */
|
|
27
|
-
enabled: boolean;
|
|
28
|
-
constructor(components: Components);
|
|
29
|
-
/**
|
|
30
|
-
* Utility method to calculate the distance from a point to a line segment.
|
|
31
|
-
*
|
|
32
|
-
* @param point - The point from which to calculate the distance.
|
|
33
|
-
* @param lineStart - The start point of the line segment.
|
|
34
|
-
* @param lineEnd - The end point of the line segment.
|
|
35
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
36
|
-
* @returns The distance from the point to the line segment.
|
|
37
|
-
*/
|
|
38
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
39
|
-
/**
|
|
40
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
41
|
-
* It also returns the edges of the found face and their indices.
|
|
42
|
-
*
|
|
43
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
44
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
45
|
-
* @param instance - The instance of the mesh (optional).
|
|
46
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
47
|
-
*/
|
|
48
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
49
|
-
edges: MeasureEdge[];
|
|
50
|
-
indices: Set<number>;
|
|
51
|
-
} | null;
|
|
52
|
-
/**
|
|
53
|
-
* Method to get the vertices and normal of a mesh face at a given index.
|
|
54
|
-
* It also applies instance transformation if provided.
|
|
55
|
-
*
|
|
56
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
57
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
58
|
-
* @param instance - The instance of the mesh (optional).
|
|
59
|
-
* @returns An object containing the vertices and normal of the face.
|
|
60
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
61
|
-
*/
|
|
62
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
63
|
-
p1: THREE.Vector3;
|
|
64
|
-
p2: THREE.Vector3;
|
|
65
|
-
p3: THREE.Vector3;
|
|
66
|
-
faceNormal: THREE.Vector3;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Method to round the vector's components to a specified number of decimal places.
|
|
70
|
-
* This is used to ensure numerical precision in edge detection.
|
|
71
|
-
*
|
|
72
|
-
* @param vector - The vector to round.
|
|
73
|
-
* @returns The vector with rounded components.
|
|
74
|
-
*/
|
|
75
|
-
round(vector: THREE.Vector3): void;
|
|
76
|
-
/**
|
|
77
|
-
* Calculates the volume of a set of fragments.
|
|
78
|
-
*
|
|
79
|
-
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
80
|
-
* @returns The total volume of the fragments and the bounding sphere.
|
|
81
|
-
*
|
|
82
|
-
* @remarks
|
|
83
|
-
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
84
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
85
|
-
*
|
|
86
|
-
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
87
|
-
* @throws Will throw an error if the fragment manager is not available.
|
|
88
|
-
*/
|
|
89
|
-
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
90
|
-
/**
|
|
91
|
-
* Calculates the total volume of a set of meshes.
|
|
92
|
-
*
|
|
93
|
-
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
94
|
-
* @returns The total volume of the meshes and the bounding sphere.
|
|
95
|
-
*
|
|
96
|
-
* @remarks
|
|
97
|
-
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
98
|
-
* and its bounding sphere.
|
|
99
|
-
*
|
|
100
|
-
*/
|
|
101
|
-
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
102
|
-
private getFaceData;
|
|
103
|
-
private getVolumeOfMesh;
|
|
104
|
-
private getSignedVolumeOfTriangle;
|
|
105
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./MeasurementUtils";
|