Skip to content

Commit 771c8ee

Browse files
committed
feat(core): add includedCategories option to IFCLoader
1 parent 44a8b60 commit 771c8ee

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatopen/components",
33
"description": "Collection of core functionalities to author BIM apps.",
4-
"version": "2.1.18",
4+
"version": "2.1.19",
55
"author": "That Open Company",
66
"contributors": [
77
"Antonio Gonzalez Viegas (https://github.com/agviegas)",

packages/core/src/core/Components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Components implements Disposable {
1414
/**
1515
* The version of the @thatopen/components library.
1616
*/
17-
static readonly release = "2.1.18";
17+
static readonly release = "2.1.19";
1818

1919
/** {@link Disposable.onDisposed} */
2020
readonly onDisposed = new Event<void>();

packages/core/src/fragments/IfcLoader/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,14 @@ export class IfcLoader extends Component implements Disposable {
228228
if (!this.webIfc.IsIfcElement(type) && type !== WEBIFC.IFCSPACE) {
229229
continue;
230230
}
231-
if (this.settings.excludedCategories.has(type)) {
231+
232+
const included = this.settings.includedCategories;
233+
if (included.size > 0 && !included.has(type)) {
234+
continue;
235+
} else if (this.settings.excludedCategories.has(type)) {
232236
continue;
233237
}
238+
234239
const result = this.webIfc.GetLineIDsWithType(0, type);
235240
const size = result.size();
236241
for (let i = 0; i < size; i++) {

packages/core/src/fragments/IfcLoader/src/ifc-fragment-settings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export class IfcFragmentSettings {
2828
/** List of categories that won't be converted to fragments. */
2929
excludedCategories = new Set<number>();
3030

31+
/** Exclusive list of categories that will be converted to fragments. If this contains any category, any other categories will be ignored. */
32+
includedCategories = new Set<number>();
33+
3134
/** Whether to save the absolute location of all IFC items. */
3235
saveLocations = false;
3336

0 commit comments

Comments
 (0)