mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
AbstractKernel::dispatch_conversion - use static cast
Previously it was using taxonomy::cast that was also trying to upgrade current item - due to the strictness of dispatch_conversion (it works only if type matches exactly because of `N == item_kind`) upgrades will never succeed so we may just skip them.
This commit is contained in:
@@ -86,7 +86,7 @@ namespace {
|
|||||||
struct dispatch_conversion {
|
struct dispatch_conversion {
|
||||||
static bool dispatch(ifcopenshell::geometry::kernels::AbstractKernel* kernel, ifcopenshell::geometry::taxonomy::kinds item_kind, const ifcopenshell::geometry::taxonomy::ptr item, IfcGeom::ConversionResults& results) {
|
static bool dispatch(ifcopenshell::geometry::kernels::AbstractKernel* kernel, ifcopenshell::geometry::taxonomy::kinds item_kind, const ifcopenshell::geometry::taxonomy::ptr item, IfcGeom::ConversionResults& results) {
|
||||||
if (N == item_kind) {
|
if (N == item_kind) {
|
||||||
auto concrete_item = ifcopenshell::geometry::taxonomy::template cast<ifcopenshell::geometry::taxonomy::type_by_kind::type<N>>(item);
|
auto concrete_item = std::static_pointer_cast<ifcopenshell::geometry::taxonomy::type_by_kind::type<N>>(item);
|
||||||
return kernel->convert_impl(concrete_item, results);
|
return kernel->convert_impl(concrete_item, results);
|
||||||
} else {
|
} else {
|
||||||
return dispatch_conversion<N + 1>::dispatch(kernel, item_kind, item, results);
|
return dispatch_conversion<N + 1>::dispatch(kernel, item_kind, item, results);
|
||||||
|
|||||||
Reference in New Issue
Block a user