Files
IfcOpenShell/src/ifcwrap/IfcPython.i
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

259 lines
7.6 KiB
OpenEdge ABL
Raw Normal View History

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
********************************************************************************/
%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
#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
%}
2021-11-08 10:58:55 +01:00
%include "stdint.i"
2020-10-26 14:10:13 +01:00
%include "std_array.i"
%include "std_vector.i"
2011-05-08 11:04:32 +00:00
%include "std_string.i"
%include "exception.i"
2024-05-23 13:06:57 +02:00
%include "std_shared_ptr.i"
%ignore IfcGeom::NumberNativeDouble;
2023-11-15 10:32:20 +01:00
%ignore ifcopenshell::geometry::Converter;
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 <;
%exception {
try {
$action
} catch(const IfcParse::IfcAttributeOutOfRangeException& e) {
SWIG_exception(SWIG_IndexError, e.what());
} catch(const IfcParse::IfcException& e) {
SWIG_exception(SWIG_RuntimeError, e.what());
} catch(const std::runtime_error& e) {
SWIG_exception(SWIG_RuntimeError, e.what());
} catch(...) {
SWIG_exception(SWIG_RuntimeError, "An unknown error occurred");
}
}
2011-05-08 11:04:32 +00:00
%include "../serializers/serializers_api.h"
// 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"
#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
#ifdef HAS_SCHEMA_2x3
2017-12-22 13:51:11 +01:00
#include "../ifcparse/Ifc2x3.h"
#endif
#ifdef HAS_SCHEMA_4
2017-12-22 13:51:11 +01:00
#include "../ifcparse/Ifc4.h"
#endif
#ifdef HAS_SCHEMA_4x1
#include "../ifcparse/Ifc4x1.h"
#endif
#ifdef HAS_SCHEMA_4x2
#include "../ifcparse/Ifc4x2.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc1
#include "../ifcparse/Ifc4x3_rc1.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc2
2021-02-14 12:43:27 +01:00
#include "../ifcparse/Ifc4x3_rc2.h"
#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"
#endif
#ifdef HAS_SCHEMA_4x3_tc1
#include "../ifcparse/Ifc4x3_tc1.h"
#endif
#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"
#endif
2017-06-05 17:26:58 +02:00
#include "../ifcparse/IfcBaseClass.h"
#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"
#include "../ifcgeom/ConversionResult.h"
#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
%}
%{
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;
%}
// Create docstrings for generated python code.
%feature("autodoc", "1");
%include "utils/type_conversion.i"
%include "utils/typemaps_in.i"
%include "utils/typemaps_out.i"
%module ifcopenshell_wrapper %{
2023-03-21 20:15:01 +01:00
#include "../ifcgeom/Converter.h"
#include "../ifcgeom/taxonomy.h"
#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"
#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"
#include "../serializers/TtlWktSerializer.h"
#ifdef HAS_SCHEMA_2x3
#include "../ifcparse/Ifc2x3.h"
#endif
#ifdef HAS_SCHEMA_4
#include "../ifcparse/Ifc4.h"
#endif
#ifdef HAS_SCHEMA_4x1
#include "../ifcparse/Ifc4x1.h"
#endif
#ifdef HAS_SCHEMA_4x2
#include "../ifcparse/Ifc4x2.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc1
#include "../ifcparse/Ifc4x3_rc1.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc2
2021-02-14 12:43:27 +01:00
#include "../ifcparse/Ifc4x3_rc2.h"
#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
#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
#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"
#include "../svgfill/src/svgfill.h"
%}
%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
}