1 // Copyright (C) 2014-2024 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "GeomAPI_swig.h"
26 // to avoid error on this
27 #define GEOMAPI_EXPORT
29 // standard definitions
34 %include "std_shared_ptr.i"
35 %include "std_string.i"
38 %shared_ptr(GeomAPI_AISObject)
39 %shared_ptr(GeomAPI_Angle)
40 %shared_ptr(GeomAPI_Angle2d)
41 %shared_ptr(GeomAPI_Ax1)
42 %shared_ptr(GeomAPI_Ax2)
43 %shared_ptr(GeomAPI_Ax3)
44 %shared_ptr(GeomAPI_Box)
45 %shared_ptr(GeomAPI_BSpline)
46 %shared_ptr(GeomAPI_BSpline2d)
47 %shared_ptr(GeomAPI_Circ)
48 %shared_ptr(GeomAPI_Circ2d)
49 %shared_ptr(GeomAPI_Cone)
50 %shared_ptr(GeomAPI_Curve)
51 %shared_ptr(GeomAPI_Cylinder)
52 %shared_ptr(GeomAPI_DataMapOfShapeMapOfShapes)
53 %shared_ptr(GeomAPI_DataMapOfShapeShape)
54 %shared_ptr(GeomAPI_IndexedMapOfShape)
55 %shared_ptr(GeomAPI_Dir)
56 %shared_ptr(GeomAPI_Dir2d)
57 %shared_ptr(GeomAPI_Edge)
58 %shared_ptr(GeomAPI_Ellipse)
59 %shared_ptr(GeomAPI_Ellipse2d)
60 %shared_ptr(GeomAPI_Face)
61 %shared_ptr(GeomAPI_ICustomPrs)
62 %shared_ptr(GeomAPI_Interface)
63 %shared_ptr(GeomAPI_IPresentable)
64 %shared_ptr(GeomAPI_Lin)
65 %shared_ptr(GeomAPI_Lin2d)
66 %shared_ptr(GeomAPI_PlanarEdges)
67 %shared_ptr(GeomAPI_Pln)
68 %shared_ptr(GeomAPI_Pnt)
69 %shared_ptr(GeomAPI_Pnt2d)
70 %shared_ptr(GeomAPI_Shape)
71 %shared_ptr(GeomAPI_ShapeExplorer)
72 %shared_ptr(GeomAPI_ShapeIterator)
73 %shared_ptr(GeomAPI_Shell)
74 %shared_ptr(GeomAPI_Solid)
75 %shared_ptr(GeomAPI_Sphere)
76 %shared_ptr(GeomAPI_Torus)
77 %shared_ptr(GeomAPI_Trsf)
78 %shared_ptr(GeomAPI_Vertex)
79 %shared_ptr(GeomAPI_Wire)
80 %shared_ptr(GeomAPI_WireExplorer)
81 %shared_ptr(GeomAPI_XY)
82 %shared_ptr(GeomAPI_XYZ)
85 %typemap(in) std::list<std::shared_ptr<GeomAPI_Pnt> > &thePoints (std::list<std::shared_ptr<GeomAPI_Pnt> > temp) {
86 std::shared_ptr<GeomAPI_Pnt> * temp_pnt;
88 if (PySequence_Check($input)) {
89 for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
90 PyObject * item = PySequence_GetItem($input, i);
91 if ((SWIG_ConvertPtrAndOwn(item, (void **)&temp_pnt, $descriptor(std::shared_ptr<GeomAPI_Pnt> *), SWIG_POINTER_EXCEPTION, &newmem)) == 0) {
93 PyErr_SetString(PyExc_TypeError, "argument must be list of GeomAPI_Pnt.");
96 temp.push_back(*temp_pnt);
97 if (newmem & SWIG_CAST_NEW_MEMORY) {
105 PyErr_SetString(PyExc_ValueError, "argument must be list of GeomAPI_Pnt.");
110 %typemap(in, numinputs=0) double & (double temp) {
114 %typemap(argout) double & {
115 $result = SWIG_Python_AppendOutput($result, PyFloat_FromDouble(*$1));
118 // std::dynamic_pointer_cast
119 template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject);
120 %template(shapeToEdge) shared_ptr_cast<GeomAPI_Edge, GeomAPI_Shape>;
123 // all supported interfaces
124 %include "GeomAPI_Interface.h"
125 %include "GeomAPI_Shape.h"
126 %include "GeomAPI_AISObject.h"
127 %include "GeomAPI_Angle.h"
128 %include "GeomAPI_Angle2d.h"
129 %include "GeomAPI_Ax1.h"
130 %include "GeomAPI_Ax2.h"
131 %include "GeomAPI_Ax3.h"
132 %include "GeomAPI_Box.h"
133 %include "GeomAPI_BSpline.h"
134 %include "GeomAPI_BSpline2d.h"
135 %include "GeomAPI_Circ.h"
136 %include "GeomAPI_Circ2d.h"
137 %include "GeomAPI_Cone.h"
138 %include "GeomAPI_Curve.h"
139 %include "GeomAPI_Cylinder.h"
140 %include "GeomAPI_DataMapOfShapeMapOfShapes.h"
141 %include "GeomAPI_DataMapOfShapeShape.h"
142 %include "GeomAPI_IndexedMapOfShape.h"
143 %include "GeomAPI_Dir.h"
144 %include "GeomAPI_Dir2d.h"
145 %include "GeomAPI_Edge.h"
146 %include "GeomAPI_Ellipse.h"
147 %include "GeomAPI_Ellipse2d.h"
148 %include "GeomAPI_Face.h"
149 %include "GeomAPI_ICustomPrs.h"
150 %include "GeomAPI_IPresentable.h"
151 %include "GeomAPI_Lin.h"
152 %include "GeomAPI_Lin2d.h"
153 %include "GeomAPI_PlanarEdges.h"
154 %include "GeomAPI_Pln.h"
155 %include "GeomAPI_Pnt.h"
156 %include "GeomAPI_Pnt2d.h"
157 %include "GeomAPI_ShapeExplorer.h"
158 %include "GeomAPI_ShapeIterator.h"
159 %include "GeomAPI_Shell.h"
160 %include "GeomAPI_Solid.h"
161 %include "GeomAPI_Sphere.h"
162 %include "GeomAPI_Torus.h"
163 %include "GeomAPI_Trsf.h"
164 %include "GeomAPI_Vertex.h"
165 %include "GeomAPI_Wire.h"
166 %include "GeomAPI_WireExplorer.h"
167 %include "GeomAPI_XY.h"
168 %include "GeomAPI_XYZ.h"
171 %template(PointList) std::list<std::shared_ptr<GeomAPI_Pnt> >;
172 %template(ShapeList) std::list<std::shared_ptr<GeomAPI_Shape> >;
174 %template(CurveSet) std::set<std::shared_ptr<GeomAPI_Curve>, GeomAPI_Curve::Comparator>;
175 %template(ShapeSet) std::set<std::shared_ptr<GeomAPI_Shape>, GeomAPI_Shape::Comparator>;
176 %template(OriShapeSet) std::set<std::shared_ptr<GeomAPI_Shape>, GeomAPI_Shape::ComparatorWithOri>;
178 %template(ShapeToShapesMap) std::map<std::shared_ptr<GeomAPI_Shape>, std::set<std::shared_ptr<GeomAPI_Shape>, GeomAPI_Shape::ComparatorWithOri>, GeomAPI_Shape::Comparator>;