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_V3d_PerspectiveView.h>
22 #include <V3d_PerspectiveView.hxx>
25 #include <Standard_ErrorHandler.hxx>
26 #include <Standard_Failure.hxx>
27 #include <Standard_SStream.hxx>
29 #include <V3d_Viewer.hxx>
30 #include <V3d_OrthographicView.hxx>
31 #include <Standard_Real.hxx>
37 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_V3d_1PerspectiveView_1Create_11 (JNIEnv *env, jobject theobj, jobject VM)
40 jcas_Locking alock(env);
43 Handle( V3d_Viewer ) the_VM;
44 void* ptr_VM = jcas_GetHandle(env,VM);
46 if ( ptr_VM != NULL ) the_VM = *( ( Handle( V3d_Viewer )* )ptr_VM );
48 Handle(V3d_PerspectiveView)* theret = new Handle(V3d_PerspectiveView);
49 *theret = new V3d_PerspectiveView(the_VM);
50 jcas_SetHandle(env,theobj,theret);
53 catch (Standard_Failure) {
55 Err << Standard_Failure::Caught();
57 jcas_ThrowException(env,Err.str().c_str());
66 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_V3d_1PerspectiveView_1Create_12 (JNIEnv *env, jobject theobj, jobject VM, jobject V)
69 jcas_Locking alock(env);
72 Handle( V3d_Viewer ) the_VM;
73 void* ptr_VM = jcas_GetHandle(env,VM);
75 if ( ptr_VM != NULL ) the_VM = *( ( Handle( V3d_Viewer )* )ptr_VM );
77 Handle( V3d_OrthographicView ) the_V;
78 void* ptr_V = jcas_GetHandle(env,V);
80 if ( ptr_V != NULL ) the_V = *( ( Handle( V3d_OrthographicView )* )ptr_V );
82 Handle(V3d_PerspectiveView)* theret = new Handle(V3d_PerspectiveView);
83 *theret = new V3d_PerspectiveView(the_VM,the_V);
84 jcas_SetHandle(env,theobj,theret);
87 catch (Standard_Failure) {
89 Err << Standard_Failure::Caught();
91 jcas_ThrowException(env,Err.str().c_str());
100 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_V3d_1PerspectiveView_1Create_13 (JNIEnv *env, jobject theobj, jobject VM, jobject V)
103 jcas_Locking alock(env);
106 Handle( V3d_Viewer ) the_VM;
107 void* ptr_VM = jcas_GetHandle(env,VM);
109 if ( ptr_VM != NULL ) the_VM = *( ( Handle( V3d_Viewer )* )ptr_VM );
111 Handle( V3d_PerspectiveView ) the_V;
112 void* ptr_V = jcas_GetHandle(env,V);
114 if ( ptr_V != NULL ) the_V = *( ( Handle( V3d_PerspectiveView )* )ptr_V );
116 Handle(V3d_PerspectiveView)* theret = new Handle(V3d_PerspectiveView);
117 *theret = new V3d_PerspectiveView(the_VM,the_V);
118 jcas_SetHandle(env,theobj,theret);
121 catch (Standard_Failure) {
122 Standard_SStream Err;
123 Err << Standard_Failure::Caught();
125 jcas_ThrowException(env,Err.str().c_str());
134 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_Copy (JNIEnv *env, jobject theobj)
138 jcas_Locking alock(env);
141 Handle(V3d_PerspectiveView) the_this = *((Handle(V3d_PerspectiveView)*) jcas_GetHandle(env,theobj));
142 Handle(V3d_PerspectiveView)* theret = new Handle(V3d_PerspectiveView);
143 *theret = the_this->Copy();
144 thejret = jcas_CreateObject(env,"CASCADESamplesJni/V3d_PerspectiveView",theret);
147 catch (Standard_Failure) {
148 Standard_SStream Err;
149 Err << Standard_Failure::Caught();
151 jcas_ThrowException(env,Err.str().c_str());
160 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_SetAngle (JNIEnv *env, jobject theobj, jdouble Angle)
163 jcas_Locking alock(env);
166 Handle(V3d_PerspectiveView) the_this = *((Handle(V3d_PerspectiveView)*) jcas_GetHandle(env,theobj));
167 the_this->SetAngle((Quantity_PlaneAngle) Angle);
170 catch (Standard_Failure) {
171 Standard_SStream Err;
172 Err << Standard_Failure::Caught();
174 jcas_ThrowException(env,Err.str().c_str());
183 JNIEXPORT jdouble JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_Angle (JNIEnv *env, jobject theobj)
187 jcas_Locking alock(env);
190 Handle(V3d_PerspectiveView) the_this = *((Handle(V3d_PerspectiveView)*) jcas_GetHandle(env,theobj));
191 thejret = the_this->Angle();
194 catch (Standard_Failure) {
195 Standard_SStream Err;
196 Err << Standard_Failure::Caught();
198 jcas_ThrowException(env,Err.str().c_str());