Adjusting testing cases for current state of OCCT
[occt.git] / samples / java / drv / SampleHLRJni / SampleHLRJni_Aspect_MarkerStyle_java.cxx
CommitLineData
7fd59977 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_MarkerStyle.h>
22#include <Aspect_MarkerStyle.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 <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>
36
37
38extern "C" {
39
40
41JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_11 (JNIEnv *env, jobject theobj)
42{
43
44jcas_Locking alock(env);
45{
46try {
47Aspect_MarkerStyle* theret = new Aspect_MarkerStyle();
48jcas_SetHandle(env,theobj,theret);
49
50}
51catch (Standard_Failure) {
52 Standard_SStream Err;
53 Err << Standard_Failure::Caught();
54 Err << (char) 0;
55 jcas_ThrowException(env,Err.str().c_str());
56}
57}
58alock.Release();
59
60}
61
62
63
64JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_12 (JNIEnv *env, jobject theobj, jshort aType)
65{
66
67jcas_Locking alock(env);
68{
69try {
70Aspect_MarkerStyle* theret = new Aspect_MarkerStyle((Aspect_TypeOfMarker) aType);
71jcas_SetHandle(env,theobj,theret);
72
73}
74catch (Standard_Failure) {
75 Standard_SStream Err;
76 Err << Standard_Failure::Caught();
77 Err << (char) 0;
78 jcas_ThrowException(env,Err.str().c_str());
79}
80}
81alock.Release();
82
83}
84
85
86
87JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_13 (JNIEnv *env, jobject theobj, jobject aXpoint, jobject aYpoint)
88{
89
90jcas_Locking alock(env);
91{
92try {
93TColStd_Array1OfReal* the_aXpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aXpoint);
94if ( the_aXpoint == NULL ) {
95
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");
102
103} // end if
104TColStd_Array1OfReal* the_aYpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aYpoint);
105if ( the_aYpoint == NULL ) {
106
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");
113
114} // end if
115Aspect_MarkerStyle* theret = new Aspect_MarkerStyle(*the_aXpoint,*the_aYpoint);
116jcas_SetHandle(env,theobj,theret);
117
118}
119catch (Standard_Failure) {
120 Standard_SStream Err;
121 Err << Standard_Failure::Caught();
122 Err << (char) 0;
123 jcas_ThrowException(env,Err.str().c_str());
124}
125}
126alock.Release();
127
128}
129
130
131
132JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Aspect_1MarkerStyle_1Create_14 (JNIEnv *env, jobject theobj, jobject aXpoint, jobject aYpoint, jobject aSpoint)
133{
134
135jcas_Locking alock(env);
136{
137try {
138TColStd_Array1OfReal* the_aXpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aXpoint);
139if ( the_aXpoint == NULL ) {
140
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");
147
148} // end if
149TColStd_Array1OfReal* the_aYpoint = (TColStd_Array1OfReal*) jcas_GetHandle(env,aYpoint);
150if ( the_aYpoint == NULL ) {
151
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");
158
159} // end if
160TColStd_Array1OfBoolean* the_aSpoint = (TColStd_Array1OfBoolean*) jcas_GetHandle(env,aSpoint);
161if ( the_aSpoint == NULL ) {
162
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");
169
170} // end if
171Aspect_MarkerStyle* theret = new Aspect_MarkerStyle(*the_aXpoint,*the_aYpoint,*the_aSpoint);
172jcas_SetHandle(env,theobj,theret);
173
174}
175catch (Standard_Failure) {
176 Standard_SStream Err;
177 Err << Standard_Failure::Caught();
178 Err << (char) 0;
179 jcas_ThrowException(env,Err.str().c_str());
180}
181}
182alock.Release();
183
184}
185
186
187
188JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Assign (JNIEnv *env, jobject theobj, jobject Other)
189{
190jobject thejret;
191
192jcas_Locking alock(env);
193{
194try {
195Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other);
196if ( the_Other == NULL ) {
197
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");
204
205} // end if
206Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
207const Aspect_MarkerStyle& theret = the_this->Assign(*the_Other);
208thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_MarkerStyle",&theret,0);
209
210}
211catch (Standard_Failure) {
212 Standard_SStream Err;
213 Err << Standard_Failure::Caught();
214 Err << (char) 0;
215 jcas_ThrowException(env,Err.str().c_str());
216}
217}
218alock.Release();
219return thejret;
220}
221
222
223
224JNIEXPORT jshort JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Type (JNIEnv *env, jobject theobj)
225{
226jshort thejret;
227
228jcas_Locking alock(env);
229{
230try {
231Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
232 thejret = the_this->Type();
233
234}
235catch (Standard_Failure) {
236 Standard_SStream Err;
237 Err << Standard_Failure::Caught();
238 Err << (char) 0;
239 jcas_ThrowException(env,Err.str().c_str());
240}
241}
242alock.Release();
243return thejret;
244}
245
246
247
248JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Length (JNIEnv *env, jobject theobj)
249{
250jint thejret;
251
252jcas_Locking alock(env);
253{
254try {
255Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
256 thejret = the_this->Length();
257
258}
259catch (Standard_Failure) {
260 Standard_SStream Err;
261 Err << Standard_Failure::Caught();
262 Err << (char) 0;
263 jcas_ThrowException(env,Err.str().c_str());
264}
265}
266alock.Release();
267return thejret;
268}
269
270
271
272JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_Values (JNIEnv *env, jobject theobj, jint aRank, jobject aX, jobject aY)
273{
274jboolean thejret;
275
276jcas_Locking alock(env);
277{
278try {
279Standard_Real the_aX = jcas_GetReal(env,aX);
280Standard_Real the_aY = jcas_GetReal(env,aY);
281Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
282 thejret = the_this->Values((Standard_Integer) aRank,the_aX,the_aY);
283jcas_SetReal(env,aX,the_aX);
284jcas_SetReal(env,aY,the_aY);
285
286}
287catch (Standard_Failure) {
288 Standard_SStream Err;
289 Err << Standard_Failure::Caught();
290 Err << (char) 0;
291 jcas_ThrowException(env,Err.str().c_str());
292}
293}
294alock.Release();
295return thejret;
296}
297
298
299
300JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_XValues (JNIEnv *env, jobject theobj)
301{
302jobject thejret;
303
304jcas_Locking alock(env);
305{
306try {
307Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
308const TShort_Array1OfShortReal& theret = the_this->XValues();
309thejret = jcas_CreateObject(env,"CASCADESamplesJni/TShort_Array1OfShortReal",&theret,0);
310
311}
312catch (Standard_Failure) {
313 Standard_SStream Err;
314 Err << Standard_Failure::Caught();
315 Err << (char) 0;
316 jcas_ThrowException(env,Err.str().c_str());
317}
318}
319alock.Release();
320return thejret;
321}
322
323
324
325JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_YValues (JNIEnv *env, jobject theobj)
326{
327jobject thejret;
328
329jcas_Locking alock(env);
330{
331try {
332Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
333const TShort_Array1OfShortReal& theret = the_this->YValues();
334thejret = jcas_CreateObject(env,"CASCADESamplesJni/TShort_Array1OfShortReal",&theret,0);
335
336}
337catch (Standard_Failure) {
338 Standard_SStream Err;
339 Err << Standard_Failure::Caught();
340 Err << (char) 0;
341 jcas_ThrowException(env,Err.str().c_str());
342}
343}
344alock.Release();
345return thejret;
346}
347
348
349
350JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_SValues (JNIEnv *env, jobject theobj)
351{
352jobject thejret;
353
354jcas_Locking alock(env);
355{
356try {
357Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
358const TColStd_Array1OfBoolean& theret = the_this->SValues();
359thejret = jcas_CreateObject(env,"CASCADESamplesJni/TColStd_Array1OfBoolean",&theret,0);
360
361}
362catch (Standard_Failure) {
363 Standard_SStream Err;
364 Err << Standard_Failure::Caught();
365 Err << (char) 0;
366 jcas_ThrowException(env,Err.str().c_str());
367}
368}
369alock.Release();
370return thejret;
371}
372
373
374
375JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_IsEqual (JNIEnv *env, jobject theobj, jobject Other)
376{
377jboolean thejret;
378
379jcas_Locking alock(env);
380{
381try {
382Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other);
383if ( the_Other == NULL ) {
384
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");
391
392} // end if
393Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
394 thejret = the_this->IsEqual(*the_Other);
395
396}
397catch (Standard_Failure) {
398 Standard_SStream Err;
399 Err << Standard_Failure::Caught();
400 Err << (char) 0;
401 jcas_ThrowException(env,Err.str().c_str());
402}
403}
404alock.Release();
405return thejret;
406}
407
408
409
410JNIEXPORT jboolean JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_IsNotEqual (JNIEnv *env, jobject theobj, jobject Other)
411{
412jboolean thejret;
413
414jcas_Locking alock(env);
415{
416try {
417Aspect_MarkerStyle* the_Other = (Aspect_MarkerStyle*) jcas_GetHandle(env,Other);
418if ( the_Other == NULL ) {
419
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");
426
427} // end if
428Aspect_MarkerStyle* the_this = (Aspect_MarkerStyle*) jcas_GetHandle(env,theobj);
429 thejret = the_this->IsNotEqual(*the_Other);
430
431}
432catch (Standard_Failure) {
433 Standard_SStream Err;
434 Err << Standard_Failure::Caught();
435 Err << (char) 0;
436 jcas_ThrowException(env,Err.str().c_str());
437}
438}
439alock.Release();
440return thejret;
441}
442
443
444
445JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkerStyle_FinalizeValue(JNIEnv *, jclass, jlong theid)
446{
447if (theid) {
448 Aspect_MarkerStyle* theobj = (Aspect_MarkerStyle*) theid;
449 delete theobj;
450}
451}
452
453
454}