prep for 4x3_rc2

This commit is contained in:
Thomas Krijnen
2021-02-14 12:43:27 +01:00
parent 7f4a436708
commit 6bbbc528fe
7 changed files with 34 additions and 4 deletions
@@ -8,16 +8,18 @@ namespace IfcGeom {
extern IfcUtil::IfcBaseClass* tesselate_Ifc4x1(const TopoDS_Shape& shape, double deflection);
extern IfcUtil::IfcBaseClass* tesselate_Ifc4x2(const TopoDS_Shape& shape, double deflection);
extern IfcUtil::IfcBaseClass* tesselate_Ifc4x3_rc1(const TopoDS_Shape& shape, double deflection);
extern IfcUtil::IfcBaseClass* tesselate_Ifc4x3_rc2(const TopoDS_Shape& shape, double deflection);
extern IfcUtil::IfcBaseClass* serialise_Ifc2x3(const TopoDS_Shape& shape, bool advanced);
extern IfcUtil::IfcBaseClass* serialise_Ifc4(const TopoDS_Shape& shape, bool advanced);
extern IfcUtil::IfcBaseClass* serialise_Ifc4x1(const TopoDS_Shape& shape, bool advanced);
extern IfcUtil::IfcBaseClass* serialise_Ifc4x2(const TopoDS_Shape& shape, bool advanced);
extern IfcUtil::IfcBaseClass* serialise_Ifc4x3_rc1(const TopoDS_Shape& shape, bool advanced);
extern IfcUtil::IfcBaseClass* serialise_Ifc4x3_rc2(const TopoDS_Shape& shape, bool advanced);
}
template <typename Fn, typename T>
IfcUtil::IfcBaseClass* execute_based_on_schema(Fn fn_2x3, Fn fn_4, Fn fn_4x1, Fn fn_4x2, Fn fn_4x3_rc1, const std::string& schema_name, const TopoDS_Shape& shape, T t) {
IfcUtil::IfcBaseClass* execute_based_on_schema(Fn fn_2x3, Fn fn_4, Fn fn_4x1, Fn fn_4x2, Fn fn_4x3_rc1, Fn fn_4x3_rc2, 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");
@@ -35,6 +37,8 @@ IfcUtil::IfcBaseClass* execute_based_on_schema(Fn fn_2x3, Fn fn_4, Fn fn_4x1, Fn
return fn_4x2(shape, t);
} else if (schema_name_lower == "ifc4x3_rc1") {
return fn_4x3_rc1(shape, t);
} else if (schema_name_lower == "ifc4x3_rc2") {
return fn_4x3_rc2(shape, t);
} else {
throw IfcParse::IfcException("No geometry serialization available for " + schema_name);
}
@@ -47,7 +51,8 @@ IfcUtil::IfcBaseClass* IfcGeom::tesselate(const std::string& schema_name, const
IfcGeom::tesselate_Ifc4x1,
IfcGeom::tesselate_Ifc4x2,
IfcGeom::tesselate_Ifc4x3_rc1,
schema_name, shape, deflection);
IfcGeom::tesselate_Ifc4x3_rc2,
schema_name, shape, deflection);
}
IfcUtil::IfcBaseClass* IfcGeom::serialise(const std::string& schema_name, const TopoDS_Shape& shape, bool advanced) {
@@ -57,5 +62,6 @@ IfcUtil::IfcBaseClass* IfcGeom::serialise(const std::string& schema_name, const
IfcGeom::serialise_Ifc4x1,
IfcGeom::serialise_Ifc4x2,
IfcGeom::serialise_Ifc4x3_rc1,
schema_name, shape, advanced);
IfcGeom::serialise_Ifc4x3_rc2,
schema_name, shape, advanced);
}