mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Option to bypass storing types when opening model
This commit is contained in:
@@ -651,6 +651,17 @@ IfcParse::filetype IfcParse::guess_file_type(const std::string& fn) {
|
||||
}
|
||||
}
|
||||
|
||||
void IfcParse::InstanceStreamer::bypassTypes(const std::set<std::string>& type_names) {
|
||||
for (auto& name : type_names) {
|
||||
try {
|
||||
types_to_bypass_.push_back(schema_->declaration_by_name(name));
|
||||
} catch (const IfcException&) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::optional<std::tuple<size_t, const IfcParse::declaration*, IfcEntityInstanceData>> IfcParse::InstanceStreamer::readInstance() {
|
||||
std::optional<std::tuple<size_t, const IfcParse::declaration*, IfcEntityInstanceData>> return_value;
|
||||
|
||||
@@ -698,6 +709,15 @@ std::optional<std::tuple<size_t, const IfcParse::declaration*, IfcEntityInstance
|
||||
goto advance;
|
||||
}
|
||||
|
||||
for (auto& ty : types_to_bypass_) {
|
||||
if (entity_type->is(*ty)) {
|
||||
bypassed_instances_.push_back(current_id);
|
||||
// Why is this a conditional clause in the loop?
|
||||
current_id = 0;
|
||||
goto advance;
|
||||
}
|
||||
}
|
||||
|
||||
parse_context ps;
|
||||
lexer_->Next();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user