diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index 29b1e2bb0f..c3985a6bc9 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -601,15 +601,15 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas } %extend IfcParse::aggregation_type { - std::string type_of_aggregation() const { - static const char* const aggr_strings = ["array", "bag", "list", "set"]; - return aggr_strings[(int) type_of_aggregation_]; + std::string type_of_aggregation_string() const { + static const char* const aggr_strings[] = {"array", "bag", "list", "set"}; + return aggr_strings[(int) $self->type_of_aggregation()]; } %pythoncode %{ def __repr__(self): format_bound = lambda i: "?" if i == -1 else str(i) return "<%s [%s:%s] of %r>" % ( - self.type_of_aggregation(), + self.type_of_aggregation_string(), format_bound(self.bound1()), format_bound(self.bound2()), self.type_of_element() @@ -646,16 +646,16 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas } %extend IfcParse::inverse_attribute { - std::string type_of_aggregation() const { - static const char* const aggr_strings = ["bag", "set", ""]; - return aggr_strings[(int) type_of_aggregation_]; + std::string type_of_aggregation_string() const { + static const char* const aggr_strings[] = {"bag", "set", ""}; + return aggr_strings[(int) $self->type_of_aggregation()]; } %pythoncode %{ def __repr__(self): format_bound = lambda i: "?" if i == -1 else str(i) return "" % ( self.name(), - self.type_of_aggregation(), + self.type_of_aggregation_string(), format_bound(self.bound1()), format_bound(self.bound2()), self.entity_reference(), diff --git a/src/ifcwrap/utils/type_conversion.i b/src/ifcwrap/utils/type_conversion.i index 9947193939..52c4ce1c4e 100644 --- a/src/ifcwrap/utils/type_conversion.i +++ b/src/ifcwrap/utils/type_conversion.i @@ -113,6 +113,7 @@ PyObject* pythonize(const std::string& t) { return PyUnicode_FromString(t.c_str()); } PyObject* pythonize(const IfcUtil::IfcBaseClass* t) { return SWIG_NewPointerObj(SWIG_as_voidptr(t), SWIGTYPE_p_IfcUtil__IfcBaseClass, 0); } PyObject* pythonize(const IfcParse::attribute* t) { return SWIG_NewPointerObj(SWIG_as_voidptr(t), SWIGTYPE_p_IfcParse__attribute, 0); } + PyObject* pythonize(const IfcParse::inverse_attribute* t) { return SWIG_NewPointerObj(SWIG_as_voidptr(t), SWIGTYPE_p_IfcParse__inverse_attribute, 0); } PyObject* pythonize(const IfcParse::entity* t) { return SWIG_NewPointerObj(SWIG_as_voidptr(t), SWIGTYPE_p_IfcParse__entity, 0); } PyObject* pythonize(const IfcParse::declaration* t) { return SWIG_NewPointerObj(SWIG_as_voidptr(t), SWIGTYPE_p_IfcParse__declaration, 0); } // NB: This cannot be temporary as a Python object is constructed from a pointer to the address of this object diff --git a/src/ifcwrap/utils/typemaps_out.i b/src/ifcwrap/utils/typemaps_out.i index dade4ada48..6be9b98110 100644 --- a/src/ifcwrap/utils/typemaps_out.i +++ b/src/ifcwrap/utils/typemaps_out.i @@ -134,5 +134,6 @@ CREATE_VECTOR_TYPEMAP_OUT(double) CREATE_VECTOR_TYPEMAP_OUT(std::string) CREATE_VECTOR_TYPEMAP_OUT(IfcGeom::Material) CREATE_VECTOR_TYPEMAP_OUT(IfcParse::attribute const *) +CREATE_VECTOR_TYPEMAP_OUT(IfcParse::inverse_attribute const *) CREATE_VECTOR_TYPEMAP_OUT(IfcParse::entity const *) CREATE_VECTOR_TYPEMAP_OUT(IfcParse::declaration const *)