2 // Copyright (C) 1991 - 2000 by
3 // Matra Datavision SA. All rights reserved.
5 // Copyright (C) 2001 - 2004 by
6 // Open CASCADE SA. All rights reserved.
8 // This file is part of the Open CASCADE Technology software.
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.
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
21 #include <SampleHLRJni_Aspect_WidthMapEntry.h>
22 #include <Aspect_WidthMapEntry.hxx>
25 #include <Standard_ErrorHandler.hxx>
26 #include <Standard_Failure.hxx>
27 #include <Standard_SStream.hxx>
29 #include <Standard_Integer.hxx>
30 #include <Aspect_WidthOfLine.hxx>
31 #include <Standard_Real.hxx>
32 #include <Standard_Boolean.hxx>
38 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_11 (JNIEnv *env, jobject theobj)
41 jcas_Locking alock(env);
44 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry();
45 jcas_SetHandle(env,theobj,theret);
48 catch (Standard_Failure) {
50 Err << Standard_Failure::Caught();
52 jcas_ThrowException(env,Err.str().c_str());
61 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_12 (JNIEnv *env, jobject theobj, jint index, jshort style)
64 jcas_Locking alock(env);
67 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry((Standard_Integer) index,(Aspect_WidthOfLine) style);
68 jcas_SetHandle(env,theobj,theret);
71 catch (Standard_Failure) {
73 Err << Standard_Failure::Caught();
75 jcas_ThrowException(env,Err.str().c_str());
84 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_13 (JNIEnv *env, jobject theobj, jint index, jdouble width)
87 jcas_Locking alock(env);
90 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry((Standard_Integer) index,(Quantity_Length) width);
91 jcas_SetHandle(env,theobj,theret);
94 catch (Standard_Failure) {
96 Err << Standard_Failure::Caught();
98 jcas_ThrowException(env,Err.str().c_str());
107 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1Create_14 (JNIEnv *env, jobject theobj, jobject entry)
110 jcas_Locking alock(env);
113 Aspect_WidthMapEntry* the_entry = (Aspect_WidthMapEntry*) jcas_GetHandle(env,entry);
114 if ( the_entry == NULL ) {
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");
124 Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry(*the_entry);
125 jcas_SetHandle(env,theobj,theret);
128 catch (Standard_Failure) {
129 Standard_SStream Err;
130 Err << Standard_Failure::Caught();
132 jcas_ThrowException(env,Err.str().c_str());
141 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1SetValue_11 (JNIEnv *env, jobject theobj, jint index, jshort style)
144 jcas_Locking alock(env);
147 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
148 the_this->SetValue((Standard_Integer) index,(Aspect_WidthOfLine) style);
151 catch (Standard_Failure) {
152 Standard_SStream Err;
153 Err << Standard_Failure::Caught();
155 jcas_ThrowException(env,Err.str().c_str());
164 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1SetValue_12 (JNIEnv *env, jobject theobj, jint index, jdouble width)
167 jcas_Locking alock(env);
170 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
171 the_this->SetValue((Standard_Integer) index,(Quantity_Length) width);
174 catch (Standard_Failure) {
175 Standard_SStream Err;
176 Err << Standard_Failure::Caught();
178 jcas_ThrowException(env,Err.str().c_str());
187 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Aspect_1WidthMapEntry_1SetValue_13 (JNIEnv *env, jobject theobj, jobject entry)
190 jcas_Locking alock(env);
193 Aspect_WidthMapEntry* the_entry = (Aspect_WidthMapEntry*) jcas_GetHandle(env,entry);
194 if ( the_entry == NULL ) {
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");
204 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
205 the_this->SetValue(*the_entry);
208 catch (Standard_Failure) {
209 Standard_SStream Err;
210 Err << Standard_Failure::Caught();
212 jcas_ThrowException(env,Err.str().c_str());
221 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_SetIndex (JNIEnv *env, jobject theobj, jint index)
224 jcas_Locking alock(env);
227 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
228 the_this->SetIndex((Standard_Integer) index);
231 catch (Standard_Failure) {
232 Standard_SStream Err;
233 Err << Standard_Failure::Caught();
235 jcas_ThrowException(env,Err.str().c_str());
244 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_SetType (JNIEnv *env, jobject theobj, jshort Style)
247 jcas_Locking alock(env);
250 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
251 the_this->SetType((Aspect_WidthOfLine) Style);
254 catch (Standard_Failure) {
255 Standard_SStream Err;
256 Err << Standard_Failure::Caught();
258 jcas_ThrowException(env,Err.str().c_str());
267 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_SetWidth (JNIEnv *env, jobject theobj, jdouble Width)
270 jcas_Locking alock(env);
273 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
274 the_this->SetWidth((Quantity_Length) Width);
277 catch (Standard_Failure) {
278 Standard_SStream Err;
279 Err << Standard_Failure::Caught();
281 jcas_ThrowException(env,Err.str().c_str());
290 JNIEXPORT jshort JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Type (JNIEnv *env, jobject theobj)
294 jcas_Locking alock(env);
297 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
298 thejret = the_this->Type();
301 catch (Standard_Failure) {
302 Standard_SStream Err;
303 Err << Standard_Failure::Caught();
305 jcas_ThrowException(env,Err.str().c_str());
314 JNIEXPORT jdouble JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Width (JNIEnv *env, jobject theobj)
318 jcas_Locking alock(env);
321 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
322 thejret = the_this->Width();
325 catch (Standard_Failure) {
326 Standard_SStream Err;
327 Err << Standard_Failure::Caught();
329 jcas_ThrowException(env,Err.str().c_str());
338 JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Index (JNIEnv *env, jobject theobj)
342 jcas_Locking alock(env);
345 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
346 thejret = the_this->Index();
349 catch (Standard_Failure) {
350 Standard_SStream Err;
351 Err << Standard_Failure::Caught();
353 jcas_ThrowException(env,Err.str().c_str());
362 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Free (JNIEnv *env, jobject theobj)
365 jcas_Locking alock(env);
368 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
372 catch (Standard_Failure) {
373 Standard_SStream Err;
374 Err << Standard_Failure::Caught();
376 jcas_ThrowException(env,Err.str().c_str());
385 JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_IsAllocated (JNIEnv *env, jobject theobj)
389 jcas_Locking alock(env);
392 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
393 thejret = the_this->IsAllocated();
396 catch (Standard_Failure) {
397 Standard_SStream Err;
398 Err << Standard_Failure::Caught();
400 jcas_ThrowException(env,Err.str().c_str());
409 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_Dump (JNIEnv *env, jobject theobj)
412 jcas_Locking alock(env);
415 Aspect_WidthMapEntry* the_this = (Aspect_WidthMapEntry*) jcas_GetHandle(env,theobj);
419 catch (Standard_Failure) {
420 Standard_SStream Err;
421 Err << Standard_Failure::Caught();
423 jcas_ThrowException(env,Err.str().c_str());
432 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMapEntry_FinalizeValue(JNIEnv *, jclass, jlong theid)
435 Aspect_WidthMapEntry* theobj = (Aspect_WidthMapEntry*) theid;