diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 70d85bb840..67aa5a9217 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -473,7 +473,7 @@ function(files_for_ifc_version IFC_VERSION RESULT_NAME) ) endfunction() -set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1") +set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1", "4x3_rc2") if(COMPILE_SCHEMA) # @todo, this appears to be untested at the moment diff --git a/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp b/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp index 42d3d8899f..f795271390 100644 --- a/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp +++ b/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp @@ -27,6 +27,9 @@ extern void init_IteratorImplementation_Ifc4x2(IteratorFactoryImplementation extern void init_IteratorImplementation_Ifc4x3_rc1(IteratorFactoryImplementation*); +template +extern void init_IteratorImplementation_Ifc4x3_rc2(IteratorFactoryImplementation*); + template IteratorFactoryImplementation::IteratorFactoryImplementation() { init_IteratorImplementation_Ifc2x3(this); @@ -34,6 +37,7 @@ IteratorFactoryImplementation::IteratorFactoryImplementation() { init_IteratorImplementation_Ifc4x1(this); init_IteratorImplementation_Ifc4x2(this); init_IteratorImplementation_Ifc4x3_rc1(this); + init_IteratorImplementation_Ifc4x3_rc2(this); } template diff --git a/src/ifcgeom_schema_agnostic/Kernel.cpp b/src/ifcgeom_schema_agnostic/Kernel.cpp index b5e3e6c8b5..7d2bc30b4b 100644 --- a/src/ifcgeom_schema_agnostic/Kernel.cpp +++ b/src/ifcgeom_schema_agnostic/Kernel.cpp @@ -53,6 +53,7 @@ extern void init_KernelImplementation_Ifc4(IfcGeom::impl::KernelFactoryImplement extern void init_KernelImplementation_Ifc4x1(IfcGeom::impl::KernelFactoryImplementation*); extern void init_KernelImplementation_Ifc4x2(IfcGeom::impl::KernelFactoryImplementation*); extern void init_KernelImplementation_Ifc4x3_rc1(IfcGeom::impl::KernelFactoryImplementation*); +extern void init_KernelImplementation_Ifc4x3_rc2(IfcGeom::impl::KernelFactoryImplementation*); IfcGeom::impl::KernelFactoryImplementation::KernelFactoryImplementation() { init_KernelImplementation_Ifc2x3(this); @@ -60,6 +61,7 @@ IfcGeom::impl::KernelFactoryImplementation::KernelFactoryImplementation() { init_KernelImplementation_Ifc4x1(this); init_KernelImplementation_Ifc4x2(this); init_KernelImplementation_Ifc4x3_rc1(this); + init_KernelImplementation_Ifc4x3_rc2(this); } void IfcGeom::impl::KernelFactoryImplementation::bind(const std::string& schema_name, IfcGeom::impl::kernel_fn fn) { @@ -162,6 +164,14 @@ namespace { return nullptr; } + IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc4x3_rc2::IfcRelDecomposes* decompose) { + Ifc4x3_rc2::IfcRelAggregates* aggr = decompose->as(); + if (aggr != nullptr) { + return aggr->RelatingObject(); + } + return nullptr; + } + IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc2x3::IfcRelDecomposes* decompose) { return decompose->RelatingObject(); } @@ -171,6 +181,7 @@ namespace { CREATE_GET_DECOMPOSING_ENTITY(Ifc4x1); CREATE_GET_DECOMPOSING_ENTITY(Ifc4x2); CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_rc1); + CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_rc2); } IfcUtil::IfcBaseEntity* IfcGeom::Kernel::get_decomposing_entity(IfcUtil::IfcBaseEntity* inst, bool include_openings) { @@ -184,6 +195,8 @@ IfcUtil::IfcBaseEntity* IfcGeom::Kernel::get_decomposing_entity(IfcUtil::IfcBase return get_decomposing_entity_impl(inst->as(), include_openings); } else if (inst->as()) { return get_decomposing_entity_impl(inst->as(), include_openings); + } else if (inst->as()) { + return get_decomposing_entity_impl(inst->as(), include_openings); } else if (inst->declaration().name() == "IfcProject") { return nullptr; } else { @@ -220,6 +233,8 @@ std::map IfcGeom::Kernel::get_layers(IfcUt return get_layers_impl(inst->as()); } else if (inst->as()) { return get_layers_impl(inst->as()); + } else if (inst->as()) { + return get_layers_impl(inst->as()); } else { throw IfcParse::IfcException("Unexpected entity " + inst->declaration().name()); } diff --git a/src/ifcgeom_schema_agnostic/Kernel.h b/src/ifcgeom_schema_agnostic/Kernel.h index 29f59a6f23..76dd35ded9 100644 --- a/src/ifcgeom_schema_agnostic/Kernel.h +++ b/src/ifcgeom_schema_agnostic/Kernel.h @@ -10,6 +10,7 @@ #include "../ifcparse/Ifc4x1.h" #include "../ifcparse/Ifc4x2.h" #include "../ifcparse/Ifc4x3_rc1.h" +#include "../ifcparse/Ifc4x3_rc2.h" #include diff --git a/src/ifcgeom_schema_agnostic/Serialization.cpp b/src/ifcgeom_schema_agnostic/Serialization.cpp index 077d3ddfdb..f14f710098 100644 --- a/src/ifcgeom_schema_agnostic/Serialization.cpp +++ b/src/ifcgeom_schema_agnostic/Serialization.cpp @@ -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 -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); } \ No newline at end of file diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 957d37a3dd..f41d0c394d 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -482,6 +482,8 @@ struct ShapeRTTI : public boost::static_visitor return helper_fn_create_shape(settings, instance, representation); } else if (schema_name == "IFC4X3_RC1") { return helper_fn_create_shape(settings, instance, representation); + } else if (schema_name == "IFC4X3_RC2") { + return helper_fn_create_shape(settings, instance, representation); } else { throw IfcParse::IfcException("No geometry support for " + schema_name); } diff --git a/src/ifcwrap/IfcPython.i b/src/ifcwrap/IfcPython.i index 11bd6f3f3d..4d0158bff8 100644 --- a/src/ifcwrap/IfcPython.i +++ b/src/ifcwrap/IfcPython.i @@ -83,6 +83,7 @@ #include "../ifcparse/Ifc4x1.h" #include "../ifcparse/Ifc4x2.h" #include "../ifcparse/Ifc4x3_rc1.h" + #include "../ifcparse/Ifc4x3_rc2.h" #include "../ifcparse/IfcBaseClass.h" #include "../ifcparse/IfcFile.h" #include "../ifcparse/IfcSchema.h" @@ -110,6 +111,7 @@ #include "../ifcparse/Ifc4x1.h" #include "../ifcparse/Ifc4x2.h" #include "../ifcparse/Ifc4x3_rc1.h" + #include "../ifcparse/Ifc4x3_rc2.h" #include "../ifcparse/IfcBaseClass.h" #include "../ifcparse/IfcFile.h" #include "../ifcparse/IfcSchema.h"