2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2012 - Pedro Arthur dos S. Souza
4 * Copyright (C) 2012 - Caio Lucas dos S. Souza
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
20 %pragma(java) jniclasscode=%{
23 System.loadLibrary("scigraphic_objects");
24 } catch (UnsatisfiedLinkError e) {
25 System.err.println("Native library failed to load. \n" + e);
31 %typemap(jni) double * "jobject"
32 %typemap(jtype) double * "Object"
33 %typemap(jstype) double * "Object"
34 %typemap(javain) double * "$javainput"
35 %typemap(javaout) double * { return $jnicall; }
37 %typemap(in) double * getSurfDataX {
38 $1 = (*jenv)->GetDoubleArrayElements(jenv, $input, NULL);
40 %typemap(argout) double * getSurfDataX {
41 (*jenv)->ReleaseDoubleArrayElements(jenv, $input, $1, 0);
43 %typemap(out) double * getSurfDataX {
44 $result = (*jenv)->NewDoubleArray(jenv, getDataSizeX(arg1));
45 (*jenv)->SetDoubleArrayRegion(jenv, $result, 0, getDataSizeX(arg1), $1);
48 %typemap(in) double * getSurfDataY {
49 $1 = (*jenv)->GetDoubleArrayElements(jenv, $input, NULL);
51 %typemap(argout) double * getSurfDataY {
52 (*jenv)->ReleaseDoubleArrayElements(jenv, $input, $1, 0);
54 %typemap(out) double * getSurfDataY {
55 $result = (*jenv)->NewDoubleArray(jenv, getDataSizeY(arg1));
56 (*jenv)->SetDoubleArrayRegion(jenv, $result, 0, getDataSizeY(arg1), $1);
59 %typemap(in) double * getSurfDataZ {
60 $1 = (*jenv)->GetDoubleArrayElements(jenv, $input, NULL);
62 %typemap(argout) double * getSurfDataZ {
63 (*jenv)->ReleaseDoubleArrayElements(jenv, $input, $1, 0);
65 %typemap(out) double * getSurfDataZ {
66 $result = (*jenv)->NewDoubleArray(jenv, getDataSizeZ(arg1));
67 (*jenv)->SetDoubleArrayRegion(jenv, $result, 0, getDataSizeZ(arg1), $1);
71 #include "returnType.h"
72 #include "getGraphicObjectProperty.h"
73 #include "setGraphicObjectProperty.h"
74 #include "graphicObjectProperties.h"
78 double * getSurfDataX(int uid)
81 getGraphicObjectProperty(uid, __GO_DATA_MODEL_X__, jni_double_vector, (void**) &X);
85 int getDataSizeX(int uid)
87 int type, size = 0, nGon = 0, nVert = 0;
91 int * pNVert = &nVert;
92 getGraphicObjectProperty(uid, __GO_TYPE__, jni_int, (void**) &pType);
98 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_X__, jni_int, (void**) &pSize);
101 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_GONS__, jni_int, (void**) &pNGon);
102 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_VERTICES_PER_GON__, jni_int, (void**) &pNVert);
111 double * getSurfDataY(int uid)
114 getGraphicObjectProperty(uid, __GO_DATA_MODEL_Y__, jni_double_vector, (void**) &Y);
118 int getDataSizeY(int uid)
120 int type, size = 0, nGon = 0, nVert = 0;
124 int * pNVert = &nVert;
125 getGraphicObjectProperty(uid, __GO_TYPE__, jni_int, (void**) &pType);
130 case __GO_GRAYPLOT__:
131 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_Y__, jni_int, (void**) &pSize);
134 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_GONS__, jni_int, (void**) &pNGon);
135 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_VERTICES_PER_GON__, jni_int, (void**) &pNVert);
144 double * getSurfDataZ(int uid)
147 getGraphicObjectProperty(uid, __GO_DATA_MODEL_Z__, jni_double_vector, (void**) &Z);
151 int getDataSizeZ(int uid)
153 int type, size = 0, nGon = 0, nVert = 0;
157 int * pNVert = &nVert;
158 getGraphicObjectProperty(uid, __GO_TYPE__, jni_int, (void**) &pType);
163 case __GO_GRAYPLOT__:
164 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_Z__, jni_int, (void**) &pSize);
167 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_GONS__, jni_int, (void**) &pNGon);
168 getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_VERTICES_PER_GON__, jni_int, (void**) &pNVert);
177 extern int createObject3dData(int obj, int newObj, int type);
178 extern double pickSurface(int uid, double x, double y, double z, double dx, double dy, double dz);
182 double * getSurfDataX(int uid);
183 double * getSurfDataY(int uid);
184 double * getSurfDataZ(int uid);
185 int createObject3dData(int obj, int newObj, int type);
186 double pickSurface(int uid, double x, double y, double z, double dx, double dy, double dz);