mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 10:59:17 +00:00
actualize wrapper code
This commit is contained in:
@@ -139,10 +139,10 @@
|
||||
return pythonize(bitstring);
|
||||
}
|
||||
|
||||
PyObject* pythonize(const IfcEntityList::ptr& t) {
|
||||
PyObject* pythonize(const aggregate_of_instance::ptr& t) {
|
||||
unsigned int i = 0;
|
||||
PyObject* pyobj = PyTuple_New(t->size());
|
||||
for (IfcEntityList::it it = t->begin(); it != t->end(); ++it, ++i) {
|
||||
for (aggregate_of_instance::it it = t->begin(); it != t->end(); ++it, ++i) {
|
||||
PyTuple_SetItem(pyobj, i, pythonize(*it));
|
||||
}
|
||||
return pyobj;
|
||||
@@ -168,10 +168,10 @@
|
||||
return pyobj;
|
||||
}
|
||||
|
||||
PyObject* pythonize(const IfcEntityListList::ptr& t) {
|
||||
PyObject* pythonize(const aggregate_of_aggregate_of_instance::ptr& t) {
|
||||
unsigned int i = 0;
|
||||
PyObject* pyobj = PyTuple_New(t->size());
|
||||
for (IfcEntityListList::outer_it it = t->begin(); it != t->end(); ++it, ++i) {
|
||||
for (aggregate_of_aggregate_of_instance::outer_it it = t->begin(); it != t->end(); ++it, ++i) {
|
||||
PyTuple_SetItem(pyobj, i, pythonize_vector(*it));
|
||||
}
|
||||
return pyobj;
|
||||
|
||||
@@ -161,9 +161,9 @@ CREATE_VECTOR_TYPEMAP_IN(std::string, STRING, str)
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(in) IfcEntityList::ptr {
|
||||
%typemap(in) aggregate_of_instance::ptr {
|
||||
if (PySequence_Check($input)) {
|
||||
$1 = IfcEntityList::ptr(new IfcEntityList());
|
||||
$1 = aggregate_of_instance::ptr(new aggregate_of_instance());
|
||||
for(Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
|
||||
PyObject* element = PySequence_GetItem($input, i);
|
||||
IfcUtil::IfcBaseClass* inst = cast_pyobject<IfcUtil::IfcBaseClass*>(element);
|
||||
@@ -178,9 +178,9 @@ CREATE_VECTOR_TYPEMAP_IN(std::string, STRING, str)
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(in) IfcEntityListList::ptr {
|
||||
%typemap(in) aggregate_of_aggregate_of_instance::ptr {
|
||||
if (PySequence_Check($input)) {
|
||||
$1 = IfcEntityListList::ptr(new IfcEntityListList());
|
||||
$1 = aggregate_of_aggregate_of_instance::ptr(new aggregate_of_aggregate_of_instance());
|
||||
for(Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
|
||||
PyObject* element = PySequence_GetItem($input, i);
|
||||
if (PySequence_Check(element)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
%typemap(out) IfcEntityList::ptr {
|
||||
%typemap(out) aggregate_of_instance::ptr {
|
||||
const unsigned size = $1 ? $1->size() : 0;
|
||||
$result = PyTuple_New(size);
|
||||
for (unsigned i = 0; i < size; ++i) {
|
||||
@@ -81,7 +81,7 @@
|
||||
$result = pythonize(v);
|
||||
break; }
|
||||
case IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE: {
|
||||
IfcEntityList::ptr v = arg;
|
||||
aggregate_of_instance::ptr v = arg;
|
||||
$result = pythonize(v);
|
||||
break; }
|
||||
case IfcUtil::Argument_AGGREGATE_OF_BINARY: {
|
||||
@@ -97,7 +97,7 @@
|
||||
$result = pythonize_vector2(v);
|
||||
break; }
|
||||
case IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_ENTITY_INSTANCE: {
|
||||
IfcEntityListList::ptr v = arg;
|
||||
aggregate_of_aggregate_of_instance::ptr v = arg;
|
||||
$result = pythonize(v);
|
||||
break; }
|
||||
case IfcUtil::Argument_EMPTY_AGGREGATE: {
|
||||
|
||||
Reference in New Issue
Block a user