@@ -204,9 +204,6 @@ std::string taxonomy_item_repr(ifcopenshell::geometry::taxonomy::item::ptr i) {
204204%include " ../serializers/XmlSerializer.h"
205205%include " ../serializers/GltfSerializer.h"
206206
207- %template (material_vector) std::vector<ifcopenshell::geometry::taxonomy::style::ptr>;
208- %template (edge_vector) std::vector<ifcopenshell::geometry::taxonomy::edge::ptr>;
209-
210207%extend ifcopenshell::geometry::taxonomy::style {
211208 size_t instance_id () const {
212209 if (self->instance == nullptr ) {
@@ -251,7 +248,7 @@ std::string taxonomy_item_repr(ifcopenshell::geometry::taxonomy::item::ptr i) {
251248
252249
253250%extend ifcopenshell::geometry::taxonomy::loop {
254- std::vector<ifcopenshell::geometry::taxonomy::edge::ptr> children_ () const {
251+ const std::vector<ifcopenshell::geometry::taxonomy::edge::ptr>& children_ () const {
255252 return $self->children ;
256253 }
257254
@@ -871,36 +868,7 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
871868%}
872869
873870%typemap(out) ifcopenshell::geometry::taxonomy::item::ptr {
874- using namespace ifcopenshell ::geometry::taxonomy;
875- auto kind = $1 ->kind ();
876- // @todo this is not automatically generated :(
877- // we can probably use the dispatch mechanism for this we already have in the kernel
878- if (kind == BSPLINE_CURVE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<bspline_curve>(std::static_pointer_cast<bspline_curve>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__bspline_curve_t, 0 | SWIG_POINTER_OWN); }
879- else if (kind == BSPLINE_SURFACE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<bspline_surface>(std::static_pointer_cast<bspline_surface>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__bspline_surface_t, 0 | SWIG_POINTER_OWN); }
880- else if (kind == CIRCLE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<circle>(std::static_pointer_cast<circle>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__circle_t, 0 | SWIG_POINTER_OWN); }
881- else if (kind == COLLECTION) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<collection>(std::static_pointer_cast<collection>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__collection_t, 0 | SWIG_POINTER_OWN); }
882- else if (kind == COLOUR) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<colour>(std::static_pointer_cast<colour>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__colour_t, 0 | SWIG_POINTER_OWN); }
883- else if (kind == CYLINDER) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<cylinder>(std::static_pointer_cast<cylinder>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__cylinder_t, 0 | SWIG_POINTER_OWN); }
884- else if (kind == DIRECTION3) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<direction3>(std::static_pointer_cast<direction3>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__direction3_t, 0 | SWIG_POINTER_OWN); }
885- else if (kind == EDGE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<edge>(std::static_pointer_cast<edge>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__edge_t, 0 | SWIG_POINTER_OWN); }
886- else if (kind == ELLIPSE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<ellipse>(std::static_pointer_cast<ellipse>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__ellipse_t, 0 | SWIG_POINTER_OWN); }
887- else if (kind == EXTRUSION) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<extrusion>(std::static_pointer_cast<extrusion>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__extrusion_t, 0 | SWIG_POINTER_OWN); }
888- else if (kind == FACE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<face>(std::static_pointer_cast<face>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__face_t, 0 | SWIG_POINTER_OWN); }
889- else if (kind == LINE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<line>(std::static_pointer_cast<line>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__line_t, 0 | SWIG_POINTER_OWN); }
890- else if (kind == LOFT) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<loft>(std::static_pointer_cast<loft>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__loft_t, 0 | SWIG_POINTER_OWN); }
891- else if (kind == LOOP) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<loop>(std::static_pointer_cast<loop>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__loop_t, 0 | SWIG_POINTER_OWN); }
892- else if (kind == MATRIX4) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<matrix4>(std::static_pointer_cast<matrix4>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__matrix4_t, 0 | SWIG_POINTER_OWN); }
893- else if (kind == NODE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<node>(std::static_pointer_cast<node>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__node_t, 0 | SWIG_POINTER_OWN); }
894- else if (kind == OFFSET_CURVE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<offset_curve>(std::static_pointer_cast<offset_curve>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__offset_curve_t, 0 | SWIG_POINTER_OWN); }
895- else if (kind == PIECEWISE_FUNCTION) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<piecewise_function>(std::static_pointer_cast<piecewise_function>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__piecewise_function_t, 0 | SWIG_POINTER_OWN); }
896- else if (kind == PLANE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<plane>(std::static_pointer_cast<plane>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__plane_t, 0 | SWIG_POINTER_OWN); }
897- else if (kind == POINT3) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<point3>(std::static_pointer_cast<point3>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__point3_t, 0 | SWIG_POINTER_OWN); }
898- else if (kind == REVOLVE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<revolve>(std::static_pointer_cast<revolve>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__revolve_t, 0 | SWIG_POINTER_OWN); }
899- else if (kind == SHELL) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<shell>(std::static_pointer_cast<shell>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__shell_t, 0 | SWIG_POINTER_OWN); }
900- else if (kind == SOLID) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<solid>(std::static_pointer_cast<solid>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__solid_t, 0 | SWIG_POINTER_OWN); }
901- else if (kind == SPHERE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<sphere>(std::static_pointer_cast<sphere>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__sphere_t, 0 | SWIG_POINTER_OWN); }
902- else if (kind == STYLE) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<style>(std::static_pointer_cast<style>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__style_t, 0 | SWIG_POINTER_OWN); }
903- else if (kind == SURFACE_CURVE_SWEEP) { $result = SWIG_NewPointerObj (SWIG_as_voidptr (new std::shared_ptr<surface_curve_sweep>(std::static_pointer_cast<surface_curve_sweep>($1 ))), SWIGTYPE_p_std__shared_ptrT_ifcopenshell__geometry__taxonomy__surface_curve_sweep_t, 0 | SWIG_POINTER_OWN); }
871+ $result = item_to_pyobject ($1 );
904872}
905873
906874%{
0 commit comments