1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.7
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 #define SWIGJAVA
12 
13 /* -----------------------------------------------------------------------------
14  *  This section contains generic SWIG labels for method/variable
15  *  declarations/attributes, and other compiler dependent labels.
16  * ----------------------------------------------------------------------------- */
17 
18 /* template workaround for compilers that cannot correctly implement the C++ standard */
19 #ifndef SWIGTEMPLATEDISAMBIGUATOR
20 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21 #  define SWIGTEMPLATEDISAMBIGUATOR template
22 # elif defined(__HP_aCC)
23 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25 #  define SWIGTEMPLATEDISAMBIGUATOR template
26 # else
27 #  define SWIGTEMPLATEDISAMBIGUATOR
28 # endif
29 #endif
30 
31 /* inline attribute */
32 #ifndef SWIGINLINE
33 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34 #   define SWIGINLINE inline
35 # else
36 #   define SWIGINLINE
37 # endif
38 #endif
39 
40 /* attribute recognised by some compilers to avoid 'unused' warnings */
41 #ifndef SWIGUNUSED
42 # if defined(__GNUC__)
43 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44 #     define SWIGUNUSED __attribute__ ((__unused__))
45 #   else
46 #     define SWIGUNUSED
47 #   endif
48 # elif defined(__ICC)
49 #   define SWIGUNUSED __attribute__ ((__unused__))
50 # else
51 #   define SWIGUNUSED
52 # endif
53 #endif
54 
55 #ifndef SWIG_MSC_UNSUPPRESS_4505
56 # if defined(_MSC_VER)
57 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
58 # endif
59 #endif
60 
61 #ifndef SWIGUNUSEDPARM
62 # ifdef __cplusplus
63 #   define SWIGUNUSEDPARM(p)
64 # else
65 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
66 # endif
67 #endif
68 
69 /* internal SWIG method */
70 #ifndef SWIGINTERN
71 # define SWIGINTERN static SWIGUNUSED
72 #endif
73 
74 /* internal inline SWIG method */
75 #ifndef SWIGINTERNINLINE
76 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
77 #endif
78 
79 /* exporting methods */
80 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
81 #  ifndef GCC_HASCLASSVISIBILITY
82 #    define GCC_HASCLASSVISIBILITY
83 #  endif
84 #endif
85 
86 #ifndef SWIGEXPORT
87 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88 #   if defined(STATIC_LINKED)
89 #     define SWIGEXPORT
90 #   else
91 #     define SWIGEXPORT __declspec(dllexport)
92 #   endif
93 # else
94 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95 #     define SWIGEXPORT __attribute__ ((visibility("default")))
96 #   else
97 #     define SWIGEXPORT
98 #   endif
99 # endif
100 #endif
101 
102 /* calling conventions for Windows */
103 #ifndef SWIGSTDCALL
104 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105 #   define SWIGSTDCALL __stdcall
106 # else
107 #   define SWIGSTDCALL
108 # endif
109 #endif
110 
111 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
112 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113 # define _CRT_SECURE_NO_DEPRECATE
114 #endif
115 
116 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118 # define _SCL_SECURE_NO_DEPRECATE
119 #endif
120 
121 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
122 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
123 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
124 #endif
125 
126 /* Intel's compiler complains if a variable which was never initialised is
127  * cast to void, which is a common idiom which we use to indicate that we
128  * are aware a variable isn't used.  So we just silence that warning.
129  * See: https://github.com/swig/swig/issues/192 for more discussion.
130  */
131 #ifdef __INTEL_COMPILER
132 # pragma warning disable 592
133 #endif
134 
135 
136 /* Fix for jlong on some versions of gcc on Windows */
137 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
138   typedef long long __int64;
139 #endif
140 
141 /* Fix for jlong on 64-bit x86 Solaris */
142 #if defined(__x86_64)
143 # ifdef _LP64
144 #   undef _LP64
145 # endif
146 #endif
147 
148 #include <jni.h>
149 #include <stdlib.h>
150 #include <string.h>
151 
152 
153 /* Support for throwing Java exceptions */
154 typedef enum {
155   SWIG_JavaOutOfMemoryError = 1,
156   SWIG_JavaIOException,
157   SWIG_JavaRuntimeException,
158   SWIG_JavaIndexOutOfBoundsException,
159   SWIG_JavaArithmeticException,
160   SWIG_JavaIllegalArgumentException,
161   SWIG_JavaNullPointerException,
162   SWIG_JavaDirectorPureVirtual,
163   SWIG_JavaUnknownError
164 } SWIG_JavaExceptionCodes;
165 
166 typedef struct {
167   SWIG_JavaExceptionCodes code;
168   const char *java_exception;
169 } SWIG_JavaExceptions_t;
170 
171 
SWIG_JavaThrowException(JNIEnv * jenv,SWIG_JavaExceptionCodes code,const char * msg)172 static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
173   jclass excep;
174   static const SWIG_JavaExceptions_t java_exceptions[] = {
175     { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
176     { SWIG_JavaIOException, "java/io/IOException" },
177     { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
178     { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
179     { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
180     { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
181     { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
182     { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
183     { SWIG_JavaUnknownError,  "java/lang/UnknownError" },
184     { (SWIG_JavaExceptionCodes)0,  "java/lang/UnknownError" }
185   };
186   const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
187 
188   while (except_ptr->code != code && except_ptr->code)
189     except_ptr++;
190 
191   (*jenv)->ExceptionClear(jenv);
192   excep = (*jenv)->FindClass(jenv, except_ptr->java_exception);
193   if (excep)
194     (*jenv)->ThrowNew(jenv, excep, msg);
195 }
196 
197 
198 /* Contract support */
199 
200 #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
201 
202 
203 #include "returnType.h"
204 #include "getGraphicObjectProperty.h"
205 #include "setGraphicObjectProperty.h"
206 #include "graphicObjectProperties.h"
207 
208 
getSurfDataX(int uid)209 double * getSurfDataX(int uid)
210 {
211 	double * X;
212 	getGraphicObjectProperty(uid, __GO_DATA_MODEL_X__, jni_double_vector, (void**) &X);
213 	return X;
214 }
215 
getDataSizeX(int uid)216 int getDataSizeX(int uid)
217 {
218 	int type, size = 0, nGon = 0, nVert = 0;
219 	int * pType = &type;
220 	int * pSize = &size;
221 	int * pNGon = &nGon;
222 	int * pNVert = &nVert;
223 	getGraphicObjectProperty(uid, __GO_TYPE__, jni_int, (void**) &pType);
224 
225 	switch(type)
226 	{
227 		case __GO_PLOT3D__:
228 		case __GO_GRAYPLOT__:
229 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_X__, jni_int, (void**) &pSize);
230 			break;
231 		case __GO_FAC3D__:
232 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_GONS__, jni_int, (void**) &pNGon);
233 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_VERTICES_PER_GON__, jni_int, (void**) &pNVert);
234 			size = nGon * nVert;
235 			break;
236 	}
237 	return size;
238 }
239 
240 
getSurfDataY(int uid)241 double * getSurfDataY(int uid)
242 {
243 	double * Y;
244 	getGraphicObjectProperty(uid, __GO_DATA_MODEL_Y__, jni_double_vector, (void**) &Y);
245 	return Y;
246 }
247 
getDataSizeY(int uid)248 int getDataSizeY(int uid)
249 {
250 	int type, size = 0, nGon = 0, nVert = 0;
251 	int * pType = &type;
252 	int * pSize = &size;
253 	int * pNGon = &nGon;
254 	int * pNVert = &nVert;
255 	getGraphicObjectProperty(uid, __GO_TYPE__, jni_int, (void**) &pType);
256 
257 	switch(type)
258 	{
259 		case __GO_PLOT3D__:
260 		case __GO_GRAYPLOT__:
261 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_Y__, jni_int, (void**) &pSize);
262 			break;
263 		case __GO_FAC3D__:
264 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_GONS__, jni_int, (void**) &pNGon);
265 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_VERTICES_PER_GON__, jni_int, (void**) &pNVert);
266 			size = nGon * nVert;
267 			break;
268 	}
269 	return size;
270 }
271 
272 
getSurfDataZ(int uid)273 double * getSurfDataZ(int uid)
274 {
275 	double * Z;
276 	getGraphicObjectProperty(uid, __GO_DATA_MODEL_Z__, jni_double_vector, (void**) &Z);
277 	return Z;
278 }
279 
getDataSizeZ(int uid)280 int getDataSizeZ(int uid)
281 {
282 	int type, size = 0, nGon = 0, nVert = 0;
283 	int * pType = &type;
284 	int * pSize = &size;
285 	int * pNGon = &nGon;
286 	int * pNVert = &nVert;
287 	getGraphicObjectProperty(uid, __GO_TYPE__, jni_int, (void**) &pType);
288 
289 	switch(type)
290 	{
291 		case __GO_PLOT3D__:
292 		case __GO_GRAYPLOT__:
293 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_Z__, jni_int, (void**) &pSize);
294 			break;
295 		case __GO_FAC3D__:
296 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_GONS__, jni_int, (void**) &pNGon);
297 			getGraphicObjectProperty(uid, __GO_DATA_MODEL_NUM_VERTICES_PER_GON__, jni_int, (void**) &pNVert);
298 			size = nGon * nVert;
299 			break;
300 	}
301 	return size;
302 }
303 
304 
305 extern int createObject3dData(int obj, int newObj, int type);
306 extern double pickSurface(int uid, double x, double y,  double z, double dx, double dy, double dz, double mx, double my, double mz, double mw);
307 
308 
309 #ifdef __cplusplus
310 extern "C" {
311 #endif
312 
Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_getSurfDataX(JNIEnv * jenv,jclass jcls,jint jarg1)313 SWIGEXPORT jobject JNICALL Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_getSurfDataX(JNIEnv *jenv, jclass jcls, jint jarg1) {
314   jobject jresult = 0 ;
315   int arg1 ;
316   double *result = 0 ;
317 
318   (void)jenv;
319   (void)jcls;
320   arg1 = (int)jarg1;
321   result = (double *)getSurfDataX(arg1);
322   {
323     jresult = (*jenv)->NewDoubleArray(jenv, getDataSizeX(arg1));
324     (*jenv)->SetDoubleArrayRegion(jenv, jresult, 0, getDataSizeX(arg1), result);
325   }
326   return jresult;
327 }
328 
329 
Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_getSurfDataY(JNIEnv * jenv,jclass jcls,jint jarg1)330 SWIGEXPORT jobject JNICALL Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_getSurfDataY(JNIEnv *jenv, jclass jcls, jint jarg1) {
331   jobject jresult = 0 ;
332   int arg1 ;
333   double *result = 0 ;
334 
335   (void)jenv;
336   (void)jcls;
337   arg1 = (int)jarg1;
338   result = (double *)getSurfDataY(arg1);
339   {
340     jresult = (*jenv)->NewDoubleArray(jenv, getDataSizeY(arg1));
341     (*jenv)->SetDoubleArrayRegion(jenv, jresult, 0, getDataSizeY(arg1), result);
342   }
343   return jresult;
344 }
345 
346 
Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_getSurfDataZ(JNIEnv * jenv,jclass jcls,jint jarg1)347 SWIGEXPORT jobject JNICALL Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_getSurfDataZ(JNIEnv *jenv, jclass jcls, jint jarg1) {
348   jobject jresult = 0 ;
349   int arg1 ;
350   double *result = 0 ;
351 
352   (void)jenv;
353   (void)jcls;
354   arg1 = (int)jarg1;
355   result = (double *)getSurfDataZ(arg1);
356   {
357     jresult = (*jenv)->NewDoubleArray(jenv, getDataSizeZ(arg1));
358     (*jenv)->SetDoubleArrayRegion(jenv, jresult, 0, getDataSizeZ(arg1), result);
359   }
360   return jresult;
361 }
362 
363 
Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_createObject3dData(JNIEnv * jenv,jclass jcls,jint jarg1,jint jarg2,jint jarg3)364 SWIGEXPORT jint JNICALL Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_createObject3dData(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2, jint jarg3) {
365   jint jresult = 0 ;
366   int arg1 ;
367   int arg2 ;
368   int arg3 ;
369   int result;
370 
371   (void)jenv;
372   (void)jcls;
373   arg1 = (int)jarg1;
374   arg2 = (int)jarg2;
375   arg3 = (int)jarg3;
376   result = (int)createObject3dData(arg1,arg2,arg3);
377   jresult = (jint)result;
378   return jresult;
379 }
380 
381 
Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_pickSurface(JNIEnv * jenv,jclass jcls,jint jarg1,jdouble jarg2,jdouble jarg3,jdouble jarg4,jdouble jarg5,jdouble jarg6,jdouble jarg7,jdouble jarg8,jdouble jarg9,jdouble jarg10,jdouble jarg11)382 SWIGEXPORT jdouble JNICALL Java_org_scilab_modules_graphic_1objects_SurfaceDataJNI_pickSurface(JNIEnv *jenv, jclass jcls, jint jarg1, jdouble jarg2, jdouble jarg3, jdouble jarg4, jdouble jarg5, jdouble jarg6, jdouble jarg7, jdouble jarg8, jdouble jarg9, jdouble jarg10, jdouble jarg11) {
383   jdouble jresult = 0 ;
384   int arg1 ;
385   double arg2 ;
386   double arg3 ;
387   double arg4 ;
388   double arg5 ;
389   double arg6 ;
390   double arg7 ;
391   double arg8 ;
392   double arg9 ;
393   double arg10 ;
394   double arg11 ;
395   double result;
396 
397   (void)jenv;
398   (void)jcls;
399   arg1 = (int)jarg1;
400   arg2 = (double)jarg2;
401   arg3 = (double)jarg3;
402   arg4 = (double)jarg4;
403   arg5 = (double)jarg5;
404   arg6 = (double)jarg6;
405   arg7 = (double)jarg7;
406   arg8 = (double)jarg8;
407   arg9 = (double)jarg9;
408   arg10 = (double)jarg10;
409   arg11 = (double)jarg11;
410   result = (double)pickSurface(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
411   jresult = (jdouble)result;
412   return jresult;
413 }
414 
415 
416 #ifdef __cplusplus
417 }
418 #endif
419 
420