#747 Apply typemaps and checks to spf header

This commit is contained in:
Thomas Krijnen
2021-02-02 11:49:42 +01:00
parent 012a2cca0f
commit 55b63410bd
2 changed files with 28 additions and 1 deletions
+22 -1
View File
@@ -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 <BRepTools_ShapeSet.hxx>
%}
%include "IfcGeomWrapper.i"
%include "IfcParseWrapper.i"
+6
View File
@@ -25,7 +25,13 @@
}
$1 = python_sequence_as_vector<template_type>($input);
}
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) std::vector<template_type> {
$1 = check_aggregate_of_type($input, get_python_type<template_type>()) ? 1 : 0;
}
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) const std::vector<template_type>& {
$1 = check_aggregate_of_type($input, get_python_type<template_type>()) ? 1 : 0;
}
%typemap(arginit) const std::vector<template_type>& {
$1 = new std::vector<template_type>();
}