// // Copyright (C) 1991 - 2000 by // Matra Datavision SA. All rights reserved. // // Copyright (C) 2001 - 2004 by // Open CASCADE SA. All rights reserved. // // This file is part of the Open CASCADE Technology software. // // This software may be distributed and/or modified under the terms and // conditions of the Open CASCADE Public License as defined by Open CASCADE SA // and appearing in the file LICENSE included in the packaging of this file. // // This software is distributed on an "AS IS" basis, without warranty of any // kind, and Open CASCADE SA hereby disclaims all such warranties, // including without limitation, any warranties of merchantability, fitness // for a particular purpose or non-infringement. Please see the License for // the specific terms and conditions governing rights and limitations under the // License. #include #include #include #include #include #include #include #include #include #include #include extern "C" { JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Aspect_1WidthMap_1Create_10 (JNIEnv *env, jobject theobj) { jcas_Locking alock(env); { try { Handle(Aspect_WidthMap)* theret = new Handle(Aspect_WidthMap); *theret = new Aspect_WidthMap(); jcas_SetHandle(env,theobj,theret); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); } JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Aspect_1WidthMap_1AddEntry_11 (JNIEnv *env, jobject theobj, jobject AnEntry) { jcas_Locking alock(env); { try { Aspect_WidthMapEntry* the_AnEntry = (Aspect_WidthMapEntry*) jcas_GetHandle(env,AnEntry); if ( the_AnEntry == NULL ) { // The following assumes availability of the default constructor (what may not // always be the case). Therefore explicit exception is thrown if the null // object has been passed. // the_AnEntry = new Aspect_WidthMapEntry (); // jcas_SetHandle ( env, AnEntry, the_AnEntry ); jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value"); } // end if Handle(Aspect_WidthMap) the_this = *((Handle(Aspect_WidthMap)*) jcas_GetHandle(env,theobj)); the_this->AddEntry(*the_AnEntry); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); } JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Aspect_1WidthMap_1AddEntry_12 (JNIEnv *env, jobject theobj, jshort aStyle) { jint thejret; jcas_Locking alock(env); { try { Handle(Aspect_WidthMap) the_this = *((Handle(Aspect_WidthMap)*) jcas_GetHandle(env,theobj)); thejret = the_this->AddEntry((Aspect_WidthOfLine) aStyle); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); return thejret; } JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Aspect_1WidthMap_1AddEntry_13 (JNIEnv *env, jobject theobj, jdouble aStyle) { jint thejret; jcas_Locking alock(env); { try { Handle(Aspect_WidthMap) the_this = *((Handle(Aspect_WidthMap)*) jcas_GetHandle(env,theobj)); thejret = the_this->AddEntry((Quantity_Length) aStyle); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); return thejret; } JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Size (JNIEnv *env, jobject theobj) { jint thejret; jcas_Locking alock(env); { try { Handle(Aspect_WidthMap) the_this = *((Handle(Aspect_WidthMap)*) jcas_GetHandle(env,theobj)); thejret = the_this->Size(); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); return thejret; } JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Index (JNIEnv *env, jobject theobj, jint aWidthmapIndex) { jint thejret; jcas_Locking alock(env); { try { Handle(Aspect_WidthMap) the_this = *((Handle(Aspect_WidthMap)*) jcas_GetHandle(env,theobj)); thejret = the_this->Index((Standard_Integer) aWidthmapIndex); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); return thejret; } JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Entry (JNIEnv *env, jobject theobj, jint AnIndex) { jobject thejret; jcas_Locking alock(env); { try { Handle(Aspect_WidthMap) the_this = *((Handle(Aspect_WidthMap)*) jcas_GetHandle(env,theobj)); Aspect_WidthMapEntry* theret = new Aspect_WidthMapEntry(the_this->Entry((Standard_Integer) AnIndex)); thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_WidthMapEntry",theret); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); return thejret; } JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1WidthMap_Dump (JNIEnv *env, jobject theobj) { jcas_Locking alock(env); { try { Handle(Aspect_WidthMap) the_this = *((Handle(Aspect_WidthMap)*) jcas_GetHandle(env,theobj)); the_this->Dump(); } catch (Standard_Failure) { Standard_SStream Err; Err << Standard_Failure::Caught(); Err << (char) 0; jcas_ThrowException(env,Err.str().c_str()); } } alock.Release(); } }