mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 13:57:34 +00:00
ISSUE #6328 fix in dispatch_token to avoid missing unknown in logicals
This commit is contained in:
committed by
Thomas Krijnen
parent
58a5f881e6
commit
35fe79dfb2
@@ -57,8 +57,10 @@ namespace {
|
|||||||
void dispatch_token(int instance_id, int attribute_id, IfcParse::Token t, IfcParse::declaration* decl, Fn fn) {
|
void dispatch_token(int instance_id, int attribute_id, IfcParse::Token t, IfcParse::declaration* decl, Fn fn) {
|
||||||
if (t.type == IfcParse::Token_BINARY) {
|
if (t.type == IfcParse::Token_BINARY) {
|
||||||
fn(IfcParse::TokenFunc::asBinary(t));
|
fn(IfcParse::TokenFunc::asBinary(t));
|
||||||
} else if (t.type == IfcParse::Token_BOOL) {
|
} else if (IfcParse::TokenFunc::isBool(t)) {
|
||||||
fn(IfcParse::TokenFunc::asBool(t));
|
fn(IfcParse::TokenFunc::asBool(t));
|
||||||
|
} else if (IfcParse::TokenFunc::isLogical(t)) {
|
||||||
|
fn(IfcParse::TokenFunc::asLogical(t));
|
||||||
} else if (t.type == IfcParse::Token_ENUMERATION) {
|
} else if (t.type == IfcParse::Token_ENUMERATION) {
|
||||||
auto& s = IfcParse::TokenFunc::asStringRef(t);
|
auto& s = IfcParse::TokenFunc::asStringRef(t);
|
||||||
if (decl && decl->as_enumeration_type()) {
|
if (decl && decl->as_enumeration_type()) {
|
||||||
|
|||||||
@@ -82,9 +82,10 @@ boost::optional<std::string> format_attribute(ifcopenshell::geometry::abstract_m
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch(argument_type) {
|
switch(argument_type) {
|
||||||
case IfcUtil::Argument_BOOL: {
|
case IfcUtil::Argument_BOOL:
|
||||||
const bool b = argument;
|
case IfcUtil::Argument_LOGICAL:{
|
||||||
value = b ? "true" : "false";
|
const boost::logic::tribool b = argument;
|
||||||
|
value = b.value == boost::logic::tribool::indeterminate_value ? "unknown" : b ? "true" : "false";
|
||||||
break; }
|
break; }
|
||||||
case IfcUtil::Argument_DOUBLE: {
|
case IfcUtil::Argument_DOUBLE: {
|
||||||
const double d = argument;
|
const double d = argument;
|
||||||
|
|||||||
Reference in New Issue
Block a user