Adjusting testing cases for current state of OCCT
[occt.git] / samples / java / drv / SampleHLRJni / SampleHLRJni_Aspect_MarkMap_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_MarkMap.h>
22#include <Aspect_MarkMap.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_MarkMapEntry.hxx>
30#include <Standard_Integer.hxx>
31#include <Aspect_MarkerStyle.hxx>
32
33
34extern "C" {
35
36
37JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkMap_Aspect_1MarkMap_1Create_10 (JNIEnv *env, jobject theobj)
38{
39
40jcas_Locking alock(env);
41{
42try {
43Handle(Aspect_MarkMap)* theret = new Handle(Aspect_MarkMap);
44*theret = new Aspect_MarkMap();
45jcas_SetHandle(env,theobj,theret);
46
47}
48catch (Standard_Failure) {
49 Standard_SStream Err;
50 Err << Standard_Failure::Caught();
51 Err << (char) 0;
52 jcas_ThrowException(env,Err.str().c_str());
53}
54}
55alock.Release();
56
57}
58
59
60
61JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkMap_Aspect_1MarkMap_1AddEntry_11 (JNIEnv *env, jobject theobj, jobject AnEntry)
62{
63
64jcas_Locking alock(env);
65{
66try {
67Aspect_MarkMapEntry* the_AnEntry = (Aspect_MarkMapEntry*) jcas_GetHandle(env,AnEntry);
68if ( the_AnEntry == NULL ) {
69
70 // The following assumes availability of the default constructor (what may not
71 // always be the case). Therefore explicit exception is thrown if the null
72 // object has been passed.
73 // the_AnEntry = new Aspect_MarkMapEntry ();
74 // jcas_SetHandle ( env, AnEntry, the_AnEntry );
75 jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
76
77} // end if
78Handle(Aspect_MarkMap) the_this = *((Handle(Aspect_MarkMap)*) jcas_GetHandle(env,theobj));
79the_this->AddEntry(*the_AnEntry);
80
81}
82catch (Standard_Failure) {
83 Standard_SStream Err;
84 Err << Standard_Failure::Caught();
85 Err << (char) 0;
86 jcas_ThrowException(env,Err.str().c_str());
87}
88}
89alock.Release();
90
91}
92
93
94
95JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1MarkMap_Aspect_1MarkMap_1AddEntry_12 (JNIEnv *env, jobject theobj, jobject aStyle)
96{
97jint thejret;
98
99jcas_Locking alock(env);
100{
101try {
102Aspect_MarkerStyle* the_aStyle = (Aspect_MarkerStyle*) jcas_GetHandle(env,aStyle);
103if ( the_aStyle == NULL ) {
104
105 // The following assumes availability of the default constructor (what may not
106 // always be the case). Therefore explicit exception is thrown if the null
107 // object has been passed.
108 // the_aStyle = new Aspect_MarkerStyle ();
109 // jcas_SetHandle ( env, aStyle, the_aStyle );
110 jcas_ThrowException (env, "NULL object has been passed while expecting an object manipulated by value");
111
112} // end if
113Handle(Aspect_MarkMap) the_this = *((Handle(Aspect_MarkMap)*) jcas_GetHandle(env,theobj));
114 thejret = the_this->AddEntry(*the_aStyle);
115
116}
117catch (Standard_Failure) {
118 Standard_SStream Err;
119 Err << Standard_Failure::Caught();
120 Err << (char) 0;
121 jcas_ThrowException(env,Err.str().c_str());
122}
123}
124alock.Release();
125return thejret;
126}
127
128
129
130JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1MarkMap_Size (JNIEnv *env, jobject theobj)
131{
132jint thejret;
133
134jcas_Locking alock(env);
135{
136try {
137Handle(Aspect_MarkMap) the_this = *((Handle(Aspect_MarkMap)*) jcas_GetHandle(env,theobj));
138 thejret = the_this->Size();
139
140}
141catch (Standard_Failure) {
142 Standard_SStream Err;
143 Err << Standard_Failure::Caught();
144 Err << (char) 0;
145 jcas_ThrowException(env,Err.str().c_str());
146}
147}
148alock.Release();
149return thejret;
150}
151
152
153
154JNIEXPORT jint JNICALL Java_SampleHLRJni_Aspect_1MarkMap_Index (JNIEnv *env, jobject theobj, jint aMarkmapIndex)
155{
156jint thejret;
157
158jcas_Locking alock(env);
159{
160try {
161Handle(Aspect_MarkMap) the_this = *((Handle(Aspect_MarkMap)*) jcas_GetHandle(env,theobj));
162 thejret = the_this->Index((Standard_Integer) aMarkmapIndex);
163
164}
165catch (Standard_Failure) {
166 Standard_SStream Err;
167 Err << Standard_Failure::Caught();
168 Err << (char) 0;
169 jcas_ThrowException(env,Err.str().c_str());
170}
171}
172alock.Release();
173return thejret;
174}
175
176
177
178JNIEXPORT void JNICALL Java_SampleHLRJni_Aspect_1MarkMap_Dump (JNIEnv *env, jobject theobj)
179{
180
181jcas_Locking alock(env);
182{
183try {
184Handle(Aspect_MarkMap) the_this = *((Handle(Aspect_MarkMap)*) jcas_GetHandle(env,theobj));
185the_this->Dump();
186
187}
188catch (Standard_Failure) {
189 Standard_SStream Err;
190 Err << Standard_Failure::Caught();
191 Err << (char) 0;
192 jcas_ThrowException(env,Err.str().c_str());
193}
194}
195alock.Release();
196
197}
198
199
200
201JNIEXPORT jobject JNICALL Java_SampleHLRJni_Aspect_1MarkMap_Entry (JNIEnv *env, jobject theobj, jint AnIndex)
202{
203jobject thejret;
204
205jcas_Locking alock(env);
206{
207try {
208Handle(Aspect_MarkMap) the_this = *((Handle(Aspect_MarkMap)*) jcas_GetHandle(env,theobj));
209Aspect_MarkMapEntry* theret = new Aspect_MarkMapEntry(the_this->Entry((Standard_Integer) AnIndex));
210thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_MarkMapEntry",theret);
211
212}
213catch (Standard_Failure) {
214 Standard_SStream Err;
215 Err << Standard_Failure::Caught();
216 Err << (char) 0;
217 jcas_ThrowException(env,Err.str().c_str());
218}
219}
220alock.Release();
221return thejret;
222}
223
224
225}