mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 12:12:15 +00:00
Guarantee schemas are initialized for serialization and tesselation
This commit is contained in:
@@ -11,7 +11,13 @@ namespace IfcGeom {
|
||||
|
||||
template <typename Fn, typename T>
|
||||
IfcUtil::IfcBaseClass* execute_based_on_schema(Fn fn1, Fn fn2, const std::string& schema_name, const TopoDS_Shape& shape, T t) {
|
||||
// @todo an ugly hack to guarantee schemas are initialised.
|
||||
try {
|
||||
IfcParse::schema_by_name("IFC2X3");
|
||||
} catch (IfcParse::IfcException&) {}
|
||||
|
||||
const std::string schema_name_lower = boost::to_lower_copy(schema_name);
|
||||
|
||||
if (schema_name_lower == "ifc2x3") {
|
||||
return fn1(shape, t);
|
||||
} else if (schema_name_lower == "ifc4") {
|
||||
|
||||
Reference in New Issue
Block a user