Skip to content

Commit 55b6341

Browse files
committed
#747 Apply typemaps and checks to spf header
1 parent 012a2cc commit 55b6341

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/ifcwrap/IfcPython.i

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@
7070
}
7171
}
7272

73-
%module ifcopenshell_wrapper %{
73+
// Include headers for the typemaps to function. This set of includes,
74+
// can probably be reduced, but for now it's identical to the includes
75+
// of the module definition below.
76+
%{
7477
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
7578
#include "../ifcgeom_schema_agnostic/Serialization.h"
7679
#include "../ifcgeom/IfcGeomTree.h"
@@ -97,5 +100,23 @@
97100

98101
%include "utils/typemaps_out.i"
99102

103+
%module ifcopenshell_wrapper %{
104+
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
105+
#include "../ifcgeom_schema_agnostic/Serialization.h"
106+
#include "../ifcgeom/IfcGeomTree.h"
107+
108+
#include "../ifcparse/Ifc2x3.h"
109+
#include "../ifcparse/Ifc4.h"
110+
#include "../ifcparse/Ifc4x1.h"
111+
#include "../ifcparse/Ifc4x2.h"
112+
#include "../ifcparse/Ifc4x3_rc1.h"
113+
#include "../ifcparse/IfcBaseClass.h"
114+
#include "../ifcparse/IfcFile.h"
115+
#include "../ifcparse/IfcSchema.h"
116+
#include "../ifcparse/utils.h"
117+
118+
#include <BRepTools_ShapeSet.hxx>
119+
%}
120+
100121
%include "IfcGeomWrapper.i"
101122
%include "IfcParseWrapper.i"

src/ifcwrap/utils/typemaps_in.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
}
2626
$1 = python_sequence_as_vector<template_type>($input);
2727
}
28+
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) std::vector<template_type> {
29+
$1 = check_aggregate_of_type($input, get_python_type<template_type>()) ? 1 : 0;
30+
}
2831

32+
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) const std::vector<template_type>& {
33+
$1 = check_aggregate_of_type($input, get_python_type<template_type>()) ? 1 : 0;
34+
}
2935
%typemap(arginit) const std::vector<template_type>& {
3036
$1 = new std::vector<template_type>();
3137
}

0 commit comments

Comments
 (0)