7fd59977 |
1 | // Copyright (C) 1991,1995 by |
2 | // |
3 | // MATRA DATAVISION, FRANCE |
4 | // |
5 | // This software is furnished in accordance with the terms and conditions |
6 | // of the contract and with the inclusion of the above copyright notice. |
7 | // This software or any other copy thereof may not be provided or otherwise |
8 | // be made available to any other person. No title to an ownership of the |
9 | // software is hereby transferred. |
10 | // |
11 | // At the termination of the contract, the software and all copies of this |
12 | // software must be deleted. |
13 | |
14 | #include <CASCADESamplesJni_Aspect_TypeMapEntry.h> |
15 | #include <Aspect_TypeMapEntry.hxx> |
16 | #include <jcas.hxx> |
17 | #include <stdlib.h> |
18 | #include <Standard_ErrorHandler.hxx> |
19 | #include <Standard_SStream.hxx> |
20 | |
21 | #include <Standard_Integer.hxx> |
22 | #include <Aspect_LineStyle.hxx> |
23 | #include <Standard_Boolean.hxx> |
24 | |
25 | |
26 | extern "C" { |
27 | |
28 | |
29 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Aspect_1TypeMapEntry_1Create_11 (JNIEnv *env, jobject theobj) |
30 | { |
31 | |
32 | jcas_Locking alock(env); |
33 | { |
34 | try { |
35 | Aspect_TypeMapEntry* theret = new Aspect_TypeMapEntry(); |
36 | jcas_SetHandle(env,theobj,theret); |
37 | |
38 | } |
39 | catch (Standard_Failure) { |
40 | Standard_SStream Err; |
41 | Err << Standard_Failure::Caught(); |
42 | Err << (char) 0; |
43 | jcas_ThrowException(env,GetSString(Err)); |
44 | } |
45 | } |
46 | alock.Release(); |
47 | |
48 | } |
49 | |
50 | |
51 | |
52 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Aspect_1TypeMapEntry_1Create_12 (JNIEnv *env, jobject theobj, jint index, jobject style) |
53 | { |
54 | |
55 | jcas_Locking alock(env); |
56 | { |
57 | try { |
58 | Aspect_LineStyle* the_style = (Aspect_LineStyle*) jcas_GetHandle(env,style); |
59 | Aspect_TypeMapEntry* theret = new Aspect_TypeMapEntry((Standard_Integer) index,*the_style); |
60 | jcas_SetHandle(env,theobj,theret); |
61 | |
62 | } |
63 | catch (Standard_Failure) { |
64 | Standard_SStream Err; |
65 | Err << Standard_Failure::Caught(); |
66 | Err << (char) 0; |
67 | jcas_ThrowException(env,GetSString(Err)); |
68 | } |
69 | } |
70 | alock.Release(); |
71 | |
72 | } |
73 | |
74 | |
75 | |
76 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Aspect_1TypeMapEntry_1Create_13 (JNIEnv *env, jobject theobj, jobject entry) |
77 | { |
78 | |
79 | jcas_Locking alock(env); |
80 | { |
81 | try { |
82 | Aspect_TypeMapEntry* the_entry = (Aspect_TypeMapEntry*) jcas_GetHandle(env,entry); |
83 | Aspect_TypeMapEntry* theret = new Aspect_TypeMapEntry(*the_entry); |
84 | jcas_SetHandle(env,theobj,theret); |
85 | |
86 | } |
87 | catch (Standard_Failure) { |
88 | Standard_SStream Err; |
89 | Err << Standard_Failure::Caught(); |
90 | Err << (char) 0; |
91 | jcas_ThrowException(env,GetSString(Err)); |
92 | } |
93 | } |
94 | alock.Release(); |
95 | |
96 | } |
97 | |
98 | |
99 | |
100 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Aspect_1TypeMapEntry_1SetValue_11 (JNIEnv *env, jobject theobj, jint index, jobject style) |
101 | { |
102 | |
103 | jcas_Locking alock(env); |
104 | { |
105 | try { |
106 | Aspect_LineStyle* the_style = (Aspect_LineStyle*) jcas_GetHandle(env,style); |
107 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
108 | the_this->SetValue((Standard_Integer) index,*the_style); |
109 | |
110 | } |
111 | catch (Standard_Failure) { |
112 | Standard_SStream Err; |
113 | Err << Standard_Failure::Caught(); |
114 | Err << (char) 0; |
115 | jcas_ThrowException(env,GetSString(Err)); |
116 | } |
117 | } |
118 | alock.Release(); |
119 | |
120 | } |
121 | |
122 | |
123 | |
124 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Aspect_1TypeMapEntry_1SetValue_12 (JNIEnv *env, jobject theobj, jobject entry) |
125 | { |
126 | |
127 | jcas_Locking alock(env); |
128 | { |
129 | try { |
130 | Aspect_TypeMapEntry* the_entry = (Aspect_TypeMapEntry*) jcas_GetHandle(env,entry); |
131 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
132 | the_this->SetValue(*the_entry); |
133 | |
134 | } |
135 | catch (Standard_Failure) { |
136 | Standard_SStream Err; |
137 | Err << Standard_Failure::Caught(); |
138 | Err << (char) 0; |
139 | jcas_ThrowException(env,GetSString(Err)); |
140 | } |
141 | } |
142 | alock.Release(); |
143 | |
144 | } |
145 | |
146 | |
147 | |
148 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_SetType (JNIEnv *env, jobject theobj, jobject Style) |
149 | { |
150 | |
151 | jcas_Locking alock(env); |
152 | { |
153 | try { |
154 | Aspect_LineStyle* the_Style = (Aspect_LineStyle*) jcas_GetHandle(env,Style); |
155 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
156 | the_this->SetType(*the_Style); |
157 | |
158 | } |
159 | catch (Standard_Failure) { |
160 | Standard_SStream Err; |
161 | Err << Standard_Failure::Caught(); |
162 | Err << (char) 0; |
163 | jcas_ThrowException(env,GetSString(Err)); |
164 | } |
165 | } |
166 | alock.Release(); |
167 | |
168 | } |
169 | |
170 | |
171 | |
172 | JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Type (JNIEnv *env, jobject theobj) |
173 | { |
174 | jobject thejret; |
175 | |
176 | jcas_Locking alock(env); |
177 | { |
178 | try { |
179 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
180 | const Aspect_LineStyle& theret = the_this->Type(); |
181 | thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_LineStyle",&theret,0); |
182 | |
183 | } |
184 | catch (Standard_Failure) { |
185 | Standard_SStream Err; |
186 | Err << Standard_Failure::Caught(); |
187 | Err << (char) 0; |
188 | jcas_ThrowException(env,GetSString(Err)); |
189 | } |
190 | } |
191 | alock.Release(); |
192 | return thejret; |
193 | } |
194 | |
195 | |
196 | |
197 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_SetIndex (JNIEnv *env, jobject theobj, jint index) |
198 | { |
199 | |
200 | jcas_Locking alock(env); |
201 | { |
202 | try { |
203 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
204 | the_this->SetIndex((Standard_Integer) index); |
205 | |
206 | } |
207 | catch (Standard_Failure) { |
208 | Standard_SStream Err; |
209 | Err << Standard_Failure::Caught(); |
210 | Err << (char) 0; |
211 | jcas_ThrowException(env,GetSString(Err)); |
212 | } |
213 | } |
214 | alock.Release(); |
215 | |
216 | } |
217 | |
218 | |
219 | |
220 | JNIEXPORT jint JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Index (JNIEnv *env, jobject theobj) |
221 | { |
222 | jint thejret; |
223 | |
224 | jcas_Locking alock(env); |
225 | { |
226 | try { |
227 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
228 | thejret = the_this->Index(); |
229 | |
230 | } |
231 | catch (Standard_Failure) { |
232 | Standard_SStream Err; |
233 | Err << Standard_Failure::Caught(); |
234 | Err << (char) 0; |
235 | jcas_ThrowException(env,GetSString(Err)); |
236 | } |
237 | } |
238 | alock.Release(); |
239 | return thejret; |
240 | } |
241 | |
242 | |
243 | |
244 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Free (JNIEnv *env, jobject theobj) |
245 | { |
246 | |
247 | jcas_Locking alock(env); |
248 | { |
249 | try { |
250 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
251 | the_this->Free(); |
252 | |
253 | } |
254 | catch (Standard_Failure) { |
255 | Standard_SStream Err; |
256 | Err << Standard_Failure::Caught(); |
257 | Err << (char) 0; |
258 | jcas_ThrowException(env,GetSString(Err)); |
259 | } |
260 | } |
261 | alock.Release(); |
262 | |
263 | } |
264 | |
265 | |
266 | |
267 | JNIEXPORT jboolean JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_IsAllocated (JNIEnv *env, jobject theobj) |
268 | { |
269 | jboolean thejret; |
270 | |
271 | jcas_Locking alock(env); |
272 | { |
273 | try { |
274 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
275 | thejret = the_this->IsAllocated(); |
276 | |
277 | } |
278 | catch (Standard_Failure) { |
279 | Standard_SStream Err; |
280 | Err << Standard_Failure::Caught(); |
281 | Err << (char) 0; |
282 | jcas_ThrowException(env,GetSString(Err)); |
283 | } |
284 | } |
285 | alock.Release(); |
286 | return thejret; |
287 | } |
288 | |
289 | |
290 | |
291 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_Dump (JNIEnv *env, jobject theobj) |
292 | { |
293 | |
294 | jcas_Locking alock(env); |
295 | { |
296 | try { |
297 | Aspect_TypeMapEntry* the_this = (Aspect_TypeMapEntry*) jcas_GetHandle(env,theobj); |
298 | the_this->Dump(); |
299 | |
300 | } |
301 | catch (Standard_Failure) { |
302 | Standard_SStream Err; |
303 | Err << Standard_Failure::Caught(); |
304 | Err << (char) 0; |
305 | jcas_ThrowException(env,GetSString(Err)); |
306 | } |
307 | } |
308 | alock.Release(); |
309 | |
310 | } |
311 | |
312 | |
313 | |
314 | JNIEXPORT void JNICALL Java_CASCADESamplesJni_Aspect_1TypeMapEntry_FinalizeValue(JNIEnv *, jclass, jlong theid) |
315 | { |
316 | if (theid) { |
317 | Aspect_TypeMapEntry* theobj = (Aspect_TypeMapEntry*) theid; |
318 | delete theobj; |
319 | } |
320 | } |
321 | |
322 | |
323 | } |