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 <CASCADESamplesJni_V2d_Viewer.h>
22 #include <V2d_Viewer.hxx>
25 #include <Standard_ErrorHandler.hxx>
26 #include <Standard_Failure.hxx>
27 #include <Standard_SStream.hxx>
29 #include <Aspect_GraphicDevice.hxx>
30 #include <Standard_ExtString.hxx>
31 #include <Standard_CString.hxx>
32 #include <Graphic2d_View.hxx>
33 #include <V2d_View.hxx>
34 #include <Aspect_ColorMap.hxx>
35 #include <Aspect_TypeMap.hxx>
36 #include <Aspect_WidthMap.hxx>
37 #include <Aspect_FontMap.hxx>
38 #include <Standard_Boolean.hxx>
39 #include <Aspect_MarkMap.hxx>
40 #include <Standard_Integer.hxx>
41 #include <Quantity_NameOfColor.hxx>
42 #include <Aspect_GridType.hxx>
43 #include <Standard_Real.hxx>
44 #include <Aspect_GridDrawMode.hxx>
45 #include <Quantity_Color.hxx>
51 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_V2d_1Viewer_1Create_11 (JNIEnv *env, jobject theobj, jobject aGraphicDevice, jstring aName, jobject aDomain)
54 jcas_Locking alock(env);
57 Handle( Aspect_GraphicDevice ) the_aGraphicDevice;
58 void* ptr_aGraphicDevice = jcas_GetHandle(env,aGraphicDevice);
60 if ( ptr_aGraphicDevice != NULL ) the_aGraphicDevice = *( ( Handle( Aspect_GraphicDevice )* )ptr_aGraphicDevice );
62 Standard_ExtString the_aName = jcas_ConvertToExtString(env,aName);
63 Standard_CString the_aDomain = jcas_ConvertToCString(env,aDomain);
64 Handle(V2d_Viewer)* theret = new Handle(V2d_Viewer);
65 *theret = new V2d_Viewer(the_aGraphicDevice,the_aName,the_aDomain);
66 jcas_SetHandle(env,theobj,theret);
69 catch (Standard_Failure) {
71 Err << Standard_Failure::Caught();
73 jcas_ThrowException(env,Err.str().c_str());
82 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_V2d_1Viewer_1Create_12 (JNIEnv *env, jobject theobj, jobject aGraphicDevice, jobject aView, jstring aName, jobject aDomain)
85 jcas_Locking alock(env);
88 Handle( Aspect_GraphicDevice ) the_aGraphicDevice;
89 void* ptr_aGraphicDevice = jcas_GetHandle(env,aGraphicDevice);
91 if ( ptr_aGraphicDevice != NULL ) the_aGraphicDevice = *( ( Handle( Aspect_GraphicDevice )* )ptr_aGraphicDevice );
93 Handle( Graphic2d_View ) the_aView;
94 void* ptr_aView = jcas_GetHandle(env,aView);
96 if ( ptr_aView != NULL ) the_aView = *( ( Handle( Graphic2d_View )* )ptr_aView );
98 Standard_ExtString the_aName = jcas_ConvertToExtString(env,aName);
99 Standard_CString the_aDomain = jcas_ConvertToCString(env,aDomain);
100 Handle(V2d_Viewer)* theret = new Handle(V2d_Viewer);
101 *theret = new V2d_Viewer(the_aGraphicDevice,the_aView,the_aName,the_aDomain);
102 jcas_SetHandle(env,theobj,theret);
105 catch (Standard_Failure) {
106 Standard_SStream Err;
107 Err << Standard_Failure::Caught();
109 jcas_ThrowException(env,Err.str().c_str());
118 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_AddView (JNIEnv *env, jobject theobj, jobject aView)
121 jcas_Locking alock(env);
124 Handle( V2d_View ) the_aView;
125 void* ptr_aView = jcas_GetHandle(env,aView);
127 if ( ptr_aView != NULL ) the_aView = *( ( Handle( V2d_View )* )ptr_aView );
129 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
130 the_this->AddView(the_aView);
133 catch (Standard_Failure) {
134 Standard_SStream Err;
135 Err << Standard_Failure::Caught();
137 jcas_ThrowException(env,Err.str().c_str());
146 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_RemoveView (JNIEnv *env, jobject theobj, jobject aView)
149 jcas_Locking alock(env);
152 Handle( V2d_View ) the_aView;
153 void* ptr_aView = jcas_GetHandle(env,aView);
155 if ( ptr_aView != NULL ) the_aView = *( ( Handle( V2d_View )* )ptr_aView );
157 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
158 the_this->RemoveView(the_aView);
161 catch (Standard_Failure) {
162 Standard_SStream Err;
163 Err << Standard_Failure::Caught();
165 jcas_ThrowException(env,Err.str().c_str());
174 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_Update (JNIEnv *env, jobject theobj)
177 jcas_Locking alock(env);
180 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
184 catch (Standard_Failure) {
185 Standard_SStream Err;
186 Err << Standard_Failure::Caught();
188 jcas_ThrowException(env,Err.str().c_str());
197 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_UpdateNew (JNIEnv *env, jobject theobj)
200 jcas_Locking alock(env);
203 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
204 the_this->UpdateNew();
207 catch (Standard_Failure) {
208 Standard_SStream Err;
209 Err << Standard_Failure::Caught();
211 jcas_ThrowException(env,Err.str().c_str());
220 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetColorMap (JNIEnv *env, jobject theobj, jobject aColorMap)
223 jcas_Locking alock(env);
226 Handle( Aspect_ColorMap ) the_aColorMap;
227 void* ptr_aColorMap = jcas_GetHandle(env,aColorMap);
229 if ( ptr_aColorMap != NULL ) the_aColorMap = *( ( Handle( Aspect_ColorMap )* )ptr_aColorMap );
231 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
232 the_this->SetColorMap(the_aColorMap);
235 catch (Standard_Failure) {
236 Standard_SStream Err;
237 Err << Standard_Failure::Caught();
239 jcas_ThrowException(env,Err.str().c_str());
248 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetTypeMap (JNIEnv *env, jobject theobj, jobject aTypeMap)
251 jcas_Locking alock(env);
254 Handle( Aspect_TypeMap ) the_aTypeMap;
255 void* ptr_aTypeMap = jcas_GetHandle(env,aTypeMap);
257 if ( ptr_aTypeMap != NULL ) the_aTypeMap = *( ( Handle( Aspect_TypeMap )* )ptr_aTypeMap );
259 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
260 the_this->SetTypeMap(the_aTypeMap);
263 catch (Standard_Failure) {
264 Standard_SStream Err;
265 Err << Standard_Failure::Caught();
267 jcas_ThrowException(env,Err.str().c_str());
276 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetWidthMap (JNIEnv *env, jobject theobj, jobject aWidthMap)
279 jcas_Locking alock(env);
282 Handle( Aspect_WidthMap ) the_aWidthMap;
283 void* ptr_aWidthMap = jcas_GetHandle(env,aWidthMap);
285 if ( ptr_aWidthMap != NULL ) the_aWidthMap = *( ( Handle( Aspect_WidthMap )* )ptr_aWidthMap );
287 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
288 the_this->SetWidthMap(the_aWidthMap);
291 catch (Standard_Failure) {
292 Standard_SStream Err;
293 Err << Standard_Failure::Caught();
295 jcas_ThrowException(env,Err.str().c_str());
304 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetFontMap (JNIEnv *env, jobject theobj, jobject aFontMap, jboolean useMFT)
307 jcas_Locking alock(env);
310 Handle( Aspect_FontMap ) the_aFontMap;
311 void* ptr_aFontMap = jcas_GetHandle(env,aFontMap);
313 if ( ptr_aFontMap != NULL ) the_aFontMap = *( ( Handle( Aspect_FontMap )* )ptr_aFontMap );
315 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
316 the_this->SetFontMap(the_aFontMap,(Standard_Boolean) useMFT);
319 catch (Standard_Failure) {
320 Standard_SStream Err;
321 Err << Standard_Failure::Caught();
323 jcas_ThrowException(env,Err.str().c_str());
332 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetMarkMap (JNIEnv *env, jobject theobj, jobject aMarkMap)
335 jcas_Locking alock(env);
338 Handle( Aspect_MarkMap ) the_aMarkMap;
339 void* ptr_aMarkMap = jcas_GetHandle(env,aMarkMap);
341 if ( ptr_aMarkMap != NULL ) the_aMarkMap = *( ( Handle( Aspect_MarkMap )* )ptr_aMarkMap );
343 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
344 the_this->SetMarkMap(the_aMarkMap);
347 catch (Standard_Failure) {
348 Standard_SStream Err;
349 Err << Standard_Failure::Caught();
351 jcas_ThrowException(env,Err.str().c_str());
360 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V2d_1Viewer_ColorMap (JNIEnv *env, jobject theobj)
364 jcas_Locking alock(env);
367 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
368 Handle(Aspect_ColorMap)* theret = new Handle(Aspect_ColorMap);
369 *theret = the_this->ColorMap();
370 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_ColorMap",theret);
373 catch (Standard_Failure) {
374 Standard_SStream Err;
375 Err << Standard_Failure::Caught();
377 jcas_ThrowException(env,Err.str().c_str());
386 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V2d_1Viewer_TypeMap (JNIEnv *env, jobject theobj)
390 jcas_Locking alock(env);
393 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
394 Handle(Aspect_TypeMap)* theret = new Handle(Aspect_TypeMap);
395 *theret = the_this->TypeMap();
396 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_TypeMap",theret);
399 catch (Standard_Failure) {
400 Standard_SStream Err;
401 Err << Standard_Failure::Caught();
403 jcas_ThrowException(env,Err.str().c_str());
412 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V2d_1Viewer_WidthMap (JNIEnv *env, jobject theobj)
416 jcas_Locking alock(env);
419 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
420 Handle(Aspect_WidthMap)* theret = new Handle(Aspect_WidthMap);
421 *theret = the_this->WidthMap();
422 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_WidthMap",theret);
425 catch (Standard_Failure) {
426 Standard_SStream Err;
427 Err << Standard_Failure::Caught();
429 jcas_ThrowException(env,Err.str().c_str());
438 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V2d_1Viewer_FontMap (JNIEnv *env, jobject theobj)
442 jcas_Locking alock(env);
445 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
446 Handle(Aspect_FontMap)* theret = new Handle(Aspect_FontMap);
447 *theret = the_this->FontMap();
448 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_FontMap",theret);
451 catch (Standard_Failure) {
452 Standard_SStream Err;
453 Err << Standard_Failure::Caught();
455 jcas_ThrowException(env,Err.str().c_str());
464 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V2d_1Viewer_MarkMap (JNIEnv *env, jobject theobj)
468 jcas_Locking alock(env);
471 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
472 Handle(Aspect_MarkMap)* theret = new Handle(Aspect_MarkMap);
473 *theret = the_this->MarkMap();
474 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_MarkMap",theret);
477 catch (Standard_Failure) {
478 Standard_SStream Err;
479 Err << Standard_Failure::Caught();
481 jcas_ThrowException(env,Err.str().c_str());
490 JNIEXPORT jboolean JNICALL Java_CASCADESamplesJni_V2d_1Viewer_UseMFT (JNIEnv *env, jobject theobj)
494 jcas_Locking alock(env);
497 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
498 thejret = the_this->UseMFT();
501 catch (Standard_Failure) {
502 Standard_SStream Err;
503 Err << Standard_Failure::Caught();
505 jcas_ThrowException(env,Err.str().c_str());
514 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V2d_1Viewer_View (JNIEnv *env, jobject theobj)
518 jcas_Locking alock(env);
521 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
522 Handle(Graphic2d_View)* theret = new Handle(Graphic2d_View);
523 *theret = the_this->View();
524 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Graphic2d_View",theret);
527 catch (Standard_Failure) {
528 Standard_SStream Err;
529 Err << Standard_Failure::Caught();
531 jcas_ThrowException(env,Err.str().c_str());
540 JNIEXPORT jint JNICALL Java_CASCADESamplesJni_V2d_1Viewer_InitializeColor (JNIEnv *env, jobject theobj, jshort aColor)
544 jcas_Locking alock(env);
547 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
548 thejret = the_this->InitializeColor((Quantity_NameOfColor) aColor);
551 catch (Standard_Failure) {
552 Standard_SStream Err;
553 Err << Standard_Failure::Caught();
555 jcas_ThrowException(env,Err.str().c_str());
564 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_InitActiveViews (JNIEnv *env, jobject theobj)
567 jcas_Locking alock(env);
570 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
571 the_this->InitActiveViews();
574 catch (Standard_Failure) {
575 Standard_SStream Err;
576 Err << Standard_Failure::Caught();
578 jcas_ThrowException(env,Err.str().c_str());
587 JNIEXPORT jboolean JNICALL Java_CASCADESamplesJni_V2d_1Viewer_MoreActiveViews (JNIEnv *env, jobject theobj)
591 jcas_Locking alock(env);
594 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
595 thejret = the_this->MoreActiveViews();
598 catch (Standard_Failure) {
599 Standard_SStream Err;
600 Err << Standard_Failure::Caught();
602 jcas_ThrowException(env,Err.str().c_str());
611 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_NextActiveViews (JNIEnv *env, jobject theobj)
614 jcas_Locking alock(env);
617 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
618 the_this->NextActiveViews();
621 catch (Standard_Failure) {
622 Standard_SStream Err;
623 Err << Standard_Failure::Caught();
625 jcas_ThrowException(env,Err.str().c_str());
634 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V2d_1Viewer_ActiveView (JNIEnv *env, jobject theobj)
638 jcas_Locking alock(env);
641 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
642 Handle(V2d_View)* theret = new Handle(V2d_View);
643 *theret = the_this->ActiveView();
644 thejret = jcas_CreateObject(env,"CASCADESamplesJni/V2d_View",theret);
647 catch (Standard_Failure) {
648 Standard_SStream Err;
649 Err << Standard_Failure::Caught();
651 jcas_ThrowException(env,Err.str().c_str());
660 JNIEXPORT jboolean JNICALL Java_CASCADESamplesJni_V2d_1Viewer_IsEmpty (JNIEnv *env, jobject theobj)
664 jcas_Locking alock(env);
667 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
668 thejret = the_this->IsEmpty();
671 catch (Standard_Failure) {
672 Standard_SStream Err;
673 Err << Standard_Failure::Caught();
675 jcas_ThrowException(env,Err.str().c_str());
684 JNIEXPORT jshort JNICALL Java_CASCADESamplesJni_V2d_1Viewer_GridType (JNIEnv *env, jobject theobj)
688 jcas_Locking alock(env);
691 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
692 thejret = the_this->GridType();
695 catch (Standard_Failure) {
696 Standard_SStream Err;
697 Err << Standard_Failure::Caught();
699 jcas_ThrowException(env,Err.str().c_str());
708 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_Hit (JNIEnv *env, jobject theobj, jdouble X, jdouble Y, jobject gx, jobject gy)
711 jcas_Locking alock(env);
714 Standard_Real the_gx = jcas_GetReal(env,gx);
715 Standard_Real the_gy = jcas_GetReal(env,gy);
716 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
717 the_this->Hit((Quantity_Length) X,(Quantity_Length) Y,the_gx,the_gy);
718 jcas_SetReal(env,gx,the_gx);
719 jcas_SetReal(env,gy,the_gy);
722 catch (Standard_Failure) {
723 Standard_SStream Err;
724 Err << Standard_Failure::Caught();
726 jcas_ThrowException(env,Err.str().c_str());
735 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_ActivateGrid (JNIEnv *env, jobject theobj, jshort aGridType, jshort aGridDrawMode)
738 jcas_Locking alock(env);
741 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
742 the_this->ActivateGrid((Aspect_GridType) aGridType,(Aspect_GridDrawMode) aGridDrawMode);
745 catch (Standard_Failure) {
746 Standard_SStream Err;
747 Err << Standard_Failure::Caught();
749 jcas_ThrowException(env,Err.str().c_str());
758 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_DeactivateGrid (JNIEnv *env, jobject theobj)
761 jcas_Locking alock(env);
764 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
765 the_this->DeactivateGrid();
768 catch (Standard_Failure) {
769 Standard_SStream Err;
770 Err << Standard_Failure::Caught();
772 jcas_ThrowException(env,Err.str().c_str());
781 JNIEXPORT jboolean JNICALL Java_CASCADESamplesJni_V2d_1Viewer_IsActive (JNIEnv *env, jobject theobj)
785 jcas_Locking alock(env);
788 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
789 thejret = the_this->IsActive();
792 catch (Standard_Failure) {
793 Standard_SStream Err;
794 Err << Standard_Failure::Caught();
796 jcas_ThrowException(env,Err.str().c_str());
805 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_RectangularGridValues (JNIEnv *env, jobject theobj, jobject XOrigin, jobject YOrigin, jobject XStep, jobject YStep, jobject RotationAngle)
808 jcas_Locking alock(env);
811 Standard_Real the_XOrigin = jcas_GetReal(env,XOrigin);
812 Standard_Real the_YOrigin = jcas_GetReal(env,YOrigin);
813 Standard_Real the_XStep = jcas_GetReal(env,XStep);
814 Standard_Real the_YStep = jcas_GetReal(env,YStep);
815 Standard_Real the_RotationAngle = jcas_GetReal(env,RotationAngle);
816 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
817 the_this->RectangularGridValues(the_XOrigin,the_YOrigin,the_XStep,the_YStep,the_RotationAngle);
818 jcas_SetReal(env,XOrigin,the_XOrigin);
819 jcas_SetReal(env,YOrigin,the_YOrigin);
820 jcas_SetReal(env,XStep,the_XStep);
821 jcas_SetReal(env,YStep,the_YStep);
822 jcas_SetReal(env,RotationAngle,the_RotationAngle);
825 catch (Standard_Failure) {
826 Standard_SStream Err;
827 Err << Standard_Failure::Caught();
829 jcas_ThrowException(env,Err.str().c_str());
838 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetRectangularGridValues (JNIEnv *env, jobject theobj, jdouble XOrigin, jdouble YOrigin, jdouble XStep, jdouble YStep, jdouble RotationAngle)
841 jcas_Locking alock(env);
844 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
845 the_this->SetRectangularGridValues((Quantity_Length) XOrigin,(Quantity_Length) YOrigin,(Quantity_Length) XStep,(Quantity_Length) YStep,(Quantity_PlaneAngle) RotationAngle);
848 catch (Standard_Failure) {
849 Standard_SStream Err;
850 Err << Standard_Failure::Caught();
852 jcas_ThrowException(env,Err.str().c_str());
861 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_CircularGridValues (JNIEnv *env, jobject theobj, jobject XOrigin, jobject YOrigin, jobject RadiusStep, jobject DivisionNumber, jobject RotationAngle)
864 jcas_Locking alock(env);
867 Standard_Real the_XOrigin = jcas_GetReal(env,XOrigin);
868 Standard_Real the_YOrigin = jcas_GetReal(env,YOrigin);
869 Standard_Real the_RadiusStep = jcas_GetReal(env,RadiusStep);
870 Standard_Integer the_DivisionNumber = jcas_GetInteger(env,DivisionNumber);
871 Standard_Real the_RotationAngle = jcas_GetReal(env,RotationAngle);
872 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
873 the_this->CircularGridValues(the_XOrigin,the_YOrigin,the_RadiusStep,the_DivisionNumber,the_RotationAngle);
874 jcas_SetReal(env,XOrigin,the_XOrigin);
875 jcas_SetReal(env,YOrigin,the_YOrigin);
876 jcas_SetReal(env,RadiusStep,the_RadiusStep);
877 jcas_SetInteger(env,DivisionNumber,the_DivisionNumber);
878 jcas_SetReal(env,RotationAngle,the_RotationAngle);
881 catch (Standard_Failure) {
882 Standard_SStream Err;
883 Err << Standard_Failure::Caught();
885 jcas_ThrowException(env,Err.str().c_str());
894 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetCircularGridValues (JNIEnv *env, jobject theobj, jdouble XOrigin, jdouble YOrigin, jdouble RadiusStep, jint DivisionNumber, jdouble RotationAngle)
897 jcas_Locking alock(env);
900 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
901 the_this->SetCircularGridValues((Quantity_Length) XOrigin,(Quantity_Length) YOrigin,(Quantity_Length) RadiusStep,(Standard_Integer) DivisionNumber,(Quantity_PlaneAngle) RotationAngle);
904 catch (Standard_Failure) {
905 Standard_SStream Err;
906 Err << Standard_Failure::Caught();
908 jcas_ThrowException(env,Err.str().c_str());
917 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V2d_1Viewer_SetGridColor (JNIEnv *env, jobject theobj, jobject color1, jobject color2)
920 jcas_Locking alock(env);
923 Quantity_Color* the_color1 = (Quantity_Color*) jcas_GetHandle(env,color1);
924 if ( the_color1 == NULL ) {
926 // The following assumes availability of the default constructor (what may not
927 // always be the case). Therefore explicit exception is thrown if the null
928 // object has been passed.
929 // the_color1 = new Quantity_Color ();
930 // jcas_SetHandle ( env, color1, the_color1 );
931 jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
934 Quantity_Color* the_color2 = (Quantity_Color*) jcas_GetHandle(env,color2);
935 if ( the_color2 == NULL ) {
937 // The following assumes availability of the default constructor (what may not
938 // always be the case). Therefore explicit exception is thrown if the null
939 // object has been passed.
940 // the_color2 = new Quantity_Color ();
941 // jcas_SetHandle ( env, color2, the_color2 );
942 jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
945 Handle(V2d_Viewer) the_this = *((Handle(V2d_Viewer)*) jcas_GetHandle(env,theobj));
946 the_this->SetGridColor(*the_color1,*the_color2);
949 catch (Standard_Failure) {
950 Standard_SStream Err;
951 Err << Standard_Failure::Caught();
953 jcas_ThrowException(env,Err.str().c_str());