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 <SampleHLRJni_V2d_DefaultMap.h>
22 #include <V2d_DefaultMap.hxx>
25 #include <Standard_ErrorHandler.hxx>
26 #include <Standard_Failure.hxx>
27 #include <Standard_SStream.hxx>
29 #include <Aspect_GenericColorMap.hxx>
30 #include <Aspect_TypeMap.hxx>
31 #include <Aspect_WidthMap.hxx>
32 #include <Aspect_FontMap.hxx>
33 #include <Aspect_MarkMap.hxx>
39 JNIEXPORT jobject JNICALL Java_SampleHLRJni_V2d_1DefaultMap_ColorMap (JNIEnv *env, jclass)
43 jcas_Locking alock(env);
46 Handle(Aspect_GenericColorMap)* theret = new Handle(Aspect_GenericColorMap);
47 *theret = V2d_DefaultMap::ColorMap();
48 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_GenericColorMap",theret);
51 catch (Standard_Failure) {
53 Err << Standard_Failure::Caught();
55 jcas_ThrowException(env,Err.str().c_str());
64 JNIEXPORT jobject JNICALL Java_SampleHLRJni_V2d_1DefaultMap_TypeMap (JNIEnv *env, jclass)
68 jcas_Locking alock(env);
71 Handle(Aspect_TypeMap)* theret = new Handle(Aspect_TypeMap);
72 *theret = V2d_DefaultMap::TypeMap();
73 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_TypeMap",theret);
76 catch (Standard_Failure) {
78 Err << Standard_Failure::Caught();
80 jcas_ThrowException(env,Err.str().c_str());
89 JNIEXPORT jobject JNICALL Java_SampleHLRJni_V2d_1DefaultMap_WidthMap (JNIEnv *env, jclass)
93 jcas_Locking alock(env);
96 Handle(Aspect_WidthMap)* theret = new Handle(Aspect_WidthMap);
97 *theret = V2d_DefaultMap::WidthMap();
98 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_WidthMap",theret);
101 catch (Standard_Failure) {
102 Standard_SStream Err;
103 Err << Standard_Failure::Caught();
105 jcas_ThrowException(env,Err.str().c_str());
114 JNIEXPORT jobject JNICALL Java_SampleHLRJni_V2d_1DefaultMap_FontMap (JNIEnv *env, jclass)
118 jcas_Locking alock(env);
121 Handle(Aspect_FontMap)* theret = new Handle(Aspect_FontMap);
122 *theret = V2d_DefaultMap::FontMap();
123 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_FontMap",theret);
126 catch (Standard_Failure) {
127 Standard_SStream Err;
128 Err << Standard_Failure::Caught();
130 jcas_ThrowException(env,Err.str().c_str());
139 JNIEXPORT jobject JNICALL Java_SampleHLRJni_V2d_1DefaultMap_MarkMap (JNIEnv *env, jclass)
143 jcas_Locking alock(env);
146 Handle(Aspect_MarkMap)* theret = new Handle(Aspect_MarkMap);
147 *theret = V2d_DefaultMap::MarkMap();
148 thejret = jcas_CreateObject(env,"CASCADESamplesJni/Aspect_MarkMap",theret);
151 catch (Standard_Failure) {
152 Standard_SStream Err;
153 Err << Standard_Failure::Caught();
155 jcas_ThrowException(env,Err.str().c_str());
164 JNIEXPORT void JNICALL Java_SampleHLRJni_V2d_1DefaultMap_FinalizeValue(JNIEnv *, jclass, jlong theid)
167 V2d_DefaultMap* theobj = (V2d_DefaultMap*) theid;