Adjusting testing cases for current state of OCCT
[occt.git] / samples / java / drv / SampleViewer3DJni / SampleViewer3DJni_Graphic3d_GraphicDriver_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 <SampleViewer3DJni_Graphic3d_GraphicDriver.h>
22#include <Graphic3d_GraphicDriver.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 <Standard_CString.hxx>
30#include <Standard_Boolean.hxx>
31#include <Standard_Integer.hxx>
32#include <Quantity_NameOfColor.hxx>
33#include <Standard_Real.hxx>
34#include <Standard_ShortReal.hxx>
35#include <TColStd_Array2OfReal.hxx>
36#include <Graphic3d_TypeOfComposition.hxx>
37#include <Graphic3d_TypeOfTexture.hxx>
38#include <AlienImage_AlienImage.hxx>
39#include <Aspect_GraphicDeviceDefinitionError.hxx>
40#include <TColStd_HArray1OfReal.hxx>
41#include <OSD_SharedLibrary.hxx>
42#include <OSD_Function.hxx>
43
44
45extern "C" {
46
47
48JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Graphic3d_1GraphicDriver_1Create_10 (JNIEnv *env, jobject theobj, jobject AShrName)
49{
50
51jcas_Locking alock(env);
52{
53try {
54Standard_CString the_AShrName = jcas_ConvertToCString(env,AShrName);
55Handle(Graphic3d_GraphicDriver)* theret = new Handle(Graphic3d_GraphicDriver);
56 OSD_SharedLibrary TheSharedLibrary(the_AShrName);
57 Standard_Boolean Result = TheSharedLibrary.DlOpen (OSD_RTLD_LAZY);
58 OSD_Function new_GLGraphicDriver = TheSharedLibrary.DlSymb ("MetaGraphicDriverFactory");
59 Handle(Graphic3d_GraphicDriver) (*fp) (Standard_CString) = NULL;
60 fp = (Handle(Graphic3d_GraphicDriver) (*) (Standard_CString)) new_GLGraphicDriver;
61 if ( ! new_GLGraphicDriver) {
62 Aspect_GraphicDeviceDefinitionError::Raise( TheSharedLibrary.DlError () );
63 }
64 Standard_CString aSharedName = TheSharedLibrary.Name ();
65 *theret = (*fp) (aSharedName);
66 jcas_SetHandle(env,theobj,theret);
67
68}
69
70catch (Standard_Failure) {
71 Standard_SStream Err;
72 Err << Standard_Failure::Caught();
73 Err << (char) 0;
74 jcas_ThrowException(env,Err.str().c_str());
75}
76}
77alock.Release();
78
79}
80
81
82
83JNIEXPORT jboolean JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Graphic3d_1GraphicDriver_1Begin_11 (JNIEnv *env, jobject theobj, jobject ADisplay)
84{
85jboolean thejret;
86
87jcas_Locking alock(env);
88{
89try {
90Standard_CString the_ADisplay = jcas_ConvertToCString(env,ADisplay);
91Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
92 thejret = the_this->Begin(the_ADisplay);
93
94}
95catch (Standard_Failure) {
96 Standard_SStream Err;
97 Err << Standard_Failure::Caught();
98 Err << (char) 0;
99 jcas_ThrowException(env,Err.str().c_str());
100}
101}
102alock.Release();
103return thejret;
104}
105
106
107
108JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_End (JNIEnv *env, jobject theobj)
109{
110
111jcas_Locking alock(env);
112{
113try {
114Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
115the_this->End();
116
117}
118catch (Standard_Failure) {
119 Standard_SStream Err;
120 Err << Standard_Failure::Caught();
121 Err << (char) 0;
122 jcas_ThrowException(env,Err.str().c_str());
123}
124}
125alock.Release();
126
127}
128
129
130
131JNIEXPORT jint JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_InquireLightLimit (JNIEnv *env, jobject theobj)
132{
133jint thejret;
134
135jcas_Locking alock(env);
136{
137try {
138Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
139 thejret = the_this->InquireLightLimit();
140
141}
142catch (Standard_Failure) {
143 Standard_SStream Err;
144 Err << Standard_Failure::Caught();
145 Err << (char) 0;
146 jcas_ThrowException(env,Err.str().c_str());
147}
148}
149alock.Release();
150return thejret;
151}
152
153
154
155JNIEXPORT jint JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_InquirePlaneLimit (JNIEnv *env, jobject theobj)
156{
157jint thejret;
158
159jcas_Locking alock(env);
160{
161try {
162Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
163 thejret = the_this->InquirePlaneLimit();
164
165}
166catch (Standard_Failure) {
167 Standard_SStream Err;
168 Err << Standard_Failure::Caught();
169 Err << (char) 0;
170 jcas_ThrowException(env,Err.str().c_str());
171}
172}
173alock.Release();
174return thejret;
175}
176
177
178
179JNIEXPORT jint JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_InquireViewLimit (JNIEnv *env, jobject theobj)
180{
181jint thejret;
182
183jcas_Locking alock(env);
184{
185try {
186Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
187 thejret = the_this->InquireViewLimit();
188
189}
190catch (Standard_Failure) {
191 Standard_SStream Err;
192 Err << Standard_Failure::Caught();
193 Err << (char) 0;
194 jcas_ThrowException(env,Err.str().c_str());
195}
196}
197alock.Release();
198return thejret;
199}
200
201
202
203JNIEXPORT jboolean JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_InquireTextureAvailable (JNIEnv *env, jobject theobj)
204{
205jboolean thejret;
206
207jcas_Locking alock(env);
208{
209try {
210Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
211 thejret = the_this->InquireTextureAvailable();
212
213}
214catch (Standard_Failure) {
215 Standard_SStream Err;
216 Err << Standard_Failure::Caught();
217 Err << (char) 0;
218 jcas_ThrowException(env,Err.str().c_str());
219}
220}
221alock.Release();
222return thejret;
223}
224
225
226
227JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_InitPick (JNIEnv *env, jobject theobj)
228{
229
230jcas_Locking alock(env);
231{
232try {
233Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
234the_this->InitPick();
235
236}
237catch (Standard_Failure) {
238 Standard_SStream Err;
239 Err << Standard_Failure::Caught();
240 Err << (char) 0;
241 jcas_ThrowException(env,Err.str().c_str());
242}
243}
244alock.Release();
245
246}
247
248
249
250JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_ZBufferTriedronSetup (JNIEnv *env, jobject theobj, jshort XColor, jshort YColor, jshort ZColor, jdouble SizeRatio, jdouble AxisDiametr, jint NbFacettes)
251{
252
253jcas_Locking alock(env);
254{
255try {
256Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
257the_this->ZBufferTriedronSetup((Quantity_NameOfColor) XColor,(Quantity_NameOfColor) YColor,(Quantity_NameOfColor) ZColor,(Standard_Real) SizeRatio,(Standard_Real) AxisDiametr,(Standard_Integer) NbFacettes);
258
259}
260catch (Standard_Failure) {
261 Standard_SStream Err;
262 Err << Standard_Failure::Caught();
263 Err << (char) 0;
264 jcas_ThrowException(env,Err.str().c_str());
265}
266}
267alock.Release();
268
269}
270
271
272
273JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_EndAddMode (JNIEnv *env, jobject theobj)
274{
275
276jcas_Locking alock(env);
277{
278try {
279Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
280the_this->EndAddMode();
281
282}
283catch (Standard_Failure) {
284 Standard_SStream Err;
285 Err << Standard_Failure::Caught();
286 Err << (char) 0;
287 jcas_ThrowException(env,Err.str().c_str());
288}
289}
290alock.Release();
291
292}
293
294
295
296JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_BeginPolyline (JNIEnv *env, jobject theobj)
297{
298
299jcas_Locking alock(env);
300{
301try {
302Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
303the_this->BeginPolyline();
304
305}
306catch (Standard_Failure) {
307 Standard_SStream Err;
308 Err << Standard_Failure::Caught();
309 Err << (char) 0;
310 jcas_ThrowException(env,Err.str().c_str());
311}
312}
313alock.Release();
314
315}
316
317
318
319JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Graphic3d_1GraphicDriver_1Draw_11 (JNIEnv *env, jobject theobj, jfloat X, jfloat Y, jfloat Z)
320{
321
322jcas_Locking alock(env);
323{
324try {
325Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
326the_this->Draw((Standard_ShortReal) X,(Standard_ShortReal) Y,(Standard_ShortReal) Z);
327
328}
329catch (Standard_Failure) {
330 Standard_SStream Err;
331 Err << Standard_Failure::Caught();
332 Err << (char) 0;
333 jcas_ThrowException(env,Err.str().c_str());
334}
335}
336alock.Release();
337
338}
339
340
341
342JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_EndImmediatMode (JNIEnv *env, jobject theobj, jint Synchronize)
343{
344
345jcas_Locking alock(env);
346{
347try {
348Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
349the_this->EndImmediatMode((Standard_Integer) Synchronize);
350
351}
352catch (Standard_Failure) {
353 Standard_SStream Err;
354 Err << Standard_Failure::Caught();
355 Err << (char) 0;
356 jcas_ThrowException(env,Err.str().c_str());
357}
358}
359alock.Release();
360
361}
362
363
364
365JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_EndPolyline (JNIEnv *env, jobject theobj)
366{
367
368jcas_Locking alock(env);
369{
370try {
371Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
372the_this->EndPolyline();
373
374}
375catch (Standard_Failure) {
376 Standard_SStream Err;
377 Err << Standard_Failure::Caught();
378 Err << (char) 0;
379 jcas_ThrowException(env,Err.str().c_str());
380}
381}
382alock.Release();
383
384}
385
386
387
388JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Graphic3d_1GraphicDriver_1Move_11 (JNIEnv *env, jobject theobj, jfloat X, jfloat Y, jfloat Z)
389{
390
391jcas_Locking alock(env);
392{
393try {
394Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
395the_this->Move((Standard_ShortReal) X,(Standard_ShortReal) Y,(Standard_ShortReal) Z);
396
397}
398catch (Standard_Failure) {
399 Standard_SStream Err;
400 Err << Standard_Failure::Caught();
401 Err << (char) 0;
402 jcas_ThrowException(env,Err.str().c_str());
403}
404}
405alock.Release();
406
407}
408
409
410
411JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetLineColor (JNIEnv *env, jobject theobj, jfloat R, jfloat G, jfloat B)
412{
413
414jcas_Locking alock(env);
415{
416try {
417Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
418the_this->SetLineColor((Standard_ShortReal) R,(Standard_ShortReal) G,(Standard_ShortReal) B);
419
420}
421catch (Standard_Failure) {
422 Standard_SStream Err;
423 Err << Standard_Failure::Caught();
424 Err << (char) 0;
425 jcas_ThrowException(env,Err.str().c_str());
426}
427}
428alock.Release();
429
430}
431
432
433
434JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetLineType (JNIEnv *env, jobject theobj, jint Type)
435{
436
437jcas_Locking alock(env);
438{
439try {
440Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
441the_this->SetLineType((Standard_Integer) Type);
442
443}
444catch (Standard_Failure) {
445 Standard_SStream Err;
446 Err << Standard_Failure::Caught();
447 Err << (char) 0;
448 jcas_ThrowException(env,Err.str().c_str());
449}
450}
451alock.Release();
452
453}
454
455
456
457JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetLineWidth (JNIEnv *env, jobject theobj, jfloat Width)
458{
459
460jcas_Locking alock(env);
461{
462try {
463Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
464the_this->SetLineWidth((Standard_ShortReal) Width);
465
466}
467catch (Standard_Failure) {
468 Standard_SStream Err;
469 Err << Standard_Failure::Caught();
470 Err << (char) 0;
471 jcas_ThrowException(env,Err.str().c_str());
472}
473}
474alock.Release();
475
476}
477
478
479
480JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetMinMax (JNIEnv *env, jobject theobj, jfloat X1, jfloat Y1, jfloat Z1, jfloat X2, jfloat Y2, jfloat Z2)
481{
482
483jcas_Locking alock(env);
484{
485try {
486Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
487the_this->SetMinMax((Standard_ShortReal) X1,(Standard_ShortReal) Y1,(Standard_ShortReal) Z1,(Standard_ShortReal) X2,(Standard_ShortReal) Y2,(Standard_ShortReal) Z2);
488
489}
490catch (Standard_Failure) {
491 Standard_SStream Err;
492 Err << Standard_Failure::Caught();
493 Err << (char) 0;
494 jcas_ThrowException(env,Err.str().c_str());
495}
496}
497alock.Release();
498
499}
500
501
502
503JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Transform (JNIEnv *env, jobject theobj, jobject AMatrix, jshort AType)
504{
505
506jcas_Locking alock(env);
507{
508try {
509TColStd_Array2OfReal* the_AMatrix = (TColStd_Array2OfReal*) jcas_GetHandle(env,AMatrix);
510if ( the_AMatrix == NULL ) {
511
512 // The following assumes availability of the default constructor (what may not
513 // always be the case). Therefore explicit exception is thrown if the null
514 // object has been passed.
515 // the_AMatrix = new TColStd_Array2OfReal ();
516 // jcas_SetHandle ( env, AMatrix, the_AMatrix );
517 jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
518
519} // end if
520Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
521the_this->Transform(*the_AMatrix,(Graphic3d_TypeOfComposition) AType);
522
523}
524catch (Standard_Failure) {
525 Standard_SStream Err;
526 Err << Standard_Failure::Caught();
527 Err << (char) 0;
528 jcas_ThrowException(env,Err.str().c_str());
529}
530}
531alock.Release();
532
533}
534
535
536
537JNIEXPORT jint JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_CreateTexture (JNIEnv *env, jobject theobj, jshort Type, jobject Image, jobject FileName, jobject TexUpperBounds)
538{
539jint thejret;
540
541jcas_Locking alock(env);
542{
543try {
544 Handle( AlienImage_AlienImage ) the_Image;
545 void* ptr_Image = jcas_GetHandle(env,Image);
546
547 if ( ptr_Image != NULL ) the_Image = *( ( Handle( AlienImage_AlienImage )* )ptr_Image );
548
549Standard_CString the_FileName = jcas_ConvertToCString(env,FileName);
550 Handle( TColStd_HArray1OfReal ) the_TexUpperBounds;
551 void* ptr_TexUpperBounds = jcas_GetHandle(env,TexUpperBounds);
552
553 if ( ptr_TexUpperBounds != NULL ) the_TexUpperBounds = *( ( Handle( TColStd_HArray1OfReal )* )ptr_TexUpperBounds );
554
555Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
556 thejret = the_this->CreateTexture((Graphic3d_TypeOfTexture) Type,the_Image,the_FileName,the_TexUpperBounds);
557
558}
559catch (Standard_Failure) {
560 Standard_SStream Err;
561 Err << Standard_Failure::Caught();
562 Err << (char) 0;
563 jcas_ThrowException(env,Err.str().c_str());
564}
565}
566alock.Release();
567return thejret;
568}
569
570
571
572JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_DestroyTexture (JNIEnv *env, jobject theobj, jint TexId)
573{
574
575jcas_Locking alock(env);
576{
577try {
578Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
579the_this->DestroyTexture((Standard_Integer) TexId);
580
581}
582catch (Standard_Failure) {
583 Standard_SStream Err;
584 Err << Standard_Failure::Caught();
585 Err << (char) 0;
586 jcas_ThrowException(env,Err.str().c_str());
587}
588}
589alock.Release();
590
591}
592
593
594
595JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_BeginPolygon2d (JNIEnv *env, jobject theobj)
596{
597
598jcas_Locking alock(env);
599{
600try {
601Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
602the_this->BeginPolygon2d();
603
604}
605catch (Standard_Failure) {
606 Standard_SStream Err;
607 Err << Standard_Failure::Caught();
608 Err << (char) 0;
609 jcas_ThrowException(env,Err.str().c_str());
610}
611}
612alock.Release();
613
614}
615
616
617
618JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_BeginPolyline2d (JNIEnv *env, jobject theobj)
619{
620
621jcas_Locking alock(env);
622{
623try {
624Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
625the_this->BeginPolyline2d();
626
627}
628catch (Standard_Failure) {
629 Standard_SStream Err;
630 Err << Standard_Failure::Caught();
631 Err << (char) 0;
632 jcas_ThrowException(env,Err.str().c_str());
633}
634}
635alock.Release();
636
637}
638
639
640
641JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Graphic3d_1GraphicDriver_1Draw_12 (JNIEnv *env, jobject theobj, jfloat X, jfloat Y)
642{
643
644jcas_Locking alock(env);
645{
646try {
647Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
648the_this->Draw((Standard_ShortReal) X,(Standard_ShortReal) Y);
649
650}
651catch (Standard_Failure) {
652 Standard_SStream Err;
653 Err << Standard_Failure::Caught();
654 Err << (char) 0;
655 jcas_ThrowException(env,Err.str().c_str());
656}
657}
658alock.Release();
659
660}
661
662
663
664JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Edge (JNIEnv *env, jobject theobj, jfloat X, jfloat Y)
665{
666
667jcas_Locking alock(env);
668{
669try {
670Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
671the_this->Edge((Standard_ShortReal) X,(Standard_ShortReal) Y);
672
673}
674catch (Standard_Failure) {
675 Standard_SStream Err;
676 Err << Standard_Failure::Caught();
677 Err << (char) 0;
678 jcas_ThrowException(env,Err.str().c_str());
679}
680}
681alock.Release();
682
683}
684
685
686
687JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_EndLayer (JNIEnv *env, jobject theobj)
688{
689
690jcas_Locking alock(env);
691{
692try {
693Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
694the_this->EndLayer();
695
696}
697catch (Standard_Failure) {
698 Standard_SStream Err;
699 Err << Standard_Failure::Caught();
700 Err << (char) 0;
701 jcas_ThrowException(env,Err.str().c_str());
702}
703}
704alock.Release();
705
706}
707
708
709
710JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_EndPolygon2d (JNIEnv *env, jobject theobj)
711{
712
713jcas_Locking alock(env);
714{
715try {
716Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
717the_this->EndPolygon2d();
718
719}
720catch (Standard_Failure) {
721 Standard_SStream Err;
722 Err << Standard_Failure::Caught();
723 Err << (char) 0;
724 jcas_ThrowException(env,Err.str().c_str());
725}
726}
727alock.Release();
728
729}
730
731
732
733JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_EndPolyline2d (JNIEnv *env, jobject theobj)
734{
735
736jcas_Locking alock(env);
737{
738try {
739Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
740the_this->EndPolyline2d();
741
742}
743catch (Standard_Failure) {
744 Standard_SStream Err;
745 Err << Standard_Failure::Caught();
746 Err << (char) 0;
747 jcas_ThrowException(env,Err.str().c_str());
748}
749}
750alock.Release();
751
752}
753
754
755
756JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Graphic3d_1GraphicDriver_1Move_12 (JNIEnv *env, jobject theobj, jfloat X, jfloat Y)
757{
758
759jcas_Locking alock(env);
760{
761try {
762Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
763the_this->Move((Standard_ShortReal) X,(Standard_ShortReal) Y);
764
765}
766catch (Standard_Failure) {
767 Standard_SStream Err;
768 Err << Standard_Failure::Caught();
769 Err << (char) 0;
770 jcas_ThrowException(env,Err.str().c_str());
771}
772}
773alock.Release();
774
775}
776
777
778
779JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Rectangle (JNIEnv *env, jobject theobj, jfloat X, jfloat Y, jfloat Width, jfloat Height)
780{
781
782jcas_Locking alock(env);
783{
784try {
785Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
786the_this->Rectangle((Standard_ShortReal) X,(Standard_ShortReal) Y,(Standard_ShortReal) Width,(Standard_ShortReal) Height);
787
788}
789catch (Standard_Failure) {
790 Standard_SStream Err;
791 Err << Standard_Failure::Caught();
792 Err << (char) 0;
793 jcas_ThrowException(env,Err.str().c_str());
794}
795}
796alock.Release();
797
798}
799
800
801
802JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetColor (JNIEnv *env, jobject theobj, jfloat R, jfloat G, jfloat B)
803{
804
805jcas_Locking alock(env);
806{
807try {
808Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
809the_this->SetColor((Standard_ShortReal) R,(Standard_ShortReal) G,(Standard_ShortReal) B);
810
811}
812catch (Standard_Failure) {
813 Standard_SStream Err;
814 Err << Standard_Failure::Caught();
815 Err << (char) 0;
816 jcas_ThrowException(env,Err.str().c_str());
817}
818}
819alock.Release();
820
821}
822
823
824
825JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetLineAttributes (JNIEnv *env, jobject theobj, jint Type, jfloat Width)
826{
827
828jcas_Locking alock(env);
829{
830try {
831Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
832the_this->SetLineAttributes((Standard_Integer) Type,(Standard_ShortReal) Width);
833
834}
835catch (Standard_Failure) {
836 Standard_SStream Err;
837 Err << Standard_Failure::Caught();
838 Err << (char) 0;
839 jcas_ThrowException(env,Err.str().c_str());
840}
841}
842alock.Release();
843
844}
845
846
847
848JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetTextAttributes (JNIEnv *env, jobject theobj, jchar* Font, jint Type, jfloat R, jfloat G, jfloat B)
849{
850
851jcas_Locking alock(env);
852{
853try {
854Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
855the_this->SetTextAttributes((Standard_CString) Font,(Standard_Integer) Type,(Standard_ShortReal) R,(Standard_ShortReal) G,(Standard_ShortReal) B);
856
857}
858catch (Standard_Failure) {
859 Standard_SStream Err;
860 Err << Standard_Failure::Caught();
861 Err << (char) 0;
862 jcas_ThrowException(env,Err.str().c_str());
863}
864}
865alock.Release();
866
867}
868
869
870
871JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Graphic3d_1GraphicDriver_1Text_15 (JNIEnv *env, jobject theobj, jobject AText, jfloat X, jfloat Y, jfloat AHeight)
872{
873
874jcas_Locking alock(env);
875{
876try {
877Standard_CString the_AText = jcas_ConvertToCString(env,AText);
878Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
879the_this->Text(the_AText,(Standard_ShortReal) X,(Standard_ShortReal) Y,(Standard_ShortReal) AHeight);
880
881}
882catch (Standard_Failure) {
883 Standard_SStream Err;
884 Err << Standard_Failure::Caught();
885 Err << (char) 0;
886 jcas_ThrowException(env,Err.str().c_str());
887}
888}
889alock.Release();
890
891}
892
893
894
895JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_TextSize (JNIEnv *env, jobject theobj, jobject AText, jfloat AHeight, jobject AWidth, jobject AnAscent, jobject ADescent)
896{
897
898jcas_Locking alock(env);
899{
900try {
901Standard_CString the_AText = jcas_ConvertToCString(env,AText);
902Standard_ShortReal the_AWidth = jcas_GetShortReal(env,AWidth);
903Standard_ShortReal the_AnAscent = jcas_GetShortReal(env,AnAscent);
904Standard_ShortReal the_ADescent = jcas_GetShortReal(env,ADescent);
905Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
906the_this->TextSize(the_AText,(Standard_ShortReal) AHeight,the_AWidth,the_AnAscent,the_ADescent);
907jcas_SetShortReal(env,AWidth,the_AWidth);
908jcas_SetShortReal(env,AnAscent,the_AnAscent);
909jcas_SetShortReal(env,ADescent,the_ADescent);
910
911}
912catch (Standard_Failure) {
913 Standard_SStream Err;
914 Err << Standard_Failure::Caught();
915 Err << (char) 0;
916 jcas_ThrowException(env,Err.str().c_str());
917}
918}
919alock.Release();
920
921}
922
923
924
925JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_PrintBoolean (JNIEnv *env, jobject theobj, jobject AComment, jboolean AValue)
926{
927
928jcas_Locking alock(env);
929{
930try {
931Standard_CString the_AComment = jcas_ConvertToCString(env,AComment);
932Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
933the_this->PrintBoolean(the_AComment,(Standard_Boolean) AValue);
934
935}
936catch (Standard_Failure) {
937 Standard_SStream Err;
938 Err << Standard_Failure::Caught();
939 Err << (char) 0;
940 jcas_ThrowException(env,Err.str().c_str());
941}
942}
943alock.Release();
944
945}
946
947
948
949JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_PrintFunction (JNIEnv *env, jobject theobj, jobject AFunc)
950{
951
952jcas_Locking alock(env);
953{
954try {
955Standard_CString the_AFunc = jcas_ConvertToCString(env,AFunc);
956Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
957the_this->PrintFunction(the_AFunc);
958
959}
960catch (Standard_Failure) {
961 Standard_SStream Err;
962 Err << Standard_Failure::Caught();
963 Err << (char) 0;
964 jcas_ThrowException(env,Err.str().c_str());
965}
966}
967alock.Release();
968
969}
970
971
972
973JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_PrintInteger (JNIEnv *env, jobject theobj, jobject AComment, jint AValue)
974{
975
976jcas_Locking alock(env);
977{
978try {
979Standard_CString the_AComment = jcas_ConvertToCString(env,AComment);
980Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
981the_this->PrintInteger(the_AComment,(Standard_Integer) AValue);
982
983}
984catch (Standard_Failure) {
985 Standard_SStream Err;
986 Err << Standard_Failure::Caught();
987 Err << (char) 0;
988 jcas_ThrowException(env,Err.str().c_str());
989}
990}
991alock.Release();
992
993}
994
995
996
997JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_PrintIResult (JNIEnv *env, jobject theobj, jobject AFunc, jint AResult)
998{
999
1000jcas_Locking alock(env);
1001{
1002try {
1003Standard_CString the_AFunc = jcas_ConvertToCString(env,AFunc);
1004Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
1005the_this->PrintIResult(the_AFunc,(Standard_Integer) AResult);
1006
1007}
1008catch (Standard_Failure) {
1009 Standard_SStream Err;
1010 Err << Standard_Failure::Caught();
1011 Err << (char) 0;
1012 jcas_ThrowException(env,Err.str().c_str());
1013}
1014}
1015alock.Release();
1016
1017}
1018
1019
1020
1021JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_PrintShortReal (JNIEnv *env, jobject theobj, jobject AComment, jfloat AValue)
1022{
1023
1024jcas_Locking alock(env);
1025{
1026try {
1027Standard_CString the_AComment = jcas_ConvertToCString(env,AComment);
1028Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
1029the_this->PrintShortReal(the_AComment,(Standard_ShortReal) AValue);
1030
1031}
1032catch (Standard_Failure) {
1033 Standard_SStream Err;
1034 Err << Standard_Failure::Caught();
1035 Err << (char) 0;
1036 jcas_ThrowException(env,Err.str().c_str());
1037}
1038}
1039alock.Release();
1040
1041}
1042
1043
1044
1045JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_PrintMatrix (JNIEnv *env, jobject theobj, jobject AComment, jobject AMatrix)
1046{
1047
1048jcas_Locking alock(env);
1049{
1050try {
1051Standard_CString the_AComment = jcas_ConvertToCString(env,AComment);
1052TColStd_Array2OfReal* the_AMatrix = (TColStd_Array2OfReal*) jcas_GetHandle(env,AMatrix);
1053if ( the_AMatrix == NULL ) {
1054
1055 // The following assumes availability of the default constructor (what may not
1056 // always be the case). Therefore explicit exception is thrown if the null
1057 // object has been passed.
1058 // the_AMatrix = new TColStd_Array2OfReal ();
1059 // jcas_SetHandle ( env, AMatrix, the_AMatrix );
1060 jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
1061
1062} // end if
1063Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
1064the_this->PrintMatrix(the_AComment,*the_AMatrix);
1065
1066}
1067catch (Standard_Failure) {
1068 Standard_SStream Err;
1069 Err << Standard_Failure::Caught();
1070 Err << (char) 0;
1071 jcas_ThrowException(env,Err.str().c_str());
1072}
1073}
1074alock.Release();
1075
1076}
1077
1078
1079
1080JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_PrintString (JNIEnv *env, jobject theobj, jobject AComment, jobject AString)
1081{
1082
1083jcas_Locking alock(env);
1084{
1085try {
1086Standard_CString the_AComment = jcas_ConvertToCString(env,AComment);
1087Standard_CString the_AString = jcas_ConvertToCString(env,AString);
1088Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
1089the_this->PrintString(the_AComment,the_AString);
1090
1091}
1092catch (Standard_Failure) {
1093 Standard_SStream Err;
1094 Err << Standard_Failure::Caught();
1095 Err << (char) 0;
1096 jcas_ThrowException(env,Err.str().c_str());
1097}
1098}
1099alock.Release();
1100
1101}
1102
1103
1104
1105JNIEXPORT void JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_SetTrace (JNIEnv *env, jobject theobj, jint ALevel)
1106{
1107
1108jcas_Locking alock(env);
1109{
1110try {
1111Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
1112the_this->SetTrace((Standard_Integer) ALevel);
1113
1114}
1115catch (Standard_Failure) {
1116 Standard_SStream Err;
1117 Err << Standard_Failure::Caught();
1118 Err << (char) 0;
1119 jcas_ThrowException(env,Err.str().c_str());
1120}
1121}
1122alock.Release();
1123
1124}
1125
1126
1127
1128JNIEXPORT jint JNICALL Java_SampleViewer3DJni_Graphic3d_1GraphicDriver_Trace (JNIEnv *env, jobject theobj)
1129{
1130jint thejret;
1131
1132jcas_Locking alock(env);
1133{
1134try {
1135Handle(Graphic3d_GraphicDriver) the_this = *((Handle(Graphic3d_GraphicDriver)*) jcas_GetHandle(env,theobj));
1136 thejret = the_this->Trace();
1137
1138}
1139catch (Standard_Failure) {
1140 Standard_SStream Err;
1141 Err << Standard_Failure::Caught();
1142 Err << (char) 0;
1143 jcas_ThrowException(env,Err.str().c_str());
1144}
1145}
1146alock.Release();
1147return thejret;
1148}
1149
1150
1151}