2 * Project Info: http://jcae.sourceforge.net
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)
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
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.
18 * (C) Copyright 2005, by EADS CRC
19 * (C) Copyright 2008, 2009, by EADS France
26 //config.h generated by autotools from config.h.in (see an example in Opencascade).
29 #include <Adaptor3d_Curve.hxx>
31 #include <Poly_Triangulation.hxx>
34 // Handle enums with Java enums
38 // Handle C arrays as Java arrays
39 %include "arrays_java.i";
40 %apply double[] {double *};
41 %apply double[] {double &};
43 // load the native library
44 %pragma(java) jniclasscode=%{
47 System.loadLibrary("TKERNEL");
48 System.loadLibrary("TKMATH");
49 System.loadLibrary("TKG2D");
50 System.loadLibrary("TKG3D");
51 System.loadLibrary("TKGEOMBASE");
52 System.loadLibrary("TKBREP");
53 System.loadLibrary("TKGEOMALGO");
54 System.loadLibrary("TKTOPALGO");
55 System.loadLibrary("TKMESH");
57 System.loadLibrary("TKPRIM");
58 System.loadLibrary("TKSHHEALING");
59 System.loadLibrary("TKBO");
61 System.loadLibrary("TKBOOL");
62 System.loadLibrary("TKFILLET");
63 System.loadLibrary("TKOFFSET");
65 System.loadLibrary("TKXSBASE");
66 System.loadLibrary("TKIGES");
67 System.loadLibrary("TKSTEPBASE");
68 System.loadLibrary("TKSTEPATTR");
69 System.loadLibrary("TKSTEP209");
70 System.loadLibrary("TKSTEP");
72 System.loadLibrary("OccJava");
73 String mmg_opt= System.getenv("MMGT_OPT");
74 if(mmg_opt != null && !"0".equals(mmg_opt))
75 throw new RuntimeException("The MMGT_OPT environment variable must be set to 0 before using occjava.");
87 %include "GeomLProp_SLProps.i"
88 %include "BRepTools.i"
89 %include "BRepBuilderAPI.i"
90 %include "BRepOffsetAPI.i"
91 %include "BRepPrimAPI.i"
92 %include "BRepAlgoAPI.i"
96 %include "BRepFilletAPI.i"
97 %include "BRepCheck.i"
98 %include "ShapeBuild.i"
99 %include "XSControl.i"
100 %include "ShapeFix.i"
101 %include "APIHeaderSection_MakeHeader.i"
102 // This one require Opencascade 6.2
103 %include "ShapeUpgrade.i"
104 //Jens Schmidt, req. f. Thesis
109 %typemap(javacode) TopExp
111 public static TopoDS_Vertex[] vertices(TopoDS_Edge edge)
113 TopoDS_Vertex first=new TopoDS_Vertex();
114 TopoDS_Vertex second=new TopoDS_Vertex();
115 vertices(edge, first, second);
116 return new TopoDS_Vertex[]{first, second};
120 class TopLoc_Location
122 %rename(isIdentity) IsIdentity;
123 %rename(transformation) Transformation;
125 Standard_Boolean IsIdentity();
126 const gp_Trsf& Transformation();
132 %rename(vertices) Vertices;
133 static void Vertices(const TopoDS_Edge& E,TopoDS_Vertex& Vfirst,TopoDS_Vertex& Vlast,const Standard_Boolean CumOri = Standard_False) ;
139 %{#include "TopExp_Explorer.hxx"%}
140 class TopExp_Explorer
144 TopExp_Explorer(const TopoDS_Shape& S,const TopAbs_ShapeEnum ToFind,
145 const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE);
149 %rename(current) Current;
150 void Init(const TopoDS_Shape& S, const TopAbs_ShapeEnum ToFind,
151 const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE) ;
152 Standard_Boolean More() const;
154 const TopoDS_Shape & Current();
160 %{#include "Bnd_Box.hxx"%}
161 %typemap(javacode) Bnd_Box
164 * Return the array { Xmin, Ymin, Zmin, Xmax, Ymax, Zmax }
166 public double[] get()
168 double[] toReturn=new double[6];
176 %rename(isVoid) IsVoid;
179 Standard_Boolean IsVoid() const;
184 void get(double box[6])
187 self->Get(box[0], box[1], box[2], box[3], box[4], box[5]);
194 %{#include "BRepBndLib.hxx"%}
199 static void Add(const TopoDS_Shape& shape,Bnd_Box& bndBox);
205 %{#include "Adaptor2d_Curve2d.hxx"%}
207 class Adaptor2d_Curve2d
209 Adaptor2d_Curve2d()=0;
211 %rename(value) Value;
212 virtual gp_Pnt2d Value(const Standard_Real U) const;
216 * Geom2dAdaptor_Curve
218 %{#include "Geom2dAdaptor_Curve.hxx"%}
219 class Geom2dAdaptor_Curve: public Adaptor2d_Curve2d
223 Geom2dAdaptor_Curve();
224 Geom2dAdaptor_Curve(const Handle_Geom2d_Curve & C);
225 Geom2dAdaptor_Curve(const Handle_Geom2d_Curve & C,const Standard_Real UFirst,const Standard_Real ULast);
226 void Load(const Handle_Geom2d_Curve & C) ;
227 void Load(const Handle_Geom2d_Curve & C,const Standard_Real UFirst,const Standard_Real ULast) ;
233 %{#include "Adaptor3d_Curve.hxx"%}
235 class Adaptor3d_Curve
239 %rename(value) Value;
240 const gp_Pnt Value(const Standard_Real U) const;
243 //extends the Adaptor3d_Curve class to reduce the JNI overhead when
244 //calling a lot of Adaptor3d_Curve.Value
245 %extend Adaptor3d_Curve
248 void arrayValues(int size, double u[])
250 for (int i = 0; i < size; i++)
252 gp_Pnt gp=self->Value(u[3*i]);
263 %{#include "GeomAdaptor_Curve.hxx"%}
265 class GeomAdaptor_Curve: public Adaptor3d_Curve
270 GeomAdaptor_Curve(const Handle_Geom_Curve & C);
271 GeomAdaptor_Curve(const Handle_Geom_Curve & C,
272 const Standard_Real UFirst,const Standard_Real ULast);
273 void Load(const Handle_Geom_Curve & C) ;
274 void Load(const Handle_Geom_Curve & C,
275 const Standard_Real UFirst,const Standard_Real ULast) ;
283 %{#include "GProp_GProps.hxx"%}
284 // class GProp_GProps
287 // %rename(mass) Mass;
289 // Standard_Real Mass() const;
295 %rename(centreOfMass) CentreOfMass;
296 %rename(matrixOfInertia) MatrixOfInertia;
298 Standard_Real Mass() const;
299 gp_Pnt CentreOfMass() const;
300 gp_Mat MatrixOfInertia() const;
303 %{#include "GProp_PGProps.hxx"%}
304 class GProp_PGProps : public GProp_GProps
307 %{#include "GProp_CelGProps.hxx"%}
308 class GProp_CelGProps: public GProp_GProps
312 %{#include "GProp_SelGProps.hxx"%}
313 class GProp_SelGProps: public GProp_GProps
317 %{#include "GProp_VelGProps.hxx"%}
318 class GProp_VelGProps: public GProp_GProps
323 //%{#include "GProp_CGProps.gxx"%}
324 //class GProp_CGProps: public GProp_GProps
328 //%{#include "GProp_SGProps.gxx"%}
329 //class GProp_SGProps: public GProp_GProps
333 //%{#include "GProp_VGProps.gxx"%}
334 //class GProp_VGProps
342 %{#include "BRepGProp.hxx"%}
346 %rename(linearProperties) LinearProperties;
347 %rename(surfaceProperties) SurfaceProperties;
348 %rename(volumeProperties) VolumeProperties;
349 %rename(volumePropertiesGK) VolumePropertiesGK;
350 static void LinearProperties(const TopoDS_Shape& shape, GProp_GProps& properties);
351 static void VolumeProperties(const TopoDS_Shape& shape, GProp_GProps& properties, const Standard_Boolean onlyClosed = Standard_False) ;
352 static Standard_Real VolumeProperties(const TopoDS_Shape& shape, GProp_GProps& properties, const Standard_Real Eps, const Standard_Boolean onlyClosed = Standard_False) ;
353 static void SurfaceProperties(const TopoDS_Shape& shape, GProp_GProps& properties) ;
354 static Standard_Real SurfaceProperties(const TopoDS_Shape& shape, GProp_GProps& properties, const Standard_Real Eps) ;
355 static Standard_Real VolumePropertiesGK(const TopoDS_Shape& shape, GProp_GProps& properties, const Standard_Real Eps, const Standard_Boolean onlyClosed = Standard_False, const Standard_Boolean isUseSpan = Standard_False, const Standard_Boolean cgFlag = Standard_False, const Standard_Boolean iFlag = Standard_False) ;
361 %rename(VOID) IFSelect_RetVoid;
362 %rename(DONE) IFSelect_RetDone;
363 %rename(ERROR) IFSelect_RetError;
364 %rename(FAIL) IFSelect_RetFail;
365 %rename(STOP) IFSelect_RetStop;
366 enum IFSelect_ReturnStatus {
374 %{#include <ShapeAnalysis_FreeBounds.hxx>%}
375 class ShapeAnalysis_FreeBounds
377 %rename(getClosedWires) GetClosedWires;
378 %rename(getOpenWires) GetOpenWires;
380 ShapeAnalysis_FreeBounds(const TopoDS_Shape& shape,
381 const Standard_Boolean splitclosed = Standard_False,
382 const Standard_Boolean splitopen = Standard_True);
383 const TopoDS_Compound& GetClosedWires() const;
384 const TopoDS_Compound& GetOpenWires() const;
387 %{#include <GCPnts_UniformDeflection.hxx>%}
388 class GCPnts_UniformDeflection
390 %rename(initialize) Initialize;
391 %rename(nbPoints) NbPoints;
392 %rename(parameter) Parameter;
394 GCPnts_UniformDeflection();
395 void Initialize(Adaptor3d_Curve& C,const Standard_Real Deflection,
396 const Standard_Real U1,const Standard_Real U2,
397 const Standard_Boolean WithControl = Standard_True) ;
398 Standard_Integer NbPoints() const;
399 Standard_Real Parameter(const Standard_Integer Index) const;
402 %{#include <BRepMesh_DiscretRoot.hxx>%}
403 class BRepMesh_DiscretRoot
405 //%rename(setDeflection) SetDeflection;
406 //%rename(setAngle) SetAngle;
407 //%rename(deflection) Deflection;
408 //%rename(angle) Angle;
409 %rename(perform) Perform;
412 BRepMesh_DiscretRoot();
414 //void SetDeflection(const Standard_Real D) ;
415 //void SetAngle(const Standard_Real Ang) ;
416 //Standard_Real Deflection() const;
417 //Standard_Real Angle() const;
418 virtual void Perform();
421 %{#include <BRepMesh_IncrementalMesh.hxx>%}
422 class BRepMesh_IncrementalMesh : public BRepMesh_DiscretRoot
424 %rename(perform) Perform;
425 %rename(isModified) IsModified;
428 BRepMesh_IncrementalMesh();
429 BRepMesh_IncrementalMesh(const TopoDS_Shape& S,const Standard_Real D,
430 const Standard_Boolean Relatif = Standard_False,
431 const Standard_Real Ang = 0.5);
434 Standard_Boolean IsModified() const;
437 %{#include <GeomAPI_ProjectPointOnSurf.hxx>%}
439 %typemap(javacode) GeomAPI_ProjectPointOnSurf
441 public void lowerDistanceParameters(double[] uv)
443 double[] d2=new double[1];
444 lowerDistanceParameters(uv, d2);
449 class GeomAPI_ProjectPointOnSurf
452 %rename(nbPoints) NbPoints;
453 %rename(lowerDistanceParameters) LowerDistanceParameters;
454 %rename(lowerDistance) LowerDistance;
455 %rename(point) Point;
456 %rename(parameters) Parameters;
457 %rename(nearestPoint) NearestPoint;
459 GeomAPI_ProjectPointOnSurf(const gp_Pnt& P,
460 const Handle_Geom_Surface & Surface);
461 void Init(const gp_Pnt& P,const Handle_Geom_Surface & surface);
462 Standard_Integer NbPoints() const;
463 Standard_Real LowerDistance() const;
464 const gp_Pnt Point(const Standard_Integer Index) const;
465 void LowerDistanceParameters(Standard_Real& U,Standard_Real& V) const;
466 void Parameters(const Standard_Integer Index,Standard_Real& U,Standard_Real& V) const;
467 gp_Pnt NearestPoint() const;
473 %{#include <BRepAlgo.hxx>%}
476 %rename(isValid) IsValid;
477 %rename(isTopologicallyValid) IsTopologicallyValid;
479 static Standard_Boolean IsValid(const TopoDS_Shape& S);
480 static Standard_Boolean IsTopologicallyValid(const TopoDS_Shape& S);