diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index abc2b4dead..bc09ca9cc5 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -71,12 +71,8 @@ class settings(ifcopenshell_wrapper.settings): ifcopenshell_wrapper.settings.set(self, *args) -# Hide templating precision to the user by choosing based on Python's -# internal float type. This is probably always going to be a double. -for ty in (ifcopenshell_wrapper.iterator_single_precision, ifcopenshell_wrapper.iterator_double_precision): - if ty.mantissa_size() == sys.float_info.mant_dig: - _iterator = ty - +# Assert templated precision to match Python's internal float type +assert ifcopenshell_wrapper.iterator_double_precision.mantissa_size() == sys.float_info.mant_dig # Make sure people are able to use python's platform agnostic paths class iterator(_iterator): diff --git a/src/ifcparse/IfcParse.h b/src/ifcparse/IfcParse.h index b46408a448..e002a6f969 100644 --- a/src/ifcparse/IfcParse.h +++ b/src/ifcparse/IfcParse.h @@ -27,7 +27,7 @@ #ifndef IFCPARSE_H #define IFCPARSE_H -#define IFCOPENSHELL_VERSION "0.6.0a0" +#define IFCOPENSHELL_VERSION "0.6.0a1" #include #include diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 0050b40d23..6d63ca12c9 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -102,21 +102,6 @@ } -// Using RTTI return a more specialized type of Element -// Note that these elements are not to be owned by SWIG/Python as they will be freed automatically upon the next iteration -// except for the IfcGeom::Element instances which are returned by Iterator::getObject() calls -%typemap(out) IfcGeom::Element* { - IfcGeom::SerializedElement* serialized_elem = dynamic_cast*>($1); - IfcGeom::TriangulationElement* triangulation_elem = dynamic_cast*>($1); - if (triangulation_elem) { - $result = SWIG_NewPointerObj(SWIG_as_voidptr(triangulation_elem), SWIGTYPE_p_IfcGeom__TriangulationElementT_float_t, 0); - } else if (serialized_elem) { - $result = SWIG_NewPointerObj(SWIG_as_voidptr(serialized_elem), SWIGTYPE_p_IfcGeom__SerializedElementT_float_t, 0); - } else { - $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_IfcGeom__ElementT_float_t, SWIG_POINTER_OWN); - } -} - // Using RTTI return a more specialized type of Element // Note that these elements are not to be owned by SWIG/Python as they will be freed automatically upon the next iteration // except for the IfcGeom::Element instances which are returned by Iterator::getObject() calls @@ -124,11 +109,11 @@ IfcGeom::SerializedElement* serialized_elem = dynamic_cast*>($1); IfcGeom::TriangulationElement* triangulation_elem = dynamic_cast*>($1); if (triangulation_elem) { - $result = SWIG_NewPointerObj(SWIG_as_voidptr(triangulation_elem), SWIGTYPE_p_IfcGeom__TriangulationElementT_double_t, 0); + $result = SWIG_NewPointerObj(SWIG_as_voidptr(triangulation_elem), SWIGTYPE_p_IfcGeom__TriangulationElementT_double_double_t, 0); } else if (serialized_elem) { - $result = SWIG_NewPointerObj(SWIG_as_voidptr(serialized_elem), SWIGTYPE_p_IfcGeom__SerializedElementT_double_t, 0); + $result = SWIG_NewPointerObj(SWIG_as_voidptr(serialized_elem), SWIGTYPE_p_IfcGeom__SerializedElementT_double_double_t, 0); } else { - $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_IfcGeom__ElementT_double_t, SWIG_POINTER_OWN); + $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_IfcGeom__ElementT_double_double_t, SWIG_POINTER_OWN); } } @@ -140,9 +125,9 @@ struct ShapeRTTI : public boost::static_visitor IfcGeom::SerializedElement* serialized_elem = dynamic_cast*>(elem); IfcGeom::TriangulationElement* triangulation_elem = dynamic_cast*>(elem); if (triangulation_elem) { - return SWIG_NewPointerObj(SWIG_as_voidptr(triangulation_elem), SWIGTYPE_p_IfcGeom__TriangulationElementT_double_t, SWIG_POINTER_OWN); + return SWIG_NewPointerObj(SWIG_as_voidptr(triangulation_elem), SWIGTYPE_p_IfcGeom__TriangulationElementT_double_double_t, SWIG_POINTER_OWN); } else if (serialized_elem) { - return SWIG_NewPointerObj(SWIG_as_voidptr(serialized_elem), SWIGTYPE_p_IfcGeom__SerializedElementT_double_t, SWIG_POINTER_OWN); + return SWIG_NewPointerObj(SWIG_as_voidptr(serialized_elem), SWIGTYPE_p_IfcGeom__SerializedElementT_double_double_t, SWIG_POINTER_OWN); } else { throw std::runtime_error("Invalid element encountered"); } @@ -459,26 +444,13 @@ struct ShapeRTTI : public boost::static_visitor %} namespace IfcGeom { - %template(iterator_single_precision) Iterator; %template(iterator_double_precision) Iterator; - - %template(element_single_precision) Element; %template(element_double_precision) Element; - - %template(triangulation_element_single_precision) TriangulationElement; %template(triangulation_element_double_precision) TriangulationElement; - - %template(serialized_element_single_precision) SerializedElement; %template(serialized_element_double_precision) SerializedElement; - - %template(transformation_single_precision) Transformation; %template(transformation_double_precision) Transformation; - - %template(matrix_single_precision) Matrix; %template(matrix_double_precision) Matrix; - namespace Representation { - %template(triangulation_single_precision) Triangulation; %template(triangulation_double_precision) Triangulation; }; }; diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index 8f2c5f4a92..174921f81c 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -27,6 +27,9 @@ private: %ignore IfcParse::IfcFile::register_inverse; %ignore IfcParse::IfcFile::unregister_inverse; %ignore IfcParse::IfcFile::schema; +%ignore IfcParse::IfcFile::begin; +%ignore IfcParse::IfcFile::end; + %ignore operator<<; %ignore IfcParse::FileDescription::FileDescription;