From 7022255491db141d26b77d6878134a5a5fb8d520 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 1 Aug 2021 11:58:33 +0200 Subject: [PATCH] Handle logical properties. --- source/import/importerifc.js | 11 ++++++++++- website/o3dv/detailssidebarpanel.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/source/import/importerifc.js b/source/import/importerifc.js index 440bc7d..55b7a7a 100644 --- a/source/import/importerifc.js +++ b/source/import/importerifc.js @@ -145,6 +145,7 @@ OV.ImporterIfc = class extends OV.ImporterBase } let elemProperty = null; let propertyName = this.GetIFCString (property.Name.value); + let strValue = null; switch (property.NominalValue.label) { case 'IFCTEXT': case 'IFCLABEL': @@ -152,7 +153,14 @@ OV.ImporterIfc = class extends OV.ImporterBase elemProperty = new OV.Property (OV.PropertyType.Text, propertyName, this.GetIFCString (property.NominalValue.value)); break; case 'IFCBOOLEAN': - elemProperty = new OV.Property (OV.PropertyType.Boolean, propertyName, property.NominalValue.value === 'T' ? true : false); + case 'IFCLOGICAL': + strValue = 'Unknown'; + if (property.NominalValue.value === 'T') { + strValue = 'True'; + } else if (property.NominalValue.value === 'F') { + strValue = 'False'; + } + elemProperty = new OV.Property (OV.PropertyType.Text, propertyName, strValue); break; case 'IFCINTEGER': case 'IFCCOUNTMEASURE': @@ -174,6 +182,7 @@ OV.ImporterIfc = class extends OV.ImporterBase default: // TODO console.log (property.NominalValue.label); + console.log (property.NominalValue.value); break; } if (elemProperty !== null) { diff --git a/website/o3dv/detailssidebarpanel.js b/website/o3dv/detailssidebarpanel.js index 88a446a..1debaef 100644 --- a/website/o3dv/detailssidebarpanel.js +++ b/website/o3dv/detailssidebarpanel.js @@ -139,7 +139,7 @@ OV.DetailsSidebarPanel = class extends OV.SidebarPanel maximumFractionDigits: 2 }); } else if (property.type === OV.PropertyType.Boolean) { - valueText = property.value ? 'Yes' : 'No'; + valueText = property.value ? 'True' : 'False'; } else if (property.type === OV.PropertyType.Percent) { valueText = parseInt (property.value * 100, 10).toString () + '%'; } else if (property.type === OV.PropertyType.Color) {