-/*\r
- * Project Info: http://jcae.sourceforge.net\r
- * \r
- * This program is free software; you can redistribute it and/or modify it under\r
- * the terms of the GNU Lesser General Public License as published by the Free\r
- * Software Foundation; either version 2.1 of the License, or (at your option)\r
- * any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful, but WITHOUT\r
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\r
- * details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public License\r
- * along with this program; if not, write to the Free Software Foundation, Inc.,\r
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\r
- *\r
- * (C) Copyright 2005, by EADS CRC\r
- */\r
-\r
-%{\r
- jdoubleArray XYZtoDoubleArray(JNIEnv* jenv, const gp_XYZ & xyz)\r
- {\r
- jdouble nativeArray[]={xyz.X(), xyz.Y(), xyz.Z()};\r
- jdoubleArray toReturn=jenv->NewDoubleArray(3);\r
- jenv->SetDoubleArrayRegion(toReturn, 0, 3, nativeArray);\r
- return toReturn;\r
- }\r
-%}\r
-\r
-/**\r
- * gp_Pnt\r
- */\r
-\r
-%typemap(jni) gp_Pnt, const gp_Pnt& "jdoubleArray"\r
-%typemap(jtype) gp_Pnt, const gp_Pnt& "double[]"\r
-%typemap(jstype) gp_Pnt, const gp_Pnt& "double[]"\r
-\r
-%typemap(in) gp_Pnt, const gp_Pnt&\r
-{\r
- if(JCALL1(GetArrayLength, jenv, $input)!=3)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 3");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- $1=new gp_Pnt(naxe[0],naxe[1],naxe[2]);\r
-}\r
-\r
-%typemap(out) const gp_Pnt&\r
-{\r
- $result=XYZtoDoubleArray(jenv, $1->XYZ());\r
-}\r
-\r
-%typemap(out) gp_Pnt\r
-{\r
- $result=XYZtoDoubleArray(jenv, $1.XYZ());\r
-}\r
-\r
-%typemap(freearg) gp_Pnt, const gp_Pnt&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(javain) gp_Pnt, const gp_Pnt& "$javainput"\r
-%typemap(javaout) gp_Pnt, const gp_Pnt&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-/**\r
- * gp_Pnt2d\r
- */\r
-\r
-%typemap(jni) gp_Pnt2d, const gp_Pnt2d& "jdoubleArray"\r
-%typemap(jtype) gp_Pnt2d, const gp_Pnt2d& "double[]"\r
-%typemap(jstype) gp_Pnt2d, const gp_Pnt2d& "double[]"\r
-\r
-%typemap(in) gp_Pnt2d, const gp_Pnt2d&\r
-{\r
- if(JCALL1(GetArrayLength, jenv, $input)!=2)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 2");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- $1=new gp_Pnt2d(naxe[0],naxe[1]);\r
-}\r
-\r
-%typemap(freearg) gp_Pnt2d, const gp_Pnt2d&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(javain) gp_Pnt2d, const gp_Pnt2d& "$javainput"\r
-%typemap(javaout) gp_Pnt2d, const gp_Pnt2d&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-%typemap(out) gp_Pnt2d, const gp_Pnt2d&\r
-{\r
- jdouble nativeArray[]={$1.X(), $1.Y()};\r
- jdoubleArray toReturn=JCALL1(NewDoubleArray, jenv, 2);\r
- JCALL4(SetDoubleArrayRegion, jenv, toReturn, 0, 2, nativeArray);\r
- $result=toReturn;\r
-}\r
-/**\r
- * gp_Pln\r
- */\r
-%typemap(jni) gp_Pln, const gp_Pln& "jdoubleArray"\r
-%typemap(jtype) gp_Pln, const gp_Pln& "double[]"\r
-%typemap(jstype) gp_Pln, const gp_Pln& "double[]"\r
-\r
-%typemap(in) gp_Pln, const gp_Pln&\r
-{\r
- if(JCALL1(GetArrayLength, jenv, $input)!=4)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 4");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- $1=new gp_Pln(naxe[0],naxe[1],naxe[2],naxe[4]);\r
-}\r
-\r
-%typemap(freearg) gp_Pln, const gp_Pln&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(javain) gp_Pln, const gp_Pln& "$javainput"\r
-%typemap(javaout) gp_Pln, const gp_Pln&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-%typemap(out) gp_Pln, const gp_Pln &\r
-{\r
- double a, b, c, d;\r
- $1.Coefficients(a, b, c, d);\r
- jdouble nativeArray[] = {a, b, c, d};\r
- jdoubleArray toReturn = JCALL1(NewDoubleArray, jenv, 4);\r
- JCALL4(SetDoubleArrayRegion, jenv, toReturn, 0, 4, nativeArray);\r
- $result=toReturn;\r
-}\r
-\r
-/**\r
- * gp_Vec\r
- */\r
-%typemap(jni) gp_Vec, const gp_Vec& "jdoubleArray"\r
-%typemap(jtype) gp_Vec, const gp_Vec& "double[]"\r
-%typemap(jstype) gp_Vec, const gp_Vec& "double[]"\r
-\r
-%typemap(in) gp_Vec, const gp_Vec&\r
-{\r
- if(JCALL1(GetArrayLength, jenv, $input)!=3)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 3");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- $1=new gp_Vec(naxe[0],naxe[1],naxe[2]);\r
-}\r
-\r
-%typemap(freearg) gp_Vec, const gp_Vec&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(javain) gp_Vec, const gp_Vec& "$javainput"\r
-%typemap(javaout) gp_Vec, const gp_Vec&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-%typemap(out) gp_Vec, const gp_Vec&\r
-{\r
- $result=XYZtoDoubleArray(jenv, $1->XYZ());\r
-}\r
-\r
-/**\r
- * gp_Dir\r
- */\r
-%typemap(jni) gp_Dir, const gp_Dir&, gp_Dir& "jdoubleArray"\r
-%typemap(jtype) gp_Dir, const gp_Dir&, gp_Dir& "double[]"\r
-%typemap(jstype) gp_Dir, const gp_Dir&, gp_Dir& "double[]"\r
-\r
-%typemap(in) gp_Dir, const gp_Dir&\r
-{\r
- if(JCALL1(GetArrayLength, jenv, $input)!=3)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 3");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- $1=new gp_Dir(naxe[0],naxe[1],naxe[2]);\r
-}\r
-\r
-%typemap(freearg) gp_Dir, const gp_Dir&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(out) const gp_Dir&\r
-{\r
- $result=XYZtoDoubleArray(jenv, $1->XYZ());\r
-}\r
-\r
-%typemap(out) gp_Dir\r
-{\r
- $result=XYZtoDoubleArray(jenv, $1.XYZ());\r
-}\r
-\r
-%typemap(javain) gp_Dir, const gp_Dir&, gp_Dir& "$javainput"\r
-%typemap(javaout) gp_Dir, const gp_Dir&, gp_Dir&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-/**\r
- * gp_Ax2\r
- */\r
-%typemap(jni) gp_Ax2, const gp_Ax2& "jdoubleArray"\r
-%typemap(jtype) gp_Ax2, const gp_Ax2& "double[]"\r
-%typemap(jstype) gp_Ax2, const gp_Ax2& "double[]"\r
-\r
-%typemap(in) gp_Ax2, const gp_Ax2&\r
-{\r
- int len = JCALL1(GetArrayLength, jenv, $input);\r
- if(len !=6 && len != 9)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 6 or 9");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- if (len == 6)\r
- $1=new gp_Ax2(gp_Pnt(naxe[0],naxe[1],naxe[2]), gp_Dir(naxe[3], naxe[4], naxe[5]));\r
- else\r
- $1=new gp_Ax2(gp_Pnt(naxe[0],naxe[1],naxe[2]), gp_Dir(naxe[3], naxe[4], naxe[5]), gp_Dir(naxe[6], naxe[7], naxe[8]));\r
-}\r
-\r
-%typemap(freearg) gp_Ax2, const gp_Ax2&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(out) gp_Ax2, const gp_Ax2&\r
-{\r
- ##error TODO\r
-}\r
-\r
-%typemap(javain) gp_Ax2, const gp_Ax2& "$javainput"\r
-%typemap(javaout) gp_Ax2, const gp_Ax2&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-/**\r
- * gp_Ax1\r
- */\r
-%typemap(jni) gp_Ax1, const gp_Ax1& "jdoubleArray"\r
-%typemap(jtype) gp_Ax1, const gp_Ax1& "double[]"\r
-%typemap(jstype) gp_Ax1, const gp_Ax1& "double[]"\r
-\r
-%typemap(in) gp_Ax1, const gp_Ax1&\r
-{\r
- if(JCALL1(GetArrayLength, jenv, $input)!=6)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 6");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- $1=new gp_Ax1(gp_Pnt(naxe[0],naxe[1],naxe[2]), gp_Dir(naxe[3], naxe[4], naxe[5]));\r
-}\r
-\r
-%typemap(freearg) gp_Ax1, const gp_Ax1&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(out) gp_Ax1, const gp_Ax1&\r
-{\r
- ##error TODO\r
-}\r
-\r
-%typemap(javain) gp_Ax1, const gp_Ax1& "$javainput"\r
-%typemap(javaout) gp_Ax1, const gp_Ax1&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-/**\r
- * gp_Trsf\r
- */\r
- %{#include <gp_Trsf.hxx>%}\r
- \r
-%rename(GP_Trsf) gp_Trsf;\r
-\r
-%typemap(javacode) gp_Trsf\r
-%{\r
- public void setValues(double[] matrix, double tolAng, double tolDist)\r
- {\r
- if(matrix.length!=12)\r
- throw new IllegalArgumentException("matrix length must be 12");\r
- setValues(\r
- matrix[0], matrix[1], matrix[2], matrix[3],\r
- matrix[4], matrix[5], matrix[6], matrix[7],\r
- matrix[8], matrix[9], matrix[10], matrix[11],\r
- tolAng, tolDist);\r
- } \r
-%}\r
-\r
-class gp_Trsf\r
-{\r
- %rename(setRotation) SetRotation;\r
- %rename(setTranslation) SetTranslation;\r
- %rename(setValues) SetValues;\r
- public:\r
- gp_Trsf();\r
- void SetRotation(const gp_Ax1& A1,const Standard_Real Ang) ;\r
- void SetTranslation(const gp_Vec& V) ;\r
- void SetValues(const Standard_Real a11,const Standard_Real a12,\r
- const Standard_Real a13,const Standard_Real a14,const Standard_Real a21,\r
- const Standard_Real a22,const Standard_Real a23,const Standard_Real a24,\r
- const Standard_Real a31,const Standard_Real a32,const Standard_Real a33,\r
- const Standard_Real a34,const Standard_Real Tolang,\r
- const Standard_Real TolDist);\r
-};\r
-\r
-%extend gp_Trsf\r
-{\r
- /** Easy to use with javax.vecmath.Matrix4D */\r
- void getValues(double matrix[16])\r
- {\r
- int k=0;\r
- for(int i=1; i<=3; i++)\r
- for(int j=1; j<=4; j++)\r
- matrix[k++]=self->Value(i,j);\r
- matrix[12]=0;\r
- matrix[13]=0;\r
- matrix[14]=0;\r
- matrix[15]=1;\r
- }\r
-}\r
-\r
-/**\r
- * GP_Circ\r
- */\r
-%{#include <gp_Circ.hxx>%}\r
-%rename(GP_Circ) gp_Circ;\r
-class gp_Circ\r
-{\r
- public:\r
- gp_Circ(const gp_Ax2& axis, const Standard_Real radius);\r
-};\r
-\r
-/**\r
- * GP_Parab\r
- */\r
-%{#include <gp_Parab.hxx>%}\r
-%rename(GP_Parab) gp_Parab;\r
-class gp_Parab\r
-{\r
- public:\r
- gp_Parab(const gp_Ax2& A2,const Standard_Real Focal);\r
- gp_Parab(const gp_Ax1& D,const gp_Pnt& F);\r
-};\r
-\r
-\r
-/*******************************************************************\r
- * *\r
- * VTT *\r
- * *\r
- *******************************************************************/\r
-\r
-/**\r
- * GP_Ellips\r
- */\r
-%{#include <gp_Elips.hxx>%}\r
- \r
- %rename(GP_Elips) gp_Elips;\r
- \r
- class gp_Elips\r
-{\r
-\r
- public:\r
- gp_Elips(const gp_Ax2& A2,const Standard_Real MajorRadius,const Standard_Real MinorRadius);\r
-};\r
-\r
-/**\r
- * GP_Lin\r
- */\r
-\r
- %{#include <gp_Lin.hxx>%}\r
- \r
- %rename(GP_Lin) gp_Lin;\r
- \r
- class gp_Lin\r
-{\r
- public:\r
- gp_Lin(const gp_Ax1& A1);\r
-};\r
-\r
-\r
-/**\r
- * gp_Mat\r
- */\r
- %{#include <gp_Mat.hxx>%}\r
-%typemap(jni) gp_Mat, const gp_Mat& "jdoubleArray"\r
-%typemap(jtype) gp_Mat, const gp_Mat& "double[]"\r
-%typemap(jstype) gp_Mat, const gp_Mat& "double[]"\r
-\r
-%typemap(in) gp_Mat, const gp_Mat&\r
-{\r
- if(JCALL1(GetArrayLength, jenv, $input)!=9)\r
- SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 9");\r
- jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);\r
- $1=new gp_Mat(naxe[0],naxe[1],naxe[2],naxe[3],naxe[4],naxe[5],naxe[6],naxe[7],naxe[8]);\r
-}\r
-\r
-%typemap(freearg) gp_Mat, const gp_Mat&\r
-{\r
- delete $1;\r
-}\r
-\r
-%typemap(javain) gp_Mat, const gp_Mat& "$javainput"\r
-%typemap(javaout) gp_Mat, const gp_Mat&\r
-{\r
- return $jnicall;\r
-}\r
-\r
-%{\r
- jdoubleArray MatToDoubleArray(JNIEnv* jenv, const gp_Mat & mat)\r
- {\r
- jdouble nativeArray[]={mat.Value(1,1), mat.Value(1,2), mat.Value(1,3),\r
- mat.Value(2,1), mat.Value(2,2), mat.Value(2,3),\r
- mat.Value(3,1), mat.Value(3,2), mat.Value(3,3)};\r
- jdoubleArray toReturn=jenv->NewDoubleArray(9);\r
- jenv->SetDoubleArrayRegion(toReturn, 0, 9, nativeArray);\r
- return toReturn;\r
- }\r
-%}\r
-\r
-%typemap(out) gp_Mat, const gp_Mat&\r
-{\r
- $result=MatToDoubleArray(jenv, $1);\r
+/*
+ * Project Info: http://jcae.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2005, by EADS CRC
+ */
+
+%{
+ jdoubleArray XYZtoDoubleArray(JNIEnv* jenv, const gp_XYZ & xyz)
+ {
+ jdouble nativeArray[]={xyz.X(), xyz.Y(), xyz.Z()};
+ jdoubleArray toReturn=jenv->NewDoubleArray(3);
+ jenv->SetDoubleArrayRegion(toReturn, 0, 3, nativeArray);
+ return toReturn;
+ }
+%}
+
+/**
+ * gp_Pnt
+ */
+
+%typemap(jni) gp_Pnt, const gp_Pnt& "jdoubleArray"
+%typemap(jtype) gp_Pnt, const gp_Pnt& "double[]"
+%typemap(jstype) gp_Pnt, const gp_Pnt& "double[]"
+
+%typemap(in) gp_Pnt, const gp_Pnt&
+{
+ if(JCALL1(GetArrayLength, jenv, $input)!=3)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 3");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ $1=new gp_Pnt(naxe[0],naxe[1],naxe[2]);
+}
+
+%typemap(out) const gp_Pnt&
+{
+ $result=XYZtoDoubleArray(jenv, $1->XYZ());
+}
+
+%typemap(out) gp_Pnt
+{
+ $result=XYZtoDoubleArray(jenv, $1.XYZ());
+}
+
+%typemap(freearg) gp_Pnt, const gp_Pnt&
+{
+ delete $1;
+}
+
+%typemap(javain) gp_Pnt, const gp_Pnt& "$javainput"
+%typemap(javaout) gp_Pnt, const gp_Pnt&
+{
+ return $jnicall;
+}
+
+/**
+ * gp_Pnt2d
+ */
+
+%typemap(jni) gp_Pnt2d, const gp_Pnt2d& "jdoubleArray"
+%typemap(jtype) gp_Pnt2d, const gp_Pnt2d& "double[]"
+%typemap(jstype) gp_Pnt2d, const gp_Pnt2d& "double[]"
+
+%typemap(in) gp_Pnt2d, const gp_Pnt2d&
+{
+ if(JCALL1(GetArrayLength, jenv, $input)!=2)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 2");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ $1=new gp_Pnt2d(naxe[0],naxe[1]);
+}
+
+%typemap(freearg) gp_Pnt2d, const gp_Pnt2d&
+{
+ delete $1;
+}
+
+%typemap(javain) gp_Pnt2d, const gp_Pnt2d& "$javainput"
+%typemap(javaout) gp_Pnt2d, const gp_Pnt2d&
+{
+ return $jnicall;
+}
+
+%typemap(out) gp_Pnt2d, const gp_Pnt2d&
+{
+ jdouble nativeArray[]={$1.X(), $1.Y()};
+ jdoubleArray toReturn=JCALL1(NewDoubleArray, jenv, 2);
+ JCALL4(SetDoubleArrayRegion, jenv, toReturn, 0, 2, nativeArray);
+ $result=toReturn;
+}
+/**
+ * gp_Pln
+ */
+%typemap(jni) gp_Pln, const gp_Pln& "jdoubleArray"
+%typemap(jtype) gp_Pln, const gp_Pln& "double[]"
+%typemap(jstype) gp_Pln, const gp_Pln& "double[]"
+
+%typemap(in) gp_Pln, const gp_Pln&
+{
+ if(JCALL1(GetArrayLength, jenv, $input)!=4)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 4");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ $1=new gp_Pln(naxe[0],naxe[1],naxe[2],naxe[4]);
+}
+
+%typemap(freearg) gp_Pln, const gp_Pln&
+{
+ delete $1;
+}
+
+%typemap(javain) gp_Pln, const gp_Pln& "$javainput"
+%typemap(javaout) gp_Pln, const gp_Pln&
+{
+ return $jnicall;
+}
+
+%typemap(out) gp_Pln, const gp_Pln &
+{
+ double a, b, c, d;
+ $1.Coefficients(a, b, c, d);
+ jdouble nativeArray[] = {a, b, c, d};
+ jdoubleArray toReturn = JCALL1(NewDoubleArray, jenv, 4);
+ JCALL4(SetDoubleArrayRegion, jenv, toReturn, 0, 4, nativeArray);
+ $result=toReturn;
+}
+
+/**
+ * gp_Vec
+ */
+%typemap(jni) gp_Vec, const gp_Vec& "jdoubleArray"
+%typemap(jtype) gp_Vec, const gp_Vec& "double[]"
+%typemap(jstype) gp_Vec, const gp_Vec& "double[]"
+
+%typemap(in) gp_Vec, const gp_Vec&
+{
+ if(JCALL1(GetArrayLength, jenv, $input)!=3)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 3");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ $1=new gp_Vec(naxe[0],naxe[1],naxe[2]);
+}
+
+%typemap(freearg) gp_Vec, const gp_Vec&
+{
+ delete $1;
+}
+
+%typemap(javain) gp_Vec, const gp_Vec& "$javainput"
+%typemap(javaout) gp_Vec, const gp_Vec&
+{
+ return $jnicall;
+}
+
+%typemap(out) gp_Vec, const gp_Vec&
+{
+ $result=XYZtoDoubleArray(jenv, $1->XYZ());
+}
+
+/**
+ * gp_Dir
+ */
+%typemap(jni) gp_Dir, const gp_Dir&, gp_Dir& "jdoubleArray"
+%typemap(jtype) gp_Dir, const gp_Dir&, gp_Dir& "double[]"
+%typemap(jstype) gp_Dir, const gp_Dir&, gp_Dir& "double[]"
+
+%typemap(in) gp_Dir, const gp_Dir&
+{
+ if(JCALL1(GetArrayLength, jenv, $input)!=3)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 3");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ $1=new gp_Dir(naxe[0],naxe[1],naxe[2]);
+}
+
+%typemap(freearg) gp_Dir, const gp_Dir&
+{
+ delete $1;
+}
+
+%typemap(out) const gp_Dir&
+{
+ $result=XYZtoDoubleArray(jenv, $1->XYZ());
+}
+
+%typemap(out) gp_Dir
+{
+ $result=XYZtoDoubleArray(jenv, $1.XYZ());
+}
+
+%typemap(javain) gp_Dir, const gp_Dir&, gp_Dir& "$javainput"
+%typemap(javaout) gp_Dir, const gp_Dir&, gp_Dir&
+{
+ return $jnicall;
+}
+
+/**
+ * gp_Ax2
+ */
+%typemap(jni) gp_Ax2, const gp_Ax2& "jdoubleArray"
+%typemap(jtype) gp_Ax2, const gp_Ax2& "double[]"
+%typemap(jstype) gp_Ax2, const gp_Ax2& "double[]"
+
+%typemap(in) gp_Ax2, const gp_Ax2&
+{
+ int len = JCALL1(GetArrayLength, jenv, $input);
+ if(len !=6 && len != 9)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 6 or 9");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ if (len == 6)
+ $1=new gp_Ax2(gp_Pnt(naxe[0],naxe[1],naxe[2]), gp_Dir(naxe[3], naxe[4], naxe[5]));
+ else
+ $1=new gp_Ax2(gp_Pnt(naxe[0],naxe[1],naxe[2]), gp_Dir(naxe[3], naxe[4], naxe[5]), gp_Dir(naxe[6], naxe[7], naxe[8]));
+}
+
+%typemap(freearg) gp_Ax2, const gp_Ax2&
+{
+ delete $1;
+}
+
+%typemap(out) gp_Ax2, const gp_Ax2&
+{
+ ##error TODO
+}
+
+%typemap(javain) gp_Ax2, const gp_Ax2& "$javainput"
+%typemap(javaout) gp_Ax2, const gp_Ax2&
+{
+ return $jnicall;
+}
+
+/**
+ * gp_Ax1
+ */
+%typemap(jni) gp_Ax1, const gp_Ax1& "jdoubleArray"
+%typemap(jtype) gp_Ax1, const gp_Ax1& "double[]"
+%typemap(jstype) gp_Ax1, const gp_Ax1& "double[]"
+
+%typemap(in) gp_Ax1, const gp_Ax1&
+{
+ if(JCALL1(GetArrayLength, jenv, $input)!=6)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 6");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ $1=new gp_Ax1(gp_Pnt(naxe[0],naxe[1],naxe[2]), gp_Dir(naxe[3], naxe[4], naxe[5]));
+}
+
+%typemap(freearg) gp_Ax1, const gp_Ax1&
+{
+ delete $1;
+}
+
+%typemap(out) gp_Ax1, const gp_Ax1&
+{
+ ##error TODO
+}
+
+%typemap(javain) gp_Ax1, const gp_Ax1& "$javainput"
+%typemap(javaout) gp_Ax1, const gp_Ax1&
+{
+ return $jnicall;
+}
+
+/**
+ * gp_Trsf
+ */
+ %{#include <gp_Trsf.hxx>%}
+
+%rename(GP_Trsf) gp_Trsf;
+
+%typemap(javacode) gp_Trsf
+%{
+ public void setValues(double[] matrix)
+ {
+ if(matrix.length!=12)
+ throw new IllegalArgumentException("matrix length must be 12");
+ setValues(
+ matrix[0], matrix[1], matrix[2], matrix[3],
+ matrix[4], matrix[5], matrix[6], matrix[7],
+ matrix[8], matrix[9], matrix[10], matrix[11]);
+ }
+%}
+
+class gp_Trsf
+{
+ %rename(setRotation) SetRotation;
+ %rename(setTranslation) SetTranslation;
+ %rename(setValues) SetValues;
+ public:
+ gp_Trsf();
+ void SetRotation(const gp_Ax1& A1,const Standard_Real Ang) ;
+ void SetTranslation(const gp_Vec& V) ;
+ void SetValues(const Standard_Real a11,const Standard_Real a12, const Standard_Real a13,const Standard_Real a14,
+ const Standard_Real a21,const Standard_Real a22,const Standard_Real a23,const Standard_Real a24,
+ const Standard_Real a31,const Standard_Real a32,const Standard_Real a33,const Standard_Real a34);
+};
+
+%extend gp_Trsf
+{
+ /** Easy to use with javax.vecmath.Matrix4D */
+ void getValues(double matrix[16])
+ {
+ int k=0;
+ for(int i=1; i<=3; i++)
+ for(int j=1; j<=4; j++)
+ matrix[k++]=self->Value(i,j);
+ matrix[12]=0;
+ matrix[13]=0;
+ matrix[14]=0;
+ matrix[15]=1;
+ }
+}
+
+/**
+ * GP_Circ
+ */
+%{#include <gp_Circ.hxx>%}
+%rename(GP_Circ) gp_Circ;
+class gp_Circ
+{
+ public:
+ gp_Circ(const gp_Ax2& axis, const Standard_Real radius);
+};
+
+/**
+ * GP_Parab
+ */
+%{#include <gp_Parab.hxx>%}
+%rename(GP_Parab) gp_Parab;
+class gp_Parab
+{
+ public:
+ gp_Parab(const gp_Ax2& A2,const Standard_Real Focal);
+ gp_Parab(const gp_Ax1& D,const gp_Pnt& F);
+};
+
+
+/*******************************************************************
+ * *
+ * VTT *
+ * *
+ *******************************************************************/
+
+/**
+ * GP_Ellips
+ */
+%{#include <gp_Elips.hxx>%}
+
+ %rename(GP_Elips) gp_Elips;
+
+ class gp_Elips
+{
+
+ public:
+ gp_Elips(const gp_Ax2& A2,const Standard_Real MajorRadius,const Standard_Real MinorRadius);
+};
+
+/**
+ * GP_Lin
+ */
+
+ %{#include <gp_Lin.hxx>%}
+
+ %rename(GP_Lin) gp_Lin;
+
+ class gp_Lin
+{
+ public:
+ gp_Lin(const gp_Ax1& A1);
+};
+
+
+/**
+ * gp_Mat
+ */
+ %{#include <gp_Mat.hxx>%}
+%typemap(jni) gp_Mat, const gp_Mat& "jdoubleArray"
+%typemap(jtype) gp_Mat, const gp_Mat& "double[]"
+%typemap(jstype) gp_Mat, const gp_Mat& "double[]"
+
+%typemap(in) gp_Mat, const gp_Mat&
+{
+ if(JCALL1(GetArrayLength, jenv, $input)!=9)
+ SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, "array length must be 9");
+ jdouble * naxe=JCALL2(GetDoubleArrayElements, jenv, $input, NULL);
+ $1=new gp_Mat(naxe[0],naxe[1],naxe[2],naxe[3],naxe[4],naxe[5],naxe[6],naxe[7],naxe[8]);
+}
+
+%typemap(freearg) gp_Mat, const gp_Mat&
+{
+ delete $1;
+}
+
+%typemap(javain) gp_Mat, const gp_Mat& "$javainput"
+%typemap(javaout) gp_Mat, const gp_Mat&
+{
+ return $jnicall;
+}
+
+%{
+ jdoubleArray MatToDoubleArray(JNIEnv* jenv, const gp_Mat & mat)
+ {
+ jdouble nativeArray[]={mat.Value(1,1), mat.Value(1,2), mat.Value(1,3),
+ mat.Value(2,1), mat.Value(2,2), mat.Value(2,3),
+ mat.Value(3,1), mat.Value(3,2), mat.Value(3,3)};
+ jdoubleArray toReturn=jenv->NewDoubleArray(9);
+ jenv->SetDoubleArrayRegion(toReturn, 0, 9, nativeArray);
+ return toReturn;
+ }
+%}
+
+%typemap(out) gp_Mat, const gp_Mat&
+{
+ $result=MatToDoubleArray(jenv, $1);
}
\ No newline at end of file