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
22 #include <BRep_Tool.hxx>
23 #include <Geom_Curve.hxx>
24 #include <BRep_Builder.hxx>
25 #include <TopoDS_Builder.hxx>
28 %typemap(javacode) BRep_Tool
30 public static double[] range(TopoDS_Edge edge)
32 double[] toReturn=new double[2];
33 range(edge, toReturn);
37 public static Geom2d_Curve curveOnSurface(TopoDS_Edge e, TopoDS_Face f, double[] range)
39 double[] d2=new double[1];
40 Geom2d_Curve toReturn=curveOnSurface(e, f, range, d2);
45 public static Geom_Curve curve(TopoDS_Edge e, double[] range)
47 double[] d2=new double[1];
48 Geom_Curve toReturn=curve(e, range, d2);
54 %catches(Standard_NoSuchObject) BRep_Tool::Parameters;
59 %rename(parameters) Parameters;
60 %rename(parameter) Parameter;
61 %rename(degenerated) Degenerated;
62 %rename(hasContinuity) HasContinuity;
63 %rename(continuity) Continuity;
64 %rename(tolerance) Tolerance;
66 %rename(surface) Surface;
67 %rename(curveOnSurface) CurveOnSurface;
69 static const gp_Pnt Pnt(const TopoDS_Vertex& V) ;
70 static gp_Pnt2d Parameters(const TopoDS_Vertex& V,const TopoDS_Face& F) ;
71 static Standard_Real Parameter(const TopoDS_Vertex& V,const TopoDS_Edge& E) ;
72 static Standard_Boolean Degenerated(const TopoDS_Edge& E) ;
73 static Standard_Boolean HasContinuity(const TopoDS_Edge& E,const TopoDS_Face& F1,const TopoDS_Face& F2) ;
74 static GeomAbs_Shape Continuity(const TopoDS_Edge& E,const TopoDS_Face& F1,const TopoDS_Face& F2) ;
75 static Standard_Real Tolerance(const TopoDS_Face& F) ;
76 static Standard_Real Tolerance(const TopoDS_Edge& E) ;
77 static Standard_Real Tolerance(const TopoDS_Vertex& V);
79 /*static const Handle_Geom_Curve& Curve(const TopoDS_Edge& E,
80 Standard_Real& First,Standard_Real& Last) ;
81 static const Handle_Geom_Surface& Surface(const TopoDS_Face& F) ;
82 static const Handle_Geom2d_Curve& CurveOnSurface(const TopoDS_Edge& E,
83 const TopoDS_Face& F,Standard_Real& First,Standard_Real& Last) ;*/
86 // Publish methods which return pointer instead of Handle. We do not need
87 // Handle because Java do the memory managment for us.
90 static Poly_Triangulation * triangulation(const TopoDS_Face& F,TopLoc_Location& L)
92 Handle_Poly_Triangulation hgc=BRep_Tool::Triangulation(F,L);
97 //return (Poly_Triangulation*)(Standard_Transient*)hgc;
98 return (Poly_Triangulation*)(Standard_Transient*)(hgc->This());
101 static void range(const TopoDS_Edge& E, double range[2])
103 BRep_Tool::Range(E, range[0], range[1]);
106 // new Handle is a little memory leak as this handle is never deleted
107 static Handle_Geom_Curve * curve(const TopoDS_Edge& E,
108 Standard_Real& First,Standard_Real& Last)
110 Handle_Geom_Curve * hgc=new Handle_Geom_Curve(BRep_Tool::Curve(E, First, Last));
117 static Handle_Geom_Surface * surface(const TopoDS_Face& F)
119 Handle_Geom_Surface * hgc=new Handle_Geom_Surface(BRep_Tool::Surface(F));
126 static Handle_Geom2d_Curve * curveOnSurface(const TopoDS_Edge& E,
127 const TopoDS_Face& F,Standard_Real& First,Standard_Real& Last)
129 Handle_Geom2d_Curve * hgc=new Handle_Geom2d_Curve(BRep_Tool::CurveOnSurface(E, F, First, Last));
137 class BRep_Builder: public TopoDS_Builder
139 %rename(updateVertex) UpdateVertex;
142 void UpdateVertex(const TopoDS_Vertex& vertex, const Standard_Real u, const Standard_Real v, const TopoDS_Face& face, const Standard_Real tolerance) const;
143 void UpdateVertex(const TopoDS_Vertex& vertex, const Standard_Real tolerance) const;