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 <Geom_Curve.hxx>
23 #include <Geom_Surface.hxx>
24 #include <Geom2d_Curve.hxx>
25 #include <Geom_Geometry.hxx>
26 #include <Geom2d_Geometry.hxx>
27 #include <Geom_BoundedCurve.hxx>
28 #include <Geom_BSplineCurve.hxx>
29 #include <Geom_TrimmedCurve.hxx>
32 %rename(Geom_Geometry) Handle_Geom_Geometry;
33 %rename(Geom_Curve) Handle_Geom_Curve;
34 %rename(Geom_Surface) Handle_Geom_Surface;
35 %rename(Geom2d_Geometry) Handle_Geom2d_Geometry;
36 %rename(Geom2d_Curve) Handle_Geom2d_Curve;
37 %rename(Geom_BoundedCurve) Handle_Geom_BoundedCurve;
38 %rename(Geom_BSplineCurve) Handle_Geom_BSplineCurve;
39 %rename(Geom_TrimmedCurve) Handle_Geom_TrimmedCurve;
40 class Handle_Geom_Geometry
42 Handle_Geom_Geometry()=0;
45 class Handle_Geom_Curve: public Handle_Geom_Geometry
47 Handle_Geom_Curve()=0;
50 %extend Handle_Geom_Curve
52 Standard_Real firstParameter()
54 return (*self)->FirstParameter();
57 Standard_Real lastParameter()
59 return (*self)->LastParameter();
62 Standard_Boolean isClosed()
64 return (*self)->IsClosed();
67 Standard_Boolean isPeriodic()
69 return (*self)->IsPeriodic();
72 Standard_Real period()
74 return (*self)->Period();
78 class Handle_Geom_Surface: public Handle_Geom_Geometry
80 Handle_Geom_Surface()=0;
83 %extend Handle_Geom_Surface
85 gp_Pnt value(const Standard_Real U,const Standard_Real V) const
87 return (*self)->Value(U, V);
90 %javamethodmodifiers bounds(double bounds[4]) const "
92 * Return the bounds of the parameters of the surface.
93 * @param bounds an array of size 4 which will receive {Umin, Umax, Vmin, Vmax}
96 void bounds(double bounds[4]) const
98 (*self)->Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
101 %javamethodmodifiers bounds(Standard_Real&, Standard_Real&, Standard_Real&, Standard_Real&) const "
103 * @deprecated use bounds(double[]) , it do not need to allocate 4 arrays.
106 void bounds(Standard_Real& U1,Standard_Real& U2,Standard_Real& V1,Standard_Real& V2) const
108 (*self)->Bounds(U1,U2,V1,V2);
111 Standard_Boolean isUClosed() const
113 return (*self)->IsUClosed();
116 Standard_Boolean isVClosed() const
118 return (*self)->IsVClosed();
121 Handle_Geom_Curve uIso(const Standard_Real U) const
123 return (*self)->UIso(U);
126 Handle_Geom_Curve vIso(const Standard_Real V) const
128 return (*self)->VIso(V);
132 class Handle_Geom2d_Geometry
134 Handle_Geom2d_Geometry()=0;
137 class Handle_Geom2d_Curve: public Handle_Geom2d_Geometry
139 Handle_Geom2d_Curve()=0;
142 class Handle_Geom_BoundedCurve : public Handle_Geom_Curve {
143 Handle_Geom_BoundedCurve()=0;
146 class Handle_Geom_BSplineCurve : public Handle_Geom_BoundedCurve {
147 Handle_Geom_BSplineCurve()=0;
150 %extend Handle_Geom_BSplineCurve
152 //TODO check that this is not a big memory leak
153 Handle_Geom_BSplineCurve(const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights,
154 const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Multiplicities,
155 const Standard_Integer Degree, const Standard_Boolean Periodic = Standard_False,
156 const Standard_Boolean CheckRational = Standard_True){
157 return new Handle_Geom_BSplineCurve(new Geom_BSplineCurve(
158 Poles, Weights, Knots, Multiplicities, Degree, Periodic, CheckRational));
161 void setKnot(const Standard_Integer Index,const Standard_Real K)
163 (*self)->SetKnot(Index,K);
166 void setKnot(const Standard_Integer Index,const Standard_Real K,const Standard_Integer M)
168 (*self)->SetKnot(Index,K,M);
173 (*self)->SetPeriodic();
176 void setNotPeriodic()
178 (*self)->SetNotPeriodic();
181 void setOrigin(const Standard_Integer Index)
183 (*self)->SetOrigin(Index);
186 void setOrigin(const Standard_Real U,const Standard_Real Tol)
188 (*self)->SetOrigin(U,Tol);
191 void setPole(const Standard_Integer Index,const gp_Pnt& P)
193 (*self)->SetPole(Index,P);
196 void setPole(const Standard_Integer Index,const gp_Pnt& P,const Standard_Real Weight)
198 (*self)->SetPole(Index,P,Weight);
201 void movePoint(const Standard_Real U,const gp_Pnt& P,const Standard_Integer Index1,const Standard_Integer Index2,Standard_Integer& FirstModifiedPole,Standard_Integer& LastModifiedPole)
203 (*self)->MovePoint(U,P,Index1,Index2,FirstModifiedPole,LastModifiedPole);
206 void movePointAndTangent(const Standard_Real U,const gp_Pnt& P,const gp_Vec& Tangent,const Standard_Real Tolerance,const Standard_Integer StartingCondition,const Standard_Integer EndingCondition)
208 Standard_Integer ErrorStatus =0;
209 (*self)->MovePointAndTangent(U,P,Tangent,Tolerance,StartingCondition,EndingCondition,ErrorStatus);
212 Standard_Boolean isClosed() const
214 return (*self)->IsClosed();
217 Standard_Boolean isPeriodic() const
219 return (*self)->IsPeriodic();
222 Standard_Boolean isRational() const
224 return (*self)->IsRational();
227 GeomAbs_Shape continuity() const
229 return (*self)->Continuity();
232 Standard_Integer Degree() const
234 return (*self)->Degree();
238 gp_Vec dN(const Standard_Real U,const Standard_Integer N) const
240 return (*self)->DN(U,N);
244 gp_Pnt localValue(const Standard_Real U,const Standard_Integer FromK1,const Standard_Integer ToK2) const
246 return (*self)->LocalValue(U,FromK1,ToK2);
249 gp_Pnt endPoint() const
251 return (*self)->EndPoint();
254 gp_Pnt startPoint() const
256 return (*self)->StartPoint();
259 Standard_Integer nbKnots() const
261 return (*self)->NbKnots();
264 Standard_Integer nbPoles() const
266 return (*self)->NbPoles();
269 gp_Pnt pole(const Standard_Integer Index) const
271 return (*self)->Pole(Index);
274 Standard_Real weight(const Standard_Integer Index) const
276 return (*self)->Weight(Index);
281 class Handle_Geom_TrimmedCurve : public Handle_Geom_BoundedCurve {
282 Handle_Geom_TrimmedCurve()=0;