diff --git a/src/ifcwrap/IfcPython.i b/src/ifcwrap/IfcPython.i index 312075f631..11bd6f3f3d 100644 --- a/src/ifcwrap/IfcPython.i +++ b/src/ifcwrap/IfcPython.i @@ -70,7 +70,10 @@ } } -%module ifcopenshell_wrapper %{ +// Include headers for the typemaps to function. This set of includes, +// can probably be reduced, but for now it's identical to the includes +// of the module definition below. +%{ #include "../ifcgeom_schema_agnostic/IfcGeomIterator.h" #include "../ifcgeom_schema_agnostic/Serialization.h" #include "../ifcgeom/IfcGeomTree.h" @@ -97,5 +100,23 @@ %include "utils/typemaps_out.i" +%module ifcopenshell_wrapper %{ + #include "../ifcgeom_schema_agnostic/IfcGeomIterator.h" + #include "../ifcgeom_schema_agnostic/Serialization.h" + #include "../ifcgeom/IfcGeomTree.h" + + #include "../ifcparse/Ifc2x3.h" + #include "../ifcparse/Ifc4.h" + #include "../ifcparse/Ifc4x1.h" + #include "../ifcparse/Ifc4x2.h" + #include "../ifcparse/Ifc4x3_rc1.h" + #include "../ifcparse/IfcBaseClass.h" + #include "../ifcparse/IfcFile.h" + #include "../ifcparse/IfcSchema.h" + #include "../ifcparse/utils.h" + + #include +%} + %include "IfcGeomWrapper.i" %include "IfcParseWrapper.i" diff --git a/src/ifcwrap/utils/typemaps_in.i b/src/ifcwrap/utils/typemaps_in.i index 3f84249021..62f05ee390 100644 --- a/src/ifcwrap/utils/typemaps_in.i +++ b/src/ifcwrap/utils/typemaps_in.i @@ -25,7 +25,13 @@ } $1 = python_sequence_as_vector($input); } + %typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) std::vector { + $1 = check_aggregate_of_type($input, get_python_type()) ? 1 : 0; + } + %typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) const std::vector& { + $1 = check_aggregate_of_type($input, get_python_type()) ? 1 : 0; + } %typemap(arginit) const std::vector& { $1 = new std::vector(); }