Integration of OCCT 6.5.0 from SVN
[occt.git] / samples / java / drv / SampleHLRJni / SampleHLRJni_Aspect_WidthMapEntry_java.cxx
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_WidthMapEntry.h>
22 #include <Aspect_WidthMapEntry.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 <Standard_Integer.hxx>
30 #include <Aspect_WidthOfLine.hxx>
31 #include <Standard_Real.hxx>
32 #include <Standard_Boolean.hxx>
33
34
35 extern "C" {
36
37
38 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_11 (JNIEnv *env, jobject theobj)
39 {
40
41 jcas_Locking alock(env);
42 {
43 try {
44 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry();
45 jcas_SetHandle(env,theobj,theret);
46
47 }
48 catch (Standard_Failure) {
49   Standard_SStream Err;
50   Err <<   Standard_Failure::Caught(); 
51   Err << (char) 0;
52   jcas_ThrowException(env,Err.str().c_str());
53 }
54 }
55 alock.Release();
56
57 }
58
59
60
61 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_12 (JNIEnv *env, jobject theobj, jint index, jshort style)
62 {
63
64 jcas_Locking alock(env);
65 {
66 try {
67 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry((Standard_Integer) index,(Aspect_WidthOfLine) style);
68 jcas_SetHandle(env,theobj,theret);
69
70 }
71 catch (Standard_Failure) {
72   Standard_SStream Err;
73   Err <<   Standard_Failure::Caught(); 
74   Err << (char) 0;
75   jcas_ThrowException(env,Err.str().c_str());
76 }
77 }
78 alock.Release();
79
80 }
81
82
83
84 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_13 (JNIEnv *env, jobject theobj, jint index, jdouble width)
85 {
86
87 jcas_Locking alock(env);
88 {
89 try {
90 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry((Standard_Integer) index,(Quantity_Length) width);
91 jcas_SetHandle(env,theobj,theret);
92
93 }
94 catch (Standard_Failure) {
95   Standard_SStream Err;
96   Err <<   Standard_Failure::Caught(); 
97   Err << (char) 0;
98   jcas_ThrowException(env,Err.str().c_str());
99 }
100 }
101 alock.Release();
102
103 }
104
105
106
107 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_14 (JNIEnv *env, jobject theobj, jobject entry)
108 {
109
110 jcas_Locking alock(env);
111 {
112 try {
113 Aspect_WidthMapEntry* the_entry = (Aspect_WidthMapEntry*) jcas_GetHandle(env,entry);
114 if ( the_entry == NULL ) {
115
116  // The following assumes availability of the default constructor (what may not
117  // always be the case). Therefore explicit exception is thrown if the null
118  // object has been passed.
119  // the_entry = new Aspect_WidthMapEntry ();
120  // jcas_SetHandle ( env, entry, the_entry );
121  jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
122
123 }  // end if
124 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry(*the_entry);
125 jcas_SetHandle(env,theobj,theret);
126
127 }
128 catch (Standard_Failure) {
129   Standard_SStream Err;
130   Err <<   Standard_Failure::Caught(); 
131   Err << (char) 0;
132   jcas_ThrowException(env,Err.str().c_str());
133 }
134 }
135 alock.Release();
136
137 }
138
139
140
141 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1SetValue_11 (JNIEnv *env, jobject theobj, jint index, jshort style)
142 {
143
144 jcas_Locking alock(env);
145 {
146 try {
147 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
148 the_this->SetValue((Standard_Integer) index,(Aspect_WidthOfLine) style);
149
150 }
151 catch (Standard_Failure) {
152   Standard_SStream Err;
153   Err <<   Standard_Failure::Caught(); 
154   Err << (char) 0;
155   jcas_ThrowException(env,Err.str().c_str());
156 }
157 }
158 alock.Release();
159
160 }
161
162
163
164 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1SetValue_12 (JNIEnv *env, jobject theobj, jint index, jdouble width)
165 {
166
167 jcas_Locking alock(env);
168 {
169 try {
170 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
171 the_this->SetValue((Standard_Integer) index,(Quantity_Length) width);
172
173 }
174 catch (Standard_Failure) {
175   Standard_SStream Err;
176   Err <<   Standard_Failure::Caught(); 
177   Err << (char) 0;
178   jcas_ThrowException(env,Err.str().c_str());
179 }
180 }
181 alock.Release();
182
183 }
184
185
186
187 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1SetValue_13 (JNIEnv *env, jobject theobj, jobject entry)
188 {
189
190 jcas_Locking alock(env);
191 {
192 try {
193 Aspect_WidthMapEntry* the_entry = (Aspect_WidthMapEntry*) jcas_GetHandle(env,entry);
194 if ( the_entry == NULL ) {
195
196  // The following assumes availability of the default constructor (what may not
197  // always be the case). Therefore explicit exception is thrown if the null
198  // object has been passed.
199  // the_entry = new Aspect_WidthMapEntry ();
200  // jcas_SetHandle ( env, entry, the_entry );
201  jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
202
203 }  // end if
204 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
205 the_this->SetValue(*the_entry);
206
207 }
208 catch (Standard_Failure) {
209   Standard_SStream Err;
210   Err <<   Standard_Failure::Caught(); 
211   Err << (char) 0;
212   jcas_ThrowException(env,Err.str().c_str());
213 }
214 }
215 alock.Release();
216
217 }
218
219
220
221 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_SetIndex (JNIEnv *env, jobject theobj, jint index)
222 {
223
224 jcas_Locking alock(env);
225 {
226 try {
227 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
228 the_this->SetIndex((Standard_Integer) index);
229
230 }
231 catch (Standard_Failure) {
232   Standard_SStream Err;
233   Err <<   Standard_Failure::Caught(); 
234   Err << (char) 0;
235   jcas_ThrowException(env,Err.str().c_str());
236 }
237 }
238 alock.Release();
239
240 }
241
242
243
244 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_SetType (JNIEnv *env, jobject theobj, jshort Style)
245 {
246
247 jcas_Locking alock(env);
248 {
249 try {
250 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
251 the_this->SetType((Aspect_WidthOfLine) Style);
252
253 }
254 catch (Standard_Failure) {
255   Standard_SStream Err;
256   Err <<   Standard_Failure::Caught(); 
257   Err << (char) 0;
258   jcas_ThrowException(env,Err.str().c_str());
259 }
260 }
261 alock.Release();
262
263 }
264
265
266
267 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_SetWidth (JNIEnv *env, jobject theobj, jdouble Width)
268 {
269
270 jcas_Locking alock(env);
271 {
272 try {
273 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
274 the_this->SetWidth((Quantity_Length) Width);
275
276 }
277 catch (Standard_Failure) {
278   Standard_SStream Err;
279   Err <<   Standard_Failure::Caught(); 
280   Err << (char) 0;
281   jcas_ThrowException(env,Err.str().c_str());
282 }
283 }
284 alock.Release();
285
286 }
287
288
289
290 JNIEXPORT jshort JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Type (JNIEnv *env, jobject theobj)
291 {
292 jshort thejret;
293
294 jcas_Locking alock(env);
295 {
296 try {
297 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
298  thejret = the_this->Type();
299
300 }
301 catch (Standard_Failure) {
302   Standard_SStream Err;
303   Err <<   Standard_Failure::Caught(); 
304   Err << (char) 0;
305   jcas_ThrowException(env,Err.str().c_str());
306 }
307 }
308 alock.Release();
309 return thejret;
310 }
311
312
313
314 JNIEXPORT jdouble JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Width (JNIEnv *env, jobject theobj)
315 {
316 jdouble thejret;
317
318 jcas_Locking alock(env);
319 {
320 try {
321 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
322  thejret = the_this->Width();
323
324 }
325 catch (Standard_Failure) {
326   Standard_SStream Err;
327   Err <<   Standard_Failure::Caught(); 
328   Err << (char) 0;
329   jcas_ThrowException(env,Err.str().c_str());
330 }
331 }
332 alock.Release();
333 return thejret;
334 }
335
336
337
338 JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Index (JNIEnv *env, jobject theobj)
339 {
340 jint thejret;
341
342 jcas_Locking alock(env);
343 {
344 try {
345 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
346  thejret = the_this->Index();
347
348 }
349 catch (Standard_Failure) {
350   Standard_SStream Err;
351   Err <<   Standard_Failure::Caught(); 
352   Err << (char) 0;
353   jcas_ThrowException(env,Err.str().c_str());
354 }
355 }
356 alock.Release();
357 return thejret;
358 }
359
360
361
362 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Free (JNIEnv *env, jobject theobj)
363 {
364
365 jcas_Locking alock(env);
366 {
367 try {
368 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
369 the_this->Free();
370
371 }
372 catch (Standard_Failure) {
373   Standard_SStream Err;
374   Err <<   Standard_Failure::Caught(); 
375   Err << (char) 0;
376   jcas_ThrowException(env,Err.str().c_str());
377 }
378 }
379 alock.Release();
380
381 }
382
383
384
385 JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_IsAllocated (JNIEnv *env, jobject theobj)
386 {
387 jboolean thejret;
388
389 jcas_Locking alock(env);
390 {
391 try {
392 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
393  thejret = the_this->IsAllocated();
394
395 }
396 catch (Standard_Failure) {
397   Standard_SStream Err;
398   Err <<   Standard_Failure::Caught(); 
399   Err << (char) 0;
400   jcas_ThrowException(env,Err.str().c_str());
401 }
402 }
403 alock.Release();
404 return thejret;
405 }
406
407
408
409 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Dump (JNIEnv *env, jobject theobj)
410 {
411
412 jcas_Locking alock(env);
413 {
414 try {
415 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
416 the_this->Dump();
417
418 }
419 catch (Standard_Failure) {
420   Standard_SStream Err;
421   Err <<   Standard_Failure::Caught(); 
422   Err << (char) 0;
423   jcas_ThrowException(env,Err.str().c_str());
424 }
425 }
426 alock.Release();
427
428 }
429
430
431
432 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_FinalizeValue(JNIEnv *, jclass, jlong theid)
433 {
434 if (theid) {
435   Aspect_WidthMapEntry* theobj = (Aspect_WidthMapEntry*) theid;
436   delete theobj;
437 }
438 }
439
440
441 }