From 34386ea27c80cf6e4a1589a891ba6a843b9ba4a6 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 11 May 2021 22:29:16 +0200 Subject: [PATCH] Hacky solution to disable schemas to speedup compilation --- cmake/CMakeLists.txt | 33 ++- .../IteratorImplementation.cpp | 24 ++ src/ifcgeom_schema_agnostic/Kernel.cpp | 150 +++++++++---- src/ifcgeom_schema_agnostic/Kernel.h | 12 + src/ifcgeom_schema_agnostic/Serialization.cpp | 135 ++++++++--- src/ifcparse/IfcHierarchyHelper.cpp | 24 ++ src/ifcparse/IfcHierarchyHelper.h | 212 +++++++++++------- src/ifcparse/IfcSIPrefix.cpp | 40 ++++ src/ifcparse/IfcSchema.cpp | 24 ++ src/ifcwrap/IfcGeomWrapper.i | 42 +++- src/ifcwrap/IfcPython.i | 26 +++ src/serializers/XmlSerializer.cpp | 26 +++ 12 files changed, 582 insertions(+), 166 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 0907cf9739..3db4c948c9 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -496,6 +496,10 @@ endfunction() set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1" "4x3_rc2") +foreach(s ${SCHEMA_VERSIONS}) + add_definitions(-DHAS_SCHEMA_${s}) +endforeach() + if(COMPILE_SCHEMA) # @todo, this appears to be untested at the moment @@ -573,8 +577,33 @@ if (BUILD_CONVERT) endif() # IfcParse -file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h) -file(GLOB IFCPARSE_CPP_FILES ../src/ifcparse/*.cpp) +file(GLOB IFCPARSE_H_FILES_ALL ../src/ifcparse/*.h) +file(GLOB IFCPARSE_CPP_FILES_ALL ../src/ifcparse/*.cpp) + +foreach(s ${IFCPARSE_H_FILES_ALL}) +if (NOT s MATCHES "[0-9]") +list(APPEND IFCPARSE_H_FILES "${s}") +endif() +endforeach() + +foreach(s ${IFCPARSE_CPP_FILES_ALL}) +if (NOT s MATCHES "[0-9]") +list(APPEND IFCPARSE_CPP_FILES "${s}") +endif() +endforeach() + +foreach(s ${SCHEMA_VERSIONS}) + list(APPEND IFCPARSE_H_FILES + ../src/ifcparse/Ifc${s}.h + ../src/ifcparse/Ifc${s}-definitions.h + ) + list(APPEND IFCPARSE_CPP_FILES + ../src/ifcparse/Ifc${s}.cpp + ../src/ifcparse/Ifc${s}-schema.cpp + ) +endforeach() + + set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES}) add_library(IfcParse ${IFCPARSE_FILES}) diff --git a/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp b/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp index f795271390..a664db0378 100644 --- a/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp +++ b/src/ifcgeom_schema_agnostic/IteratorImplementation.cpp @@ -12,32 +12,56 @@ template IteratorFactoryImplementation& iterator_implementations& iterator_implementations(); template IteratorFactoryImplementation& iterator_implementations(); +#ifdef HAS_SCHEMA_2x3 template extern void init_IteratorImplementation_Ifc2x3(IteratorFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4 template extern void init_IteratorImplementation_Ifc4(IteratorFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x1 template extern void init_IteratorImplementation_Ifc4x1(IteratorFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x2 template extern void init_IteratorImplementation_Ifc4x2(IteratorFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 template extern void init_IteratorImplementation_Ifc4x3_rc1(IteratorFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 template extern void init_IteratorImplementation_Ifc4x3_rc2(IteratorFactoryImplementation*); +#endif template IteratorFactoryImplementation::IteratorFactoryImplementation() { +#ifdef HAS_SCHEMA_2x3 init_IteratorImplementation_Ifc2x3(this); +#endif +#ifdef HAS_SCHEMA_4 init_IteratorImplementation_Ifc4(this); +#endif +#ifdef HAS_SCHEMA_4x1 init_IteratorImplementation_Ifc4x1(this); +#endif +#ifdef HAS_SCHEMA_4x2 init_IteratorImplementation_Ifc4x2(this); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 init_IteratorImplementation_Ifc4x3_rc1(this); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 init_IteratorImplementation_Ifc4x3_rc2(this); +#endif } template diff --git a/src/ifcgeom_schema_agnostic/Kernel.cpp b/src/ifcgeom_schema_agnostic/Kernel.cpp index 7d2bc30b4b..bf0cc32c51 100644 --- a/src/ifcgeom_schema_agnostic/Kernel.cpp +++ b/src/ifcgeom_schema_agnostic/Kernel.cpp @@ -48,20 +48,44 @@ IfcGeom::impl::KernelFactoryImplementation& IfcGeom::impl::kernel_implementation return impl; } +#ifdef HAS_SCHEMA_2x3 extern void init_KernelImplementation_Ifc2x3(IfcGeom::impl::KernelFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4 extern void init_KernelImplementation_Ifc4(IfcGeom::impl::KernelFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x1 extern void init_KernelImplementation_Ifc4x1(IfcGeom::impl::KernelFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x2 extern void init_KernelImplementation_Ifc4x2(IfcGeom::impl::KernelFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 extern void init_KernelImplementation_Ifc4x3_rc1(IfcGeom::impl::KernelFactoryImplementation*); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 extern void init_KernelImplementation_Ifc4x3_rc2(IfcGeom::impl::KernelFactoryImplementation*); +#endif IfcGeom::impl::KernelFactoryImplementation::KernelFactoryImplementation() { +#ifdef HAS_SCHEMA_2x3 init_KernelImplementation_Ifc2x3(this); +#endif +#ifdef HAS_SCHEMA_4 init_KernelImplementation_Ifc4(this); +#endif +#ifdef HAS_SCHEMA_4x1 init_KernelImplementation_Ifc4x1(this); +#endif +#ifdef HAS_SCHEMA_4x2 init_KernelImplementation_Ifc4x2(this); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 init_KernelImplementation_Ifc4x3_rc1(this); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 init_KernelImplementation_Ifc4x3_rc2(this); +#endif } void IfcGeom::impl::KernelFactoryImplementation::bind(const std::string& schema_name, IfcGeom::impl::kernel_fn fn) { @@ -132,6 +156,15 @@ IfcSchema::IfcObjectDefinition* get_decomposing_entity_impl(IfcSchema::IfcProduc } namespace { + +#ifdef HAS_SCHEMA_2x3 + IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc2x3::IfcRelDecomposes* decompose) { + return decompose->RelatingObject(); + } + CREATE_GET_DECOMPOSING_ENTITY(Ifc2x3); +#endif + +#ifdef HAS_SCHEMA_4 IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc4::IfcRelDecomposes* decompose) { Ifc4::IfcRelAggregates* aggr = decompose->as(); if (aggr != nullptr) { @@ -139,7 +172,10 @@ namespace { } return nullptr; } - + CREATE_GET_DECOMPOSING_ENTITY(Ifc4); +#endif + +#ifdef HAS_SCHEMA_4x1 IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc4x1::IfcRelDecomposes* decompose) { Ifc4x1::IfcRelAggregates* aggr = decompose->as(); if (aggr != nullptr) { @@ -147,7 +183,10 @@ namespace { } return nullptr; } - + CREATE_GET_DECOMPOSING_ENTITY(Ifc4x1); +#endif + +#ifdef HAS_SCHEMA_4x2 IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc4x2::IfcRelDecomposes* decompose) { Ifc4x2::IfcRelAggregates* aggr = decompose->as(); if (aggr != nullptr) { @@ -155,7 +194,10 @@ namespace { } return nullptr; } - + CREATE_GET_DECOMPOSING_ENTITY(Ifc4x2); +#endif + +#ifdef HAS_SCHEMA_4x3_rc1 IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc4x3_rc1::IfcRelDecomposes* decompose) { Ifc4x3_rc1::IfcRelAggregates* aggr = decompose->as(); if (aggr != nullptr) { @@ -163,7 +205,10 @@ namespace { } return nullptr; } + CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_rc1); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc4x3_rc2::IfcRelDecomposes* decompose) { Ifc4x3_rc2::IfcRelAggregates* aggr = decompose->as(); if (aggr != nullptr) { @@ -171,37 +216,47 @@ namespace { } return nullptr; } - - IfcUtil::IfcBaseEntity* get_RelatingObject(Ifc2x3::IfcRelDecomposes* decompose) { - return decompose->RelatingObject(); - } - - CREATE_GET_DECOMPOSING_ENTITY(Ifc2x3); - CREATE_GET_DECOMPOSING_ENTITY(Ifc4); - CREATE_GET_DECOMPOSING_ENTITY(Ifc4x1); - CREATE_GET_DECOMPOSING_ENTITY(Ifc4x2); - CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_rc1); CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_rc2); +#endif + } IfcUtil::IfcBaseEntity* IfcGeom::Kernel::get_decomposing_entity(IfcUtil::IfcBaseEntity* inst, bool include_openings) { +#ifdef HAS_SCHEMA_2x3 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->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->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 { - throw IfcParse::IfcException("Unexpected entity " + inst->declaration().name()); } +#endif +#ifdef HAS_SCHEMA_4 + if (inst->as()) { + return get_decomposing_entity_impl(inst->as(), include_openings); + } +#endif +#ifdef HAS_SCHEMA_4x1 + if (inst->as()) { + return get_decomposing_entity_impl(inst->as(), include_openings); + } +#endif +#ifdef HAS_SCHEMA_4x2 + if (inst->as()) { + return get_decomposing_entity_impl(inst->as(), include_openings); + } +#endif +#ifdef HAS_SCHEMA_4x3_rc1 + if (inst->as()) { + return get_decomposing_entity_impl(inst->as(), include_openings); + } +#endif +#ifdef HAS_SCHEMA_4x3_rc2 + if (inst->as()) { + return get_decomposing_entity_impl(inst->as(), include_openings); + } +#endif + if (inst->declaration().name() == "IfcProject") { + return nullptr; + } + + throw IfcParse::IfcException("Unexpected entity " + inst->declaration().name()); } namespace { @@ -223,21 +278,38 @@ namespace { } std::map IfcGeom::Kernel::get_layers(IfcUtil::IfcBaseEntity* inst) { +#ifdef HAS_SCHEMA_2x3 if (inst->as()) { 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 if (inst->as()) { - 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()); } +#endif +#ifdef HAS_SCHEMA_4 + if (inst->as()) { + return get_layers_impl(inst->as()); + } +#endif +#ifdef HAS_SCHEMA_4x1 + if (inst->as()) { + return get_layers_impl(inst->as()); + } +#endif +#ifdef HAS_SCHEMA_4x2 + if (inst->as()) { + return get_layers_impl(inst->as()); + } +#endif +#ifdef HAS_SCHEMA_4x3_rc1 + if (inst->as()) { + return get_layers_impl(inst->as()); + } +#endif +#ifdef HAS_SCHEMA_4x3_rc2 + if (inst->as()) { + return get_layers_impl(inst->as()); + } +#endif + + throw IfcParse::IfcException("Unexpected entity " + inst->declaration().name()); } bool IfcGeom::Kernel::is_manifold(const TopoDS_Shape& a) { diff --git a/src/ifcgeom_schema_agnostic/Kernel.h b/src/ifcgeom_schema_agnostic/Kernel.h index 76dd35ded9..3878755c61 100644 --- a/src/ifcgeom_schema_agnostic/Kernel.h +++ b/src/ifcgeom_schema_agnostic/Kernel.h @@ -5,12 +5,24 @@ #include "../ifcgeom/IfcGeomIteratorSettings.h" #include "../ifcgeom/IfcRepresentationShapeItem.h" +#ifdef HAS_SCHEMA_2x3 #include "../ifcparse/Ifc2x3.h" +#endif +#ifdef HAS_SCHEMA_4 #include "../ifcparse/Ifc4.h" +#endif +#ifdef HAS_SCHEMA_4x1 #include "../ifcparse/Ifc4x1.h" +#endif +#ifdef HAS_SCHEMA_4x2 #include "../ifcparse/Ifc4x2.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc1 #include "../ifcparse/Ifc4x3_rc1.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc2 #include "../ifcparse/Ifc4x3_rc2.h" +#endif #include diff --git a/src/ifcgeom_schema_agnostic/Serialization.cpp b/src/ifcgeom_schema_agnostic/Serialization.cpp index f14f710098..4c18055e07 100644 --- a/src/ifcgeom_schema_agnostic/Serialization.cpp +++ b/src/ifcgeom_schema_agnostic/Serialization.cpp @@ -3,23 +3,59 @@ #include namespace IfcGeom { +#ifdef HAS_SCHEMA_2x3 extern IfcUtil::IfcBaseClass* tesselate_Ifc2x3(const TopoDS_Shape& shape, double deflection); - extern IfcUtil::IfcBaseClass* tesselate_Ifc4(const TopoDS_Shape& shape, double deflection); - 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); +#endif + +#ifdef HAS_SCHEMA_4 + extern IfcUtil::IfcBaseClass* tesselate_Ifc4(const TopoDS_Shape& shape, double deflection); extern IfcUtil::IfcBaseClass* serialise_Ifc4(const TopoDS_Shape& shape, bool advanced); +#endif + +#ifdef HAS_SCHEMA_4x1 + extern IfcUtil::IfcBaseClass* tesselate_Ifc4x1(const TopoDS_Shape& shape, double deflection); extern IfcUtil::IfcBaseClass* serialise_Ifc4x1(const TopoDS_Shape& shape, bool advanced); +#endif + +#ifdef HAS_SCHEMA_4x2 + extern IfcUtil::IfcBaseClass* tesselate_Ifc4x2(const TopoDS_Shape& shape, double deflection); extern IfcUtil::IfcBaseClass* serialise_Ifc4x2(const TopoDS_Shape& shape, bool advanced); +#endif + +#ifdef HAS_SCHEMA_4x3_rc1 + extern IfcUtil::IfcBaseClass* tesselate_Ifc4x3_rc1(const TopoDS_Shape& shape, double deflection); extern IfcUtil::IfcBaseClass* serialise_Ifc4x3_rc1(const TopoDS_Shape& shape, bool advanced); +#endif + +#ifdef HAS_SCHEMA_4x3_rc2 + extern IfcUtil::IfcBaseClass* tesselate_Ifc4x3_rc2(const TopoDS_Shape& shape, double deflection); extern IfcUtil::IfcBaseClass* serialise_Ifc4x3_rc2(const TopoDS_Shape& shape, bool advanced); +#endif } template -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) { +IfcUtil::IfcBaseClass* execute_based_on_schema( +#ifdef HAS_SCHEMA_2x3 + Fn fn_2x3, +#endif +#ifdef HAS_SCHEMA_4 + Fn fn_4, +#endif +#ifdef HAS_SCHEMA_4x1 + Fn fn_4x1, +#endif +#ifdef HAS_SCHEMA_4x2 + Fn fn_4x2, +#endif +#ifdef HAS_SCHEMA_4x3_rc1 + Fn fn_4x3_rc1, +#endif +#ifdef HAS_SCHEMA_4x3_rc2 + Fn fn_4x3_rc2, +#endif + 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"); @@ -27,41 +63,82 @@ IfcUtil::IfcBaseClass* execute_based_on_schema(Fn fn_2x3, Fn fn_4, Fn fn_4x1, Fn const std::string schema_name_lower = boost::to_lower_copy(schema_name); +#ifdef HAS_SCHEMA_2x3 if (schema_name_lower == "ifc2x3") { return fn_2x3(shape, t); - } else if (schema_name_lower == "ifc4") { - return fn_4(shape, t); - } else if (schema_name_lower == "ifc4x1") { - return fn_4x1(shape, t); - } else if (schema_name_lower == "ifc4x2") { - 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); } +#endif +#ifdef HAS_SCHEMA_4 + if (schema_name_lower == "ifc4") { + return fn_4(shape, t); + } +#endif +#ifdef HAS_SCHEMA_4x1 + if (schema_name_lower == "ifc4x1") { + return fn_4x1(shape, t); + } +#endif +#ifdef HAS_SCHEMA_4x2 + if (schema_name_lower == "ifc4x2") { + return fn_4x2(shape, t); + } +#endif +#ifdef HAS_SCHEMA_4x3_rc1 + if (schema_name_lower == "ifc4x3_rc1") { + return fn_4x3_rc1(shape, t); + } +#endif +#ifdef HAS_SCHEMA_4x3_rx2 + if (schema_name_lower == "ifc4x3_rc2") { + return fn_4x3_rc2(shape, t); + } +#endif + + throw IfcParse::IfcException("No geometry serialization available for " + schema_name); } IfcUtil::IfcBaseClass* IfcGeom::tesselate(const std::string& schema_name, const TopoDS_Shape& shape, double deflection) { return execute_based_on_schema( - IfcGeom::tesselate_Ifc2x3, - IfcGeom::tesselate_Ifc4, - IfcGeom::tesselate_Ifc4x1, - IfcGeom::tesselate_Ifc4x2, - IfcGeom::tesselate_Ifc4x3_rc1, +#ifdef HAS_SCHEMA_2x3 + IfcGeom::tesselate_Ifc2x3, +#endif +#ifdef HAS_SCHEMA_4 + IfcGeom::tesselate_Ifc4, +#endif +#ifdef HAS_SCHEMA_4x1 + IfcGeom::tesselate_Ifc4x1, +#endif +#ifdef HAS_SCHEMA_4x2 + IfcGeom::tesselate_Ifc4x2, +#endif +#ifdef HAS_SCHEMA_4x3_rc1 + IfcGeom::tesselate_Ifc4x3_rc1, +#endif +#ifdef HAS_SCHEMA_4x3_rc2 IfcGeom::tesselate_Ifc4x3_rc2, +#endif schema_name, shape, deflection); } IfcUtil::IfcBaseClass* IfcGeom::serialise(const std::string& schema_name, const TopoDS_Shape& shape, bool advanced) { return execute_based_on_schema( - IfcGeom::serialise_Ifc2x3, - IfcGeom::serialise_Ifc4, - IfcGeom::serialise_Ifc4x1, - IfcGeom::serialise_Ifc4x2, - IfcGeom::serialise_Ifc4x3_rc1, +#ifdef HAS_SCHEMA_2x3 + IfcGeom::serialise_Ifc2x3, +#endif +#ifdef HAS_SCHEMA_4 + IfcGeom::serialise_Ifc4, +#endif +#ifdef HAS_SCHEMA_4x1 + IfcGeom::serialise_Ifc4x1, +#endif +#ifdef HAS_SCHEMA_4x2 + IfcGeom::serialise_Ifc4x2, +#endif +#ifdef HAS_SCHEMA_4x3_rc1 + IfcGeom::serialise_Ifc4x3_rc1, +#endif +#ifdef HAS_SCHEMA_4x3_rc2 IfcGeom::serialise_Ifc4x3_rc2, +#endif schema_name, shape, advanced); } \ No newline at end of file diff --git a/src/ifcparse/IfcHierarchyHelper.cpp b/src/ifcparse/IfcHierarchyHelper.cpp index 54a5eabf2f..4866f3f78e 100644 --- a/src/ifcparse/IfcHierarchyHelper.cpp +++ b/src/ifcparse/IfcHierarchyHelper.cpp @@ -454,41 +454,53 @@ void IfcHierarchyHelper::setSurfaceColour(typename Schema::IfcProductRep } } +#ifdef HAS_SCHEMA_2x3 Ifc2x3::IfcStyledItem* create_styled_item(Ifc2x3::IfcRepresentationItem* item, Ifc2x3::IfcPresentationStyleAssignment* style_assignment) { Ifc2x3::IfcPresentationStyleAssignment::list::ptr style_assignments(new Ifc2x3::IfcPresentationStyleAssignment::list); style_assignments->push(style_assignment); return new Ifc2x3::IfcStyledItem(item, style_assignments, boost::none); } +#endif +#ifdef HAS_SCHEMA_4 Ifc4::IfcStyledItem* create_styled_item(Ifc4::IfcRepresentationItem* item, Ifc4::IfcPresentationStyleAssignment* style_assignment) { IfcEntityList::ptr style_assignments(new IfcEntityList); style_assignments->push(style_assignment); return new Ifc4::IfcStyledItem(item, style_assignments, boost::none); } +#endif +#ifdef HAS_SCHEMA_4x1 Ifc4x1::IfcStyledItem* create_styled_item(Ifc4x1::IfcRepresentationItem* item, Ifc4x1::IfcPresentationStyleAssignment* style_assignment) { IfcEntityList::ptr style_assignments(new IfcEntityList); style_assignments->push(style_assignment); return new Ifc4x1::IfcStyledItem(item, style_assignments, boost::none); } +#endif +#ifdef HAS_SCHEMA_4x2 Ifc4x2::IfcStyledItem* create_styled_item(Ifc4x2::IfcRepresentationItem* item, Ifc4x2::IfcPresentationStyleAssignment* style_assignment) { IfcEntityList::ptr style_assignments(new IfcEntityList); style_assignments->push(style_assignment); return new Ifc4x2::IfcStyledItem(item, style_assignments, boost::none); } +#endif +#ifdef HAS_SCHEMA_4x3_rc1 Ifc4x3_rc1::IfcStyledItem* create_styled_item(Ifc4x3_rc1::IfcRepresentationItem* item, Ifc4x3_rc1::IfcPresentationStyleAssignment* style_assignment) { IfcEntityList::ptr style_assignments(new IfcEntityList); style_assignments->push(style_assignment); return new Ifc4x3_rc1::IfcStyledItem(item, style_assignments, boost::none); } +#endif +#ifdef HAS_SCHEMA_4x3_rc2 Ifc4x3_rc2::IfcStyledItem* create_styled_item(Ifc4x3_rc2::IfcRepresentationItem* item, Ifc4x3_rc2::IfcPresentationStyleAssignment* style_assignment) { IfcEntityList::ptr style_assignments(new IfcEntityList); style_assignments->push(style_assignment); return new Ifc4x3_rc2::IfcStyledItem(item, style_assignments, boost::none); } +#endif template void IfcHierarchyHelper::setSurfaceColour(typename Schema::IfcRepresentation* rep, @@ -582,9 +594,21 @@ typename Schema::IfcGeometricRepresentationContext* IfcHierarchyHelper:: } } +#ifdef HAS_SCHEMA_2x3 template IFC_PARSE_API class IfcHierarchyHelper; +#endif +#ifdef HAS_SCHEMA_4 template IFC_PARSE_API class IfcHierarchyHelper; +#endif +#ifdef HAS_SCHEMA_4x1 template IFC_PARSE_API class IfcHierarchyHelper; +#endif +#ifdef HAS_SCHEMA_4x2 template IFC_PARSE_API class IfcHierarchyHelper; +#endif +#ifdef HAS_SCHEMA_4x3_rc1 template IFC_PARSE_API class IfcHierarchyHelper; +#endif +#ifdef HAS_SCHEMA_4x3_rc2 template IFC_PARSE_API class IfcHierarchyHelper; +#endif diff --git a/src/ifcparse/IfcHierarchyHelper.h b/src/ifcparse/IfcHierarchyHelper.h index 0ff2514274..4d459820e0 100644 --- a/src/ifcparse/IfcHierarchyHelper.h +++ b/src/ifcparse/IfcHierarchyHelper.h @@ -32,12 +32,24 @@ #include "ifc_parse_api.h" +#ifdef HAS_SCHEMA_2x3 #include "../ifcparse/Ifc2x3.h" +#endif +#ifdef HAS_SCHEMA_4 #include "../ifcparse/Ifc4.h" +#endif +#ifdef HAS_SCHEMA_4x1 #include "../ifcparse/Ifc4x1.h" +#endif +#ifdef HAS_SCHEMA_4x2 #include "../ifcparse/Ifc4x2.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc1 #include "../ifcparse/Ifc4x3_rc1.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc2 #include "../ifcparse/Ifc4x3_rc2.h" +#endif #include "../ifcparse/IfcFile.h" @@ -45,78 +57,150 @@ #include "../ifcparse/IfcGlobalId.h" namespace { - IfcUtil::IfcBaseClass* get_parent_of_relation(IfcUtil::IfcBaseClass* t) { - return *t->data().getArgument( - t->declaration().as_entity()->attribute_index("RelatingObject") - ); - } - +#ifdef HAS_SCHEMA_2x3 Ifc2x3::IfcObjectDefinition* get_parent_of_relation(Ifc2x3::IfcRelContainedInSpatialStructure* t) { return t->RelatingStructure(); } - Ifc4::IfcObjectDefinition* get_parent_of_relation(Ifc4::IfcRelContainedInSpatialStructure* t) { - return t->RelatingStructure(); - } - - Ifc4x1::IfcObjectDefinition* get_parent_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure* t) { - return t->RelatingStructure(); - } - - Ifc4x2::IfcObjectDefinition* get_parent_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure* t) { - return t->RelatingStructure(); - } - - Ifc4x3_rc1::IfcObjectDefinition* get_parent_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure* t) { - return t->RelatingStructure(); - } - - IfcEntityList::ptr get_children_of_relation(IfcUtil::IfcBaseClass* t) { - return *t->data().getArgument( - t->declaration().as_entity()->attribute_index("RelatedElements") - ); - } - IfcEntityList::ptr get_children_of_relation(Ifc2x3::IfcRelContainedInSpatialStructure* t) { return t->RelatedElements()->generalize(); } - IfcEntityList::ptr get_children_of_relation(Ifc4::IfcRelContainedInSpatialStructure* t) { - return t->RelatedElements()->generalize(); - } - - IfcEntityList::ptr get_children_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure* t) { - return t->RelatedElements()->generalize(); - } - - IfcEntityList::ptr get_children_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure* t) { - return t->RelatedElements()->generalize(); - } - - IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure* t) { - return t->RelatedElements()->generalize(); - } - IfcEntityList::ptr get_children_of_relation(Ifc2x3::IfcRelAggregates* t) { return t->RelatedObjects()->generalize(); } + void set_children_of_relation(Ifc2x3::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { + t->setRelatedElements(cs->as()); + } + + void set_children_of_relation(Ifc2x3::IfcRelAggregates* t, IfcEntityList::ptr& cs) { + t->setRelatedObjects(cs->as()); + } +#endif + +#ifdef HAS_SCHEMA_4 + Ifc4::IfcObjectDefinition* get_parent_of_relation(Ifc4::IfcRelContainedInSpatialStructure* t) { + return t->RelatingStructure(); + } + + IfcEntityList::ptr get_children_of_relation(Ifc4::IfcRelContainedInSpatialStructure* t) { + return t->RelatedElements()->generalize(); + } + IfcEntityList::ptr get_children_of_relation(Ifc4::IfcRelAggregates* t) { return t->RelatedObjects()->generalize(); } + void set_children_of_relation(Ifc4::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { + t->setRelatedElements(cs->as()); + } + + void set_children_of_relation(Ifc4::IfcRelAggregates* t, IfcEntityList::ptr& cs) { + t->setRelatedObjects(cs->as()); + } +#endif + +#ifdef HAS_SCHEMA_4x1 + Ifc4x1::IfcObjectDefinition* get_parent_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure* t) { + return t->RelatingStructure(); + } + + IfcEntityList::ptr get_children_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure* t) { + return t->RelatedElements()->generalize(); + } + IfcEntityList::ptr get_children_of_relation(Ifc4x1::IfcRelAggregates* t) { return t->RelatedObjects()->generalize(); } + void set_children_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { + t->setRelatedElements(cs->as()); + } + + void set_children_of_relation(Ifc4x1::IfcRelAggregates* t, IfcEntityList::ptr& cs) { + t->setRelatedObjects(cs->as()); + } +#endif + +#ifdef HAS_SCHEMA_4x2 + Ifc4x2::IfcObjectDefinition* get_parent_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure* t) { + return t->RelatingStructure(); + } + + IfcEntityList::ptr get_children_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure* t) { + return t->RelatedElements()->generalize(); + } + IfcEntityList::ptr get_children_of_relation(Ifc4x2::IfcRelAggregates* t) { return t->RelatedObjects()->generalize(); } + void set_children_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { + t->setRelatedElements(cs->as()); + } + + void set_children_of_relation(Ifc4x2::IfcRelAggregates* t, IfcEntityList::ptr& cs) { + t->setRelatedObjects(cs->as()); + } +#endif + +#ifdef HAS_SCHEMA_4x3_rc1 + Ifc4x3_rc1::IfcObjectDefinition* get_parent_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure* t) { + return t->RelatingStructure(); + } + + IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure* t) { + return t->RelatedElements()->generalize(); + } + IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc1::IfcRelAggregates* t) { return t->RelatedObjects()->generalize(); } + void set_children_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { + t->setRelatedElements(cs->as()); + } + + void set_children_of_relation(Ifc4x3_rc1::IfcRelAggregates* t, IfcEntityList::ptr& cs) { + t->setRelatedObjects(cs->as()); + } +#endif + +#ifdef HAS_SCHEMA_4x3_rc2 + Ifc4x3_rc2::IfcObjectDefinition* get_parent_of_relation(Ifc4x3_rc2::IfcRelContainedInSpatialStructure* t) { + return t->RelatingStructure(); + } + + IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc2::IfcRelContainedInSpatialStructure* t) { + return t->RelatedElements()->generalize(); + } + + IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc2::IfcRelAggregates* t) { + return t->RelatedObjects()->generalize(); + } + + void set_children_of_relation(Ifc4x3_rc2::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { + t->setRelatedElements(cs->as()); + } + + void set_children_of_relation(Ifc4x3_rc2::IfcRelAggregates* t, IfcEntityList::ptr& cs) { + t->setRelatedObjects(cs->as()); + } +#endif + + IfcUtil::IfcBaseClass* get_parent_of_relation(IfcUtil::IfcBaseClass* t) { + return *t->data().getArgument( + t->declaration().as_entity()->attribute_index("RelatingObject") + ); + } + + IfcEntityList::ptr get_children_of_relation(IfcUtil::IfcBaseClass* t) { + return *t->data().getArgument( + t->declaration().as_entity()->attribute_index("RelatedElements") + ); + } + void set_children_of_relation(IfcUtil::IfcBaseClass* t, IfcEntityList::ptr& cs) { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument; attr->set(cs); @@ -125,46 +209,6 @@ namespace { attr ); } - - void set_children_of_relation(Ifc2x3::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { - t->setRelatedElements(cs->as()); - } - - void set_children_of_relation(Ifc4::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { - t->setRelatedElements(cs->as()); - } - - void set_children_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { - t->setRelatedElements(cs->as()); - } - - void set_children_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { - t->setRelatedElements(cs->as()); - } - - void set_children_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) { - t->setRelatedElements(cs->as()); - } - - void set_children_of_relation(Ifc2x3::IfcRelAggregates* t, IfcEntityList::ptr& cs) { - t->setRelatedObjects(cs->as()); - } - - void set_children_of_relation(Ifc4::IfcRelAggregates* t, IfcEntityList::ptr& cs) { - t->setRelatedObjects(cs->as()); - } - - void set_children_of_relation(Ifc4x1::IfcRelAggregates* t, IfcEntityList::ptr& cs) { - t->setRelatedObjects(cs->as()); - } - - void set_children_of_relation(Ifc4x2::IfcRelAggregates* t, IfcEntityList::ptr& cs) { - t->setRelatedObjects(cs->as()); - } - - void set_children_of_relation(Ifc4x3_rc1::IfcRelAggregates* t, IfcEntityList::ptr& cs) { - t->setRelatedObjects(cs->as()); - } } template class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile { diff --git a/src/ifcparse/IfcSIPrefix.cpp b/src/ifcparse/IfcSIPrefix.cpp index 1d289ffb61..f67e30052c 100644 --- a/src/ifcparse/IfcSIPrefix.cpp +++ b/src/ifcparse/IfcSIPrefix.cpp @@ -19,12 +19,24 @@ #include "IfcSIPrefix.h" +#ifdef HAS_SCHEMA_2x3 #include "../ifcparse/Ifc2x3.h" +#endif +#ifdef HAS_SCHEMA_4 #include "../ifcparse/Ifc4.h" +#endif +#ifdef HAS_SCHEMA_4x1 #include "../ifcparse/Ifc4x1.h" +#endif +#ifdef HAS_SCHEMA_4x2 #include "../ifcparse/Ifc4x2.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc1 #include "../ifcparse/Ifc4x3_rc1.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc2 #include "../ifcparse/Ifc4x3_rc2.h" +#endif double IfcParse::IfcSIPrefixToValue(const std::string& v) { if ( v == "EXA" ) return 1.e18; @@ -75,17 +87,45 @@ double IfcParse::get_SI_equivalent(typename Schema::IfcNamedUnit* named_unit) { } #if defined(_MSC_VER) && _MSC_VER < 1900 + +#ifdef HAS_SCHEMA_2x3 template double IfcParse::get_SI_equivalent(Ifc2x3::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4 template double IfcParse::get_SI_equivalent(Ifc4::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x1 template double IfcParse::get_SI_equivalent(Ifc4x1::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x2 template double IfcParse::get_SI_equivalent(Ifc4x2::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 template double IfcParse::get_SI_equivalent(Ifc4x3_rc1::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 template double IfcParse::get_SI_equivalent(Ifc4x3_rc2::IfcNamedUnit* named_unit); +#endif + #else + +#ifdef HAS_SCHEMA_2x3 template double IfcParse::get_SI_equivalent(typename Ifc2x3::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4 template double IfcParse::get_SI_equivalent(typename Ifc4::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x1 template double IfcParse::get_SI_equivalent(typename Ifc4x1::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x2 template double IfcParse::get_SI_equivalent(typename Ifc4x2::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 template double IfcParse::get_SI_equivalent(typename Ifc4x3_rc1::IfcNamedUnit* named_unit); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 template double IfcParse::get_SI_equivalent(typename Ifc4x3_rc2::IfcNamedUnit* named_unit); #endif + +#endif diff --git a/src/ifcparse/IfcSchema.cpp b/src/ifcparse/IfcSchema.cpp index db3bdb5d7e..c03ed1cd6d 100644 --- a/src/ifcparse/IfcSchema.cpp +++ b/src/ifcparse/IfcSchema.cpp @@ -76,21 +76,45 @@ void IfcParse::register_schema(schema_definition* s) { } +#ifdef HAS_SCHEMA_2x3 #include "../ifcparse/Ifc2x3.h" +#endif +#ifdef HAS_SCHEMA_4 #include "../ifcparse/Ifc4.h" +#endif +#ifdef HAS_SCHEMA_4x1 #include "../ifcparse/Ifc4x1.h" +#endif +#ifdef HAS_SCHEMA_4x2 #include "../ifcparse/Ifc4x2.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc1 #include "../ifcparse/Ifc4x3_rc1.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc2 #include "../ifcparse/Ifc4x3_rc2.h" +#endif const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& name) { // TODO: initialize automatically somehow +#ifdef HAS_SCHEMA_2x3 Ifc2x3::get_schema(); +#endif +#ifdef HAS_SCHEMA_4 Ifc4::get_schema(); +#endif +#ifdef HAS_SCHEMA_4x1 Ifc4x1::get_schema(); +#endif +#ifdef HAS_SCHEMA_4x2 Ifc4x2::get_schema(); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 Ifc4x3_rc1::get_schema(); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 Ifc4x3_rc2::get_schema(); +#endif std::map::const_iterator it = schemas.find(boost::to_upper_copy(name)); if (it == schemas.end()) { diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 73564da30c..366c9f5fee 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -472,21 +472,39 @@ struct ShapeRTTI : public boost::static_visitor %inline %{ static boost::variant*, 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(settings, instance, representation); - } else if (schema_name == "IFC4") { - return helper_fn_create_shape(settings, instance, representation); - } else if (schema_name == "IFC4X1") { - return helper_fn_create_shape(settings, instance, representation); - } else if (schema_name == "IFC4X2") { - 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); } + #endif + #ifdef HAS_SCHEMA_4 + if (schema_name == "IFC4") { + return helper_fn_create_shape(settings, instance, representation); + } + #endif + #ifdef HAS_SCHEMA_4x1 + if (schema_name == "IFC4X1") { + return helper_fn_create_shape(settings, instance, representation); + } + #endif + #ifdef HAS_SCHEMA_4x2 + if (schema_name == "IFC4X2") { + return helper_fn_create_shape(settings, instance, representation); + } + #endif + #ifdef HAS_SCHEMA_4x3_rc1 + if (schema_name == "IFC4X3_RC1") { + return helper_fn_create_shape(settings, instance, representation); + } + #endif + #ifdef HAS_SCHEMA_4x3_rc2 + if (schema_name == "IFC4X3_RC2") { + return helper_fn_create_shape(settings, instance, representation); + } + #endif + + throw IfcParse::IfcException("No geometry support for " + schema_name); } %} diff --git a/src/ifcwrap/IfcPython.i b/src/ifcwrap/IfcPython.i index 4d0158bff8..3593d5d06f 100644 --- a/src/ifcwrap/IfcPython.i +++ b/src/ifcwrap/IfcPython.i @@ -78,12 +78,25 @@ #include "../ifcgeom_schema_agnostic/Serialization.h" #include "../ifcgeom/IfcGeomTree.h" +#ifdef HAS_SCHEMA_2x3 #include "../ifcparse/Ifc2x3.h" +#endif +#ifdef HAS_SCHEMA_4 #include "../ifcparse/Ifc4.h" +#endif +#ifdef HAS_SCHEMA_4x1 #include "../ifcparse/Ifc4x1.h" +#endif +#ifdef HAS_SCHEMA_4x2 #include "../ifcparse/Ifc4x2.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc1 #include "../ifcparse/Ifc4x3_rc1.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc2 #include "../ifcparse/Ifc4x3_rc2.h" +#endif + #include "../ifcparse/IfcBaseClass.h" #include "../ifcparse/IfcFile.h" #include "../ifcparse/IfcSchema.h" @@ -106,12 +119,25 @@ #include "../ifcgeom_schema_agnostic/Serialization.h" #include "../ifcgeom/IfcGeomTree.h" +#ifdef HAS_SCHEMA_2x3 #include "../ifcparse/Ifc2x3.h" +#endif +#ifdef HAS_SCHEMA_4 #include "../ifcparse/Ifc4.h" +#endif +#ifdef HAS_SCHEMA_4x1 #include "../ifcparse/Ifc4x1.h" +#endif +#ifdef HAS_SCHEMA_4x2 #include "../ifcparse/Ifc4x2.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc1 #include "../ifcparse/Ifc4x3_rc1.h" +#endif +#ifdef HAS_SCHEMA_4x3_rc2 #include "../ifcparse/Ifc4x3_rc2.h" +#endif + #include "../ifcparse/IfcBaseClass.h" #include "../ifcparse/IfcFile.h" #include "../ifcparse/IfcSchema.h" diff --git a/src/serializers/XmlSerializer.cpp b/src/serializers/XmlSerializer.cpp index bf1f6d9b52..dea89823f5 100644 --- a/src/serializers/XmlSerializer.cpp +++ b/src/serializers/XmlSerializer.cpp @@ -1,17 +1,43 @@ #include "XmlSerializer.h" +#ifdef HAS_SCHEMA_2x3 extern void init_XmlSerializerIfc2x3(XmlSerializerFactory::Factory*); +#endif +#ifdef HAS_SCHEMA_4 extern void init_XmlSerializerIfc4(XmlSerializerFactory::Factory*); +#endif +#ifdef HAS_SCHEMA_4x1 extern void init_XmlSerializerIfc4x1(XmlSerializerFactory::Factory*); +#endif +#ifdef HAS_SCHEMA_4x2 extern void init_XmlSerializerIfc4x2(XmlSerializerFactory::Factory*); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 extern void init_XmlSerializerIfc4x3_rc1(XmlSerializerFactory::Factory*); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 +extern void init_XmlSerializerIfc4x3_rc2(XmlSerializerFactory::Factory*); +#endif XmlSerializerFactory::Factory::Factory() { +#ifdef HAS_SCHEMA_2x3 init_XmlSerializerIfc2x3(this); +#endif +#ifdef HAS_SCHEMA_4 init_XmlSerializerIfc4(this); +#endif +#ifdef HAS_SCHEMA_4x1 init_XmlSerializerIfc4x1(this); +#endif +#ifdef HAS_SCHEMA_4x2 init_XmlSerializerIfc4x2(this); +#endif +#ifdef HAS_SCHEMA_4x3_rc1 init_XmlSerializerIfc4x3_rc1(this); +#endif +#ifdef HAS_SCHEMA_4x3_rc2 + init_XmlSerializerIfc4x3_rc2(this); +#endif } void XmlSerializerFactory::Factory::bind(const std::string& schema_name, fn f) {