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_MarkerStyle.h>
22 #include <Aspect_MarkerStyle.hxx>
25 #include <Standard_ErrorHandler.hxx>
26 #include <Standard_Failure.hxx>
27 #include <Standard_SStream.hxx>
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>
41 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_11 (JNIEnv *env, jobject theobj)
44 jcas_Locking alock(env);
47 Aspect_MarkerStyle* theret = new Aspect_MarkerStyle();
48 jcas_SetHandle(env,theobj,theret);
51 catch (Standard_Failure) {
53 Err << Standard_Failure::Caught();
55 jcas_ThrowException(env,Err.str().c_str());
64 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_12 (JNIEnv *env, jobject theobj, jshort aType)
67 jcas_Locking alock(env);
70 Aspect_MarkerStyle* theret = new Aspect_MarkerStyle((Aspect_TypeOfMarker) aType);
71 jcas_SetHandle(env,theobj,theret);
74 catch (Standard_Failure) {
76 Err << Standard_Failure::Caught();
78 jcas_ThrowException(env,Err.str().c_str());
87 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_13 (JNIEnv *env, jobject theobj, jobject aXpoint, jobject aYpoint)
90 jcas_Locking alock(env);
93 TColStd_Array1OfReal* the_aXpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aXpoint);
94 if ( the_aXpoint == NULL ) {
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");
104 TColStd_Array1OfReal* the_aYpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aYpoint);
105 if ( the_aYpoint == NULL ) {
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");
115 Aspect_MarkerStyle* theret = new Aspect_MarkerStyle(*the_aXpoint,*the_aYpoint);
116 jcas_SetHandle(env,theobj,theret);
119 catch (Standard_Failure) {
120 Standard_SStream Err;
121 Err << Standard_Failure::Caught();
123 jcas_ThrowException(env,Err.str().c_str());
132 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_14 (JNIEnv *env, jobject theobj, jobject aXpoint, jobject aYpoint, jobject aSpoint)
135 jcas_Locking alock(env);
138 TColStd_Array1OfReal* the_aXpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aXpoint);
139 if ( the_aXpoint == NULL ) {
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");
149 TColStd_Array1OfReal* the_aYpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aYpoint);
150 if ( the_aYpoint == NULL ) {
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");
160 TColStd_Array1OfBoolean* the_aSpoint = (TColStd_Array1OfBoolean*) jcas_GetHandle(env,aSpoint);
161 if ( the_aSpoint == NULL ) {
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");
171 Aspect_MarkerStyle* theret = new Aspect_MarkerStyle(*the_aXpoint,*the_aYpoint,*the_aSpoint);
172 jcas_SetHandle(env,theobj,theret);
175 catch (Standard_Failure) {
176 Standard_SStream Err;
177 Err << Standard_Failure::Caught();
179 jcas_ThrowException(env,Err.str().c_str());
188 JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Assign (JNIEnv *env, jobject theobj, jobject Other)
192 jcas_Locking alock(env);
195 Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other);
196 if ( the_Other == NULL ) {
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");
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);
211 catch (Standard_Failure) {
212 Standard_SStream Err;
213 Err << Standard_Failure::Caught();
215 jcas_ThrowException(env,Err.str().c_str());
224 JNIEXPORT jshort JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Type (JNIEnv *env, jobject theobj)
228 jcas_Locking alock(env);
231 Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
232 thejret = the_this->Type();
235 catch (Standard_Failure) {
236 Standard_SStream Err;
237 Err << Standard_Failure::Caught();
239 jcas_ThrowException(env,Err.str().c_str());
248 JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Length (JNIEnv *env, jobject theobj)
252 jcas_Locking alock(env);
255 Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
256 thejret = the_this->Length();
259 catch (Standard_Failure) {
260 Standard_SStream Err;
261 Err << Standard_Failure::Caught();
263 jcas_ThrowException(env,Err.str().c_str());
272 JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Values (JNIEnv *env, jobject theobj, jint aRank, jobject aX, jobject aY)
276 jcas_Locking alock(env);
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);
287 catch (Standard_Failure) {
288 Standard_SStream Err;
289 Err << Standard_Failure::Caught();
291 jcas_ThrowException(env,Err.str().c_str());
300 JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_XValues (JNIEnv *env, jobject theobj)
304 jcas_Locking alock(env);
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);
312 catch (Standard_Failure) {
313 Standard_SStream Err;
314 Err << Standard_Failure::Caught();
316 jcas_ThrowException(env,Err.str().c_str());
325 JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_YValues (JNIEnv *env, jobject theobj)
329 jcas_Locking alock(env);
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);
337 catch (Standard_Failure) {
338 Standard_SStream Err;
339 Err << Standard_Failure::Caught();
341 jcas_ThrowException(env,Err.str().c_str());
350 JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_SValues (JNIEnv *env, jobject theobj)
354 jcas_Locking alock(env);
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);
362 catch (Standard_Failure) {
363 Standard_SStream Err;
364 Err << Standard_Failure::Caught();
366 jcas_ThrowException(env,Err.str().c_str());
375 JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_IsEqual (JNIEnv *env, jobject theobj, jobject Other)
379 jcas_Locking alock(env);
382 Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other);
383 if ( the_Other == NULL ) {
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");
393 Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
394 thejret = the_this->IsEqual(*the_Other);
397 catch (Standard_Failure) {
398 Standard_SStream Err;
399 Err << Standard_Failure::Caught();
401 jcas_ThrowException(env,Err.str().c_str());
410 JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_IsNotEqual (JNIEnv *env, jobject theobj, jobject Other)
414 jcas_Locking alock(env);
417 Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other);
418 if ( the_Other == NULL ) {
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");
428 Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
429 thejret = the_this->IsNotEqual(*the_Other);
432 catch (Standard_Failure) {
433 Standard_SStream Err;
434 Err << Standard_Failure::Caught();
436 jcas_ThrowException(env,Err.str().c_str());
445 JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_FinalizeValue(JNIEnv *, jclass, jlong theid)
448 Aspect_MarkerStyle* theobj = (Aspect_MarkerStyle*) theid;