7fd59977 |
1 | // |
2 | // Copyright (C) 1991 - 2000 by |
3 | // Matra Datavision SA. All rights reserved. |
4 | // |
5 | // Copyright (C) 2001 - 2004 by |
6 | // Open CASCADE SA. All rights reserved. |
7 | // |
8 | // This file is part of the Open CASCADE Technology software. |
9 | // |
10 | // This software may be distributed and/or modified under the terms and |
11 | // conditions of the Open CASCADE Public License as defined by Open CASCADE SA |
12 | // and appearing in the file LICENSE included in the packaging of this file. |
13 | // |
14 | // This software is distributed on an "AS IS" basis, without warranty of any |
15 | // kind, and Open CASCADE SA hereby disclaims all such warranties, |
16 | // including without limitation, any warranties of merchantability, fitness |
17 | // for a particular purpose or non-infringement. Please see the License for |
18 | // the specific terms and conditions governing rights and limitations under the |
19 | // License. |
20 | |
21 | #include <SampleHLRJni_Aspect_MarkerStyle.h> |
22 | #include <Aspect_MarkerStyle.hxx> |
23 | #include <jcas.hxx> |
24 | #include <stdlib.h> |
25 | #include <Standard_ErrorHandler.hxx> |
26 | #include <Standard_Failure.hxx> |
27 | #include <Standard_SStream.hxx> |
28 | |
29 | #include <Aspect_TypeOfMarker.hxx> |
30 | #include <TColStd_Array1OfReal.hxx> |
31 | #include <TColStd_Array1OfBoolean.hxx> |
32 | #include <Standard_Integer.hxx> |
33 | #include <Standard_Boolean.hxx> |
34 | #include <Standard_Real.hxx> |
35 | #include <TShort_Array1OfShortReal.hxx> |
36 | |
37 | |
38 | extern "C" { |
39 | |
40 | |
41 | JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_11 (JNIEnv *env, jobject theobj) |
42 | { |
43 | |
44 | jcas_Locking alock(env); |
45 | { |
46 | try { |
47 | Aspect_MarkerStyle* theret = new Aspect_MarkerStyle(); |
48 | jcas_SetHandle(env,theobj,theret); |
49 | |
50 | } |
51 | catch (Standard_Failure) { |
52 | Standard_SStream Err; |
53 | Err << Standard_Failure::Caught(); |
54 | Err << (char) 0; |
55 | jcas_ThrowException(env,Err.str().c_str()); |
56 | } |
57 | } |
58 | alock.Release(); |
59 | |
60 | } |
61 | |
62 | |
63 | |
64 | JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_12 (JNIEnv *env, jobject theobj, jshort aType) |
65 | { |
66 | |
67 | jcas_Locking alock(env); |
68 | { |
69 | try { |
70 | Aspect_MarkerStyle* theret = new Aspect_MarkerStyle((Aspect_TypeOfMarker) aType); |
71 | jcas_SetHandle(env,theobj,theret); |
72 | |
73 | } |
74 | catch (Standard_Failure) { |
75 | Standard_SStream Err; |
76 | Err << Standard_Failure::Caught(); |
77 | Err << (char) 0; |
78 | jcas_ThrowException(env,Err.str().c_str()); |
79 | } |
80 | } |
81 | alock.Release(); |
82 | |
83 | } |
84 | |
85 | |
86 | |
87 | JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_13 (JNIEnv *env, jobject theobj, jobject aXpoint, jobject aYpoint) |
88 | { |
89 | |
90 | jcas_Locking alock(env); |
91 | { |
92 | try { |
93 | TColStd_Array1OfReal* the_aXpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aXpoint); |
94 | if ( the_aXpoint == NULL ) { |
95 | |
96 | // The following assumes availability of the default constructor (what may not |
97 | // always be the case). Therefore explicit exception is thrown if the null |
98 | // object has been passed. |
99 | // the_aXpoint = new TColStd_Array1OfReal (); |
100 | // jcas_SetHandle ( env, aXpoint, the_aXpoint ); |
101 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
102 | |
103 | } // end if |
104 | TColStd_Array1OfReal* the_aYpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aYpoint); |
105 | if ( the_aYpoint == NULL ) { |
106 | |
107 | // The following assumes availability of the default constructor (what may not |
108 | // always be the case). Therefore explicit exception is thrown if the null |
109 | // object has been passed. |
110 | // the_aYpoint = new TColStd_Array1OfReal (); |
111 | // jcas_SetHandle ( env, aYpoint, the_aYpoint ); |
112 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
113 | |
114 | } // end if |
115 | Aspect_MarkerStyle* theret = new Aspect_MarkerStyle(*the_aXpoint,*the_aYpoint); |
116 | jcas_SetHandle(env,theobj,theret); |
117 | |
118 | } |
119 | catch (Standard_Failure) { |
120 | Standard_SStream Err; |
121 | Err << Standard_Failure::Caught(); |
122 | Err << (char) 0; |
123 | jcas_ThrowException(env,Err.str().c_str()); |
124 | } |
125 | } |
126 | alock.Release(); |
127 | |
128 | } |
129 | |
130 | |
131 | |
132 | JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_14 (JNIEnv *env, jobject theobj, jobject aXpoint, jobject aYpoint, jobject aSpoint) |
133 | { |
134 | |
135 | jcas_Locking alock(env); |
136 | { |
137 | try { |
138 | TColStd_Array1OfReal* the_aXpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aXpoint); |
139 | if ( the_aXpoint == NULL ) { |
140 | |
141 | // The following assumes availability of the default constructor (what may not |
142 | // always be the case). Therefore explicit exception is thrown if the null |
143 | // object has been passed. |
144 | // the_aXpoint = new TColStd_Array1OfReal (); |
145 | // jcas_SetHandle ( env, aXpoint, the_aXpoint ); |
146 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
147 | |
148 | } // end if |
149 | TColStd_Array1OfReal* the_aYpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aYpoint); |
150 | if ( the_aYpoint == NULL ) { |
151 | |
152 | // The following assumes availability of the default constructor (what may not |
153 | // always be the case). Therefore explicit exception is thrown if the null |
154 | // object has been passed. |
155 | // the_aYpoint = new TColStd_Array1OfReal (); |
156 | // jcas_SetHandle ( env, aYpoint, the_aYpoint ); |
157 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
158 | |
159 | } // end if |
160 | TColStd_Array1OfBoolean* the_aSpoint = (TColStd_Array1OfBoolean*) jcas_GetHandle(env,aSpoint); |
161 | if ( the_aSpoint == NULL ) { |
162 | |
163 | // The following assumes availability of the default constructor (what may not |
164 | // always be the case). Therefore explicit exception is thrown if the null |
165 | // object has been passed. |
166 | // the_aSpoint = new TColStd_Array1OfBoolean (); |
167 | // jcas_SetHandle ( env, aSpoint, the_aSpoint ); |
168 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
169 | |
170 | } // end if |
171 | Aspect_MarkerStyle* theret = new Aspect_MarkerStyle(*the_aXpoint,*the_aYpoint,*the_aSpoint); |
172 | jcas_SetHandle(env,theobj,theret); |
173 | |
174 | } |
175 | catch (Standard_Failure) { |
176 | Standard_SStream Err; |
177 | Err << Standard_Failure::Caught(); |
178 | Err << (char) 0; |
179 | jcas_ThrowException(env,Err.str().c_str()); |
180 | } |
181 | } |
182 | alock.Release(); |
183 | |
184 | } |
185 | |
186 | |
187 | |
188 | JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Assign (JNIEnv *env, jobject theobj, jobject Other) |
189 | { |
190 | jobject thejret; |
191 | |
192 | jcas_Locking alock(env); |
193 | { |
194 | try { |
195 | Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other); |
196 | if ( the_Other == NULL ) { |
197 | |
198 | // The following assumes availability of the default constructor (what may not |
199 | // always be the case). Therefore explicit exception is thrown if the null |
200 | // object has been passed. |
201 | // the_Other = new Aspect_MarkerStyle (); |
202 | // jcas_SetHandle ( env, Other, the_Other ); |
203 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
204 | |
205 | } // end if |
206 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
207 | const Aspect_MarkerStyle& theret = the_this->Assign(*the_Other); |
208 | thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_MarkerStyle",&theret,0); |
209 | |
210 | } |
211 | catch (Standard_Failure) { |
212 | Standard_SStream Err; |
213 | Err << Standard_Failure::Caught(); |
214 | Err << (char) 0; |
215 | jcas_ThrowException(env,Err.str().c_str()); |
216 | } |
217 | } |
218 | alock.Release(); |
219 | return thejret; |
220 | } |
221 | |
222 | |
223 | |
224 | JNIEXPORT jshort JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Type (JNIEnv *env, jobject theobj) |
225 | { |
226 | jshort thejret; |
227 | |
228 | jcas_Locking alock(env); |
229 | { |
230 | try { |
231 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
232 | thejret = the_this->Type(); |
233 | |
234 | } |
235 | catch (Standard_Failure) { |
236 | Standard_SStream Err; |
237 | Err << Standard_Failure::Caught(); |
238 | Err << (char) 0; |
239 | jcas_ThrowException(env,Err.str().c_str()); |
240 | } |
241 | } |
242 | alock.Release(); |
243 | return thejret; |
244 | } |
245 | |
246 | |
247 | |
248 | JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Length (JNIEnv *env, jobject theobj) |
249 | { |
250 | jint thejret; |
251 | |
252 | jcas_Locking alock(env); |
253 | { |
254 | try { |
255 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
256 | thejret = the_this->Length(); |
257 | |
258 | } |
259 | catch (Standard_Failure) { |
260 | Standard_SStream Err; |
261 | Err << Standard_Failure::Caught(); |
262 | Err << (char) 0; |
263 | jcas_ThrowException(env,Err.str().c_str()); |
264 | } |
265 | } |
266 | alock.Release(); |
267 | return thejret; |
268 | } |
269 | |
270 | |
271 | |
272 | JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Values (JNIEnv *env, jobject theobj, jint aRank, jobject aX, jobject aY) |
273 | { |
274 | jboolean thejret; |
275 | |
276 | jcas_Locking alock(env); |
277 | { |
278 | try { |
279 | Standard_Real the_aX = jcas_GetReal(env,aX); |
280 | Standard_Real the_aY = jcas_GetReal(env,aY); |
281 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
282 | thejret = the_this->Values((Standard_Integer) aRank,the_aX,the_aY); |
283 | jcas_SetReal(env,aX,the_aX); |
284 | jcas_SetReal(env,aY,the_aY); |
285 | |
286 | } |
287 | catch (Standard_Failure) { |
288 | Standard_SStream Err; |
289 | Err << Standard_Failure::Caught(); |
290 | Err << (char) 0; |
291 | jcas_ThrowException(env,Err.str().c_str()); |
292 | } |
293 | } |
294 | alock.Release(); |
295 | return thejret; |
296 | } |
297 | |
298 | |
299 | |
300 | JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_XValues (JNIEnv *env, jobject theobj) |
301 | { |
302 | jobject thejret; |
303 | |
304 | jcas_Locking alock(env); |
305 | { |
306 | try { |
307 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
308 | const TShort_Array1OfShortReal& theret = the_this->XValues(); |
309 | thejret = jcas_CreateObject(env,"CASCADESamplesJni/TShort_Array1OfShortReal",&theret,0); |
310 | |
311 | } |
312 | catch (Standard_Failure) { |
313 | Standard_SStream Err; |
314 | Err << Standard_Failure::Caught(); |
315 | Err << (char) 0; |
316 | jcas_ThrowException(env,Err.str().c_str()); |
317 | } |
318 | } |
319 | alock.Release(); |
320 | return thejret; |
321 | } |
322 | |
323 | |
324 | |
325 | JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_YValues (JNIEnv *env, jobject theobj) |
326 | { |
327 | jobject thejret; |
328 | |
329 | jcas_Locking alock(env); |
330 | { |
331 | try { |
332 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
333 | const TShort_Array1OfShortReal& theret = the_this->YValues(); |
334 | thejret = jcas_CreateObject(env,"CASCADESamplesJni/TShort_Array1OfShortReal",&theret,0); |
335 | |
336 | } |
337 | catch (Standard_Failure) { |
338 | Standard_SStream Err; |
339 | Err << Standard_Failure::Caught(); |
340 | Err << (char) 0; |
341 | jcas_ThrowException(env,Err.str().c_str()); |
342 | } |
343 | } |
344 | alock.Release(); |
345 | return thejret; |
346 | } |
347 | |
348 | |
349 | |
350 | JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_SValues (JNIEnv *env, jobject theobj) |
351 | { |
352 | jobject thejret; |
353 | |
354 | jcas_Locking alock(env); |
355 | { |
356 | try { |
357 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
358 | const TColStd_Array1OfBoolean& theret = the_this->SValues(); |
359 | thejret = jcas_CreateObject(env,"CASCADESamplesJni/TColStd_Array1OfBoolean",&theret,0); |
360 | |
361 | } |
362 | catch (Standard_Failure) { |
363 | Standard_SStream Err; |
364 | Err << Standard_Failure::Caught(); |
365 | Err << (char) 0; |
366 | jcas_ThrowException(env,Err.str().c_str()); |
367 | } |
368 | } |
369 | alock.Release(); |
370 | return thejret; |
371 | } |
372 | |
373 | |
374 | |
375 | JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_IsEqual (JNIEnv *env, jobject theobj, jobject Other) |
376 | { |
377 | jboolean thejret; |
378 | |
379 | jcas_Locking alock(env); |
380 | { |
381 | try { |
382 | Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other); |
383 | if ( the_Other == NULL ) { |
384 | |
385 | // The following assumes availability of the default constructor (what may not |
386 | // always be the case). Therefore explicit exception is thrown if the null |
387 | // object has been passed. |
388 | // the_Other = new Aspect_MarkerStyle (); |
389 | // jcas_SetHandle ( env, Other, the_Other ); |
390 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
391 | |
392 | } // end if |
393 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
394 | thejret = the_this->IsEqual(*the_Other); |
395 | |
396 | } |
397 | catch (Standard_Failure) { |
398 | Standard_SStream Err; |
399 | Err << Standard_Failure::Caught(); |
400 | Err << (char) 0; |
401 | jcas_ThrowException(env,Err.str().c_str()); |
402 | } |
403 | } |
404 | alock.Release(); |
405 | return thejret; |
406 | } |
407 | |
408 | |
409 | |
410 | JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_IsNotEqual (JNIEnv *env, jobject theobj, jobject Other) |
411 | { |
412 | jboolean thejret; |
413 | |
414 | jcas_Locking alock(env); |
415 | { |
416 | try { |
417 | Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other); |
418 | if ( the_Other == NULL ) { |
419 | |
420 | // The following assumes availability of the default constructor (what may not |
421 | // always be the case). Therefore explicit exception is thrown if the null |
422 | // object has been passed. |
423 | // the_Other = new Aspect_MarkerStyle (); |
424 | // jcas_SetHandle ( env, Other, the_Other ); |
425 | jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); |
426 | |
427 | } // end if |
428 | Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj); |
429 | thejret = the_this->IsNotEqual(*the_Other); |
430 | |
431 | } |
432 | catch (Standard_Failure) { |
433 | Standard_SStream Err; |
434 | Err << Standard_Failure::Caught(); |
435 | Err << (char) 0; |
436 | jcas_ThrowException(env,Err.str().c_str()); |
437 | } |
438 | } |
439 | alock.Release(); |
440 | return thejret; |
441 | } |
442 | |
443 | |
444 | |
445 | JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_FinalizeValue(JNIEnv *, jclass, jlong theid) |
446 | { |
447 | if (theid) { |
448 | Aspect_MarkerStyle* theobj = (Aspect_MarkerStyle*) theid; |
449 | delete theobj; |
450 | } |
451 | } |
452 | |
453 | |
454 | } |