Hacky solution to disable schemas to speedup compilation

This commit is contained in:
Thomas Krijnen
2021-05-11 22:29:16 +02:00
parent ce76d27acc
commit 34386ea27c
12 changed files with 582 additions and 166 deletions
+30 -12
View File
@@ -472,21 +472,39 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
%inline %{
static boost::variant<IfcGeom::Element<double>*, IfcGeom::Representation::Representation*> create_shape(IfcGeom::IteratorSettings& settings, IfcUtil::IfcBaseClass* instance, IfcUtil::IfcBaseClass* representation = 0) {
const std::string& schema_name = instance->declaration().schema()->name();
#ifdef HAS_SCHEMA_2x3
if (schema_name == "IFC2X3") {
return helper_fn_create_shape<Ifc2x3>(settings, instance, representation);
} else if (schema_name == "IFC4") {
return helper_fn_create_shape<Ifc4>(settings, instance, representation);
} else if (schema_name == "IFC4X1") {
return helper_fn_create_shape<Ifc4x1>(settings, instance, representation);
} else if (schema_name == "IFC4X2") {
return helper_fn_create_shape<Ifc4x2>(settings, instance, representation);
} else if (schema_name == "IFC4X3_RC1") {
return helper_fn_create_shape<Ifc4x3_rc1>(settings, instance, representation);
} else if (schema_name == "IFC4X3_RC2") {
return helper_fn_create_shape<Ifc4x3_rc2>(settings, instance, representation);
} else {
throw IfcParse::IfcException("No geometry support for " + schema_name);
}
#endif
#ifdef HAS_SCHEMA_4
if (schema_name == "IFC4") {
return helper_fn_create_shape<Ifc4>(settings, instance, representation);
}
#endif
#ifdef HAS_SCHEMA_4x1
if (schema_name == "IFC4X1") {
return helper_fn_create_shape<Ifc4x1>(settings, instance, representation);
}
#endif
#ifdef HAS_SCHEMA_4x2
if (schema_name == "IFC4X2") {
return helper_fn_create_shape<Ifc4x2>(settings, instance, representation);
}
#endif
#ifdef HAS_SCHEMA_4x3_rc1
if (schema_name == "IFC4X3_RC1") {
return helper_fn_create_shape<Ifc4x3_rc1>(settings, instance, representation);
}
#endif
#ifdef HAS_SCHEMA_4x3_rc2
if (schema_name == "IFC4X3_RC2") {
return helper_fn_create_shape<Ifc4x3_rc2>(settings, instance, representation);
}
#endif
throw IfcParse::IfcException("No geometry support for " + schema_name);
}
%}