mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 00:46:36 +00:00
Use custom typemaps for geometry related classes as well
This commit is contained in:
@@ -107,6 +107,7 @@
|
||||
// Conversion functions to convert STL vectors into Python objects
|
||||
%{
|
||||
PyObject* pythonize(const int& t) { return PyInt_FromLong(t); }
|
||||
PyObject* pythonize(const unsigned int& t) { return PyInt_FromLong(t); }
|
||||
PyObject* pythonize(const bool& t) { return PyBool_FromLong(t); }
|
||||
PyObject* pythonize(const double& t) { return PyFloat_FromDouble(t); }
|
||||
PyObject* pythonize(const std::string& t) { return PyString_FromString(t.c_str()); }
|
||||
|
||||
@@ -97,10 +97,11 @@
|
||||
$result = pythonize_vector<template_type>($1);
|
||||
}
|
||||
%typemap(out) const std::vector<template_type>& {
|
||||
$result = pythonize_vector<template_type>($1);
|
||||
$result = pythonize_vector<template_type>(*$1);
|
||||
}
|
||||
%enddef
|
||||
|
||||
CREATE_VECTOR_TYPEMAP_OUT(int)
|
||||
CREATE_VECTOR_TYPEMAP_OUT(unsigned int)
|
||||
CREATE_VECTOR_TYPEMAP_OUT(double)
|
||||
CREATE_VECTOR_TYPEMAP_OUT(std::string)
|
||||
|
||||
Reference in New Issue
Block a user