@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.cjs
CHANGED
|
@@ -3827,7 +3827,9 @@ class DataMap extends Map {
|
|
|
3827
3827
|
this.onCleared.trigger();
|
|
3828
3828
|
}
|
|
3829
3829
|
/**
|
|
3830
|
-
* Sets the value for the specified key in the map
|
|
3830
|
+
* Sets the value for the specified key in the map.
|
|
3831
|
+
* If the item is new, then onItemSet is triggered.
|
|
3832
|
+
* If the item is already in the map, then onItemUpdated is triggered.
|
|
3831
3833
|
*
|
|
3832
3834
|
* @param key - The key of the item to set.
|
|
3833
3835
|
* @param value - The value of the item to set.
|
|
@@ -3877,6 +3879,97 @@ class DataMap extends Map {
|
|
|
3877
3879
|
}
|
|
3878
3880
|
class ComponentWithUI extends Component {
|
|
3879
3881
|
}
|
|
3882
|
+
class ControlsUtils {
|
|
3883
|
+
static isEntry(item) {
|
|
3884
|
+
const types = /* @__PURE__ */ new Set([
|
|
3885
|
+
"Boolean",
|
|
3886
|
+
"Color",
|
|
3887
|
+
"Text",
|
|
3888
|
+
"Number",
|
|
3889
|
+
"Select",
|
|
3890
|
+
"Vector3",
|
|
3891
|
+
"TextSet",
|
|
3892
|
+
"None"
|
|
3893
|
+
]);
|
|
3894
|
+
return types.has(item.type);
|
|
3895
|
+
}
|
|
3896
|
+
static copySchema(schema, copy = {}) {
|
|
3897
|
+
for (const name in schema) {
|
|
3898
|
+
const entry = schema[name];
|
|
3899
|
+
if (this.isEntry(entry)) {
|
|
3900
|
+
copy[name] = this.copyEntry(entry);
|
|
3901
|
+
} else {
|
|
3902
|
+
copy[name] = {};
|
|
3903
|
+
this.copySchema(entry, copy[name]);
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
return copy;
|
|
3907
|
+
}
|
|
3908
|
+
static copyEntry(controlEntry) {
|
|
3909
|
+
if (controlEntry.type === "Boolean") {
|
|
3910
|
+
const entry = controlEntry;
|
|
3911
|
+
return {
|
|
3912
|
+
type: entry.type,
|
|
3913
|
+
value: entry.value
|
|
3914
|
+
};
|
|
3915
|
+
}
|
|
3916
|
+
if (controlEntry.type === "Color") {
|
|
3917
|
+
const entry = controlEntry;
|
|
3918
|
+
return {
|
|
3919
|
+
type: entry.type,
|
|
3920
|
+
value: entry.value.clone()
|
|
3921
|
+
};
|
|
3922
|
+
}
|
|
3923
|
+
if (controlEntry.type === "Text") {
|
|
3924
|
+
const entry = controlEntry;
|
|
3925
|
+
return {
|
|
3926
|
+
type: entry.type,
|
|
3927
|
+
value: entry.value
|
|
3928
|
+
};
|
|
3929
|
+
}
|
|
3930
|
+
if (controlEntry.type === "Number") {
|
|
3931
|
+
const entry = controlEntry;
|
|
3932
|
+
return {
|
|
3933
|
+
type: entry.type,
|
|
3934
|
+
value: entry.value,
|
|
3935
|
+
min: entry.min,
|
|
3936
|
+
max: entry.max,
|
|
3937
|
+
interpolable: entry.interpolable
|
|
3938
|
+
};
|
|
3939
|
+
}
|
|
3940
|
+
if (controlEntry.type === "Select") {
|
|
3941
|
+
const entry = controlEntry;
|
|
3942
|
+
return {
|
|
3943
|
+
type: entry.type,
|
|
3944
|
+
value: entry.value,
|
|
3945
|
+
multiple: entry.multiple,
|
|
3946
|
+
options: new Set(entry.options)
|
|
3947
|
+
};
|
|
3948
|
+
}
|
|
3949
|
+
if (controlEntry.type === "Vector3") {
|
|
3950
|
+
const entry = controlEntry;
|
|
3951
|
+
return {
|
|
3952
|
+
type: entry.type,
|
|
3953
|
+
value: entry.value.clone()
|
|
3954
|
+
};
|
|
3955
|
+
}
|
|
3956
|
+
if (controlEntry.type === "TextSet") {
|
|
3957
|
+
const entry = controlEntry;
|
|
3958
|
+
return {
|
|
3959
|
+
type: entry.type,
|
|
3960
|
+
value: new Set(entry.value)
|
|
3961
|
+
};
|
|
3962
|
+
}
|
|
3963
|
+
if (controlEntry.type === "None") {
|
|
3964
|
+
const entry = controlEntry;
|
|
3965
|
+
return {
|
|
3966
|
+
type: entry.type,
|
|
3967
|
+
value: entry.value
|
|
3968
|
+
};
|
|
3969
|
+
}
|
|
3970
|
+
throw new Error("Invalid entry!");
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3880
3973
|
class EventManager {
|
|
3881
3974
|
constructor() {
|
|
3882
3975
|
/**
|
|
@@ -5385,7 +5478,7 @@ const _Components = class _Components {
|
|
|
5385
5478
|
/**
|
|
5386
5479
|
* The version of the @thatopen/components library.
|
|
5387
5480
|
*/
|
|
5388
|
-
__publicField(_Components, "release", "2.4.0
|
|
5481
|
+
__publicField(_Components, "release", "2.4.0");
|
|
5389
5482
|
let Components = _Components;
|
|
5390
5483
|
class SimpleWorld extends Base {
|
|
5391
5484
|
constructor() {
|
|
@@ -5552,76 +5645,69 @@ class Configurator {
|
|
|
5552
5645
|
configManager.list.set(this.uuid, this);
|
|
5553
5646
|
}
|
|
5554
5647
|
get controls() {
|
|
5555
|
-
|
|
5556
|
-
for (const name in this._config) {
|
|
5557
|
-
const entry = this._config[name];
|
|
5558
|
-
copy[name] = this.copyEntry(entry);
|
|
5559
|
-
}
|
|
5560
|
-
return copy;
|
|
5648
|
+
return ControlsUtils.copySchema(this._config);
|
|
5561
5649
|
}
|
|
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
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
}
|
|
5650
|
+
set(data) {
|
|
5651
|
+
for (const name in data) {
|
|
5652
|
+
if (name in this) {
|
|
5653
|
+
const key = name;
|
|
5654
|
+
this[key] = data[name].value;
|
|
5655
|
+
}
|
|
5656
|
+
}
|
|
5657
|
+
}
|
|
5658
|
+
export(controls = this._config, exported = {}) {
|
|
5659
|
+
for (const id in controls) {
|
|
5660
|
+
const control = controls[id];
|
|
5661
|
+
const isControl = ControlsUtils.isEntry(control);
|
|
5662
|
+
if (isControl) {
|
|
5663
|
+
if (control.type === "Color") {
|
|
5664
|
+
const { r, g, b } = control.value;
|
|
5665
|
+
exported[id] = { ...control, value: { r, g, b } };
|
|
5666
|
+
} else if (control.type === "Vector3") {
|
|
5667
|
+
const { x, y, z } = control.value;
|
|
5668
|
+
exported[id] = { ...control, value: { x, y, z } };
|
|
5669
|
+
} else if (control.type === "TextSet") {
|
|
5670
|
+
const value = Array.from(control.value);
|
|
5671
|
+
exported[id] = { ...control, value };
|
|
5672
|
+
} else if (control.type === "Select") {
|
|
5673
|
+
const options = Array.from(control.options);
|
|
5674
|
+
exported[id] = { ...control, options };
|
|
5675
|
+
} else {
|
|
5676
|
+
exported[id] = { ...control };
|
|
5677
|
+
}
|
|
5678
|
+
} else {
|
|
5679
|
+
exported[id] = {};
|
|
5680
|
+
this.export(control, exported[id]);
|
|
5681
|
+
}
|
|
5682
|
+
}
|
|
5683
|
+
return exported;
|
|
5684
|
+
}
|
|
5685
|
+
import(exported, imported = {}, first = true) {
|
|
5686
|
+
for (const id in exported) {
|
|
5687
|
+
const control = exported[id];
|
|
5688
|
+
const isControl = ControlsUtils.isEntry(control);
|
|
5689
|
+
if (isControl) {
|
|
5690
|
+
if (control.type === "Color") {
|
|
5691
|
+
const { r, g, b } = control.value;
|
|
5692
|
+
imported[id] = { ...control, value: new THREE__namespace.Color(r, g, b) };
|
|
5693
|
+
} else if (control.type === "Vector3") {
|
|
5694
|
+
const { x, y, z } = control.value;
|
|
5695
|
+
imported[id] = { ...control, value: new THREE__namespace.Vector3(x, y, z) };
|
|
5696
|
+
} else if (control.type === "TextSet") {
|
|
5697
|
+
imported[id] = { ...control, value: new Set(control.value) };
|
|
5698
|
+
} else if (control.type === "Select") {
|
|
5699
|
+
imported[id] = { ...control, options: new Set(control.options) };
|
|
5700
|
+
} else {
|
|
5701
|
+
imported[id] = { ...control };
|
|
5702
|
+
}
|
|
5703
|
+
} else {
|
|
5704
|
+
imported[id] = {};
|
|
5705
|
+
this.import(control, imported[id], false);
|
|
5706
|
+
}
|
|
5616
5707
|
}
|
|
5617
|
-
if (
|
|
5618
|
-
|
|
5619
|
-
return {
|
|
5620
|
-
type: entry.type,
|
|
5621
|
-
value: entry.value
|
|
5622
|
-
};
|
|
5708
|
+
if (first) {
|
|
5709
|
+
this.set(imported);
|
|
5623
5710
|
}
|
|
5624
|
-
throw new Error("Invalid entry!");
|
|
5625
5711
|
}
|
|
5626
5712
|
}
|
|
5627
5713
|
const _ConfigManager = class _ConfigManager extends Component {
|
|
@@ -9554,13 +9640,15 @@ class SimpleRaycaster {
|
|
|
9554
9640
|
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
9555
9641
|
* to query. If not provided, it will query all the meshes stored in
|
|
9556
9642
|
* {@link Components.meshes}.
|
|
9643
|
+
* @param position - the screen position to use for raycasting. If not provided,
|
|
9644
|
+
* the last pointer (mouse/touch) position will be used.
|
|
9557
9645
|
*/
|
|
9558
|
-
castRay(items = Array.from(this.world.meshes)) {
|
|
9646
|
+
castRay(items = Array.from(this.world.meshes), position = this.mouse.position) {
|
|
9559
9647
|
if (!this.world) {
|
|
9560
9648
|
throw new Error("A world is needed to cast rays!");
|
|
9561
9649
|
}
|
|
9562
9650
|
const camera = this.world.camera.three;
|
|
9563
|
-
this.three.setFromCamera(
|
|
9651
|
+
this.three.setFromCamera(position, camera);
|
|
9564
9652
|
return this.intersect(items);
|
|
9565
9653
|
}
|
|
9566
9654
|
/**
|
|
@@ -11087,6 +11175,9 @@ class SimplePlane {
|
|
|
11087
11175
|
* @param {boolean} state - The new enabled state.
|
|
11088
11176
|
*/
|
|
11089
11177
|
set enabled(state) {
|
|
11178
|
+
if (this.world.isDisposing) {
|
|
11179
|
+
return;
|
|
11180
|
+
}
|
|
11090
11181
|
if (!this.world.renderer) {
|
|
11091
11182
|
throw new Error("No renderer found for clipping plane!");
|
|
11092
11183
|
}
|
|
@@ -15329,7 +15420,8 @@ const GeometryTypes = /* @__PURE__ */ new Set([
|
|
|
15329
15420
|
3958567839,
|
|
15330
15421
|
2513912981,
|
|
15331
15422
|
2830218821,
|
|
15332
|
-
427810014
|
|
15423
|
+
427810014,
|
|
15424
|
+
2916149573
|
|
15333
15425
|
]);
|
|
15334
15426
|
const _IfcJsonExporter = class _IfcJsonExporter extends Component {
|
|
15335
15427
|
constructor(components) {
|
|
@@ -15883,7 +15975,7 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
15883
15975
|
*/
|
|
15884
15976
|
async newPset(model, name, description) {
|
|
15885
15977
|
const schema = _IfcPropertiesManager.getIFCSchema(model);
|
|
15886
|
-
const { ownerHistoryHandle } = await this.getOwnerHistory(model);
|
|
15978
|
+
const { handle: ownerHistoryHandle } = await this.getOwnerHistory(model);
|
|
15887
15979
|
const psetGlobalId = this.newGUID(model);
|
|
15888
15980
|
const psetName = new WEBIFC__namespace[schema].IfcLabel(name);
|
|
15889
15981
|
const psetDescription = description ? new WEBIFC__namespace[schema].IfcText(description) : null;
|
|
@@ -15895,18 +15987,8 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
15895
15987
|
[]
|
|
15896
15988
|
);
|
|
15897
15989
|
pset.expressID = this.getNewExpressID(model);
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
relGlobalId,
|
|
15901
|
-
ownerHistoryHandle,
|
|
15902
|
-
null,
|
|
15903
|
-
null,
|
|
15904
|
-
[],
|
|
15905
|
-
new WEBIFC__namespace.Handle(pset.expressID)
|
|
15906
|
-
);
|
|
15907
|
-
rel.expressID = this.getNewExpressID(model);
|
|
15908
|
-
await this.setData(model, pset, rel);
|
|
15909
|
-
return { pset, rel };
|
|
15990
|
+
await this.setData(model, pset);
|
|
15991
|
+
return { pset };
|
|
15910
15992
|
}
|
|
15911
15993
|
/**
|
|
15912
15994
|
* Removes a Property Set (Pset) from the given model.
|
|
@@ -16021,7 +16103,7 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16021
16103
|
indexer.addEntitiesRelation(
|
|
16022
16104
|
model,
|
|
16023
16105
|
psetID,
|
|
16024
|
-
{ type: WEBIFC__namespace.IFCRELDEFINESBYPROPERTIES, inv: "
|
|
16106
|
+
{ type: WEBIFC__namespace.IFCRELDEFINESBYPROPERTIES, inv: "DefinesOcurrence" },
|
|
16025
16107
|
...expressIDs
|
|
16026
16108
|
);
|
|
16027
16109
|
}
|
|
@@ -16069,7 +16151,7 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16069
16151
|
if (!relName) {
|
|
16070
16152
|
throw new Error(`IfcPropertiesManager: ${relName} is unsoported.`);
|
|
16071
16153
|
}
|
|
16072
|
-
const schema = model
|
|
16154
|
+
const schema = _IfcPropertiesManager.getIFCSchema(model);
|
|
16073
16155
|
const attributePositions = ifcRelAttrsPosition[relName];
|
|
16074
16156
|
const RelClass = WEBIFC__namespace[schema][relName];
|
|
16075
16157
|
if (!(attributePositions && RelClass)) {
|
|
@@ -16120,7 +16202,9 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16120
16202
|
for (const expressID of changes) {
|
|
16121
16203
|
const data = await model.getProperties(expressID);
|
|
16122
16204
|
if (!data) {
|
|
16123
|
-
ifcApi.
|
|
16205
|
+
const existed = ifcApi.GetLine(modelID, expressID);
|
|
16206
|
+
if (existed)
|
|
16207
|
+
ifcApi.DeleteLine(modelID, expressID);
|
|
16124
16208
|
} else {
|
|
16125
16209
|
ifcApi.WriteLine(modelID, data);
|
|
16126
16210
|
}
|
|
@@ -16217,9 +16301,9 @@ const _IfcPropertiesManager = class _IfcPropertiesManager extends Component {
|
|
|
16217
16301
|
throw new Error("No OwnerHistory was found.");
|
|
16218
16302
|
}
|
|
16219
16303
|
const keys = Object.keys(ownerHistories).map((key) => parseInt(key, 10));
|
|
16220
|
-
const
|
|
16221
|
-
const
|
|
16222
|
-
return {
|
|
16304
|
+
const entity = ownerHistories[keys[0]];
|
|
16305
|
+
const handle = new WEBIFC__namespace.Handle(entity.expressID);
|
|
16306
|
+
return { entity, handle };
|
|
16223
16307
|
}
|
|
16224
16308
|
registerChange(model, ...expressID) {
|
|
16225
16309
|
if (!this.changeMap[model.uuid]) {
|
|
@@ -16324,7 +16408,7 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16324
16408
|
__publicField(this, "onFragmentsDisposed", (data) => {
|
|
16325
16409
|
delete this.relationMaps[data.groupID];
|
|
16326
16410
|
});
|
|
16327
|
-
//
|
|
16411
|
+
// Used to create the corresponding IfcRelationship with the IfcPropertiesManager
|
|
16328
16412
|
__publicField(this, "_changeMap", {});
|
|
16329
16413
|
/**
|
|
16330
16414
|
* An event that is triggered when entities are related in a BIM model.
|
|
@@ -16347,43 +16431,26 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16347
16431
|
return;
|
|
16348
16432
|
const relatingID = relAttrs[relatingKey].value;
|
|
16349
16433
|
const relatedIDs = relAttrs[relatedKey].map((el) => el.value);
|
|
16350
|
-
const
|
|
16351
|
-
|
|
16352
|
-
|
|
16353
|
-
|
|
16354
|
-
|
|
16355
|
-
|
|
16356
|
-
|
|
16357
|
-
let indexMap = currentMap.get(index);
|
|
16358
|
-
if (!indexMap) {
|
|
16359
|
-
indexMap = [];
|
|
16360
|
-
currentMap.set(index, indexMap);
|
|
16361
|
-
}
|
|
16362
|
-
for (const id of relatedIDs) {
|
|
16363
|
-
indexMap.push(id);
|
|
16364
|
-
}
|
|
16434
|
+
const indexMap = this.getEntityRelations(
|
|
16435
|
+
relationsMap,
|
|
16436
|
+
relatingID,
|
|
16437
|
+
relating
|
|
16438
|
+
);
|
|
16439
|
+
for (const id of relatedIDs) {
|
|
16440
|
+
indexMap.push(id);
|
|
16365
16441
|
}
|
|
16366
16442
|
for (const id of relatedIDs) {
|
|
16367
|
-
const
|
|
16368
|
-
if (index2 === null)
|
|
16369
|
-
continue;
|
|
16370
|
-
let currentMap = relationsMap.get(id);
|
|
16371
|
-
if (!currentMap) {
|
|
16372
|
-
currentMap = /* @__PURE__ */ new Map();
|
|
16373
|
-
relationsMap.set(id, currentMap);
|
|
16374
|
-
}
|
|
16375
|
-
let relations = currentMap.get(index2);
|
|
16376
|
-
if (!relations) {
|
|
16377
|
-
relations = [];
|
|
16378
|
-
currentMap.set(index2, relations);
|
|
16379
|
-
}
|
|
16443
|
+
const relations = this.getEntityRelations(relationsMap, id, related);
|
|
16380
16444
|
relations.push(relatingID);
|
|
16381
16445
|
}
|
|
16382
16446
|
}
|
|
16383
16447
|
getAttributeIndex(inverseAttribute) {
|
|
16384
16448
|
const index = this._inverseAttributes.indexOf(inverseAttribute);
|
|
16385
|
-
if (index === -1)
|
|
16386
|
-
|
|
16449
|
+
if (index === -1) {
|
|
16450
|
+
throw new Error(
|
|
16451
|
+
`IfcRelationsIndexer: ${inverseAttribute} is not a valid IFC Inverse Attribute name or its not supported yet by this component.`
|
|
16452
|
+
);
|
|
16453
|
+
}
|
|
16387
16454
|
return index;
|
|
16388
16455
|
}
|
|
16389
16456
|
/**
|
|
@@ -16417,28 +16484,27 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16417
16484
|
* representation of the relations indexed by entity expressIDs and relation types.
|
|
16418
16485
|
* @throws An error if the model does not have properties loaded.
|
|
16419
16486
|
*/
|
|
16420
|
-
async process(model) {
|
|
16487
|
+
async process(model, config) {
|
|
16421
16488
|
if (!model.hasProperties)
|
|
16422
16489
|
throw new Error("FragmentsGroup properties not found");
|
|
16423
16490
|
let relationsMap = this.relationMaps[model.uuid];
|
|
16424
|
-
if (relationsMap) {
|
|
16425
|
-
|
|
16491
|
+
if (!relationsMap) {
|
|
16492
|
+
relationsMap = /* @__PURE__ */ new Map();
|
|
16493
|
+
this.relationMaps[model.uuid] = relationsMap;
|
|
16426
16494
|
}
|
|
16427
|
-
|
|
16428
|
-
|
|
16429
|
-
|
|
16430
|
-
|
|
16495
|
+
const entities = model.getLocalProperties();
|
|
16496
|
+
if (!entities)
|
|
16497
|
+
return relationsMap;
|
|
16498
|
+
const relationsToProcess = (config == null ? void 0 : config.relationsToProcess) ?? this._ifcRels;
|
|
16499
|
+
for (const [_, entity] of Object.entries(entities)) {
|
|
16500
|
+
if (!relationsToProcess.includes(entity.type))
|
|
16431
16501
|
continue;
|
|
16432
|
-
|
|
16433
|
-
const relInverseAttributes = this._relToAttributesMap.get(relType);
|
|
16502
|
+
const relInverseAttributes = this._relToAttributesMap.get(entity.type);
|
|
16434
16503
|
if (!relInverseAttributes) {
|
|
16435
16504
|
continue;
|
|
16436
16505
|
}
|
|
16437
16506
|
const { forRelated: related, forRelating: relating } = relInverseAttributes;
|
|
16438
|
-
|
|
16439
|
-
const relAttrs = relsAttrs[expressID];
|
|
16440
|
-
this.indexRelations(relationsMap, relAttrs, related, relating);
|
|
16441
|
-
}
|
|
16507
|
+
this.indexRelations(relationsMap, entity, related, relating);
|
|
16442
16508
|
}
|
|
16443
16509
|
this.setRelationMap(model, relationsMap);
|
|
16444
16510
|
return relationsMap;
|
|
@@ -16480,26 +16546,33 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16480
16546
|
*
|
|
16481
16547
|
* @param model The `FragmentsGroup` model containing the entity, or its UUID.
|
|
16482
16548
|
* @param expressID The unique identifier of the entity within the model.
|
|
16483
|
-
* @param
|
|
16484
|
-
* @returns An array of express IDs representing the related entities
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16549
|
+
* @param attribute The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
16550
|
+
* @returns An array of express IDs representing the related entities. If the array is empty, no relations were found.
|
|
16551
|
+
*/
|
|
16552
|
+
getEntityRelations(model, expressID, attribute) {
|
|
16553
|
+
const index = this.getAttributeIndex(attribute);
|
|
16554
|
+
let relationsMap;
|
|
16555
|
+
if (model instanceof FRAGS.FragmentsGroup) {
|
|
16556
|
+
relationsMap = this.relationMaps[model.uuid];
|
|
16557
|
+
} else if (typeof model === "string") {
|
|
16558
|
+
relationsMap = this.relationMaps[model];
|
|
16559
|
+
} else {
|
|
16560
|
+
relationsMap = model;
|
|
16494
16561
|
}
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
|
|
16498
|
-
|
|
16562
|
+
if (!relationsMap && (model instanceof FRAGS.FragmentsGroup || typeof model === "string")) {
|
|
16563
|
+
relationsMap = /* @__PURE__ */ new Map();
|
|
16564
|
+
const id = model instanceof FRAGS.FragmentsGroup ? model.uuid : model;
|
|
16565
|
+
this.relationMaps[id] = relationsMap;
|
|
16566
|
+
}
|
|
16567
|
+
let entityRelations = relationsMap.get(expressID);
|
|
16568
|
+
if (!entityRelations) {
|
|
16569
|
+
entityRelations = /* @__PURE__ */ new Map();
|
|
16570
|
+
relationsMap.set(expressID, entityRelations);
|
|
16499
16571
|
}
|
|
16500
|
-
|
|
16572
|
+
let relations = entityRelations.get(index);
|
|
16501
16573
|
if (!relations) {
|
|
16502
|
-
|
|
16574
|
+
relations = [];
|
|
16575
|
+
entityRelations.set(index, relations);
|
|
16503
16576
|
}
|
|
16504
16577
|
return relations;
|
|
16505
16578
|
}
|
|
@@ -16620,8 +16693,6 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16620
16693
|
const set = /* @__PURE__ */ new Set();
|
|
16621
16694
|
for (const [id, map] of relations) {
|
|
16622
16695
|
const index = this.getAttributeIndex(inv);
|
|
16623
|
-
if (index === null)
|
|
16624
|
-
throw new Error("IfcRelationsIndexer: invalid inverse attribute name");
|
|
16625
16696
|
const rels = map.get(index);
|
|
16626
16697
|
if (rels && rels.includes(expressID))
|
|
16627
16698
|
set.add(id);
|
|
@@ -16647,28 +16718,17 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16647
16718
|
);
|
|
16648
16719
|
if (!existingRelations) {
|
|
16649
16720
|
const attributeIndex = this.getAttributeIndex(relationName);
|
|
16650
|
-
if (!attributeIndex) {
|
|
16651
|
-
throw new Error(
|
|
16652
|
-
`IfcRelationsIndexer: ${relationName} is not a valid relation name.`
|
|
16653
|
-
);
|
|
16654
|
-
}
|
|
16655
16721
|
const entityRelations = this.relationMaps[model.uuid].get(expressID);
|
|
16656
16722
|
entityRelations == null ? void 0 : entityRelations.set(attributeIndex, relIDs);
|
|
16657
16723
|
} else {
|
|
16658
16724
|
existingRelations.push(...relIDs);
|
|
16659
16725
|
}
|
|
16660
16726
|
}
|
|
16661
|
-
// removeEntitiesRelation(
|
|
16662
|
-
// model: FragmentsGroup,
|
|
16663
|
-
// relatingID: number,
|
|
16664
|
-
// relationName: InverseAttribute,
|
|
16665
|
-
// ...relatedIDs: number[]
|
|
16666
|
-
// ) {}
|
|
16667
16727
|
/**
|
|
16668
16728
|
* Converts the relations made into actual IFC data.
|
|
16669
16729
|
*
|
|
16670
16730
|
* @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
|
|
16671
|
-
* It only make sense to use if the relations need to be write in the IFC file.
|
|
16731
|
+
* It only make sense to use it if the relations need to be write in the IFC file.
|
|
16672
16732
|
*
|
|
16673
16733
|
* @returns A promise that resolves when all the relation changes have been applied.
|
|
16674
16734
|
*/
|
|
@@ -16712,9 +16772,11 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16712
16772
|
}
|
|
16713
16773
|
addEntitiesRelation(model, relatingID, rel, ...relatedIDs) {
|
|
16714
16774
|
const { type, inv } = rel;
|
|
16715
|
-
|
|
16716
|
-
if (!relationsMap)
|
|
16717
|
-
|
|
16775
|
+
let relationsMap = this.relationMaps[model.uuid];
|
|
16776
|
+
if (!relationsMap) {
|
|
16777
|
+
relationsMap = /* @__PURE__ */ new Map();
|
|
16778
|
+
this.relationMaps[model.uuid] = relationsMap;
|
|
16779
|
+
}
|
|
16718
16780
|
if (!this._ifcRels.includes(type))
|
|
16719
16781
|
return;
|
|
16720
16782
|
const relInvAttrs = relToAttributesMap.get(type);
|
|
@@ -16760,35 +16822,11 @@ const _IfcRelationsIndexer = class _IfcRelationsIndexer extends Component {
|
|
|
16760
16822
|
relatingData.related.add(...relatedExpressID);
|
|
16761
16823
|
}
|
|
16762
16824
|
for (const id of relatingExpressID) {
|
|
16763
|
-
|
|
16764
|
-
|
|
16765
|
-
currentMap = /* @__PURE__ */ new Map();
|
|
16766
|
-
relationsMap.set(id, currentMap);
|
|
16767
|
-
}
|
|
16768
|
-
const index = this.getAttributeIndex(relating);
|
|
16769
|
-
if (index !== null) {
|
|
16770
|
-
let indexMap = currentMap.get(index);
|
|
16771
|
-
if (!indexMap) {
|
|
16772
|
-
indexMap = [];
|
|
16773
|
-
currentMap.set(index, indexMap);
|
|
16774
|
-
}
|
|
16775
|
-
indexMap.push(...relatedExpressID);
|
|
16776
|
-
}
|
|
16825
|
+
const indexMap = this.getEntityRelations(model, id, relating);
|
|
16826
|
+
indexMap.push(...relatedExpressID);
|
|
16777
16827
|
}
|
|
16778
16828
|
for (const id of relatedExpressID) {
|
|
16779
|
-
|
|
16780
|
-
if (!currentMap) {
|
|
16781
|
-
currentMap = /* @__PURE__ */ new Map();
|
|
16782
|
-
relationsMap.set(id, currentMap);
|
|
16783
|
-
}
|
|
16784
|
-
const index = this.getAttributeIndex(related);
|
|
16785
|
-
if (index === null)
|
|
16786
|
-
continue;
|
|
16787
|
-
let relations = currentMap.get(index);
|
|
16788
|
-
if (!relations) {
|
|
16789
|
-
relations = [];
|
|
16790
|
-
currentMap.set(index, relations);
|
|
16791
|
-
}
|
|
16829
|
+
const relations = this.getEntityRelations(model, id, related);
|
|
16792
16830
|
relations.push(...relatingExpressID);
|
|
16793
16831
|
}
|
|
16794
16832
|
}
|
|
@@ -21537,9 +21575,9 @@ const _Topic = class _Topic {
|
|
|
21537
21575
|
__publicField(this, "_type", _Topic.default.type);
|
|
21538
21576
|
__publicField(this, "_status", _Topic.default.status);
|
|
21539
21577
|
__publicField(this, "_priority", _Topic.default.priority);
|
|
21540
|
-
__publicField(this, "_stage", _Topic.default.
|
|
21578
|
+
__publicField(this, "_stage", _Topic.default.stage);
|
|
21541
21579
|
__publicField(this, "_assignedTo", _Topic.default.assignedTo);
|
|
21542
|
-
__publicField(this, "_labels", _Topic.default.labels);
|
|
21580
|
+
__publicField(this, "_labels", _Topic.default.labels ?? /* @__PURE__ */ new Set());
|
|
21543
21581
|
__publicField(this, "_components");
|
|
21544
21582
|
this._components = components;
|
|
21545
21583
|
const manager = components.get(BCFTopics);
|
|
@@ -21865,8 +21903,7 @@ ${tags}
|
|
|
21865
21903
|
__publicField(_Topic, "default", {
|
|
21866
21904
|
title: "BCF Topic",
|
|
21867
21905
|
type: "Issue",
|
|
21868
|
-
status: "Active"
|
|
21869
|
-
labels: /* @__PURE__ */ new Set()
|
|
21906
|
+
status: "Active"
|
|
21870
21907
|
});
|
|
21871
21908
|
let Topic = _Topic;
|
|
21872
21909
|
const extensionsImporter = (manager, extensionsXML) => {
|
|
@@ -22126,8 +22163,9 @@ const _BCFTopics = class _BCFTopics extends Component {
|
|
|
22126
22163
|
if (data) {
|
|
22127
22164
|
topic.guid = data.guid ?? topic.guid;
|
|
22128
22165
|
topic.set(data);
|
|
22166
|
+
} else {
|
|
22167
|
+
this.list.set(topic.guid, topic);
|
|
22129
22168
|
}
|
|
22130
|
-
this.list.set(topic.guid, topic);
|
|
22131
22169
|
return topic;
|
|
22132
22170
|
}
|
|
22133
22171
|
/**
|
|
@@ -23017,6 +23055,84 @@ const _BoundingBoxer = class _BoundingBoxer extends Component {
|
|
|
23017
23055
|
};
|
|
23018
23056
|
__publicField(_BoundingBoxer, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
|
|
23019
23057
|
let BoundingBoxer = _BoundingBoxer;
|
|
23058
|
+
const _IfcIsolator = class _IfcIsolator extends Component {
|
|
23059
|
+
constructor(components) {
|
|
23060
|
+
super(components);
|
|
23061
|
+
/** {@link Component.enabled} */
|
|
23062
|
+
__publicField(this, "enabled", true);
|
|
23063
|
+
components.add(_IfcIsolator.uuid, this);
|
|
23064
|
+
}
|
|
23065
|
+
async getIsolatedElements(webIfc, modelID, elementIDs) {
|
|
23066
|
+
const isolatedElementIDs = /* @__PURE__ */ new Set();
|
|
23067
|
+
function addElementAndReferences(elementID) {
|
|
23068
|
+
if (isolatedElementIDs.has(elementID))
|
|
23069
|
+
return;
|
|
23070
|
+
const element = webIfc.GetLine(modelID, elementID);
|
|
23071
|
+
if (!element)
|
|
23072
|
+
return;
|
|
23073
|
+
isolatedElementIDs.add(elementID);
|
|
23074
|
+
for (const prop in element) {
|
|
23075
|
+
const value = element[prop];
|
|
23076
|
+
if (value && value.constructor.name === "Handle" && value.value > 0) {
|
|
23077
|
+
addElementAndReferences(value.value);
|
|
23078
|
+
} else if (Array.isArray(value)) {
|
|
23079
|
+
value.forEach((refID) => {
|
|
23080
|
+
if (refID && refID.constructor.name === "Handle" && refID.value > 0) {
|
|
23081
|
+
addElementAndReferences(refID.value);
|
|
23082
|
+
}
|
|
23083
|
+
});
|
|
23084
|
+
}
|
|
23085
|
+
}
|
|
23086
|
+
}
|
|
23087
|
+
for (const elementID of elementIDs) {
|
|
23088
|
+
addElementAndReferences(elementID);
|
|
23089
|
+
}
|
|
23090
|
+
const arr = [];
|
|
23091
|
+
for (const elementID of isolatedElementIDs) {
|
|
23092
|
+
arr.push(elementID);
|
|
23093
|
+
}
|
|
23094
|
+
arr.sort((a, b) => {
|
|
23095
|
+
return a - b;
|
|
23096
|
+
});
|
|
23097
|
+
const isolatedElements = [];
|
|
23098
|
+
arr.forEach((elementID) => {
|
|
23099
|
+
const element = webIfc.GetLine(modelID, elementID);
|
|
23100
|
+
isolatedElements.push(element);
|
|
23101
|
+
});
|
|
23102
|
+
return isolatedElements;
|
|
23103
|
+
}
|
|
23104
|
+
/**
|
|
23105
|
+
* Exports isolated elements to the new model.
|
|
23106
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
23107
|
+
* @param modelID ID of the new IFC model.
|
|
23108
|
+
* @param isolatedElements The array of isolated elements
|
|
23109
|
+
*/
|
|
23110
|
+
async export(webIfc, modelID, isolatedElements) {
|
|
23111
|
+
isolatedElements.forEach((element) => {
|
|
23112
|
+
webIfc.WriteLine(modelID, element);
|
|
23113
|
+
});
|
|
23114
|
+
const data = webIfc.SaveModel(modelID);
|
|
23115
|
+
return data;
|
|
23116
|
+
}
|
|
23117
|
+
async splitIfc(webIfc, ifcFile, idsToExtract) {
|
|
23118
|
+
const ifcBuffer = new Uint8Array(ifcFile);
|
|
23119
|
+
const modelID = webIfc.OpenModel(ifcBuffer);
|
|
23120
|
+
const isolated = await this.getIsolatedElements(
|
|
23121
|
+
webIfc,
|
|
23122
|
+
modelID,
|
|
23123
|
+
idsToExtract
|
|
23124
|
+
);
|
|
23125
|
+
const newModelID = webIfc.CreateModel({ schema: WEBIFC__namespace.Schemas.IFC2X3 });
|
|
23126
|
+
const data = await this.export(webIfc, newModelID, isolated);
|
|
23127
|
+
return data;
|
|
23128
|
+
}
|
|
23129
|
+
};
|
|
23130
|
+
/**
|
|
23131
|
+
* A unique identifier for the component.
|
|
23132
|
+
* This UUID is used to register the component within the Components system.
|
|
23133
|
+
*/
|
|
23134
|
+
__publicField(_IfcIsolator, "uuid", "6eb0ba2f-71c0-464e-bcec-2d7c335186b2");
|
|
23135
|
+
let IfcIsolator = _IfcIsolator;
|
|
23020
23136
|
const _IfcFinderQuery = class _IfcFinderQuery {
|
|
23021
23137
|
constructor(components) {
|
|
23022
23138
|
/**
|
|
@@ -23983,7 +24099,7 @@ const _Classifier = class _Classifier extends Component {
|
|
|
23983
24099
|
`Classifier: model relations of ${model.name || model.uuid} have to exists to group by spatial structure.`
|
|
23984
24100
|
);
|
|
23985
24101
|
}
|
|
23986
|
-
const systemName = "spatialStructures";
|
|
24102
|
+
const systemName = config.systemName ?? "spatialStructures";
|
|
23987
24103
|
const noProps = config.useProperties === void 0;
|
|
23988
24104
|
const useProperties = noProps || config.useProperties;
|
|
23989
24105
|
for (const [expressID] of modelRelations) {
|
|
@@ -24108,19 +24224,18 @@ const _Classifier = class _Classifier extends Component {
|
|
|
24108
24224
|
};
|
|
24109
24225
|
}
|
|
24110
24226
|
}
|
|
24111
|
-
return
|
|
24227
|
+
return exported;
|
|
24112
24228
|
}
|
|
24113
24229
|
/**
|
|
24114
24230
|
* Imports a classification previously exported with .export().
|
|
24115
24231
|
* @param data the serialized classification to import.
|
|
24116
24232
|
*/
|
|
24117
24233
|
import(data) {
|
|
24118
|
-
const
|
|
24119
|
-
for (const systemName in imported) {
|
|
24234
|
+
for (const systemName in data) {
|
|
24120
24235
|
if (!this.list[systemName]) {
|
|
24121
24236
|
this.list[systemName] = {};
|
|
24122
24237
|
}
|
|
24123
|
-
const system =
|
|
24238
|
+
const system = data[systemName];
|
|
24124
24239
|
for (const groupName in system) {
|
|
24125
24240
|
const group = system[groupName];
|
|
24126
24241
|
this.list[systemName][groupName] = {
|
|
@@ -24684,16 +24799,27 @@ const _IfcGeometryTiler = class _IfcGeometryTiler extends Component {
|
|
|
24684
24799
|
this._assets = [];
|
|
24685
24800
|
}
|
|
24686
24801
|
async streamGeometries() {
|
|
24687
|
-
|
|
24802
|
+
const exportMap = /* @__PURE__ */ new Map();
|
|
24803
|
+
for (const [id, value] of this._geometries) {
|
|
24804
|
+
exportMap.set(id, value);
|
|
24805
|
+
if (exportMap.size > this.settings.minGeometrySize) {
|
|
24806
|
+
await this.outputGeometries(exportMap);
|
|
24807
|
+
}
|
|
24808
|
+
}
|
|
24809
|
+
await this.outputGeometries(exportMap);
|
|
24810
|
+
this._geometries.clear();
|
|
24811
|
+
this._geometryCount = 0;
|
|
24812
|
+
}
|
|
24813
|
+
async outputGeometries(exportMap) {
|
|
24814
|
+
let buffer = this._streamSerializer.export(exportMap);
|
|
24688
24815
|
let data = {};
|
|
24689
|
-
for (const [id, { boundingBox: boundingBox2, hasHoles }] of
|
|
24816
|
+
for (const [id, { boundingBox: boundingBox2, hasHoles }] of exportMap) {
|
|
24690
24817
|
data[id] = { boundingBox: boundingBox2, hasHoles };
|
|
24691
24818
|
}
|
|
24692
24819
|
await this.onGeometryStreamed.trigger({ data, buffer });
|
|
24693
24820
|
data = null;
|
|
24694
24821
|
buffer = null;
|
|
24695
|
-
|
|
24696
|
-
this._geometryCount = 0;
|
|
24822
|
+
exportMap.clear();
|
|
24697
24823
|
}
|
|
24698
24824
|
registerGeometryData(group, itemID, geometry, asset, geometryID, transpGeometryID) {
|
|
24699
24825
|
const geometryData = this._visitedGeometries.get(transpGeometryID);
|
|
@@ -25123,8 +25249,8 @@ class Viewpoint {
|
|
|
25123
25249
|
*
|
|
25124
25250
|
* @returns A Promise that resolves when the camera has been set.
|
|
25125
25251
|
*/
|
|
25126
|
-
async go(transition = true) {
|
|
25127
|
-
const { camera } = this.world;
|
|
25252
|
+
async go(world, transition = true) {
|
|
25253
|
+
const { camera } = world ?? this.world;
|
|
25128
25254
|
if (!camera.hasCameraControls()) {
|
|
25129
25255
|
throw new Error(
|
|
25130
25256
|
"Viewpoint: the world's camera need controls to set the viewpoint."
|
|
@@ -25188,8 +25314,8 @@ class Viewpoint {
|
|
|
25188
25314
|
* @throws An error if the world's camera does not have camera controls.
|
|
25189
25315
|
* @throws An error if the world's renderer is not available.
|
|
25190
25316
|
*/
|
|
25191
|
-
updateCamera() {
|
|
25192
|
-
const { camera, renderer } = this.world;
|
|
25317
|
+
updateCamera(world) {
|
|
25318
|
+
const { camera, renderer } = world ?? this.world;
|
|
25193
25319
|
if (!renderer) {
|
|
25194
25320
|
throw new Error("Viewpoint: the world needs to have a renderer!");
|
|
25195
25321
|
}
|
|
@@ -26266,21 +26392,17 @@ class IDSFacet {
|
|
|
26266
26392
|
this.addCheckResult(checkLog, checks);
|
|
26267
26393
|
let pass = false;
|
|
26268
26394
|
if (facetParameter.type === "simple") {
|
|
26269
|
-
|
|
26270
|
-
pass = value === parameter2;
|
|
26395
|
+
pass = value === facetParameter.parameter;
|
|
26271
26396
|
}
|
|
26272
26397
|
if (facetParameter.type === "enumeration") {
|
|
26273
|
-
|
|
26274
|
-
pass = parameter2.includes(value);
|
|
26398
|
+
pass = facetParameter.parameter.includes(value);
|
|
26275
26399
|
}
|
|
26276
26400
|
if (facetParameter.type === "pattern") {
|
|
26277
|
-
const
|
|
26278
|
-
const regex = new RegExp(parameter2);
|
|
26401
|
+
const regex = new RegExp(facetParameter.parameter);
|
|
26279
26402
|
pass = regex.test(String(value));
|
|
26280
26403
|
}
|
|
26281
26404
|
if (facetParameter.type === "length") {
|
|
26282
|
-
const
|
|
26283
|
-
const { min, length, max } = parameter2;
|
|
26405
|
+
const { min, length, max } = facetParameter.parameter;
|
|
26284
26406
|
if (length !== void 0) {
|
|
26285
26407
|
pass = String(value).length === length;
|
|
26286
26408
|
}
|
|
@@ -26364,6 +26486,7 @@ const getParameterXML = (name, parameter) => {
|
|
|
26364
26486
|
class IDSAttribute extends IDSFacet {
|
|
26365
26487
|
constructor(components, name) {
|
|
26366
26488
|
super(components);
|
|
26489
|
+
__publicField(this, "facetType", "Attribute");
|
|
26367
26490
|
__publicField(this, "name");
|
|
26368
26491
|
__publicField(this, "value");
|
|
26369
26492
|
this.name = name;
|
|
@@ -26500,6 +26623,7 @@ class IDSAttribute extends IDSFacet {
|
|
|
26500
26623
|
class IDSClassification extends IDSFacet {
|
|
26501
26624
|
constructor(components, system) {
|
|
26502
26625
|
super(components);
|
|
26626
|
+
__publicField(this, "facetType", "Classification");
|
|
26503
26627
|
__publicField(this, "system");
|
|
26504
26628
|
__publicField(this, "value");
|
|
26505
26629
|
__publicField(this, "uri");
|
|
@@ -26782,6 +26906,7 @@ class IDSClassification extends IDSFacet {
|
|
|
26782
26906
|
class IDSEntity extends IDSFacet {
|
|
26783
26907
|
constructor(components, name) {
|
|
26784
26908
|
super(components);
|
|
26909
|
+
__publicField(this, "facetType", "Entity");
|
|
26785
26910
|
__publicField(this, "name");
|
|
26786
26911
|
__publicField(this, "predefinedType");
|
|
26787
26912
|
this.name = name;
|
|
@@ -26910,11 +27035,13 @@ class IDSEntity extends IDSFacet {
|
|
|
26910
27035
|
class IDSProperty extends IDSFacet {
|
|
26911
27036
|
constructor(components, propertySet, baseName) {
|
|
26912
27037
|
super(components);
|
|
27038
|
+
__publicField(this, "facetType", "Property");
|
|
26913
27039
|
__publicField(this, "propertySet");
|
|
26914
27040
|
__publicField(this, "baseName");
|
|
26915
27041
|
__publicField(this, "value");
|
|
26916
27042
|
__publicField(this, "dataType");
|
|
26917
27043
|
__publicField(this, "uri");
|
|
27044
|
+
// These are defined by the IDS specification
|
|
26918
27045
|
__publicField(this, "_unsupportedTypes", [
|
|
26919
27046
|
WEBIFC__namespace.IFCCOMPLEXPROPERTY,
|
|
26920
27047
|
WEBIFC__namespace.IFCPHYSICALCOMPLEXQUANTITY
|
|
@@ -27110,10 +27237,43 @@ class IDSProperty extends IDSFacet {
|
|
|
27110
27237
|
(name) => name.endsWith("Value") || name.endsWith("Values")
|
|
27111
27238
|
);
|
|
27112
27239
|
}
|
|
27113
|
-
|
|
27114
|
-
|
|
27240
|
+
async getPsetProps(model, attrs, propsListName) {
|
|
27241
|
+
const attrsClone = structuredClone(attrs);
|
|
27242
|
+
const props = [];
|
|
27243
|
+
const list = attrsClone[propsListName];
|
|
27244
|
+
if (!list)
|
|
27245
|
+
return props;
|
|
27246
|
+
for (const { value } of list) {
|
|
27247
|
+
const propAttrs = await model.getProperties(value);
|
|
27248
|
+
if (propAttrs)
|
|
27249
|
+
props.push(propAttrs);
|
|
27250
|
+
}
|
|
27251
|
+
attrsClone[propsListName] = props;
|
|
27252
|
+
return attrsClone;
|
|
27253
|
+
}
|
|
27254
|
+
async getTypePsets(model, expressID) {
|
|
27115
27255
|
const sets = [];
|
|
27116
27256
|
const indexer = this.components.get(IfcRelationsIndexer);
|
|
27257
|
+
const types = indexer.getEntityRelations(model, expressID, "IsTypedBy");
|
|
27258
|
+
if (!(types && types[0]))
|
|
27259
|
+
return sets;
|
|
27260
|
+
const typeAttrs = await model.getProperties(types[0]);
|
|
27261
|
+
if (!(typeAttrs && "HasPropertySets" in typeAttrs && Array.isArray(typeAttrs.HasPropertySets))) {
|
|
27262
|
+
return sets;
|
|
27263
|
+
}
|
|
27264
|
+
for (const { value } of typeAttrs.HasPropertySets) {
|
|
27265
|
+
const psetAttrs = await model.getProperties(value);
|
|
27266
|
+
if (!(psetAttrs && "HasProperties" in psetAttrs && Array.isArray(psetAttrs.HasProperties))) {
|
|
27267
|
+
continue;
|
|
27268
|
+
}
|
|
27269
|
+
const pset = await this.getPsetProps(model, psetAttrs, "HasProperties");
|
|
27270
|
+
sets.push(pset);
|
|
27271
|
+
}
|
|
27272
|
+
return sets;
|
|
27273
|
+
}
|
|
27274
|
+
async getPsets(model, expressID) {
|
|
27275
|
+
const sets = await this.getTypePsets(model, expressID);
|
|
27276
|
+
const indexer = this.components.get(IfcRelationsIndexer);
|
|
27117
27277
|
const definitions = indexer.getEntityRelations(
|
|
27118
27278
|
model,
|
|
27119
27279
|
expressID,
|
|
@@ -27128,15 +27288,8 @@ class IDSProperty extends IDSFacet {
|
|
|
27128
27288
|
const propsListName = this.getItemsAttrName(attrs.type);
|
|
27129
27289
|
if (!propsListName)
|
|
27130
27290
|
continue;
|
|
27131
|
-
const
|
|
27132
|
-
|
|
27133
|
-
for (const { value } of attrsClone[propsListName]) {
|
|
27134
|
-
const propAttrs = await model.getProperties(value);
|
|
27135
|
-
if (propAttrs)
|
|
27136
|
-
props.push(propAttrs);
|
|
27137
|
-
}
|
|
27138
|
-
attrsClone[propsListName] = props;
|
|
27139
|
-
sets.push(attrsClone);
|
|
27291
|
+
const pset = await this.getPsetProps(model, attrs, propsListName);
|
|
27292
|
+
sets.push(pset);
|
|
27140
27293
|
}
|
|
27141
27294
|
return sets;
|
|
27142
27295
|
}
|
|
@@ -27145,8 +27298,9 @@ class IDSProperty extends IDSFacet {
|
|
|
27145
27298
|
// 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
|
|
27146
27299
|
evalValue(attrs, checks) {
|
|
27147
27300
|
const valueKey = this.getValueKey(attrs);
|
|
27301
|
+
const valueAttr = attrs[valueKey];
|
|
27148
27302
|
if (this.value) {
|
|
27149
|
-
if (!
|
|
27303
|
+
if (!valueAttr) {
|
|
27150
27304
|
checks == null ? void 0 : checks.push({
|
|
27151
27305
|
parameter: "Value",
|
|
27152
27306
|
currentValue: null,
|
|
@@ -27155,17 +27309,16 @@ class IDSProperty extends IDSFacet {
|
|
|
27155
27309
|
});
|
|
27156
27310
|
return false;
|
|
27157
27311
|
}
|
|
27158
|
-
const valueAttr = attrs[valueKey];
|
|
27159
27312
|
const facetValue = structuredClone(this.value);
|
|
27160
27313
|
if (valueAttr.name === "IFCLABEL" && facetValue.type === "simple") {
|
|
27161
27314
|
facetValue.parameter = String(facetValue.parameter);
|
|
27162
27315
|
}
|
|
27163
27316
|
if ((attrs.type === WEBIFC__namespace.IFCPROPERTYLISTVALUE || attrs.type === WEBIFC__namespace.IFCPROPERTYENUMERATEDVALUE) && Array.isArray(valueAttr)) {
|
|
27164
|
-
const values = valueAttr.map((
|
|
27165
|
-
const matchingValue = valueAttr.find((
|
|
27317
|
+
const values = valueAttr.map((value) => value.value);
|
|
27318
|
+
const matchingValue = valueAttr.find((value) => {
|
|
27166
27319
|
if (!facetValue)
|
|
27167
27320
|
return false;
|
|
27168
|
-
return this.evalRequirement(
|
|
27321
|
+
return this.evalRequirement(value.value, facetValue, "Value");
|
|
27169
27322
|
});
|
|
27170
27323
|
checks == null ? void 0 : checks.push({
|
|
27171
27324
|
currentValue: values,
|
|
@@ -27185,8 +27338,7 @@ class IDSProperty extends IDSFacet {
|
|
|
27185
27338
|
}
|
|
27186
27339
|
if (!valueKey)
|
|
27187
27340
|
return true;
|
|
27188
|
-
|
|
27189
|
-
if (value.type === 3 && value.value === 2) {
|
|
27341
|
+
if (valueAttr.type === 3 && valueAttr.value === 2) {
|
|
27190
27342
|
checks == null ? void 0 : checks.push({
|
|
27191
27343
|
parameter: "Value",
|
|
27192
27344
|
currentValue: null,
|
|
@@ -27195,7 +27347,7 @@ class IDSProperty extends IDSFacet {
|
|
|
27195
27347
|
});
|
|
27196
27348
|
return false;
|
|
27197
27349
|
}
|
|
27198
|
-
if (
|
|
27350
|
+
if (valueAttr.type === 1 && valueAttr.value.trim() === "") {
|
|
27199
27351
|
checks == null ? void 0 : checks.push({
|
|
27200
27352
|
parameter: "Value",
|
|
27201
27353
|
currentValue: "",
|
|
@@ -27211,6 +27363,15 @@ class IDSProperty extends IDSFacet {
|
|
|
27211
27363
|
return true;
|
|
27212
27364
|
const valueKey = this.getValueKey(attrs);
|
|
27213
27365
|
const valueAttr = attrs[valueKey];
|
|
27366
|
+
if (!valueAttr) {
|
|
27367
|
+
checks == null ? void 0 : checks.push({
|
|
27368
|
+
parameter: "DataType",
|
|
27369
|
+
currentValue: null,
|
|
27370
|
+
pass: false,
|
|
27371
|
+
requiredValue: this.dataType
|
|
27372
|
+
});
|
|
27373
|
+
return false;
|
|
27374
|
+
}
|
|
27214
27375
|
if ((attrs.type === WEBIFC__namespace.IFCPROPERTYLISTVALUE || attrs.type === WEBIFC__namespace.IFCPROPERTYENUMERATEDVALUE) && Array.isArray(valueAttr) && valueAttr[0]) {
|
|
27215
27376
|
const valueType = valueAttr[0].name;
|
|
27216
27377
|
const result2 = this.evalRequirement(
|
|
@@ -27256,6 +27417,20 @@ class IDSSpecification {
|
|
|
27256
27417
|
this.ifcVersion.add(version);
|
|
27257
27418
|
}
|
|
27258
27419
|
}
|
|
27420
|
+
set(data) {
|
|
27421
|
+
const _data = data;
|
|
27422
|
+
const _this = this;
|
|
27423
|
+
for (const key in data) {
|
|
27424
|
+
if (key === "identifier")
|
|
27425
|
+
continue;
|
|
27426
|
+
const value = _data[key];
|
|
27427
|
+
if (key in this)
|
|
27428
|
+
_this[key] = value;
|
|
27429
|
+
}
|
|
27430
|
+
const manager = this.components.get(IDSSpecifications);
|
|
27431
|
+
manager.list.set(this.identifier, this);
|
|
27432
|
+
return this;
|
|
27433
|
+
}
|
|
27259
27434
|
/**
|
|
27260
27435
|
* Tests the model to test against the specification's requirements.
|
|
27261
27436
|
*
|
|
@@ -27301,8 +27476,9 @@ class IDSSpecification {
|
|
|
27301
27476
|
const getParameterValue = (property) => {
|
|
27302
27477
|
if (!property)
|
|
27303
27478
|
return void 0;
|
|
27304
|
-
const result = {
|
|
27479
|
+
const result = {};
|
|
27305
27480
|
if ("simpleValue" in property) {
|
|
27481
|
+
result.type = "simple";
|
|
27306
27482
|
result.parameter = property.simpleValue;
|
|
27307
27483
|
}
|
|
27308
27484
|
if ("restriction" in property) {
|
|
@@ -27593,6 +27769,7 @@ exports.ComponentWithUI = ComponentWithUI;
|
|
|
27593
27769
|
exports.Components = Components;
|
|
27594
27770
|
exports.ConfigManager = ConfigManager;
|
|
27595
27771
|
exports.Configurator = Configurator;
|
|
27772
|
+
exports.ControlsUtils = ControlsUtils;
|
|
27596
27773
|
exports.CullerRenderer = CullerRenderer;
|
|
27597
27774
|
exports.Cullers = Cullers;
|
|
27598
27775
|
exports.DataMap = DataMap;
|
|
@@ -27621,6 +27798,7 @@ exports.IfcFinder = IfcFinder;
|
|
|
27621
27798
|
exports.IfcFinderQuery = IfcFinderQuery;
|
|
27622
27799
|
exports.IfcFragmentSettings = IfcFragmentSettings;
|
|
27623
27800
|
exports.IfcGeometryTiler = IfcGeometryTiler;
|
|
27801
|
+
exports.IfcIsolator = IfcIsolator;
|
|
27624
27802
|
exports.IfcJsonExporter = IfcJsonExporter;
|
|
27625
27803
|
exports.IfcLoader = IfcLoader;
|
|
27626
27804
|
exports.IfcPropertiesManager = IfcPropertiesManager;
|