]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/src/GeomAPI.i
Merge "Allow property editing with just a single mouse click"
[simantics/3d.git] / org.jcae.opencascade / src / GeomAPI.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  *
15  * @author Jens Schmidt
16  *
17  */
18
19 %{#include <GeomAPI_PointsToBSpline.hxx>%}
20 %{#include <GeomAPI_Interpolate.hxx>%}
21
22 class GeomAPI_PointsToBSpline  {
23  public:
24  GeomAPI_PointsToBSpline();
25  GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points,const Standard_Integer DegMin = 3,const Standard_Integer DegMax = 8,const GeomAbs_Shape Continuity = GeomAbs_C2,const Standard_Real Tol3D = 1.0e-3);
26  GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points,const TColStd_Array1OfReal& Parameters,const Standard_Integer DegMin = 3,const Standard_Integer DegMax = 8,const GeomAbs_Shape Continuity = GeomAbs_C2,const Standard_Real Tol3D = 1.0e-3);
27  const Handle_Geom_BSplineCurve& Curve() const;
28 };
29
30 class GeomAPI_Interpolate  {
31  public:
32  GeomAPI_Interpolate(const Handle_TColgp_HArray1OfPnt& Points,const Standard_Boolean PeriodicFlag,const Standard_Real Tolerance);
33  void Load(const TColgp_Array1OfVec& Tangents,const Handle_TColStd_HArray1OfBoolean& TangentFlags,const Standard_Boolean Scale = Standard_True);
34  void Perform();
35  const Handle_Geom_BSplineCurve& Curve() const;
36 };
37
38 //%{#include <TColgp_HArray1OfPnt.hxx>%}
39 //%rename(TColgp_HArray1OfPnt) Handle_TColgp_HArray1OfPnt;
40 /* 
41 class Handle_TColgp_HArray1OfPnt
42 {
43         Handle_TColgp_HArray1OfPnt()=0;
44 };
45
46 %extend Handle_Tcolgp_HArray1OfPnt
47 {
48   static Handle_Tcolgp_Harray1OfPnt * hndl() {
49   
50     Handle_Tcolgp_Harray1OfPnt 
51         
52   }
53 };*/
54 /*
55 %extend Handle_TColgp_HArray1OfPnt
56 {
57   static Handle_TColgp_HArray1OfPnt * test(const TColgp_Array1OfPnt& Points)
58   {
59     Handle_TColgp_HArray1OfPnt * hgc=new Handle_TColgp_HArray1OfPnt();
60         if(hgc->IsNull())
61           return NULL;
62         else
63           return hgc;
64   }
65 };
66  */ 
67
68 /*
69 %extend GeomAPI_Interpolate {
70
71   static GeomAPI_Interpolate create(const TColgp_Array1OfPnt& Points,const Standard_Boolean PeriodicFlag,const Standard_Real Tolerance)
72         {
73           //TODO: leaks??
74           
75           int i;
76           Handle(TColgp_HArray1OfPnt) harray = new TColgp_HArray1OfPnt(Points.Lower(),Points.Upper()); 
77           for (i=1;i<=Points.Length(); i++) {
78            // harray->SetValue(i,Points.Value(i));
79            harray->SetValue(i,Points.Value(i));
80           }
81           
82       return GeomAPI_Interpolate(harray,PeriodicFlag,Tolerance);
83           
84           }
85 };*/