diff --git a/src/ifcparse/IfcFile.cpp b/src/ifcparse/IfcFile.cpp index 84afd8c128..fd4e3bc947 100644 --- a/src/ifcparse/IfcFile.cpp +++ b/src/ifcparse/IfcFile.cpp @@ -625,7 +625,7 @@ std::optionalschema())->instantiate(decl, ps.construct(entity_instance_name, references_to_resolve, decl, boost::none, attribute_index == -1 ? (int)attribute_index_within_data : attribute_index)); + auto* simple_type_instance = (schema ? schema : file->schema())->instantiate(decl, ps.construct(entity_instance_name, *references_to_resolve, decl, boost::none, attribute_index == -1 ? (int)attribute_index_within_data : attribute_index)); //@todo decide addEntity(((IfcUtil::IfcBaseClass*)*entity)); context.push(simple_type_instance); simple_type_instance->file_ = file; @@ -753,7 +753,7 @@ IfcEntityInstanceData IfcParse::impl::in_memory_file_storage::read(unsigned int parse_context pc; tokens->Next(); load(i, ty->as_entity(), pc, -1); - return IfcEntityInstanceData(pc.construct(i, *references_to_resolve, ty, boost::none)); + return IfcEntityInstanceData(pc.construct(i, *references_to_resolve, ty, boost::none, -1)); } void IfcParse::impl::in_memory_file_storage::try_read_semicolon() const { @@ -1543,7 +1543,7 @@ void IfcParse::impl::in_memory_file_storage::read_from_stream(IfcParse::IfcSpfSt auto attr_index = p.first.index_; if (storage->has_attribute_value(nullptr, nullptr, 0, attr_index)) { - auto inst = storage->get_attribute_value(nullptr, nullptr, 0, attr_index); + IfcUtil::IfcBaseClass* inst = storage->get_attribute_value(nullptr, nullptr, 0, attr_index); if (!inst->declaration().as_entity()) { // Probably a case of IfcPropertySetDefinitionSet, divert storage of reference to the simply type instance storage = &inst->data(); @@ -1552,7 +1552,7 @@ void IfcParse::impl::in_memory_file_storage::read_from_stream(IfcParse::IfcSpfSt } if (storage->has_attribute_value(nullptr, nullptr, 0, attr_index)) { - storage->set(nullptr, nullptr, 0, attr_index, it->second); + storage->set_attribute_value(nullptr, nullptr, 0, attr_index, it->second); } else { Logger::Error("Duplicate definition for instance reference"); } @@ -1580,7 +1580,7 @@ void IfcParse::impl::in_memory_file_storage::read_from_stream(IfcParse::IfcSpfSt auto attr_index = p.first.index_; if (storage->has_attribute_value(nullptr, nullptr, 0, attr_index)) { - auto inst = storage->get_attribute_value(nullptr, nullptr, 0, attr_index); + IfcUtil::IfcBaseClass* inst = storage->get_attribute_value(nullptr, nullptr, 0, attr_index); if (!inst->declaration().as_entity()) { // Probably a case of IfcPropertySetDefinitionSet, divert storage of reference to the simply type instance storage = &inst->data(); @@ -1589,7 +1589,7 @@ void IfcParse::impl::in_memory_file_storage::read_from_stream(IfcParse::IfcSpfSt } if (storage->has_attribute_value(nullptr, nullptr, 0, attr_index)) { - storage->set(nullptr, nullptr, 0, attr_index, instances); + storage->set_attribute_value(nullptr, nullptr, 0, attr_index, instances); } else { Logger::Error("Duplicate definition for instance reference"); } @@ -1616,7 +1616,7 @@ void IfcParse::impl::in_memory_file_storage::read_from_stream(IfcParse::IfcSpfSt auto attr_index = p.first.index_; if (storage->has_attribute_value(nullptr, nullptr, 0, attr_index)) { - auto inst = storage->get_attribute_value(nullptr, nullptr, 0, attr_index); + IfcUtil::IfcBaseClass* inst = storage->get_attribute_value(nullptr, nullptr, 0, attr_index); if (!inst->declaration().as_entity()) { // Probably a case of IfcPropertySetDefinitionSet, divert storage of reference to the simply type instance storage = &inst->data(); @@ -1625,7 +1625,7 @@ void IfcParse::impl::in_memory_file_storage::read_from_stream(IfcParse::IfcSpfSt } if (storage->has_attribute_value(nullptr, nullptr, 0, attr_index)) { - storage->set(nullptr, nullptr, 0, attr_index, instances); + storage->set_attribute_value(nullptr, nullptr, 0, attr_index, instances); } else { Logger::Error("Duplicate definition for instance reference"); } diff --git a/src/ifcparse/IfcSpfHeader.cpp b/src/ifcparse/IfcSpfHeader.cpp index cf9c1f9b06..3c69be6bd1 100644 --- a/src/ifcparse/IfcSpfHeader.cpp +++ b/src/ifcparse/IfcSpfHeader.cpp @@ -35,7 +35,7 @@ namespace { parse_context pc; storage->tokens->Next(); storage->load(-1, nullptr, pc, -1); - return pc.construct(-1, *storage->references_to_resolve, nullptr, s); + return pc.construct(-1, *storage->references_to_resolve, nullptr, s, -1); } else { // std::unreachable(); return IfcEntityInstanceData(in_memory_attribute_storage(10)); diff --git a/src/ifcparse/storage.h b/src/ifcparse/storage.h index 59917ccd61..dc3c1aa599 100644 --- a/src/ifcparse/storage.h +++ b/src/ifcparse/storage.h @@ -171,7 +171,7 @@ namespace IfcParse { void push(IfcUtil::IfcBaseClass* inst); - IfcEntityInstanceData construct(int name, unresolved_references& references_to_resolve, const IfcParse::declaration* decl, boost::optional expected_size); + IfcEntityInstanceData construct(int name, unresolved_references& references_to_resolve, const IfcParse::declaration* decl, boost::optional expected_size, int resolve_reference_index); }; namespace impl { diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index 0966fc5fcc..c8e75ab87f 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -43,7 +43,7 @@ private: // Available as get_inverse(). %ignore IfcParse::IfcFile::instances_by_reference; -%ignore parse_context; +%ignore IfcParse::parse_context; %ignore operator<<;