]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/src/BRepBuilderAPI.i
Scale tooltip font by display DPI.
[simantics/3d.git] / org.jcae.opencascade / src / BRepBuilderAPI.i
1 /*/*
2  * Project Info:  http://jcae.sourceforge.net
3  * 
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation; either version 2.1 of the License, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17  *
18  * (C) Copyright 2005, by EADS CRC
19  */
20
21 %{
22 #include <BRepBuilderAPI_Transform.hxx>
23 #include <BRepBuilderAPI_ModifyShape.hxx>
24 #include <BRepBuilderAPI_MakeShape.hxx>
25 #include <BRepBuilderAPI_MakeWire.hxx>
26 #include <BRepBuilderAPI_MakeVertex.hxx>
27 #include <BRepBuilderAPI_MakeEdge.hxx>
28 #include <BRepBuilderAPI_MakeFace.hxx>
29 #include <BRepBuilderAPI_MakeShell.hxx>
30 #include <BRepBuilderAPI_MakeSolid.hxx>
31 #include <BRepBuilderAPI_NurbsConvert.hxx>
32 #include <BRepOffsetAPI_ThruSections.hxx>
33 #include <Standard_Version.hxx>
34 #if OCC_VERSION_MAJOR >= 6
35 #include <BRepBuilderAPI_Sewing.hxx>
36 #else
37 #include <BRepAlgo_Sewing.hxx>
38 #define BRepBuilderAPI_Sewing BRepAlgo_Sewing
39 #endif
40 %}
41
42 class BRepBuilderAPI_Command
43 {
44         %rename(isDone) IsDone;
45         BRepBuilderAPI_Command()=0;
46         public:
47         virtual Standard_Boolean  IsDone() const;
48 };
49
50 class BRepBuilderAPI_MakeShape: public BRepBuilderAPI_Command
51 {
52         //Hide the constructor to make this class abstract
53         BRepBuilderAPI_MakeShape()=0;
54         public:
55         %rename(build) Build;
56         %rename(shape) Shape;
57         virtual void Build();
58         // FIXME: 7.3.0
59         //const TopoDS_Shape& Shape() const;
60         const TopoDS_Shape& Shape();
61 };
62
63 class BRepBuilderAPI_ModifyShape: public BRepBuilderAPI_MakeShape
64 {
65         BRepBuilderAPI_ModifyShape()=0;
66         public:
67 };
68
69 %extend BRepBuilderAPI_ModifyShape {
70     // Use %extend to be compatible with OCE < 0.18 and OCE >= 0.18
71         TopoDS_Shape modifiedShape(const TopoDS_Shape& S) const {
72                 return self->ModifiedShape(S);
73         }
74 }
75
76 class BRepBuilderAPI_Transform : public BRepBuilderAPI_ModifyShape
77 {
78         %rename(perform) Perform;
79         public:
80         BRepBuilderAPI_Transform(const gp_Trsf& T);
81         BRepBuilderAPI_Transform(const TopoDS_Shape& S, const gp_Trsf& T,
82                 const Standard_Boolean Copy = Standard_False);
83         void Perform(const TopoDS_Shape& S,
84                 const Standard_Boolean Copy = Standard_False) ;
85 };
86
87 class BRepBuilderAPI_MakeVertex: public BRepBuilderAPI_MakeShape
88 {
89         %rename(vertex) Vertex;
90         public:
91         BRepBuilderAPI_MakeVertex(const gp_Pnt& P);
92         //const TopoDS_Vertex& Vertex() const;
93 };
94
95 class BRepBuilderAPI_MakeWire : public BRepBuilderAPI_MakeShape
96 {
97         %rename(wire) Wire;
98         %rename(add) Add;
99         %rename(isDone) IsDone;
100         public:
101         BRepBuilderAPI_MakeWire();
102         BRepBuilderAPI_MakeWire(const TopoDS_Edge& E);
103         BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,const TopoDS_Edge& E2);
104         BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,const TopoDS_Edge& E2,
105                 const TopoDS_Edge& E3);
106         BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,const TopoDS_Edge& E2,
107                 const TopoDS_Edge& E3,const TopoDS_Edge& E4);
108         BRepBuilderAPI_MakeWire(const TopoDS_Wire& W);
109         BRepBuilderAPI_MakeWire(const TopoDS_Wire& W,const TopoDS_Edge& E);
110         void Add(const TopoDS_Edge& E) ;
111         void Add(const TopoDS_Wire& W) ;
112         void Add(const TopTools_ListOfShape & shapes);
113         Standard_Boolean IsDone() const;
114         const TopoDS_Wire& Wire();
115 };
116
117 class BRepBuilderAPI_MakeEdge : public BRepBuilderAPI_MakeShape
118 {
119         %rename(edge) Edge;
120         %rename(isDone) IsDone;
121         public:
122         BRepBuilderAPI_MakeEdge();
123         BRepBuilderAPI_MakeEdge(const Handle_Geom_Curve& L);
124         BRepBuilderAPI_MakeEdge(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
125         BRepBuilderAPI_MakeEdge(const gp_Pnt& P1,const gp_Pnt& P2);
126         BRepBuilderAPI_MakeEdge(const gp_Circ& L);
127         BRepBuilderAPI_MakeEdge(const gp_Circ& L,const Standard_Real p1,const Standard_Real p2);
128         BRepBuilderAPI_MakeEdge(const gp_Circ& L,const gp_Pnt& P1,const gp_Pnt& P2);
129         BRepBuilderAPI_MakeEdge(const gp_Circ& L,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
130         BRepBuilderAPI_MakeEdge(const gp_Parab& L);
131         BRepBuilderAPI_MakeEdge(const gp_Parab& L,const Standard_Real p1,const Standard_Real p2);
132         BRepBuilderAPI_MakeEdge(const gp_Parab& L,const gp_Pnt& P1,const gp_Pnt& P2);
133         BRepBuilderAPI_MakeEdge(const gp_Parab& L,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
134         BRepBuilderAPI_MakeEdge(const Handle_Geom2d_Curve& L, const Handle_Geom_Surface& S);
135     BRepBuilderAPI_MakeEdge(const Handle_Geom_TrimmedCurve& L);
136         Standard_Boolean IsDone() const;
137         // FIXME: 7.3.0
138         //const TopoDS_Edge& Edge() const;
139         const TopoDS_Edge& Edge();
140         
141         BRepBuilderAPI_MakeEdge(const gp_Lin& L);
142         BRepBuilderAPI_MakeEdge(const gp_Lin& L,const Standard_Real p1,const Standard_Real p2);
143     BRepBuilderAPI_MakeEdge(const gp_Lin& L,const gp_Pnt& P1,const gp_Pnt& P2);
144     BRepBuilderAPI_MakeEdge(const gp_Lin& L,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
145     BRepBuilderAPI_MakeEdge(const gp_Elips& L);
146         BRepBuilderAPI_MakeEdge(const gp_Elips& L,const Standard_Real p1,const Standard_Real p2);
147         BRepBuilderAPI_MakeEdge(const gp_Elips& L,const gp_Pnt& P1,const gp_Pnt& P2);
148         BRepBuilderAPI_MakeEdge(const gp_Elips& L,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
149         BRepBuilderAPI_MakeEdge(const gp_Hypr& L);
150         BRepBuilderAPI_MakeEdge(const gp_Hypr& L,const Standard_Real p1,const Standard_Real p2);
151         BRepBuilderAPI_MakeEdge(const gp_Hypr& L,const gp_Pnt& P1,const gp_Pnt& P2);
152         BRepBuilderAPI_MakeEdge(const gp_Hypr& L,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
153         BRepBuilderAPI_MakeEdge(const Handle_Geom_Curve& L,const Standard_Real p1,const Standard_Real p2);
154         BRepBuilderAPI_MakeEdge(const Handle_Geom_Curve& L,const gp_Pnt& P1,const gp_Pnt& P2);
155         BRepBuilderAPI_MakeEdge(const Handle_Geom_Curve& L,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
156         BRepBuilderAPI_MakeEdge(const Handle_Geom_Curve& L,const gp_Pnt& P1,const gp_Pnt& P2,const Standard_Real p1,const Standard_Real p2);
157         BRepBuilderAPI_MakeEdge(const Handle_Geom_Curve& L,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2,const Standard_Real p1,const Standard_Real p2);
158         BRepBuilderAPI_MakeEdge(const Handle_Geom2d_Curve& L,const Handle_Geom_Surface& S);
159         BRepBuilderAPI_MakeEdge(const Handle_Geom2d_Curve& L,const Handle_Geom_Surface& S,const Standard_Real p1,const Standard_Real p2);
160         BRepBuilderAPI_MakeEdge(const Handle_Geom2d_Curve& L,const Handle_Geom_Surface& S,const gp_Pnt& P1,const gp_Pnt& P2);
161         BRepBuilderAPI_MakeEdge(const Handle_Geom2d_Curve& L,const Handle_Geom_Surface& S,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
162         BRepBuilderAPI_MakeEdge(const Handle_Geom2d_Curve& L,const Handle_Geom_Surface& S,const gp_Pnt& P1,const gp_Pnt& P2,const Standard_Real p1,const Standard_Real p2);
163         
164 };
165
166 class BRepBuilderAPI_MakeFace  : public BRepBuilderAPI_MakeShape
167 {
168         %rename(face) Face;
169         public:
170         BRepBuilderAPI_MakeFace(const TopoDS_Wire& W,
171                 const Standard_Boolean OnlyPlane = Standard_False);
172     BRepBuilderAPI_MakeFace(const TopoDS_Face& F,const TopoDS_Wire& W);
173         //const TopoDS_Face& Face() const;
174 };
175
176 class BRepBuilderAPI_MakeSolid: public BRepBuilderAPI_MakeShape
177 {
178         %rename(add) Add;
179         %rename(isDone) IsDone;
180         %rename(isDeleted) IsDeleted;
181         public:
182         BRepBuilderAPI_MakeSolid();
183         BRepBuilderAPI_MakeSolid(const TopoDS_CompSolid& S);
184         BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S);
185         BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1,const TopoDS_Shell& S2);
186         BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1,const TopoDS_Shell& S2,const TopoDS_Shell& S3);
187         BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So);
188         BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So,const TopoDS_Shell& S);
189         void Add(const TopoDS_Shell& S) ;
190         Standard_Boolean IsDone() const;
191         Standard_Boolean IsDeleted(const TopoDS_Shape& S) ;
192 };
193
194 class BRepBuilderAPI_Sewing
195 {
196         public:
197         
198         %rename(init) Init;
199         %rename(add) Add;
200         %rename(perform) Perform;
201         %rename(sewedShape) SewedShape;
202
203         %rename(load) Load;
204         %rename(nbFreeEdges) NbFreeEdges;
205         %rename(freeEdge) FreeEdge;
206         %rename(nbMultipleEdges) NbMultipleEdges;
207         %rename(multipleEdge) MultipleEdge;
208         %rename(nbDegeneratedShapes) NbDegeneratedShapes;
209         %rename(degeneratedShape) DegeneratedShape;
210         %rename(nbDeletedFaces) NbDeletedFaces;
211         %rename(deletedFace) DeletedFace;
212         %rename(isDegenerated) IsDegenerated;
213         %rename(isModified) IsModified;
214         %rename(modified) Modified;
215         %rename(dump) Dump;
216
217         %rename(isModifiedSubShape) IsModifiedSubShape;
218         %rename(modifiedSubShape) ModifiedSubShape;
219
220         BRepBuilderAPI_Sewing(const Standard_Real tolerance = 1.0e-06,
221                 const Standard_Boolean option = Standard_True,
222                 const Standard_Boolean cutting = Standard_True,
223                 const Standard_Boolean nonmanifold = Standard_False);
224         void Init(const Standard_Real tolerance,
225                 const Standard_Boolean option = Standard_True,
226                 const Standard_Boolean cutting = Standard_True,
227                 const Standard_Boolean nonmanifold = Standard_False) ;
228         void Load(const TopoDS_Shape& shape) ;
229         void Add(const TopoDS_Shape& shape) ;
230         void Perform() ;
231         const TopoDS_Shape& SewedShape() const;
232         Standard_Integer NbFreeEdges() const;
233         const TopoDS_Edge& FreeEdge(const Standard_Integer index) const;
234         Standard_Integer NbMultipleEdges() const;
235         const TopoDS_Edge& MultipleEdge(const Standard_Integer index) const;
236         Standard_Integer NbDegeneratedShapes() const;
237         const TopoDS_Shape& DegeneratedShape(const Standard_Integer index) const;
238         Standard_Integer NbDeletedFaces() const;
239         const TopoDS_Face& DeletedFace(const Standard_Integer index) const;
240         Standard_Boolean IsDegenerated(const TopoDS_Shape& shape) const;
241         Standard_Boolean IsModified(const TopoDS_Shape& shape) const;
242         const TopoDS_Shape& Modified(const TopoDS_Shape& shape) const;
243         void Dump() const;
244
245         Standard_Boolean IsModifiedSubShape(const TopoDS_Shape& shape) const;
246         TopoDS_Shape ModifiedSubShape(const TopoDS_Shape& shape) const;
247 };
248
249 class BRepBuilderAPI_NurbsConvert : public BRepBuilderAPI_ModifyShape
250 {
251         %rename(perform) Perform;
252         public:
253         BRepBuilderAPI_NurbsConvert();
254         BRepBuilderAPI_NurbsConvert(const TopoDS_Shape& S,
255                 const Standard_Boolean Copy = Standard_False);
256         void Perform(const TopoDS_Shape& S,
257                 const Standard_Boolean Copy = Standard_False) ;
258 };
259
260 class BRepOffsetAPI_ThruSections  : public BRepBuilderAPI_MakeShape
261 {
262 public:
263         %rename(addWire) AddWire;
264         %rename(checkCompatibility) CheckCompatibility;
265
266         %rename(init) Init;
267         %rename(addVertex) AddVertex;
268         %rename(build) Build;
269
270         BRepOffsetAPI_ThruSections(const Standard_Boolean isSolid = Standard_False, const Standard_Boolean ruled = Standard_False, const Standard_Real pres3d = 1.0e-06);
271         void AddWire (const TopoDS_Wire& wire) ;
272         void CheckCompatibility (const Standard_Boolean check = Standard_True) ;
273     const  TopoDS_Shape& Shape();
274
275         void Init(const Standard_Boolean isSolid = Standard_False,const Standard_Boolean ruled = Standard_False,const Standard_Real pres3d = 1.0e-06) ;
276         void AddVertex(const TopoDS_Vertex& aVertex) ;
277         void Build();
278 };
279
280 /**
281   * VTT
282 */
283
284 class BRepBuilderAPI_MakeShell  : public BRepBuilderAPI_MakeShape {
285   %rename(init) Init;
286   %rename(isDone) IsDone;
287   %rename(error) Error;
288   public:
289   BRepBuilderAPI_MakeShell();
290   BRepBuilderAPI_MakeShell(const Handle_Geom_Surface& S,const Standard_Boolean Segment = Standard_False);
291   BRepBuilderAPI_MakeShell(const Handle_Geom_Surface& S,const Standard_Real UMin,const Standard_Real UMax,const Standard_Real VMin,const Standard_Real VMax,const Standard_Boolean Segment = Standard_False);
292   void Init(const Handle_Geom_Surface& S,const Standard_Real UMin,const Standard_Real UMax,const Standard_Real VMin,const Standard_Real VMax,const Standard_Boolean Segment = Standard_False) ;
293   Standard_Boolean IsDone() const;
294   BRepBuilderAPI_ShellError Error();
295   const TopoDS_Shell& Shell();
296 };