mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
57
samples/java/drv/SampleAISBasicJni/SampleAISBasicJni_UnitsAPI_java.cxx
Executable file
57
samples/java/drv/SampleAISBasicJni/SampleAISBasicJni_UnitsAPI_java.cxx
Executable file
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// Copyright (C) 1991 - 2000 by
|
||||
// Matra Datavision SA. All rights reserved.
|
||||
//
|
||||
// Copyright (C) 2001 - 2004 by
|
||||
// Open CASCADE SA. All rights reserved.
|
||||
//
|
||||
// This file is part of the Open CASCADE Technology software.
|
||||
//
|
||||
// This software may be distributed and/or modified under the terms and
|
||||
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
|
||||
// and appearing in the file LICENSE included in the packaging of this file.
|
||||
//
|
||||
// This software is distributed on an "AS IS" basis, without warranty of any
|
||||
// kind, and Open CASCADE SA hereby disclaims all such warranties,
|
||||
// including without limitation, any warranties of merchantability, fitness
|
||||
// for a particular purpose or non-infringement. Please see the License for
|
||||
// the specific terms and conditions governing rights and limitations under the
|
||||
// License.
|
||||
|
||||
|
||||
#include <SampleAISBasicJni_UnitsAPI.h>
|
||||
#include <UnitsAPI.hxx>
|
||||
#include <jcas.hxx>
|
||||
#include <stdlib.h>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
|
||||
#include <UnitsAPI_SystemUnits.hxx>
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL Java_SampleAISBasicJni_UnitsAPI_SetLocalSystem (JNIEnv *env, jclass, jshort aSystemUnit)
|
||||
{
|
||||
|
||||
jcas_Locking alock(env);
|
||||
{
|
||||
try {
|
||||
UnitsAPI::SetLocalSystem((UnitsAPI_SystemUnits) aSystemUnit);
|
||||
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Standard_SStream Err;
|
||||
Err << Standard_Failure::Caught();
|
||||
Err << (char) 0;
|
||||
jcas_ThrowException(env,Err.str().c_str());
|
||||
}
|
||||
}
|
||||
alock.Release();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user