@thatopen/components 2.4.0-alpha.8 → 2.4.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/dist/core/Components/index.d.ts +1 -1
- package/dist/core/ConfigManager/src/configurator.d.ts +5 -3
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +3 -1
- package/dist/core/ShadowedScene/index.d.ts +1 -2
- package/dist/core/Types/src/component-with-ui.d.ts +8 -3
- package/dist/core/Types/src/config-types.d.ts +5 -0
- package/dist/core/Types/src/data-map.d.ts +3 -1
- package/dist/core/Types/src/data-set.d.ts +1 -2
- package/dist/core/Viewpoints/src/viewpoint.d.ts +2 -2
- package/dist/fragments/Classifier/index.d.ts +15 -2
- package/dist/fragments/IfcGeometryTiler/index.d.ts +1 -0
- package/dist/ifc/IfcIsolator/index.d.ts +24 -0
- package/dist/ifc/IfcPropertiesManager/index.d.ts +7 -3
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +8 -18
- package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +51 -0
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +16 -0
- package/dist/ifc/index.d.ts +1 -0
- package/dist/index.cjs +420 -242
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.mjs +3 -3
- package/dist/index.mjs +421 -243
- package/dist/namespace.d.ts +4000 -3857
- package/dist/openbim/BCFTopics/index.d.ts +1 -2
- package/dist/openbim/BCFTopics/src/Topic.d.ts +5 -1
- package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +1 -2
- package/dist/openbim/IDSSpecifications/index.d.ts +1 -2
- package/dist/openbim/IDSSpecifications/src/Specification.d.ts +4 -3
- package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +1 -0
- package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +1 -0
- package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +1 -0
- package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +2 -1
- package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +1 -0
- package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +1 -0
- package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +3 -0
- package/dist/openbim/IDSSpecifications/src/types.d.ts +39 -20
- package/package.json +58 -58
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
import * as THREE$1 from "three";
|
|
8
|
-
import { BufferAttribute, Vector3,
|
|
8
|
+
import { BufferAttribute, Vector3, Plane, Line3, Vector2, Triangle, Sphere, Matrix4, Box3, BackSide, DoubleSide, FrontSide, Ray, Mesh, Object3D, MeshBasicMaterial, LineBasicMaterial, CylinderGeometry, BoxGeometry, BufferGeometry, Float32BufferAttribute, OctahedronGeometry, Line, TorusGeometry, SphereGeometry, Quaternion, Euler, PlaneGeometry, Raycaster } from "three";
|
|
9
9
|
import * as FRAGS from "@thatopen/fragments";
|
|
10
10
|
import { FragmentsGroup, Serializer } from "@thatopen/fragments";
|
|
11
11
|
import * as WEBIFC from "web-ifc";
|
|
@@ -3808,7 +3808,9 @@ class DataMap extends Map {
|
|
|
3808
3808
|
this.onCleared.trigger();
|
|
3809
3809
|
}
|
|
3810
3810
|
/**
|
|
3811
|
-
* Sets the value for the specified key in the map
|
|
3811
|
+
* Sets the value for the specified key in the map.
|
|
3812
|
+
* If the item is new, then onItemSet is triggered.
|
|
3813
|
+
* If the item is already in the map, then onItemUpdated is triggered.
|
|
3812
3814
|
*
|
|
3813
3815
|
* @param key - The key of the item to set.
|
|
3814
3816
|
* @param value - The value of the item to set.
|
|
@@ -3858,6 +3860,97 @@ class DataMap extends Map {
|
|
|
3858
3860
|
}
|
|
3859
3861
|
class ComponentWithUI extends Component {
|
|
3860
3862
|
}
|
|
3863
|
+
class ControlsUtils {
|
|
3864
|
+
static isEntry(item) {
|
|
3865
|
+
const types = /* @__PURE__ */ new Set([
|
|
3866
|
+
"Boolean",
|
|
3867
|
+
"Color",
|
|
3868
|
+
"Text",
|
|
3869
|
+
"Number",
|
|
3870
|
+
"Select",
|
|
3871
|
+
"Vector3",
|
|
3872
|
+
"TextSet",
|
|
3873
|
+
"None"
|
|
3874
|
+
]);
|
|
3875
|
+
return types.has(item.type);
|
|
3876
|
+
}
|
|
3877
|
+
static copySchema(schema, copy = {}) {
|
|
3878
|
+
for (const name in schema) {
|
|
3879
|
+
const entry = schema[name];
|
|
3880
|
+
if (this.isEntry(entry)) {
|
|
3881
|
+
copy[name] = this.copyEntry(entry);
|
|
3882
|
+
} else {
|
|
3883
|
+
copy[name] = {};
|
|
3884
|
+
this.copySchema(entry, copy[name]);
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
return copy;
|
|
3888
|
+
}
|
|
3889
|
+
static copyEntry(controlEntry) {
|
|
3890
|
+
if (controlEntry.type === "Boolean") {
|
|
3891
|
+
const entry = controlEntry;
|
|
3892
|
+
return {
|
|
3893
|
+
type: entry.type,
|
|
3894
|
+
value: entry.value
|
|
3895
|
+
};
|
|
3896
|
+
}
|
|
3897
|
+
if (controlEntry.type === "Color") {
|
|
3898
|
+
const entry = controlEntry;
|
|
3899
|
+
return {
|
|
3900
|
+
type: entry.type,
|
|
3901
|
+
value: entry.value.clone()
|
|
3902
|
+
};
|
|
3903
|
+
}
|
|
3904
|
+
if (controlEntry.type === "Text") {
|
|
3905
|
+
const entry = controlEntry;
|
|
3906
|
+
return {
|
|
3907
|
+
type: entry.type,
|
|
3908
|
+
value: entry.value
|
|
3909
|
+
};
|
|
3910
|
+
}
|
|
3911
|
+
if (controlEntry.type === "Number") {
|
|
3912
|
+
const entry = controlEntry;
|
|
3913
|
+
return {
|
|
3914
|
+
type: entry.type,
|
|
3915
|
+
value: entry.value,
|
|
3916
|
+
min: entry.min,
|
|
3917
|
+
max: entry.max,
|
|
3918
|
+
interpolable: entry.interpolable
|
|
3919
|
+
};
|
|
3920
|
+
}
|
|
3921
|
+
if (controlEntry.type === "Select") {
|
|
3922
|
+
const entry = controlEntry;
|
|
3923
|
+
return {
|
|
3924
|
+
type: entry.type,
|
|
3925
|
+
value: entry.value,
|
|
3926
|
+
multiple: entry.multiple,
|
|
3927
|
+
options: new Set(entry.options)
|
|
3928
|
+
};
|
|
3929
|
+
}
|
|
3930
|
+
if (controlEntry.type === "Vector3") {
|
|
3931
|
+
const entry = controlEntry;
|
|
3932
|
+
return {
|
|
3933
|
+
type: entry.type,
|
|
3934
|
+
value: entry.value.clone()
|
|
3935
|
+
};
|
|
3936
|
+
}
|
|
3937
|
+
if (controlEntry.type === "TextSet") {
|
|
3938
|
+
const entry = controlEntry;
|
|
3939
|
+
return {
|
|
3940
|
+
type: entry.type,
|
|
3941
|
+
value: new Set(entry.value)
|
|
3942
|
+
};
|
|
3943
|
+
}
|
|
3944
|
+
if (controlEntry.type === "None") {
|
|
3945
|
+
const entry = controlEntry;
|
|
3946
|
+
return {
|
|
3947
|
+
type: entry.type,
|
|
3948
|
+
value: entry.value
|
|
3949
|
+
};
|
|
3950
|
+
}
|
|
3951
|
+
throw new Error("Invalid entry!");
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3861
3954
|
class EventManager {
|
|
3862
3955
|
constructor() {
|
|
3863
3956
|
/**
|
|
@@ -5366,7 +5459,7 @@ const _Components = class _Components {
|
|
|
5366
5459
|
/**
|
|
5367
5460
|
* The version of the @thatopen/components library.
|
|
5368
5461
|
*/
|
|
5369
|
-
__publicField(_Components, "release", "2.4.0
|
|
5462
|
+
__publicField(_Components, "release", "2.4.0");
|
|
5370
5463
|
let Components = _Components;
|
|
5371
5464
|
class SimpleWorld extends Base {
|
|
5372
5465
|
constructor() {
|
|
@@ -5533,76 +5626,69 @@ class Configurator {
|
|
|
5533
5626
|
configManager.list.set(this.uuid, this);
|
|
5534
5627
|
}
|
|
5535
5628
|
get controls() {
|
|
5536
|
-
|
|
5537
|
-
for (const name in this._config) {
|
|
5538
|
-
const entry = this._config[name];
|
|
5539
|
-
copy[name] = this.copyEntry(entry);
|
|
5540
|
-
}
|
|
5541
|
-
return copy;
|
|
5629
|
+
return ControlsUtils.copySchema(this._config);
|
|
5542
5630
|
}
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
}
|
|
5631
|
+
set(data) {
|
|
5632
|
+
for (const name in data) {
|
|
5633
|
+
if (name in this) {
|
|
5634
|
+
const key = name;
|
|
5635
|
+
this[key] = data[name].value;
|
|
5636
|
+
}
|
|
5637
|
+
}
|
|
5638
|
+
}
|
|
5639
|
+
export(controls = this._config, exported = {}) {
|
|
5640
|
+
for (const id in controls) {
|
|
5641
|
+
const control = controls[id];
|
|
5642
|
+
const isControl = ControlsUtils.isEntry(control);
|
|
5643
|
+
if (isControl) {
|
|
5644
|
+
if (control.type === "Color") {
|
|
5645
|
+
const { r, g, b } = control.value;
|
|
5646
|
+
exported[id] = { ...control, value: { r, g, b } };
|
|
5647
|
+
} else if (control.type === "Vector3") {
|
|
5648
|
+
const { x, y, z } = control.value;
|
|
5649
|
+
exported[id] = { ...control, value: { x, y, z } };
|
|
5650
|
+
} else if (control.type === "TextSet") {
|
|
5651
|
+
const value = Array.from(control.value);
|
|
5652
|
+
exported[id] = { ...control, value };
|
|
5653
|
+
} else if (control.type === "Select") {
|
|
5654
|
+
const options = Array.from(control.options);
|
|
5655
|
+
exported[id] = { ...control, options };
|
|
5656
|
+
} else {
|
|
5657
|
+
exported[id] = { ...control };
|
|
5658
|
+
}
|
|
5659
|
+
} else {
|
|
5660
|
+
exported[id] = {};
|
|
5661
|
+
this.export(control, exported[id]);
|
|
5662
|
+
}
|
|
5663
|
+
}
|
|
5664
|
+
return exported;
|
|
5665
|
+
}
|
|
5666
|
+
import(exported, imported = {}, first = true) {
|
|
5667
|
+
for (const id in exported) {
|
|
5668
|
+
const control = exported[id];
|
|
5669
|
+
const isControl = ControlsUtils.isEntry(control);
|
|
5670
|
+
if (isControl) {
|
|
5671
|
+
if (control.type === "Color") {
|
|
5672
|
+
const { r, g, b } = control.value;
|
|
5673
|
+
imported[id] = { ...control, value: new THREE$1.Color(r, g, b) };
|
|
5674
|
+
} else if (control.type === "Vector3") {
|
|
5675
|
+
const { x, y, z } = control.value;
|
|
5676
|
+
imported[id] = { ...control, value: new THREE$1.Vector3(x, y, z) };
|
|
5677
|
+
} else if (control.type === "TextSet") {
|
|
5678
|
+
imported[id] = { ...control, value: new Set(control.value) };
|
|
5679
|
+
} else if (control.type === "Select") {
|
|
5680
|
+
imported[id] = { ...control, options: new Set(control.options) };
|
|
5681
|
+
} else {
|
|
5682
|
+
imported[id] = { ...control };
|
|
5683
|
+
}
|
|
5684
|
+
} else {
|
|
5685
|
+
imported[id] = {};
|
|
5686
|
+
this.import(control, imported[id], false);
|
|
5687
|
+
}
|
|
5597
5688
|
}
|
|
5598
|
-
if (
|
|
5599
|
-
|
|
5600
|
-
return {
|
|
5601
|
-
type: entry.type,
|
|
5602
|
-
value: entry.value
|
|
5603
|
-
};
|
|
5689
|
+
if (first) {
|
|
5690
|
+
this.set(imported);
|
|
5604
5691
|
}
|
|
5605
|
-
throw new Error("Invalid entry!");
|
|
5606
5692
|
}
|
|
5607
5693
|
}
|
|
5608
5694
|
const _ConfigManager = class _ConfigManager extends Component {
|
|
@@ -9535,13 +9621,15 @@ class SimpleRaycaster {
|
|
|
9535
9621
|
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
9536
9622
|
* to query. If not provided, it will query all the meshes stored in
|
|
9537
9623
|
* {@link Components.meshes}.
|
|
9624
|
+
* @param position - the screen position to use for raycasting. If not provided,
|
|
9625
|
+
* the last pointer (mouse/touch) position will be used.
|
|
9538
9626
|
*/
|
|
9539
|
-
castRay(items = Array.from(this.world.meshes)) {
|
|
9627
|
+
castRay(items = Array.from(this.world.meshes), position = this.mouse.position) {
|
|
9540
9628
|
if (!this.world) {
|
|
9541
9629
|
throw new Error("A world is needed to cast rays!");
|
|
9542
9630
|
}
|
|
9543
9631
|
const camera = this.world.camera.three;
|
|
9544
|
-
this.three.setFromCamera(
|
|
9632
|
+
this.three.setFromCamera(position, camera);
|
|
9545
9633
|
return this.intersect(items);
|
|
9546
9634
|
}
|
|
9547
9635
|
/**
|
|
@@ -11068,6 +11156,9 @@ class SimplePlane {
|
|
|
11068
11156
|
* @param {boolean} state - The new enabled state.
|
|
11069
11157
|
*/
|
|
11070
11158
|
set enabled(state) {
|
|
11159
|
+
if (this.world.isDisposing) {
|
|
11160
|
+
return;
|
|
11161
|
+
}
|
|
11071
11162
|
if (!this.world.renderer) {
|
|
11072
11163
|
throw new Error("No renderer found for clipping plane!");
|
|
11073
11164
|
}
|
|
@@ -15310,7 +15401,8 @@ const GeometryTypes = /* @__PURE__ */ new Set([
|
|
|
15310
15401
|
3958567839,
|
|
15311
15402
|
2513912981,
|
|
15312
15403
|
2830218821,
|
|
15313
|
-
427810014
|
|
15404
|
+
427810014,
|
|
15405
|
+
2916149573
|
|
15314
15406
|
]);
|
|
15315
15407
|
const _IfcJsonExporter = class _IfcJsonExporter extends Component {
|
|
15316
15408
|
constructor(components) {
|
|
@@ -15864,7 +15956,7 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
15864
15956
|
*/
|
|
15865
15957
|
async newPset(model, name, description) {
|
|
15866
15958
|
const schema = _IfcPropertiesManager.getIFCSchema(model);
|
|
15867
|
-
const { ownerHistoryHandle } = await this.getOwnerHistory(model);
|
|
15959
|
+
const { handle: ownerHistoryHandle } = await this.getOwnerHistory(model);
|
|
15868
15960
|
const psetGlobalId = this.newGUID(model);
|
|
15869
15961
|
const psetName = new WEBIFC[schema].IfcLabel(name);
|
|
15870
15962
|
const psetDescription = description ? new WEBIFC[schema].IfcText(description) : null;
|
|
@@ -15876,18 +15968,8 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
15876
15968
|
[]
|
|
15877
15969
|
);
|
|
15878
15970
|
pset.expressID = this.getNewExpressID(model);
|
|
15879
|
-
|
|
15880
|
-
|
|
15881
|
-
relGlobalId,
|
|
15882
|
-
ownerHistoryHandle,
|
|
15883
|
-
null,
|
|
15884
|
-
null,
|
|
15885
|
-
[],
|
|
15886
|
-
new WEBIFC.Handle(pset.expressID)
|
|
15887
|
-
);
|
|
15888
|
-
rel.expressID = this.getNewExpressID(model);
|
|
15889
|
-
await this.setData(model, pset, rel);
|
|
15890
|
-
return { pset, rel };
|
|
15971
|
+
await this.setData(model, pset);
|
|
15972
|
+
return { pset };
|
|
15891
15973
|
}
|
|
15892
15974
|
/**
|
|
15893
15975
|
* Removes a Property Set (Pset) from the given model.
|
|
@@ -16002,7 +16084,7 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16002
16084
|
indexer.addEntitiesRelation(
|
|
16003
16085
|
model,
|
|
16004
16086
|
psetID,
|
|
16005
|
-
{ type: WEBIFC.IFCRELDEFINESBYPROPERTIES, inv: "
|
|
16087
|
+
{ type: WEBIFC.IFCRELDEFINESBYPROPERTIES, inv: "DefinesOcurrence" },
|
|
16006
16088
|
...expressIDs
|
|
16007
16089
|
);
|
|
16008
16090
|
}
|
|
@@ -16050,7 +16132,7 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16050
16132
|
if (!relName) {
|
|
16051
16133
|
throw new Error(`IfcPropertiesManager: ${relName} is unsoported.`);
|
|
16052
16134
|
}
|
|
16053
|
-
const schema = model
|
|
16135
|
+
const schema = _IfcPropertiesManager.getIFCSchema(model);
|
|
16054
16136
|
const attributePositions = ifcRelAttrsPosition[relName];
|
|
16055
16137
|
const RelClass = WEBIFC[schema][relName];
|
|
16056
16138
|
if (!(attributePositions && RelClass)) {
|
|
@@ -16101,7 +16183,9 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16101
16183
|
for (const expressID of changes) {
|
|
16102
16184
|
const data = await model.getProperties(expressID);
|
|
16103
16185
|
if (!data) {
|
|
16104
|
-
ifcApi.
|
|
16186
|
+
const existed = ifcApi.GetLine(modelID, expressID);
|
|
16187
|
+
if (existed)
|
|
16188
|
+
ifcApi.DeleteLine(modelID, expressID);
|
|
16105
16189
|
} else {
|
|
16106
16190
|
ifcApi.WriteLine(modelID, data);
|
|
16107
16191
|
}
|
|
@@ -16198,9 +16282,9 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16198
16282
|
throw new Error("No OwnerHistory was found.");
|
|
16199
16283
|
}
|
|
16200
16284
|
const keys = Object.keys(ownerHistories).map((key) => parseInt(key, 10));
|
|
16201
|
-
const
|
|
16202
|
-
const
|
|
16203
|
-
return {
|
|
16285
|
+
const entity = ownerHistories[keys[0]];
|
|
16286
|
+
const handle = new WEBIFC.Handle(entity.expressID);
|
|
16287
|
+
return { entity, handle };
|
|
16204
16288
|
}
|
|
16205
16289
|
registerChange(model, ...expressID) {
|
|
16206
16290
|
if (!this.changeMap[model.uuid]) {
|
|
@@ -16305,7 +16389,7 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16305
16389
|
__publicField(this, "onFragmentsDisposed", (data) => {
|
|
16306
16390
|
delete this.relationMaps[data.groupID];
|
|
16307
16391
|
});
|
|
16308
|
-
//
|
|
16392
|
+
// Used to create the corresponding IfcRelationship with the IfcPropertiesManager
|
|
16309
16393
|
__publicField(this, "_changeMap", {});
|
|
16310
16394
|
/**
|
|
16311
16395
|
* An event that is triggered when entities are related in a BIM model.
|
|
@@ -16328,43 +16412,26 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16328
16412
|
return;
|
|
16329
16413
|
const relatingID = relAttrs[relatingKey].value;
|
|
16330
16414
|
const relatedIDs = relAttrs[relatedKey].map((el) => el.value);
|
|
16331
|
-
const
|
|
16332
|
-
|
|
16333
|
-
|
|
16334
|
-
|
|
16335
|
-
|
|
16336
|
-
|
|
16337
|
-
|
|
16338
|
-
let indexMap = currentMap.get(index);
|
|
16339
|
-
if (!indexMap) {
|
|
16340
|
-
indexMap = [];
|
|
16341
|
-
currentMap.set(index, indexMap);
|
|
16342
|
-
}
|
|
16343
|
-
for (const id of relatedIDs) {
|
|
16344
|
-
indexMap.push(id);
|
|
16345
|
-
}
|
|
16415
|
+
const indexMap = this.getEntityRelations(
|
|
16416
|
+
relationsMap,
|
|
16417
|
+
relatingID,
|
|
16418
|
+
relating
|
|
16419
|
+
);
|
|
16420
|
+
for (const id of relatedIDs) {
|
|
16421
|
+
indexMap.push(id);
|
|
16346
16422
|
}
|
|
16347
16423
|
for (const id of relatedIDs) {
|
|
16348
|
-
const
|
|
16349
|
-
if (index2 === null)
|
|
16350
|
-
continue;
|
|
16351
|
-
let currentMap = relationsMap.get(id);
|
|
16352
|
-
if (!currentMap) {
|
|
16353
|
-
currentMap = /* @__PURE__ */ new Map();
|
|
16354
|
-
relationsMap.set(id, currentMap);
|
|
16355
|
-
}
|
|
16356
|
-
let relations = currentMap.get(index2);
|
|
16357
|
-
if (!relations) {
|
|
16358
|
-
relations = [];
|
|
16359
|
-
currentMap.set(index2, relations);
|
|
16360
|
-
}
|
|
16424
|
+
const relations = this.getEntityRelations(relationsMap, id, related);
|
|
16361
16425
|
relations.push(relatingID);
|
|
16362
16426
|
}
|
|
16363
16427
|
}
|
|
16364
16428
|
getAttributeIndex(inverseAttribute) {
|
|
16365
16429
|
const index = this._inverseAttributes.indexOf(inverseAttribute);
|
|
16366
|
-
if (index === -1)
|
|
16367
|
-
|
|
16430
|
+
if (index === -1) {
|
|
16431
|
+
throw new Error(
|
|
16432
|
+
`IfcRelationsIndexer: ${inverseAttribute} is not a valid IFC Inverse Attribute name or its not supported yet by this component.`
|
|
16433
|
+
);
|
|
16434
|
+
}
|
|
16368
16435
|
return index;
|
|
16369
16436
|
}
|
|
16370
16437
|
/**
|
|
@@ -16398,28 +16465,27 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16398
16465
|
* representation of the relations indexed by entity expressIDs and relation types.
|
|
16399
16466
|
* @throws An error if the model does not have properties loaded.
|
|
16400
16467
|
*/
|
|
16401
|
-
async process(model) {
|
|
16468
|
+
async process(model, config) {
|
|
16402
16469
|
if (!model.hasProperties)
|
|
16403
16470
|
throw new Error("FragmentsGroup properties not found");
|
|
16404
16471
|
let relationsMap = this.relationMaps[model.uuid];
|
|
16405
|
-
if (relationsMap) {
|
|
16406
|
-
|
|
16472
|
+
if (!relationsMap) {
|
|
16473
|
+
relationsMap = /* @__PURE__ */ new Map();
|
|
16474
|
+
this.relationMaps[model.uuid] = relationsMap;
|
|
16407
16475
|
}
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16476
|
+
const entities = model.getLocalProperties();
|
|
16477
|
+
if (!entities)
|
|
16478
|
+
return relationsMap;
|
|
16479
|
+
const relationsToProcess = (config == null ? void 0 : config.relationsToProcess) ?? this._ifcRels;
|
|
16480
|
+
for (const [_, entity] of Object.entries(entities)) {
|
|
16481
|
+
if (!relationsToProcess.includes(entity.type))
|
|
16412
16482
|
continue;
|
|
16413
|
-
|
|
16414
|
-
const relInverseAttributes = this._relToAttributesMap.get(relType);
|
|
16483
|
+
const relInverseAttributes = this._relToAttributesMap.get(entity.type);
|
|
16415
16484
|
if (!relInverseAttributes) {
|
|
16416
16485
|
continue;
|
|
16417
16486
|
}
|
|
16418
16487
|
const { forRelated: related, forRelating: relating } = relInverseAttributes;
|
|
16419
|
-
|
|
16420
|
-
const relAttrs = relsAttrs[expressID];
|
|
16421
|
-
this.indexRelations(relationsMap, relAttrs, related, relating);
|
|
16422
|
-
}
|
|
16488
|
+
this.indexRelations(relationsMap, entity, related, relating);
|
|
16423
16489
|
}
|
|
16424
16490
|
this.setRelationMap(model, relationsMap);
|
|
16425
16491
|
return relationsMap;
|
|
@@ -16461,26 +16527,33 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16461
16527
|
*
|
|
16462
16528
|
* @param model The `FragmentsGroup` model containing the entity, or its UUID.
|
|
16463
16529
|
* @param expressID The unique identifier of the entity within the model.
|
|
16464
|
-
* @param
|
|
16465
|
-
* @returns An array of express IDs representing the related entities
|
|
16466
|
-
|
|
16467
|
-
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
|
|
16530
|
+
* @param attribute The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
16531
|
+
* @returns An array of express IDs representing the related entities. If the array is empty, no relations were found.
|
|
16532
|
+
*/
|
|
16533
|
+
getEntityRelations(model, expressID, attribute) {
|
|
16534
|
+
const index = this.getAttributeIndex(attribute);
|
|
16535
|
+
let relationsMap;
|
|
16536
|
+
if (model instanceof FragmentsGroup) {
|
|
16537
|
+
relationsMap = this.relationMaps[model.uuid];
|
|
16538
|
+
} else if (typeof model === "string") {
|
|
16539
|
+
relationsMap = this.relationMaps[model];
|
|
16540
|
+
} else {
|
|
16541
|
+
relationsMap = model;
|
|
16475
16542
|
}
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16543
|
+
if (!relationsMap && (model instanceof FragmentsGroup || typeof model === "string")) {
|
|
16544
|
+
relationsMap = /* @__PURE__ */ new Map();
|
|
16545
|
+
const id = model instanceof FragmentsGroup ? model.uuid : model;
|
|
16546
|
+
this.relationMaps[id] = relationsMap;
|
|
16547
|
+
}
|
|
16548
|
+
let entityRelations = relationsMap.get(expressID);
|
|
16549
|
+
if (!entityRelations) {
|
|
16550
|
+
entityRelations = /* @__PURE__ */ new Map();
|
|
16551
|
+
relationsMap.set(expressID, entityRelations);
|
|
16480
16552
|
}
|
|
16481
|
-
|
|
16553
|
+
let relations = entityRelations.get(index);
|
|
16482
16554
|
if (!relations) {
|
|
16483
|
-
|
|
16555
|
+
relations = [];
|
|
16556
|
+
entityRelations.set(index, relations);
|
|
16484
16557
|
}
|
|
16485
16558
|
return relations;
|
|
16486
16559
|
}
|
|
@@ -16601,8 +16674,6 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16601
16674
|
const set = /* @__PURE__ */ new Set();
|
|
16602
16675
|
for (const [id, map] of relations) {
|
|
16603
16676
|
const index = this.getAttributeIndex(inv);
|
|
16604
|
-
if (index === null)
|
|
16605
|
-
throw new Error("IfcRelationsIndexer: invalid inverse attribute name");
|
|
16606
16677
|
const rels = map.get(index);
|
|
16607
16678
|
if (rels && rels.includes(expressID))
|
|
16608
16679
|
set.add(id);
|
|
@@ -16628,28 +16699,17 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16628
16699
|
);
|
|
16629
16700
|
if (!existingRelations) {
|
|
16630
16701
|
const attributeIndex = this.getAttributeIndex(relationName);
|
|
16631
|
-
if (!attributeIndex) {
|
|
16632
|
-
throw new Error(
|
|
16633
|
-
`IfcRelationsIndexer: ${relationName} is not a valid relation name.`
|
|
16634
|
-
);
|
|
16635
|
-
}
|
|
16636
16702
|
const entityRelations = this.relationMaps[model.uuid].get(expressID);
|
|
16637
16703
|
entityRelations == null ? void 0 : entityRelations.set(attributeIndex, relIDs);
|
|
16638
16704
|
} else {
|
|
16639
16705
|
existingRelations.push(...relIDs);
|
|
16640
16706
|
}
|
|
16641
16707
|
}
|
|
16642
|
-
// removeEntitiesRelation(
|
|
16643
|
-
// model: FragmentsGroup,
|
|
16644
|
-
// relatingID: number,
|
|
16645
|
-
// relationName: InverseAttribute,
|
|
16646
|
-
// ...relatedIDs: number[]
|
|
16647
|
-
// ) {}
|
|
16648
16708
|
/**
|
|
16649
16709
|
* Converts the relations made into actual IFC data.
|
|
16650
16710
|
*
|
|
16651
16711
|
* @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
|
|
16652
|
-
* It only make sense to use if the relations need to be write in the IFC file.
|
|
16712
|
+
* It only make sense to use it if the relations need to be write in the IFC file.
|
|
16653
16713
|
*
|
|
16654
16714
|
* @returns A promise that resolves when all the relation changes have been applied.
|
|
16655
16715
|
*/
|
|
@@ -16693,9 +16753,11 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16693
16753
|
}
|
|
16694
16754
|
addEntitiesRelation(model, relatingID, rel, ...relatedIDs) {
|
|
16695
16755
|
const { type, inv } = rel;
|
|
16696
|
-
|
|
16697
|
-
if (!relationsMap)
|
|
16698
|
-
|
|
16756
|
+
let relationsMap = this.relationMaps[model.uuid];
|
|
16757
|
+
if (!relationsMap) {
|
|
16758
|
+
relationsMap = /* @__PURE__ */ new Map();
|
|
16759
|
+
this.relationMaps[model.uuid] = relationsMap;
|
|
16760
|
+
}
|
|
16699
16761
|
if (!this._ifcRels.includes(type))
|
|
16700
16762
|
return;
|
|
16701
16763
|
const relInvAttrs = relToAttributesMap.get(type);
|
|
@@ -16741,35 +16803,11 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16741
16803
|
relatingData.related.add(...relatedExpressID);
|
|
16742
16804
|
}
|
|
16743
16805
|
for (const id of relatingExpressID) {
|
|
16744
|
-
|
|
16745
|
-
|
|
16746
|
-
currentMap = /* @__PURE__ */ new Map();
|
|
16747
|
-
relationsMap.set(id, currentMap);
|
|
16748
|
-
}
|
|
16749
|
-
const index = this.getAttributeIndex(relating);
|
|
16750
|
-
if (index !== null) {
|
|
16751
|
-
let indexMap = currentMap.get(index);
|
|
16752
|
-
if (!indexMap) {
|
|
16753
|
-
indexMap = [];
|
|
16754
|
-
currentMap.set(index, indexMap);
|
|
16755
|
-
}
|
|
16756
|
-
indexMap.push(...relatedExpressID);
|
|
16757
|
-
}
|
|
16806
|
+
const indexMap = this.getEntityRelations(model, id, relating);
|
|
16807
|
+
indexMap.push(...relatedExpressID);
|
|
16758
16808
|
}
|
|
16759
16809
|
for (const id of relatedExpressID) {
|
|
16760
|
-
|
|
16761
|
-
if (!currentMap) {
|
|
16762
|
-
currentMap = /* @__PURE__ */ new Map();
|
|
16763
|
-
relationsMap.set(id, currentMap);
|
|
16764
|
-
}
|
|
16765
|
-
const index = this.getAttributeIndex(related);
|
|
16766
|
-
if (index === null)
|
|
16767
|
-
continue;
|
|
16768
|
-
let relations = currentMap.get(index);
|
|
16769
|
-
if (!relations) {
|
|
16770
|
-
relations = [];
|
|
16771
|
-
currentMap.set(index, relations);
|
|
16772
|
-
}
|
|
16810
|
+
const relations = this.getEntityRelations(model, id, related);
|
|
16773
16811
|
relations.push(...relatingExpressID);
|
|
16774
16812
|
}
|
|
16775
16813
|
}
|
|
@@ -21518,9 +21556,9 @@ const _Topic = class _Topic {
|
|
|
21518
21556
|
__publicField(this, "_type", _Topic.default.type);
|
|
21519
21557
|
__publicField(this, "_status", _Topic.default.status);
|
|
21520
21558
|
__publicField(this, "_priority", _Topic.default.priority);
|
|
21521
|
-
__publicField(this, "_stage", _Topic.default.
|
|
21559
|
+
__publicField(this, "_stage", _Topic.default.stage);
|
|
21522
21560
|
__publicField(this, "_assignedTo", _Topic.default.assignedTo);
|
|
21523
|
-
__publicField(this, "_labels", _Topic.default.labels);
|
|
21561
|
+
__publicField(this, "_labels", _Topic.default.labels ?? /* @__PURE__ */ new Set());
|
|
21524
21562
|
__publicField(this, "_components");
|
|
21525
21563
|
this._components = components;
|
|
21526
21564
|
const manager = components.get(BCFTopics);
|
|
@@ -21846,8 +21884,7 @@ ${tags}
|
|
|
21846
21884
|
__publicField(_Topic, "default", {
|
|
21847
21885
|
title: "BCF Topic",
|
|
21848
21886
|
type: "Issue",
|
|
21849
|
-
status: "Active"
|
|
21850
|
-
labels: /* @__PURE__ */ new Set()
|
|
21887
|
+
status: "Active"
|
|
21851
21888
|
});
|
|
21852
21889
|
let Topic = _Topic;
|
|
21853
21890
|
const extensionsImporter = (manager, extensionsXML) => {
|
|
@@ -22107,8 +22144,9 @@ const _BCFTopics = class _BCFTopics extends Component {
|
|
|
22107
22144
|
if (data) {
|
|
22108
22145
|
topic.guid = data.guid ?? topic.guid;
|
|
22109
22146
|
topic.set(data);
|
|
22147
|
+
} else {
|
|
22148
|
+
this.list.set(topic.guid, topic);
|
|
22110
22149
|
}
|
|
22111
|
-
this.list.set(topic.guid, topic);
|
|
22112
22150
|
return topic;
|
|
22113
22151
|
}
|
|
22114
22152
|
/**
|
|
@@ -22998,6 +23036,84 @@ const _BoundingBoxer = class _BoundingBoxer extends Component {
|
|
|
22998
23036
|
};
|
|
22999
23037
|
__publicField(_BoundingBoxer, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
|
|
23000
23038
|
let BoundingBoxer = _BoundingBoxer;
|
|
23039
|
+
const _IfcIsolator = class _IfcIsolator extends Component {
|
|
23040
|
+
constructor(components) {
|
|
23041
|
+
super(components);
|
|
23042
|
+
/** {@link Component.enabled} */
|
|
23043
|
+
__publicField(this, "enabled", true);
|
|
23044
|
+
components.add(_IfcIsolator.uuid, this);
|
|
23045
|
+
}
|
|
23046
|
+
async getIsolatedElements(webIfc, modelID, elementIDs) {
|
|
23047
|
+
const isolatedElementIDs = /* @__PURE__ */ new Set();
|
|
23048
|
+
function addElementAndReferences(elementID) {
|
|
23049
|
+
if (isolatedElementIDs.has(elementID))
|
|
23050
|
+
return;
|
|
23051
|
+
const element = webIfc.GetLine(modelID, elementID);
|
|
23052
|
+
if (!element)
|
|
23053
|
+
return;
|
|
23054
|
+
isolatedElementIDs.add(elementID);
|
|
23055
|
+
for (const prop in element) {
|
|
23056
|
+
const value = element[prop];
|
|
23057
|
+
if (value && value.constructor.name === "Handle" && value.value > 0) {
|
|
23058
|
+
addElementAndReferences(value.value);
|
|
23059
|
+
} else if (Array.isArray(value)) {
|
|
23060
|
+
value.forEach((refID) => {
|
|
23061
|
+
if (refID && refID.constructor.name === "Handle" && refID.value > 0) {
|
|
23062
|
+
addElementAndReferences(refID.value);
|
|
23063
|
+
}
|
|
23064
|
+
});
|
|
23065
|
+
}
|
|
23066
|
+
}
|
|
23067
|
+
}
|
|
23068
|
+
for (const elementID of elementIDs) {
|
|
23069
|
+
addElementAndReferences(elementID);
|
|
23070
|
+
}
|
|
23071
|
+
const arr = [];
|
|
23072
|
+
for (const elementID of isolatedElementIDs) {
|
|
23073
|
+
arr.push(elementID);
|
|
23074
|
+
}
|
|
23075
|
+
arr.sort((a, b) => {
|
|
23076
|
+
return a - b;
|
|
23077
|
+
});
|
|
23078
|
+
const isolatedElements = [];
|
|
23079
|
+
arr.forEach((elementID) => {
|
|
23080
|
+
const element = webIfc.GetLine(modelID, elementID);
|
|
23081
|
+
isolatedElements.push(element);
|
|
23082
|
+
});
|
|
23083
|
+
return isolatedElements;
|
|
23084
|
+
}
|
|
23085
|
+
/**
|
|
23086
|
+
* Exports isolated elements to the new model.
|
|
23087
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
23088
|
+
* @param modelID ID of the new IFC model.
|
|
23089
|
+
* @param isolatedElements The array of isolated elements
|
|
23090
|
+
*/
|
|
23091
|
+
async export(webIfc, modelID, isolatedElements) {
|
|
23092
|
+
isolatedElements.forEach((element) => {
|
|
23093
|
+
webIfc.WriteLine(modelID, element);
|
|
23094
|
+
});
|
|
23095
|
+
const data = webIfc.SaveModel(modelID);
|
|
23096
|
+
return data;
|
|
23097
|
+
}
|
|
23098
|
+
async splitIfc(webIfc, ifcFile, idsToExtract) {
|
|
23099
|
+
const ifcBuffer = new Uint8Array(ifcFile);
|
|
23100
|
+
const modelID = webIfc.OpenModel(ifcBuffer);
|
|
23101
|
+
const isolated = await this.getIsolatedElements(
|
|
23102
|
+
webIfc,
|
|
23103
|
+
modelID,
|
|
23104
|
+
idsToExtract
|
|
23105
|
+
);
|
|
23106
|
+
const newModelID = webIfc.CreateModel({ schema: WEBIFC.Schemas.IFC2X3 });
|
|
23107
|
+
const data = await this.export(webIfc, newModelID, isolated);
|
|
23108
|
+
return data;
|
|
23109
|
+
}
|
|
23110
|
+
};
|
|
23111
|
+
/**
|
|
23112
|
+
* A unique identifier for the component.
|
|
23113
|
+
* This UUID is used to register the component within the Components system.
|
|
23114
|
+
*/
|
|
23115
|
+
__publicField(_IfcIsolator, "uuid", "6eb0ba2f-71c0-464e-bcec-2d7c335186b2");
|
|
23116
|
+
let IfcIsolator = _IfcIsolator;
|
|
23001
23117
|
const _IfcFinderQuery = class _IfcFinderQuery {
|
|
23002
23118
|
constructor(components) {
|
|
23003
23119
|
/**
|
|
@@ -23964,7 +24080,7 @@ const _Classifier = class _Classifier extends Component {
|
|
|
23964
24080
|
`Classifier: model relations of ${model.name || model.uuid} have to exists to group by spatial structure.`
|
|
23965
24081
|
);
|
|
23966
24082
|
}
|
|
23967
|
-
const systemName = "spatialStructures";
|
|
24083
|
+
const systemName = config.systemName ?? "spatialStructures";
|
|
23968
24084
|
const noProps = config.useProperties === void 0;
|
|
23969
24085
|
const useProperties = noProps || config.useProperties;
|
|
23970
24086
|
for (const [expressID] of modelRelations) {
|
|
@@ -24089,19 +24205,18 @@ const _Classifier = class _Classifier extends Component {
|
|
|
24089
24205
|
};
|
|
24090
24206
|
}
|
|
24091
24207
|
}
|
|
24092
|
-
return
|
|
24208
|
+
return exported;
|
|
24093
24209
|
}
|
|
24094
24210
|
/**
|
|
24095
24211
|
* Imports a classification previously exported with .export().
|
|
24096
24212
|
* @param data the serialized classification to import.
|
|
24097
24213
|
*/
|
|
24098
24214
|
import(data) {
|
|
24099
|
-
const
|
|
24100
|
-
for (const systemName in imported) {
|
|
24215
|
+
for (const systemName in data) {
|
|
24101
24216
|
if (!this.list[systemName]) {
|
|
24102
24217
|
this.list[systemName] = {};
|
|
24103
24218
|
}
|
|
24104
|
-
const system =
|
|
24219
|
+
const system = data[systemName];
|
|
24105
24220
|
for (const groupName in system) {
|
|
24106
24221
|
const group = system[groupName];
|
|
24107
24222
|
this.list[systemName][groupName] = {
|
|
@@ -24665,16 +24780,27 @@ const _IfcGeometryTiler = class _IfcGeometryTiler extends Component {
|
|
|
24665
24780
|
this._assets = [];
|
|
24666
24781
|
}
|
|
24667
24782
|
async streamGeometries() {
|
|
24668
|
-
|
|
24783
|
+
const exportMap = /* @__PURE__ */ new Map();
|
|
24784
|
+
for (const [id, value] of this._geometries) {
|
|
24785
|
+
exportMap.set(id, value);
|
|
24786
|
+
if (exportMap.size > this.settings.minGeometrySize) {
|
|
24787
|
+
await this.outputGeometries(exportMap);
|
|
24788
|
+
}
|
|
24789
|
+
}
|
|
24790
|
+
await this.outputGeometries(exportMap);
|
|
24791
|
+
this._geometries.clear();
|
|
24792
|
+
this._geometryCount = 0;
|
|
24793
|
+
}
|
|
24794
|
+
async outputGeometries(exportMap) {
|
|
24795
|
+
let buffer = this._streamSerializer.export(exportMap);
|
|
24669
24796
|
let data = {};
|
|
24670
|
-
for (const [id, { boundingBox: boundingBox2, hasHoles }] of
|
|
24797
|
+
for (const [id, { boundingBox: boundingBox2, hasHoles }] of exportMap) {
|
|
24671
24798
|
data[id] = { boundingBox: boundingBox2, hasHoles };
|
|
24672
24799
|
}
|
|
24673
24800
|
await this.onGeometryStreamed.trigger({ data, buffer });
|
|
24674
24801
|
data = null;
|
|
24675
24802
|
buffer = null;
|
|
24676
|
-
|
|
24677
|
-
this._geometryCount = 0;
|
|
24803
|
+
exportMap.clear();
|
|
24678
24804
|
}
|
|
24679
24805
|
registerGeometryData(group, itemID, geometry, asset, geometryID, transpGeometryID) {
|
|
24680
24806
|
const geometryData = this._visitedGeometries.get(transpGeometryID);
|
|
@@ -25104,8 +25230,8 @@ class Viewpoint {
|
|
|
25104
25230
|
*
|
|
25105
25231
|
* @returns A Promise that resolves when the camera has been set.
|
|
25106
25232
|
*/
|
|
25107
|
-
async go(transition = true) {
|
|
25108
|
-
const { camera } = this.world;
|
|
25233
|
+
async go(world, transition = true) {
|
|
25234
|
+
const { camera } = world ?? this.world;
|
|
25109
25235
|
if (!camera.hasCameraControls()) {
|
|
25110
25236
|
throw new Error(
|
|
25111
25237
|
"Viewpoint: the world's camera need controls to set the viewpoint."
|
|
@@ -25169,8 +25295,8 @@ class Viewpoint {
|
|
|
25169
25295
|
* @throws An error if the world's camera does not have camera controls.
|
|
25170
25296
|
* @throws An error if the world's renderer is not available.
|
|
25171
25297
|
*/
|
|
25172
|
-
updateCamera() {
|
|
25173
|
-
const { camera, renderer } = this.world;
|
|
25298
|
+
updateCamera(world) {
|
|
25299
|
+
const { camera, renderer } = world ?? this.world;
|
|
25174
25300
|
if (!renderer) {
|
|
25175
25301
|
throw new Error("Viewpoint: the world needs to have a renderer!");
|
|
25176
25302
|
}
|
|
@@ -26247,21 +26373,17 @@ class IDSFacet {
|
|
|
26247
26373
|
this.addCheckResult(checkLog, checks);
|
|
26248
26374
|
let pass = false;
|
|
26249
26375
|
if (facetParameter.type === "simple") {
|
|
26250
|
-
|
|
26251
|
-
pass = value === parameter2;
|
|
26376
|
+
pass = value === facetParameter.parameter;
|
|
26252
26377
|
}
|
|
26253
26378
|
if (facetParameter.type === "enumeration") {
|
|
26254
|
-
|
|
26255
|
-
pass = parameter2.includes(value);
|
|
26379
|
+
pass = facetParameter.parameter.includes(value);
|
|
26256
26380
|
}
|
|
26257
26381
|
if (facetParameter.type === "pattern") {
|
|
26258
|
-
const
|
|
26259
|
-
const regex = new RegExp(parameter2);
|
|
26382
|
+
const regex = new RegExp(facetParameter.parameter);
|
|
26260
26383
|
pass = regex.test(String(value));
|
|
26261
26384
|
}
|
|
26262
26385
|
if (facetParameter.type === "length") {
|
|
26263
|
-
const
|
|
26264
|
-
const { min, length, max } = parameter2;
|
|
26386
|
+
const { min, length, max } = facetParameter.parameter;
|
|
26265
26387
|
if (length !== void 0) {
|
|
26266
26388
|
pass = String(value).length === length;
|
|
26267
26389
|
}
|
|
@@ -26345,6 +26467,7 @@ const getParameterXML = (name, parameter) => {
|
|
|
26345
26467
|
class IDSAttribute extends IDSFacet {
|
|
26346
26468
|
constructor(components, name) {
|
|
26347
26469
|
super(components);
|
|
26470
|
+
__publicField(this, "facetType", "Attribute");
|
|
26348
26471
|
__publicField(this, "name");
|
|
26349
26472
|
__publicField(this, "value");
|
|
26350
26473
|
this.name = name;
|
|
@@ -26481,6 +26604,7 @@ class IDSAttribute extends IDSFacet {
|
|
|
26481
26604
|
class IDSClassification extends IDSFacet {
|
|
26482
26605
|
constructor(components, system) {
|
|
26483
26606
|
super(components);
|
|
26607
|
+
__publicField(this, "facetType", "Classification");
|
|
26484
26608
|
__publicField(this, "system");
|
|
26485
26609
|
__publicField(this, "value");
|
|
26486
26610
|
__publicField(this, "uri");
|
|
@@ -26763,6 +26887,7 @@ class IDSClassification extends IDSFacet {
|
|
|
26763
26887
|
class IDSEntity extends IDSFacet {
|
|
26764
26888
|
constructor(components, name) {
|
|
26765
26889
|
super(components);
|
|
26890
|
+
__publicField(this, "facetType", "Entity");
|
|
26766
26891
|
__publicField(this, "name");
|
|
26767
26892
|
__publicField(this, "predefinedType");
|
|
26768
26893
|
this.name = name;
|
|
@@ -26891,11 +27016,13 @@ class IDSEntity extends IDSFacet {
|
|
|
26891
27016
|
class IDSProperty extends IDSFacet {
|
|
26892
27017
|
constructor(components, propertySet, baseName) {
|
|
26893
27018
|
super(components);
|
|
27019
|
+
__publicField(this, "facetType", "Property");
|
|
26894
27020
|
__publicField(this, "propertySet");
|
|
26895
27021
|
__publicField(this, "baseName");
|
|
26896
27022
|
__publicField(this, "value");
|
|
26897
27023
|
__publicField(this, "dataType");
|
|
26898
27024
|
__publicField(this, "uri");
|
|
27025
|
+
// These are defined by the IDS specification
|
|
26899
27026
|
__publicField(this, "_unsupportedTypes", [
|
|
26900
27027
|
WEBIFC.IFCCOMPLEXPROPERTY,
|
|
26901
27028
|
WEBIFC.IFCPHYSICALCOMPLEXQUANTITY
|
|
@@ -27091,10 +27218,43 @@ class IDSProperty extends IDSFacet {
|
|
|
27091
27218
|
(name) => name.endsWith("Value") || name.endsWith("Values")
|
|
27092
27219
|
);
|
|
27093
27220
|
}
|
|
27094
|
-
|
|
27095
|
-
|
|
27221
|
+
async getPsetProps(model, attrs, propsListName) {
|
|
27222
|
+
const attrsClone = structuredClone(attrs);
|
|
27223
|
+
const props = [];
|
|
27224
|
+
const list = attrsClone[propsListName];
|
|
27225
|
+
if (!list)
|
|
27226
|
+
return props;
|
|
27227
|
+
for (const { value } of list) {
|
|
27228
|
+
const propAttrs = await model.getProperties(value);
|
|
27229
|
+
if (propAttrs)
|
|
27230
|
+
props.push(propAttrs);
|
|
27231
|
+
}
|
|
27232
|
+
attrsClone[propsListName] = props;
|
|
27233
|
+
return attrsClone;
|
|
27234
|
+
}
|
|
27235
|
+
async getTypePsets(model, expressID) {
|
|
27096
27236
|
const sets = [];
|
|
27097
27237
|
const indexer = this.components.get(IfcRelationsIndexer);
|
|
27238
|
+
const types = indexer.getEntityRelations(model, expressID, "IsTypedBy");
|
|
27239
|
+
if (!(types && types[0]))
|
|
27240
|
+
return sets;
|
|
27241
|
+
const typeAttrs = await model.getProperties(types[0]);
|
|
27242
|
+
if (!(typeAttrs && "HasPropertySets" in typeAttrs && Array.isArray(typeAttrs.HasPropertySets))) {
|
|
27243
|
+
return sets;
|
|
27244
|
+
}
|
|
27245
|
+
for (const { value } of typeAttrs.HasPropertySets) {
|
|
27246
|
+
const psetAttrs = await model.getProperties(value);
|
|
27247
|
+
if (!(psetAttrs && "HasProperties" in psetAttrs && Array.isArray(psetAttrs.HasProperties))) {
|
|
27248
|
+
continue;
|
|
27249
|
+
}
|
|
27250
|
+
const pset = await this.getPsetProps(model, psetAttrs, "HasProperties");
|
|
27251
|
+
sets.push(pset);
|
|
27252
|
+
}
|
|
27253
|
+
return sets;
|
|
27254
|
+
}
|
|
27255
|
+
async getPsets(model, expressID) {
|
|
27256
|
+
const sets = await this.getTypePsets(model, expressID);
|
|
27257
|
+
const indexer = this.components.get(IfcRelationsIndexer);
|
|
27098
27258
|
const definitions = indexer.getEntityRelations(
|
|
27099
27259
|
model,
|
|
27100
27260
|
expressID,
|
|
@@ -27109,15 +27269,8 @@ class IDSProperty extends IDSFacet {
|
|
|
27109
27269
|
const propsListName = this.getItemsAttrName(attrs.type);
|
|
27110
27270
|
if (!propsListName)
|
|
27111
27271
|
continue;
|
|
27112
|
-
const
|
|
27113
|
-
|
|
27114
|
-
for (const { value } of attrsClone[propsListName]) {
|
|
27115
|
-
const propAttrs = await model.getProperties(value);
|
|
27116
|
-
if (propAttrs)
|
|
27117
|
-
props.push(propAttrs);
|
|
27118
|
-
}
|
|
27119
|
-
attrsClone[propsListName] = props;
|
|
27120
|
-
sets.push(attrsClone);
|
|
27272
|
+
const pset = await this.getPsetProps(model, attrs, propsListName);
|
|
27273
|
+
sets.push(pset);
|
|
27121
27274
|
}
|
|
27122
27275
|
return sets;
|
|
27123
27276
|
}
|
|
@@ -27126,8 +27279,9 @@ class IDSProperty extends IDSFacet {
|
|
|
27126
27279
|
// Work must to be done to convert numerical value units to IDS-nominated standard units https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/units.md
|
|
27127
27280
|
evalValue(attrs, checks) {
|
|
27128
27281
|
const valueKey = this.getValueKey(attrs);
|
|
27282
|
+
const valueAttr = attrs[valueKey];
|
|
27129
27283
|
if (this.value) {
|
|
27130
|
-
if (!
|
|
27284
|
+
if (!valueAttr) {
|
|
27131
27285
|
checks == null ? void 0 : checks.push({
|
|
27132
27286
|
parameter: "Value",
|
|
27133
27287
|
currentValue: null,
|
|
@@ -27136,17 +27290,16 @@ class IDSProperty extends IDSFacet {
|
|
|
27136
27290
|
});
|
|
27137
27291
|
return false;
|
|
27138
27292
|
}
|
|
27139
|
-
const valueAttr = attrs[valueKey];
|
|
27140
27293
|
const facetValue = structuredClone(this.value);
|
|
27141
27294
|
if (valueAttr.name === "IFCLABEL" && facetValue.type === "simple") {
|
|
27142
27295
|
facetValue.parameter = String(facetValue.parameter);
|
|
27143
27296
|
}
|
|
27144
27297
|
if ((attrs.type === WEBIFC.IFCPROPERTYLISTVALUE || attrs.type === WEBIFC.IFCPROPERTYENUMERATEDVALUE) && Array.isArray(valueAttr)) {
|
|
27145
|
-
const values = valueAttr.map((
|
|
27146
|
-
const matchingValue = valueAttr.find((
|
|
27298
|
+
const values = valueAttr.map((value) => value.value);
|
|
27299
|
+
const matchingValue = valueAttr.find((value) => {
|
|
27147
27300
|
if (!facetValue)
|
|
27148
27301
|
return false;
|
|
27149
|
-
return this.evalRequirement(
|
|
27302
|
+
return this.evalRequirement(value.value, facetValue, "Value");
|
|
27150
27303
|
});
|
|
27151
27304
|
checks == null ? void 0 : checks.push({
|
|
27152
27305
|
currentValue: values,
|
|
@@ -27166,8 +27319,7 @@ class IDSProperty extends IDSFacet {
|
|
|
27166
27319
|
}
|
|
27167
27320
|
if (!valueKey)
|
|
27168
27321
|
return true;
|
|
27169
|
-
|
|
27170
|
-
if (value.type === 3 && value.value === 2) {
|
|
27322
|
+
if (valueAttr.type === 3 && valueAttr.value === 2) {
|
|
27171
27323
|
checks == null ? void 0 : checks.push({
|
|
27172
27324
|
parameter: "Value",
|
|
27173
27325
|
currentValue: null,
|
|
@@ -27176,7 +27328,7 @@ class IDSProperty extends IDSFacet {
|
|
|
27176
27328
|
});
|
|
27177
27329
|
return false;
|
|
27178
27330
|
}
|
|
27179
|
-
if (
|
|
27331
|
+
if (valueAttr.type === 1 && valueAttr.value.trim() === "") {
|
|
27180
27332
|
checks == null ? void 0 : checks.push({
|
|
27181
27333
|
parameter: "Value",
|
|
27182
27334
|
currentValue: "",
|
|
@@ -27192,6 +27344,15 @@ class IDSProperty extends IDSFacet {
|
|
|
27192
27344
|
return true;
|
|
27193
27345
|
const valueKey = this.getValueKey(attrs);
|
|
27194
27346
|
const valueAttr = attrs[valueKey];
|
|
27347
|
+
if (!valueAttr) {
|
|
27348
|
+
checks == null ? void 0 : checks.push({
|
|
27349
|
+
parameter: "DataType",
|
|
27350
|
+
currentValue: null,
|
|
27351
|
+
pass: false,
|
|
27352
|
+
requiredValue: this.dataType
|
|
27353
|
+
});
|
|
27354
|
+
return false;
|
|
27355
|
+
}
|
|
27195
27356
|
if ((attrs.type === WEBIFC.IFCPROPERTYLISTVALUE || attrs.type === WEBIFC.IFCPROPERTYENUMERATEDVALUE) && Array.isArray(valueAttr) && valueAttr[0]) {
|
|
27196
27357
|
const valueType = valueAttr[0].name;
|
|
27197
27358
|
const result2 = this.evalRequirement(
|
|
@@ -27237,6 +27398,20 @@ class IDSSpecification {
|
|
|
27237
27398
|
this.ifcVersion.add(version);
|
|
27238
27399
|
}
|
|
27239
27400
|
}
|
|
27401
|
+
set(data) {
|
|
27402
|
+
const _data = data;
|
|
27403
|
+
const _this = this;
|
|
27404
|
+
for (const key in data) {
|
|
27405
|
+
if (key === "identifier")
|
|
27406
|
+
continue;
|
|
27407
|
+
const value = _data[key];
|
|
27408
|
+
if (key in this)
|
|
27409
|
+
_this[key] = value;
|
|
27410
|
+
}
|
|
27411
|
+
const manager = this.components.get(IDSSpecifications);
|
|
27412
|
+
manager.list.set(this.identifier, this);
|
|
27413
|
+
return this;
|
|
27414
|
+
}
|
|
27240
27415
|
/**
|
|
27241
27416
|
* Tests the model to test against the specification's requirements.
|
|
27242
27417
|
*
|
|
@@ -27282,8 +27457,9 @@ class IDSSpecification {
|
|
|
27282
27457
|
const getParameterValue = (property) => {
|
|
27283
27458
|
if (!property)
|
|
27284
27459
|
return void 0;
|
|
27285
|
-
const result = {
|
|
27460
|
+
const result = {};
|
|
27286
27461
|
if ("simpleValue" in property) {
|
|
27462
|
+
result.type = "simple";
|
|
27287
27463
|
result.parameter = property.simpleValue;
|
|
27288
27464
|
}
|
|
27289
27465
|
if ("restriction" in property) {
|
|
@@ -27575,6 +27751,7 @@ export {
|
|
|
27575
27751
|
Components,
|
|
27576
27752
|
ConfigManager,
|
|
27577
27753
|
Configurator,
|
|
27754
|
+
ControlsUtils,
|
|
27578
27755
|
CullerRenderer,
|
|
27579
27756
|
Cullers,
|
|
27580
27757
|
DataMap,
|
|
@@ -27603,6 +27780,7 @@ export {
|
|
|
27603
27780
|
IfcFinderQuery,
|
|
27604
27781
|
IfcFragmentSettings,
|
|
27605
27782
|
IfcGeometryTiler,
|
|
27783
|
+
IfcIsolator,
|
|
27606
27784
|
IfcJsonExporter,
|
|
27607
27785
|
IfcLoader,
|
|
27608
27786
|
IfcPropertiesManager,
|