2011-05-08 11:04:32 +00:00
|
|
|
/********************************************************************************
|
2015-01-16 16:26:40 +00:00
|
|
|
* *
|
|
|
|
|
* This file is part of IfcOpenShell. *
|
|
|
|
|
* *
|
|
|
|
|
* IfcOpenShell is free software: you can redistribute it and/or modify *
|
2011-05-08 11:04:32 +00:00
|
|
|
* it under the terms of the Lesser GNU General Public License as published by *
|
2015-01-16 16:26:40 +00:00
|
|
|
* the Free Software Foundation, either version 3.0 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* IfcOpenShell is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* Lesser GNU General Public License for more details. *
|
|
|
|
|
* *
|
2011-05-08 11:04:32 +00:00
|
|
|
* You should have received a copy of the Lesser GNU General Public License *
|
2015-01-16 16:26:40 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
|
* *
|
2011-05-08 11:04:32 +00:00
|
|
|
********************************************************************************/
|
|
|
|
|
|
2015-11-04 16:25:13 +02:00
|
|
|
%begin %{
|
|
|
|
|
#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
|
|
|
|
|
/* https://github.com/swig/swig/issues/325 */
|
|
|
|
|
# include <basetsd.h>
|
|
|
|
|
# include <assert.h>
|
|
|
|
|
# include <ctype.h>
|
|
|
|
|
# include <errno.h>
|
|
|
|
|
# include <io.h>
|
|
|
|
|
# include <math.h>
|
|
|
|
|
# include <sal.h>
|
|
|
|
|
# include <stdarg.h>
|
|
|
|
|
# include <stddef.h>
|
|
|
|
|
# include <stdio.h>
|
|
|
|
|
# include <stdlib.h>
|
|
|
|
|
# include <string.h>
|
|
|
|
|
# include <sys/stat.h>
|
|
|
|
|
# include <time.h>
|
|
|
|
|
# include <wchar.h>
|
|
|
|
|
#endif
|
2015-11-21 23:05:28 +02:00
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
# pragma warning(push)
|
|
|
|
|
# pragma warning(disable : 4127 4244 4702 4510 4512 4610)
|
|
|
|
|
# if _MSC_VER > 1800
|
|
|
|
|
# pragma warning(disable : 4456 4459)
|
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
// TODO add '# pragma warning(pop)' to the very end of the file
|
2015-11-04 16:25:13 +02:00
|
|
|
%}
|
|
|
|
|
|
2021-11-08 10:58:55 +01:00
|
|
|
%include "stdint.i"
|
2020-10-26 14:10:13 +01:00
|
|
|
%include "std_array.i"
|
2021-08-07 23:09:19 +02:00
|
|
|
%include "std_vector.i"
|
2011-05-08 11:04:32 +00:00
|
|
|
%include "std_string.i"
|
2013-05-11 15:26:35 +00:00
|
|
|
%include "exception.i"
|
2024-05-23 13:06:57 +02:00
|
|
|
%include "std_shared_ptr.i"
|
2023-11-02 09:04:34 +01:00
|
|
|
|
|
|
|
|
%ignore IfcGeom::NumberNativeDouble;
|
2023-11-15 10:32:20 +01:00
|
|
|
%ignore ifcopenshell::geometry::Converter;
|
2013-05-11 15:26:35 +00:00
|
|
|
|
2017-06-24 13:36:26 +02:00
|
|
|
// General python-specific rename rules for comparison operators.
|
|
|
|
|
// Mostly to silence warnings, but might be of use some time.
|
|
|
|
|
%rename("__eq__") operator ==;
|
|
|
|
|
%rename("__lt__") operator <;
|
|
|
|
|
|
2013-05-11 15:26:35 +00:00
|
|
|
%exception {
|
|
|
|
|
try {
|
|
|
|
|
$action
|
2015-06-17 11:27:02 +00:00
|
|
|
} catch(const IfcParse::IfcAttributeOutOfRangeException& e) {
|
|
|
|
|
SWIG_exception(SWIG_IndexError, e.what());
|
|
|
|
|
} catch(const IfcParse::IfcException& e) {
|
2015-01-05 14:11:42 +00:00
|
|
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
2015-06-17 11:27:02 +00:00
|
|
|
} catch(const std::runtime_error& e) {
|
2013-05-11 15:26:35 +00:00
|
|
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
|
|
|
|
} catch(...) {
|
|
|
|
|
SWIG_exception(SWIG_RuntimeError, "An unknown error occurred");
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-05-08 11:04:32 +00:00
|
|
|
|
2022-05-03 11:38:12 +02:00
|
|
|
%include "../serializers/serializers_api.h"
|
|
|
|
|
|
2021-02-02 11:49:42 +01:00
|
|
|
// Include headers for the typemaps to function. This set of includes,
|
|
|
|
|
// can probably be reduced, but for now it's identical to the includes
|
|
|
|
|
// of the module definition below.
|
|
|
|
|
%{
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/Iterator.h"
|
|
|
|
|
#include "../ifcgeom/taxonomy.h"
|
2024-09-10 10:11:17 -07:00
|
|
|
#include "../ifcgeom/piecewise_function_evaluator.h"
|
2023-03-22 11:17:14 +01:00
|
|
|
#ifdef IFOPSH_WITH_OPENCASCADE
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/Serialization/Serialization.h"
|
|
|
|
|
#include "../ifcgeom/kernels/opencascade/IfcGeomTree.h"
|
2021-07-11 15:03:21 +02:00
|
|
|
|
2023-03-22 11:17:14 +01:00
|
|
|
#include <BRepTools_ShapeSet.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-07-11 15:03:21 +02:00
|
|
|
#include "../serializers/SvgSerializer.h"
|
|
|
|
|
#include "../serializers/WavefrontObjSerializer.h"
|
2021-10-29 10:40:15 +02:00
|
|
|
#include "../serializers/HdfSerializer.h"
|
2017-12-22 17:37:58 +01:00
|
|
|
|
2021-05-11 22:29:16 +02:00
|
|
|
#ifdef HAS_SCHEMA_2x3
|
2017-12-22 13:51:11 +01:00
|
|
|
#include "../ifcparse/Ifc2x3.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4
|
2017-12-22 13:51:11 +01:00
|
|
|
#include "../ifcparse/Ifc4.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x1
|
2020-06-15 12:48:30 +02:00
|
|
|
#include "../ifcparse/Ifc4x1.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x2
|
2020-06-15 12:48:30 +02:00
|
|
|
#include "../ifcparse/Ifc4x2.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_rc1
|
2020-06-15 12:48:30 +02:00
|
|
|
#include "../ifcparse/Ifc4x3_rc1.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_rc2
|
2021-02-14 12:43:27 +01:00
|
|
|
#include "../ifcparse/Ifc4x3_rc2.h"
|
2021-07-03 21:42:37 -07:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_rc3
|
|
|
|
|
#include "../ifcparse/Ifc4x3_rc3.h"
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_rc4
|
|
|
|
|
#include "../ifcparse/Ifc4x3_rc4.h"
|
2022-07-17 21:13:46 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3
|
|
|
|
|
#include "../ifcparse/Ifc4x3.h"
|
2022-11-20 16:52:46 +01:00
|
|
|
#endif
|
2022-11-23 13:23:49 +01:00
|
|
|
#ifdef HAS_SCHEMA_4x3_tc1
|
|
|
|
|
#include "../ifcparse/Ifc4x3_tc1.h"
|
|
|
|
|
#endif
|
2022-11-20 16:52:46 +01:00
|
|
|
#ifdef HAS_SCHEMA_4x3_add1
|
|
|
|
|
#include "../ifcparse/Ifc4x3_add1.h"
|
2023-12-19 12:40:38 +01:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_add2
|
|
|
|
|
#include "../ifcparse/Ifc4x3_add2.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
|
2017-06-05 17:26:58 +02:00
|
|
|
#include "../ifcparse/IfcBaseClass.h"
|
2015-01-05 14:11:42 +00:00
|
|
|
#include "../ifcparse/IfcFile.h"
|
2017-12-31 12:20:13 +01:00
|
|
|
#include "../ifcparse/IfcSchema.h"
|
2020-07-05 11:40:17 +02:00
|
|
|
#include "../ifcparse/utils.h"
|
2016-06-22 15:03:18 +02:00
|
|
|
|
2023-11-15 10:32:20 +01:00
|
|
|
#include "../ifcgeom/ConversionSettings.h"
|
2023-11-02 09:04:34 +01:00
|
|
|
#include "../ifcgeom/ConversionResult.h"
|
|
|
|
|
|
2021-08-07 23:09:19 +02:00
|
|
|
#include "../svgfill/src/svgfill.h"
|
2023-12-11 21:06:25 +01:00
|
|
|
|
|
|
|
|
#ifdef IFOPSH_WITH_CGAL
|
|
|
|
|
#include "../ifcgeom/kernels/cgal/CgalConversionResult.h"
|
|
|
|
|
#endif
|
2011-05-08 11:04:32 +00:00
|
|
|
%}
|
|
|
|
|
|
2024-09-18 19:25:37 +02:00
|
|
|
%{
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
struct is_std_vector : std::false_type {};
|
|
|
|
|
template<typename T, typename Alloc>
|
|
|
|
|
struct is_std_vector<std::vector<T, Alloc>> : std::true_type {};
|
|
|
|
|
template<typename T>
|
|
|
|
|
constexpr bool is_std_vector_v = is_std_vector<T>::value;
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
struct is_std_vector_vector : std::false_type {};
|
|
|
|
|
template<typename T, typename Alloc, typename Alloc2>
|
|
|
|
|
struct is_std_vector_vector<std::vector<std::vector<T, Alloc>, Alloc2>> : std::true_type {};
|
|
|
|
|
template<typename T>
|
|
|
|
|
constexpr bool is_std_vector_vector_v = is_std_vector_vector<T>::value;
|
|
|
|
|
|
|
|
|
|
%}
|
|
|
|
|
|
2017-10-30 00:10:33 -04:00
|
|
|
// Create docstrings for generated python code.
|
|
|
|
|
%feature("autodoc", "1");
|
|
|
|
|
|
2015-06-26 13:06:28 +00:00
|
|
|
%include "utils/type_conversion.i"
|
|
|
|
|
|
|
|
|
|
%include "utils/typemaps_in.i"
|
|
|
|
|
|
|
|
|
|
%include "utils/typemaps_out.i"
|
2015-06-02 13:29:08 +00:00
|
|
|
|
2021-02-02 11:49:42 +01:00
|
|
|
%module ifcopenshell_wrapper %{
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/Converter.h"
|
|
|
|
|
#include "../ifcgeom/taxonomy.h"
|
2024-09-10 10:11:17 -07:00
|
|
|
#include "../ifcgeom/piecewise_function_evaluator.h"
|
2023-03-22 11:17:14 +01:00
|
|
|
#ifdef IFOPSH_WITH_OPENCASCADE
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/Serialization/Serialization.h"
|
|
|
|
|
#include "../ifcgeom/kernels/opencascade/IfcGeomTree.h"
|
2023-03-22 11:17:14 +01:00
|
|
|
|
|
|
|
|
#include <BRepTools_ShapeSet.hxx>
|
|
|
|
|
#endif
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/Iterator.h"
|
2023-11-02 09:04:34 +01:00
|
|
|
#include "../ifcgeom/ConversionResult.h"
|
2021-07-11 15:03:21 +02:00
|
|
|
|
|
|
|
|
#include "../serializers/SvgSerializer.h"
|
|
|
|
|
#include "../serializers/WavefrontObjSerializer.h"
|
2021-10-29 10:40:15 +02:00
|
|
|
#include "../serializers/HdfSerializer.h"
|
2022-02-26 14:52:58 +01:00
|
|
|
#include "../serializers/XmlSerializer.h"
|
|
|
|
|
#include "../serializers/GltfSerializer.h"
|
2024-09-27 16:32:41 +02:00
|
|
|
#include "../serializers/TtlWktSerializer.h"
|
|
|
|
|
|
2021-05-11 22:29:16 +02:00
|
|
|
#ifdef HAS_SCHEMA_2x3
|
2021-02-02 11:49:42 +01:00
|
|
|
#include "../ifcparse/Ifc2x3.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4
|
2021-02-02 11:49:42 +01:00
|
|
|
#include "../ifcparse/Ifc4.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x1
|
2021-02-02 11:49:42 +01:00
|
|
|
#include "../ifcparse/Ifc4x1.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x2
|
2021-02-02 11:49:42 +01:00
|
|
|
#include "../ifcparse/Ifc4x2.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_rc1
|
2021-02-02 11:49:42 +01:00
|
|
|
#include "../ifcparse/Ifc4x3_rc1.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_rc2
|
2021-02-14 12:43:27 +01:00
|
|
|
#include "../ifcparse/Ifc4x3_rc2.h"
|
2021-05-11 22:29:16 +02:00
|
|
|
#endif
|
2022-07-17 21:13:46 +02:00
|
|
|
#ifdef HAS_SCHEMA_4x3_rc3
|
|
|
|
|
#include "../ifcparse/Ifc4x3_rc3.h"
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_rc4
|
|
|
|
|
#include "../ifcparse/Ifc4x3_rc4.h"
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3
|
|
|
|
|
#include "../ifcparse/Ifc4x3.h"
|
|
|
|
|
#endif
|
2022-11-23 13:23:49 +01:00
|
|
|
#ifdef HAS_SCHEMA_4x3_tc1
|
|
|
|
|
#include "../ifcparse/Ifc4x3_tc1.h"
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAS_SCHEMA_4x3_add1
|
|
|
|
|
#include "../ifcparse/Ifc4x3_add1.h"
|
|
|
|
|
#endif
|
2023-12-19 12:40:38 +01:00
|
|
|
#ifdef HAS_SCHEMA_4x3_add2
|
|
|
|
|
#include "../ifcparse/Ifc4x3_add2.h"
|
|
|
|
|
#endif
|
2021-05-11 22:29:16 +02:00
|
|
|
|
2021-02-02 11:49:42 +01:00
|
|
|
#include "../ifcparse/IfcBaseClass.h"
|
|
|
|
|
#include "../ifcparse/IfcFile.h"
|
|
|
|
|
#include "../ifcparse/IfcSchema.h"
|
|
|
|
|
#include "../ifcparse/utils.h"
|
2023-11-15 10:32:20 +01:00
|
|
|
|
|
|
|
|
#include "../ifcgeom/ConversionSettings.h"
|
|
|
|
|
#include "../ifcgeom/ConversionResult.h"
|
2021-02-02 11:49:42 +01:00
|
|
|
|
2021-08-07 23:09:19 +02:00
|
|
|
#include "../svgfill/src/svgfill.h"
|
2021-02-02 11:49:42 +01:00
|
|
|
%}
|
|
|
|
|
|
2015-01-10 23:01:52 +00:00
|
|
|
%include "IfcGeomWrapper.i"
|
|
|
|
|
%include "IfcParseWrapper.i"
|
2024-02-29 17:17:59 +11:00
|
|
|
%include "std_vector.i"
|
2021-08-04 18:24:47 +02:00
|
|
|
|
|
|
|
|
namespace std {
|
|
|
|
|
%template(float_array_3) array<double, 3>;
|
2024-02-29 17:17:59 +11:00
|
|
|
%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>>;
|
2021-08-04 18:24:47 +02:00
|
|
|
}
|