mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix create_shape() overloads because SWIG does not map None for us anymore
This commit is contained in:
@@ -507,7 +507,7 @@ def create_shape(
|
||||
"""
|
||||
return wrap_shape_creation(
|
||||
settings,
|
||||
ifcopenshell_wrapper.create_shape(settings, inst, repr if repr is not None else None, geometry_library),
|
||||
ifcopenshell_wrapper.create_shape(settings, inst, repr, geometry_library) if repr else ifcopenshell_wrapper.create_shape(settings, inst, geometry_library),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1040,7 +1040,7 @@ ifcopenshell::geometry::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type
|
||||
%}
|
||||
|
||||
%inline %{
|
||||
static std::variant<IfcGeom::Element*, IfcGeom::Representation::Representation*, IfcGeom::Transformation*> create_shape(ifcopenshell::geometry::Settings& settings, const express::Base& instance, const express::Base& representation = express::Base(), const char* const geometry_library="opencascade") {
|
||||
static std::variant<IfcGeom::Element*, IfcGeom::Representation::Representation*, IfcGeom::Transformation*> create_shape(ifcopenshell::geometry::Settings& settings, const express::Base& instance, const express::Base& representation, const char* const geometry_library="opencascade") {
|
||||
const std::string& schema_name = instance.declaration().schema()->name();
|
||||
|
||||
#ifdef HAS_SCHEMA_2x3
|
||||
@@ -1106,6 +1106,11 @@ ifcopenshell::geometry::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type
|
||||
|
||||
throw IfcParse::IfcException("No geometry support for " + schema_name);
|
||||
}
|
||||
|
||||
// Manual definition of overload without representation argument
|
||||
static std::variant<IfcGeom::Element*, IfcGeom::Representation::Representation*, IfcGeom::Transformation*> create_shape(ifcopenshell::geometry::Settings& settings, const express::Base& instance, const char* const geometry_library="opencascade") {
|
||||
return create_shape(settings, instance, express::Base(), geometry_library);
|
||||
}
|
||||
%}
|
||||
|
||||
#ifdef IFOPSH_WITH_OPENCASCADE
|
||||
|
||||
Reference in New Issue
Block a user