mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
GUID chunking now implemented when loading either from iterator or H5
This commit is contained in:
+36
-1
@@ -86,6 +86,7 @@
|
||||
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
||||
#include "../ifcgeom_schema_agnostic/Serialization.h"
|
||||
#include "../ifcgeom_schema_agnostic/IfcGeomTree.h"
|
||||
#include "../ifcgeom_schema_agnostic/chunk.h"
|
||||
|
||||
#include "../serializers/SvgSerializer.h"
|
||||
#include "../serializers/WavefrontObjSerializer.h"
|
||||
@@ -152,6 +153,7 @@
|
||||
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
||||
#include "../ifcgeom_schema_agnostic/Serialization.h"
|
||||
#include "../ifcgeom_schema_agnostic/IfcGeomTree.h"
|
||||
#include "../ifcgeom_schema_agnostic/chunk.h"
|
||||
|
||||
#include "../serializers/SvgSerializer.h"
|
||||
#include "../serializers/WavefrontObjSerializer.h"
|
||||
@@ -209,6 +211,7 @@
|
||||
%include "IfcGeomWrapper.i"
|
||||
%include "IfcParseWrapper.i"
|
||||
%include "std_vector.i"
|
||||
%include "../ifcgeom_schema_agnostic/chunk.h"
|
||||
%include "numpy.i"
|
||||
%init %{
|
||||
import_array();
|
||||
@@ -219,12 +222,14 @@ namespace std {
|
||||
%template(FloatVector) vector<float>;
|
||||
%template(IntVector) std::vector<int>;
|
||||
%template(DoubleVector) std::vector<double>;
|
||||
%template(StringVector) std::vector<std::string>;
|
||||
%template(FloatVectorVector) std::vector<std::vector<float>>;
|
||||
%template(DoubleVectorVector) std::vector<std::vector<double>>;
|
||||
%template(H5ShapeVector) std::vector<IfcGeom::h5_shape>;
|
||||
}
|
||||
|
||||
%extend IfcGeom::h5_shape {
|
||||
PyObject* IfcGeom::h5_shape::get_verts() {
|
||||
PyObject* get_verts() {
|
||||
npy_intp dims[1] = { (npy_intp)$self->verts.size() };
|
||||
PyObject* array = PyArray_SimpleNewFromData(1, dims, NPY_FLOAT, (void*)$self->verts.data());
|
||||
PyArray_CLEARFLAGS((PyArrayObject*)array, NPY_ARRAY_WRITEABLE); // Make the array read-only
|
||||
@@ -252,3 +257,33 @@ namespace std {
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
%extend IfcGeom::chunk {
|
||||
PyObject* get_verts() {
|
||||
npy_intp dims[1] = { (npy_intp)$self->verts.size() };
|
||||
PyObject* array = PyArray_SimpleNewFromData(1, dims, NPY_DOUBLE, (void*)$self->verts.data());
|
||||
PyArray_CLEARFLAGS((PyArrayObject*)array, NPY_ARRAY_WRITEABLE); // Make the array read-only
|
||||
return array;
|
||||
}
|
||||
|
||||
PyObject* get_faces() {
|
||||
npy_intp dims[1] = { (npy_intp)$self->faces.size() };
|
||||
PyObject* array = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)$self->faces.data());
|
||||
PyArray_CLEARFLAGS((PyArrayObject*)array, NPY_ARRAY_WRITEABLE); // Make the array read-only
|
||||
return array;
|
||||
}
|
||||
|
||||
PyObject* get_materials() {
|
||||
npy_intp dims[1] = { (npy_intp)$self->materials.size() };
|
||||
PyObject* array = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)$self->materials.data());
|
||||
PyArray_CLEARFLAGS((PyArrayObject*)array, NPY_ARRAY_WRITEABLE); // Make the array read-only
|
||||
return array;
|
||||
}
|
||||
|
||||
PyObject* get_material_ids() {
|
||||
npy_intp dims[1] = { (npy_intp)$self->material_ids.size() };
|
||||
PyObject* array = PyArray_SimpleNewFromData(1, dims, NPY_INT, (void*)$self->material_ids.data());
|
||||
PyArray_CLEARFLAGS((PyArrayObject*)array, NPY_ARRAY_WRITEABLE); // Make the array read-only
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user