mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Reintroduce binary type in express parser
This commit is contained in:
@@ -114,6 +114,7 @@ actions = {
|
|||||||
'aggregation_types' : "lambda t: AggregationType(t)",
|
'aggregation_types' : "lambda t: AggregationType(t)",
|
||||||
'general_aggregation_types' : "lambda t: AggregationType(t)",
|
'general_aggregation_types' : "lambda t: AggregationType(t)",
|
||||||
'select_type' : "lambda t: SelectType(t)",
|
'select_type' : "lambda t: SelectType(t)",
|
||||||
|
'binary_type' : "lambda t: BinaryType(t)",
|
||||||
'subtype_declaration' : "lambda t: SubtypeExpression(t)",
|
'subtype_declaration' : "lambda t: SubtypeExpression(t)",
|
||||||
'derive_clause' : "lambda t: AttributeList('derive', t)",
|
'derive_clause' : "lambda t: AttributeList('derive', t)",
|
||||||
'derived_attr' : "lambda t: DerivedAttribute(t)",
|
'derived_attr' : "lambda t: DerivedAttribute(t)",
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class Mapping:
|
|||||||
def make_argument_entity(self, attr):
|
def make_argument_entity(self, attr):
|
||||||
type = attr.type if hasattr(attr, 'type') else attr
|
type = attr.type if hasattr(attr, 'type') else attr
|
||||||
while isinstance(type, nodes.AggregationType): type = type.type
|
while isinstance(type, nodes.AggregationType): type = type.type
|
||||||
if type in self.express_to_cpp_typemapping: return "Type::UNDEFINED"
|
if str(type) in self.express_to_cpp_typemapping: return "Type::UNDEFINED"
|
||||||
else: return "Type::%s" % type
|
else: return "Type::%s" % type
|
||||||
|
|
||||||
def make_argument_type(self, attr):
|
def make_argument_type(self, attr):
|
||||||
@@ -88,6 +88,8 @@ class Mapping:
|
|||||||
return "ENTITY_INSTANCE"
|
return "ENTITY_INSTANCE"
|
||||||
elif self.schema.is_type(type):
|
elif self.schema.is_type(type):
|
||||||
return _make_argument_type(self.schema.types[type].type.type)
|
return _make_argument_type(self.schema.types[type].type.type)
|
||||||
|
elif isinstance(type, nodes.BinaryType):
|
||||||
|
return "BINARY"
|
||||||
elif isinstance(type, nodes.EnumerationType):
|
elif isinstance(type, nodes.EnumerationType):
|
||||||
return "ENUMERATION"
|
return "ENUMERATION"
|
||||||
elif isinstance(type, nodes.AggregationType):
|
elif isinstance(type, nodes.AggregationType):
|
||||||
|
|||||||
@@ -145,6 +145,13 @@ class DerivedAttribute(Node):
|
|||||||
return str(self.name)
|
return str(self.name)
|
||||||
|
|
||||||
|
|
||||||
|
class BinaryType(Node):
|
||||||
|
def init(self):
|
||||||
|
pass
|
||||||
|
def __repr__(self):
|
||||||
|
return "binary"
|
||||||
|
|
||||||
|
|
||||||
class BoundSpecification(Node):
|
class BoundSpecification(Node):
|
||||||
lower = property(lambda self: self.tokens[1])
|
lower = property(lambda self: self.tokens[1])
|
||||||
upper = property(lambda self: self.tokens[3])
|
upper = property(lambda self: self.tokens[3])
|
||||||
|
|||||||
@@ -7366,8 +7366,8 @@ bool IfcPropertySetDefinitionSet::is(Type::Enum v) const { return v == IfcProper
|
|||||||
Type::Enum IfcPropertySetDefinitionSet::type() const { return Type::IfcPropertySetDefinitionSet; }
|
Type::Enum IfcPropertySetDefinitionSet::type() const { return Type::IfcPropertySetDefinitionSet; }
|
||||||
Type::Enum IfcPropertySetDefinitionSet::Class() { return Type::IfcPropertySetDefinitionSet; }
|
Type::Enum IfcPropertySetDefinitionSet::Class() { return Type::IfcPropertySetDefinitionSet; }
|
||||||
IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcAbstractEntity* e) { entity = e; }
|
IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcAbstractEntity* e) { entity = e; }
|
||||||
IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr v) { IfcWritableEntity* e = new IfcWritableEntity(Type::IfcPropertySetDefinitionSet); e->setArgument(0, v); entity = e; }
|
IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr v) { IfcWritableEntity* e = new IfcWritableEntity(Type::IfcPropertySetDefinitionSet); e->setArgument(0, v->generalize()); entity = e; }
|
||||||
IfcPropertySetDefinitionSet::operator IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr() const { return *entity->getArgument(0); }
|
IfcPropertySetDefinitionSet::operator IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr() const { IfcEntityList::ptr es = *entity->getArgument(0); return es->as<IfcPropertySetDefinition>(); }
|
||||||
|
|
||||||
// Function implementations for IfcRadioActivityMeasure
|
// Function implementations for IfcRadioActivityMeasure
|
||||||
IfcUtil::ArgumentType IfcRadioActivityMeasure::getArgumentType(unsigned int i) const { if (i == 0) { return IfcUtil::Argument_DOUBLE; } else { throw IfcParse::IfcException("argument out of range"); } }
|
IfcUtil::ArgumentType IfcRadioActivityMeasure::getArgumentType(unsigned int i) const { if (i == 0) { return IfcUtil::Argument_DOUBLE; } else { throw IfcParse::IfcException("argument out of range"); } }
|
||||||
|
|||||||
Reference in New Issue
Block a user