mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 22:16:41 +00:00
Hacky solution to disable schemas to speedup compilation
This commit is contained in:
@@ -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<Ifc4::IfcRelAggregates>();
|
||||
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<Ifc4x1::IfcRelAggregates>();
|
||||
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<Ifc4x2::IfcRelAggregates>();
|
||||
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<Ifc4x3_rc1::IfcRelAggregates>();
|
||||
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<Ifc4x3_rc2::IfcRelAggregates>();
|
||||
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<Ifc2x3::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc2x3::IfcProduct>(), include_openings);
|
||||
} else if (inst->as<Ifc4::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4::IfcProduct>(), include_openings);
|
||||
} else if (inst->as<Ifc4x1::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x1::IfcProduct>(), include_openings);
|
||||
} else if (inst->as<Ifc4x2::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x2::IfcProduct>(), include_openings);
|
||||
} else if (inst->as<Ifc4x3_rc1::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x3_rc1::IfcProduct>(), include_openings);
|
||||
} else if (inst->as<Ifc4x3_rc2::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x3_rc2::IfcProduct>(), 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<Ifc4::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4::IfcProduct>(), include_openings);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x1
|
||||
if (inst->as<Ifc4x1::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x1::IfcProduct>(), include_openings);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x2
|
||||
if (inst->as<Ifc4x2::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x2::IfcProduct>(), include_openings);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_rc1
|
||||
if (inst->as<Ifc4x3_rc1::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x3_rc1::IfcProduct>(), include_openings);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_rc2
|
||||
if (inst->as<Ifc4x3_rc2::IfcProduct>()) {
|
||||
return get_decomposing_entity_impl(inst->as<Ifc4x3_rc2::IfcProduct>(), 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<std::string, IfcUtil::IfcBaseEntity*> IfcGeom::Kernel::get_layers(IfcUtil::IfcBaseEntity* inst) {
|
||||
#ifdef HAS_SCHEMA_2x3
|
||||
if (inst->as<Ifc2x3::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc2x3>(inst->as<Ifc2x3::IfcProduct>());
|
||||
} else if (inst->as<Ifc4::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4>(inst->as<Ifc4::IfcProduct>());
|
||||
} else if (inst->as<Ifc4x1::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x1>(inst->as<Ifc4x1::IfcProduct>());
|
||||
} else if (inst->as<Ifc4x2::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x2>(inst->as<Ifc4x2::IfcProduct>());
|
||||
} else if (inst->as<Ifc4x3_rc1::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x3_rc1>(inst->as<Ifc4x3_rc1::IfcProduct>());
|
||||
} else if (inst->as<Ifc4x3_rc2::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x3_rc2>(inst->as<Ifc4x3_rc2::IfcProduct>());
|
||||
} else {
|
||||
throw IfcParse::IfcException("Unexpected entity " + inst->declaration().name());
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4
|
||||
if (inst->as<Ifc4::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4>(inst->as<Ifc4::IfcProduct>());
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x1
|
||||
if (inst->as<Ifc4x1::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x1>(inst->as<Ifc4x1::IfcProduct>());
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x2
|
||||
if (inst->as<Ifc4x2::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x2>(inst->as<Ifc4x2::IfcProduct>());
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_rc1
|
||||
if (inst->as<Ifc4x3_rc1::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x3_rc1>(inst->as<Ifc4x3_rc1::IfcProduct>());
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_rc2
|
||||
if (inst->as<Ifc4x3_rc2::IfcProduct>()) {
|
||||
return get_layers_impl<Ifc4x3_rc2>(inst->as<Ifc4x3_rc2::IfcProduct>());
|
||||
}
|
||||
#endif
|
||||
|
||||
throw IfcParse::IfcException("Unexpected entity " + inst->declaration().name());
|
||||
}
|
||||
|
||||
bool IfcGeom::Kernel::is_manifold(const TopoDS_Shape& a) {
|
||||
|
||||
Reference in New Issue
Block a user