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
|
|
|
|
2025-02-23 15:22:36 +01:00
|
|
|
%{
|
|
|
|
|
#include <array>
|
|
|
|
|
%}
|
|
|
|
|
%template(DoubleArray3) std::array<double, 3>;
|
|
|
|
|
|
2023-11-15 10:32:20 +01:00
|
|
|
%ignore ifcopenshell::geometry::Converter;
|
2013-05-11 15:26:35 +00:00
|
|
|
|
2024-12-29 15:53:21 +01:00
|
|
|
// Not relevant for python: new_IfcBaseClass() calls instantiate()
|
|
|
|
|
%ignore schema_definition::instantiate;
|
|
|
|
|
|
|
|
|
|
// Irrelevant abstract base that only has anonymous concrete implementations
|
|
|
|
|
%ignore instance_factory;
|
|
|
|
|
|
|
|
|
|
// Not relevant for python usage
|
2026-01-04 10:40:02 +01:00
|
|
|
%ignore express::Base::data;
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore *::references_to_resolve;
|
|
|
|
|
|
|
|
|
|
// SVG serializer internal
|
|
|
|
|
%ignore geometry_data;
|
|
|
|
|
%ignore vertical_section;
|
|
|
|
|
%ignore horizontal_plan;
|
|
|
|
|
%ignore storey_sorter;
|
|
|
|
|
%ignore layerset_information;
|
|
|
|
|
|
|
|
|
|
// taxonomy
|
|
|
|
|
// - tuples
|
|
|
|
|
%ignore curves;
|
|
|
|
|
%ignore surfaces;
|
|
|
|
|
%ignore upgrades;
|
|
|
|
|
|
|
|
|
|
%ignore loop_to_face_upgrade_impl;
|
|
|
|
|
%ignore curve_to_edge_upgrade_impl;
|
|
|
|
|
%ignore curve_to_loop_upgrade_impl;
|
|
|
|
|
%ignore edge_to_loop_upgrade_impl;
|
|
|
|
|
%ignore curve_to_face_upgrade_impl;
|
2025-02-22 16:04:01 -08:00
|
|
|
%ignore loop_to_function_item_upgrade_impl;
|
2024-12-29 15:53:21 +01:00
|
|
|
|
2025-10-26 10:03:33 +01:00
|
|
|
%ignore IfcGeom::geometry_exception;
|
|
|
|
|
%ignore IfcGeom::too_many_faces_exception;
|
|
|
|
|
%ignore ifcopenshell::geometry::taxonomy::topology_error;
|
|
|
|
|
|
2024-12-29 15:53:21 +01:00
|
|
|
// settings, can this done more generally?
|
2025-08-07 12:12:33 +05:00
|
|
|
// GeometrySerializer.h
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore UseElementNames;
|
|
|
|
|
%ignore UseElementGuids;
|
|
|
|
|
%ignore UseElementStepIds;
|
|
|
|
|
%ignore UseElementTypes;
|
|
|
|
|
%ignore UseYUp;
|
|
|
|
|
%ignore WriteGltfEcef;
|
|
|
|
|
%ignore FloatingPointDigits;
|
|
|
|
|
%ignore BaseUri;
|
|
|
|
|
%ignore WktUseSection;
|
2026-03-18 12:16:28 +05:00
|
|
|
%ignore SeparateZUpNode;
|
2026-07-22 16:26:13 +05:00
|
|
|
%ignore SvgBounds;
|
|
|
|
|
%ignore SvgScale;
|
|
|
|
|
%ignore SvgCenter;
|
|
|
|
|
%ignore SvgSectionRef;
|
|
|
|
|
%ignore SvgElevationRef;
|
|
|
|
|
%ignore SvgElevationRefGuid;
|
|
|
|
|
%ignore SvgAutoSection;
|
|
|
|
|
%ignore SvgAutoElevation;
|
|
|
|
|
%ignore SvgDrawStoreyHeights;
|
|
|
|
|
%ignore SvgProfileThreshold;
|
|
|
|
|
%ignore SvgStoreyHeightLineLength;
|
|
|
|
|
%ignore SvgUseNamespace;
|
|
|
|
|
%ignore SvgUseHlrPoly;
|
|
|
|
|
%ignore SvgUsePrefiltering;
|
|
|
|
|
%ignore SvgUnifyInputs;
|
|
|
|
|
%ignore SvgSegmentProjection;
|
|
|
|
|
%ignore SvgSubtractBefore;
|
|
|
|
|
%ignore SvgPolygonal;
|
|
|
|
|
%ignore SvgAlwaysProject;
|
|
|
|
|
%ignore SvgWithoutStoreys;
|
|
|
|
|
%ignore SvgNoCss;
|
|
|
|
|
%ignore SvgMirrorY;
|
|
|
|
|
%ignore SvgMirrorX;
|
|
|
|
|
%ignore SvgDoorArcs;
|
|
|
|
|
%ignore SvgSectionHeight;
|
|
|
|
|
%ignore SvgSectionHeightFromStoreys;
|
|
|
|
|
%ignore SvgPrintSpaceNames;
|
|
|
|
|
%ignore SvgPrintSpaceAreas;
|
|
|
|
|
%ignore SvgSpaceNameTransform;
|
2025-08-07 12:12:33 +05:00
|
|
|
// ConversionSettings.h
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore MesherLinearDeflection;
|
|
|
|
|
%ignore MesherAngularDeflection;
|
|
|
|
|
%ignore ReorientShells;
|
|
|
|
|
%ignore LengthUnit;
|
|
|
|
|
%ignore PlaneUnit;
|
|
|
|
|
%ignore Precision;
|
|
|
|
|
%ignore LayersetFirst;
|
|
|
|
|
%ignore DisableBooleanResult;
|
|
|
|
|
%ignore NoWireIntersectionCheck;
|
|
|
|
|
%ignore NoWireIntersectionTolerance;
|
|
|
|
|
%ignore PrecisionFactor;
|
|
|
|
|
%ignore DebugBooleanOperations;
|
|
|
|
|
%ignore BooleanAttempt2d;
|
|
|
|
|
%ignore WeldVertices;
|
|
|
|
|
%ignore UseWorldCoords;
|
|
|
|
|
%ignore UnifyShapes;
|
|
|
|
|
%ignore UseMaterialNames;
|
|
|
|
|
%ignore ConvertBackUnits;
|
|
|
|
|
%ignore ContextIds;
|
|
|
|
|
%ignore ContextTypes;
|
|
|
|
|
%ignore ContextIdentifiers;
|
2026-07-22 16:33:37 +05:00
|
|
|
%ignore ContextPriorities;
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore OutputDimensionality;
|
2026-07-22 16:33:37 +05:00
|
|
|
%ignore MaxVoidsPerElement;
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore IteratorOutput;
|
|
|
|
|
%ignore DisableOpeningSubtractions;
|
|
|
|
|
%ignore ApplyDefaultMaterials;
|
|
|
|
|
%ignore DontEmitNormals;
|
|
|
|
|
%ignore GenerateUvs;
|
|
|
|
|
%ignore ApplyLayerSets;
|
|
|
|
|
%ignore UseElementHierarchy;
|
|
|
|
|
%ignore ValidateQuantities;
|
|
|
|
|
%ignore EdgeArrows;
|
|
|
|
|
%ignore SiteLocalPlacement;
|
|
|
|
|
%ignore BuildingLocalPlacement;
|
|
|
|
|
%ignore NoParallelMapping;
|
2025-08-07 12:12:33 +05:00
|
|
|
%ignore PermissiveShapeReuse;
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore ForceSpaceTransparency;
|
|
|
|
|
%ignore CircleSegments;
|
2025-08-07 12:12:33 +05:00
|
|
|
%ignore CgalSmoothAngleDegrees;
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore KeepBoundingBoxes;
|
|
|
|
|
%ignore SurfaceColour;
|
2025-08-07 12:12:33 +05:00
|
|
|
%ignore ComputeCurvature;
|
|
|
|
|
%ignore FunctionStepType;
|
|
|
|
|
%ignore FunctionStepParam;
|
2024-12-29 15:53:21 +01:00
|
|
|
%ignore ModelOffset;
|
|
|
|
|
%ignore ModelRotation;
|
2025-08-07 12:12:33 +05:00
|
|
|
%ignore TriangulationType;
|
|
|
|
|
%ignore CgalEmitOriginalEdges;
|
|
|
|
|
%ignore OcctNoCleanTriangulation;
|
|
|
|
|
%ignore CacheShapes;
|
2026-03-18 12:16:28 +05:00
|
|
|
%ignore MakeVolume;
|
2025-08-07 12:12:33 +05:00
|
|
|
%ignore DeferProcessingFirstElement;
|
|
|
|
|
%ignore MaxOffset;
|
|
|
|
|
%ignore MaxOffsetDeviation;
|
|
|
|
|
%ignore ApplyOffset;
|
2025-11-19 10:43:52 +01:00
|
|
|
|
2026-07-24 18:24:24 +05:00
|
|
|
%ignore filetype;
|
|
|
|
|
%ignore guess_file_type;
|
|
|
|
|
|
2024-12-29 15:53:21 +01:00
|
|
|
// Triangulated representation helper struct
|
|
|
|
|
%ignore EdgeKey;
|
|
|
|
|
|
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
|
2026-03-31 15:32:36 +02:00
|
|
|
} catch(const ifcopenshell::attribute_out_of_range_exception& e) {
|
2015-06-17 11:27:02 +00:00
|
|
|
SWIG_exception(SWIG_IndexError, e.what());
|
2026-03-31 15:32:36 +02:00
|
|
|
} catch(const ifcopenshell::exception& 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"
|
2026-04-17 11:24:09 +02:00
|
|
|
#include "../ifcgeom/tree.h"
|
|
|
|
|
#include "../ifcgeom/Serialization/Serialization.h"
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/taxonomy.h"
|
2025-01-02 11:10:56 -08:00
|
|
|
#include "../ifcgeom/function_item_evaluator.h"
|
2023-03-22 11:17:14 +01:00
|
|
|
|
2026-01-04 10:40:02 +01:00
|
|
|
#include "../ifcparse/express.h"
|
2026-03-31 15:32:36 +02:00
|
|
|
#include "../ifcparse/file.h"
|
|
|
|
|
#include "../ifcparse/schema.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"
|
2026-04-21 16:18:59 +02:00
|
|
|
|
|
|
|
|
// @todo abstract into plug-in interface
|
|
|
|
|
#include "../serializers/RocksDbSerializer.h"
|
2011-05-08 11:04:32 +00:00
|
|
|
%}
|
|
|
|
|
|
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"
|
2026-04-17 11:24:09 +02:00
|
|
|
#include "../ifcgeom/tree.h"
|
|
|
|
|
#include "../ifcgeom/Serialization/Serialization.h"
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/taxonomy.h"
|
2025-01-02 11:10:56 -08:00
|
|
|
#include "../ifcgeom/function_item_evaluator.h"
|
2023-03-21 20:15:01 +01:00
|
|
|
#include "../ifcgeom/Iterator.h"
|
2023-11-02 09:04:34 +01:00
|
|
|
#include "../ifcgeom/ConversionResult.h"
|
2025-09-26 14:24:49 +02:00
|
|
|
#include "../ifcgeom/hybrid_kernel.h"
|
2026-05-08 16:20:26 +02:00
|
|
|
#include "../ifcgeom/GeometrySerializer.h"
|
2021-07-11 15:03:21 +02:00
|
|
|
|
2026-01-04 10:40:02 +01:00
|
|
|
#include "../ifcparse/express.h"
|
2026-03-31 15:32:36 +02:00
|
|
|
#include "../ifcparse/file.h"
|
|
|
|
|
#include "../ifcparse/schema.h"
|
2021-02-02 11:49:42 +01:00
|
|
|
#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"
|
2026-04-21 16:18:59 +02:00
|
|
|
|
|
|
|
|
// @todo abstract into plug-in interface
|
|
|
|
|
#include "../serializers/RocksDbSerializer.h"
|
2021-02-02 11:49:42 +01:00
|
|
|
%}
|
|
|
|
|
|
2026-05-07 14:43:26 +02:00
|
|
|
%{
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
namespace ifcopenshell {
|
|
|
|
|
namespace plugin {
|
|
|
|
|
void set_search_paths(const std::vector<std::string>& paths);
|
|
|
|
|
std::vector<std::string> search_paths();
|
|
|
|
|
void clear_search_paths();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
%inline %{
|
|
|
|
|
void set_plugin_search_paths(const std::vector<std::string>& paths) {
|
|
|
|
|
ifcopenshell::plugin::set_search_paths(paths);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> get_plugin_search_paths() {
|
|
|
|
|
return ifcopenshell::plugin::search_paths();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clear_plugin_search_paths() {
|
|
|
|
|
ifcopenshell::plugin::clear_search_paths();
|
|
|
|
|
}
|
|
|
|
|
%}
|
|
|
|
|
|
2015-01-10 23:01:52 +00:00
|
|
|
%include "IfcGeomWrapper.i"
|
|
|
|
|
%include "IfcParseWrapper.i"
|