Adjusting testing cases for current state of OCCT
[occt.git] / samples / java / drv / CASCADESamplesJni / CASCADESamplesJni_V3d_PerspectiveView_java.cxx
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 <CASCADESamplesJni_V3d_PerspectiveView.h>
22 #include <V3d_PerspectiveView.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 <V3d_Viewer.hxx>
30 #include <V3d_OrthographicView.hxx>
31 #include <Standard_Real.hxx>
32
33
34 extern "C" {
35
36
37 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_V3d_1PerspectiveView_1Create_11 (JNIEnv *env, jobject theobj, jobject VM)
38 {
39
40 jcas_Locking alock(env);
41 {
42 try {
43  Handle( V3d_Viewer ) the_VM;
44  void*                ptr_VM = jcas_GetHandle(env,VM);
45  
46  if ( ptr_VM != NULL ) the_VM = *(   (  Handle( V3d_Viewer )*  )ptr_VM   );
47
48 Handle(V3d_PerspectiveView)* theret = new Handle(V3d_PerspectiveView);
49 *theret = new V3d_PerspectiveView(the_VM);
50 jcas_SetHandle(env,theobj,theret);
51
52 }
53 catch (Standard_Failure) {
54   Standard_SStream Err;
55   Err <<   Standard_Failure::Caught(); 
56   Err << (char) 0;
57   jcas_ThrowException(env,Err.str().c_str());
58 }
59 }
60 alock.Release();
61
62 }
63
64
65
66 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_V3d_1PerspectiveView_1Create_12 (JNIEnv *env, jobject theobj, jobject VM, jobject V)
67 {
68
69 jcas_Locking alock(env);
70 {
71 try {
72  Handle( V3d_Viewer ) the_VM;
73  void*                ptr_VM = jcas_GetHandle(env,VM);
74  
75  if ( ptr_VM != NULL ) the_VM = *(   (  Handle( V3d_Viewer )*  )ptr_VM   );
76
77  Handle( V3d_OrthographicView ) the_V;
78  void*                ptr_V = jcas_GetHandle(env,V);
79  
80  if ( ptr_V != NULL ) the_V = *(   (  Handle( V3d_OrthographicView )*  )ptr_V   );
81
82 Handle(V3d_PerspectiveView)* theret = new Handle(V3d_PerspectiveView);
83 *theret = new V3d_PerspectiveView(the_VM,the_V);
84 jcas_SetHandle(env,theobj,theret);
85
86 }
87 catch (Standard_Failure) {
88   Standard_SStream Err;
89   Err <<   Standard_Failure::Caught(); 
90   Err << (char) 0;
91   jcas_ThrowException(env,Err.str().c_str());
92 }
93 }
94 alock.Release();
95
96 }
97
98
99
100 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_V3d_1PerspectiveView_1Create_13 (JNIEnv *env, jobject theobj, jobject VM, jobject V)
101 {
102
103 jcas_Locking alock(env);
104 {
105 try {
106  Handle( V3d_Viewer ) the_VM;
107  void*                ptr_VM = jcas_GetHandle(env,VM);
108  
109  if ( ptr_VM != NULL ) the_VM = *(   (  Handle( V3d_Viewer )*  )ptr_VM   );
110
111  Handle( V3d_PerspectiveView ) the_V;
112  void*                ptr_V = jcas_GetHandle(env,V);
113  
114  if ( ptr_V != NULL ) the_V = *(   (  Handle( V3d_PerspectiveView )*  )ptr_V   );
115
116 Handle(V3d_PerspectiveView)* theret = new Handle(V3d_PerspectiveView);
117 *theret = new V3d_PerspectiveView(the_VM,the_V);
118 jcas_SetHandle(env,theobj,theret);
119
120 }
121 catch (Standard_Failure) {
122   Standard_SStream Err;
123   Err <<   Standard_Failure::Caught(); 
124   Err << (char) 0;
125   jcas_ThrowException(env,Err.str().c_str());
126 }
127 }
128 alock.Release();
129
130 }
131
132
133
134 JNIEXPORT jobject JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_Copy (JNIEnv *env, jobject theobj)
135 {
136 jobject thejret;
137
138 jcas_Locking alock(env);
139 {
140 try {
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);
145
146 }
147 catch (Standard_Failure) {
148   Standard_SStream Err;
149   Err <<   Standard_Failure::Caught(); 
150   Err << (char) 0;
151   jcas_ThrowException(env,Err.str().c_str());
152 }
153 }
154 alock.Release();
155 return thejret;
156 }
157
158
159
160 JNIEXPORT void JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_SetAngle (JNIEnv *env, jobject theobj, jdouble Angle)
161 {
162
163 jcas_Locking alock(env);
164 {
165 try {
166 Handle(V3d_PerspectiveView) the_this = *((Handle(V3d_PerspectiveView)*) jcas_GetHandle(env,theobj));
167 the_this->SetAngle((Quantity_PlaneAngle) Angle);
168
169 }
170 catch (Standard_Failure) {
171   Standard_SStream Err;
172   Err <<   Standard_Failure::Caught(); 
173   Err << (char) 0;
174   jcas_ThrowException(env,Err.str().c_str());
175 }
176 }
177 alock.Release();
178
179 }
180
181
182
183 JNIEXPORT jdouble JNICALL Java_CASCADESamplesJni_V3d_1PerspectiveView_Angle (JNIEnv *env, jobject theobj)
184 {
185 jdouble thejret;
186
187 jcas_Locking alock(env);
188 {
189 try {
190 Handle(V3d_PerspectiveView) the_this = *((Handle(V3d_PerspectiveView)*) jcas_GetHandle(env,theobj));
191  thejret = the_this->Angle();
192
193 }
194 catch (Standard_Failure) {
195   Standard_SStream Err;
196   Err <<   Standard_Failure::Caught(); 
197   Err << (char) 0;
198   jcas_ThrowException(env,Err.str().c_str());
199 }
200 }
201 alock.Release();
202 return thejret;
203 }
204
205
206 }