mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 20:02:30 +00:00
Update bimserver_plugin and ifcjni for IfcEngineModel::getInstanceFromExpressId()
This commit is contained in:
@@ -33,7 +33,7 @@ JNIEXPORT jobject JNICALL Java_org_ifcopenshell_IfcOpenShellModel_getGeometry (J
|
|||||||
if ( ! has_more ) return 0;
|
if ( ! has_more ) return 0;
|
||||||
jclass class_def = env->FindClass ("org/ifcopenshell/IfcGeomObject");
|
jclass class_def = env->FindClass ("org/ifcopenshell/IfcGeomObject");
|
||||||
if ( ! class_def ) return 0;
|
if ( ! class_def ) return 0;
|
||||||
jmethodID jconstructor = env->GetMethodID(class_def, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I[F[F)V");
|
jmethodID jconstructor = env->GetMethodID(class_def, "<init>", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[I[F[F)V");
|
||||||
if ( ! jconstructor ) return 0;
|
if ( ! jconstructor ) return 0;
|
||||||
const IfcGeomObjects::IfcGeomObject* o = IfcGeomObjects::Get();
|
const IfcGeomObjects::IfcGeomObject* o = IfcGeomObjects::Get();
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ JNIEXPORT jobject JNICALL Java_org_ifcopenshell_IfcOpenShellModel_getGeometry (J
|
|||||||
env->SetFloatArrayRegion(positions,0,o->mesh->verts.size(),(jfloat*) &o->mesh->verts[0]);
|
env->SetFloatArrayRegion(positions,0,o->mesh->verts.size(),(jfloat*) &o->mesh->verts[0]);
|
||||||
env->SetFloatArrayRegion(normals,0,o->mesh->normals.size(),(jfloat*) &o->mesh->normals[0]);
|
env->SetFloatArrayRegion(normals,0,o->mesh->normals.size(),(jfloat*) &o->mesh->normals[0]);
|
||||||
|
|
||||||
jobject return_obj = env->NewObject(class_def, jconstructor, name, type, guid, indices, positions, normals);
|
jobject return_obj = env->NewObject(class_def, jconstructor, o->id, name, type, guid, indices, positions, normals);
|
||||||
|
|
||||||
env->DeleteLocalRef(name);
|
env->DeleteLocalRef(name);
|
||||||
env->DeleteLocalRef(type);
|
env->DeleteLocalRef(type);
|
||||||
@@ -65,7 +65,7 @@ JNIEXPORT jobject JNICALL Java_org_ifcopenshell_IfcOpenShellModel_getGeometry (J
|
|||||||
return return_obj;
|
return return_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT bool JNICALL Java_org_ifcopenshell_IfcOpenShellModel_setIfcData (JNIEnv * env, jobject, jbyteArray jdata) {
|
JNIEXPORT jboolean JNICALL Java_org_ifcopenshell_IfcOpenShellModel_setIfcData (JNIEnv * env, jobject, jbyteArray jdata) {
|
||||||
void* data = env->GetByteArrayElements(jdata, NULL);
|
void* data = env->GetByteArrayElements(jdata, NULL);
|
||||||
const int length = env->GetArrayLength(jdata);
|
const int length = env->GetArrayLength(jdata);
|
||||||
if ( ! data || ! length ) return false;
|
if ( ! data || ! length ) return false;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ extern "C" {
|
|||||||
/*
|
/*
|
||||||
* Class: org_ifcopenshell_IfcOpenShellModel
|
* Class: org_ifcopenshell_IfcOpenShellModel
|
||||||
* Method: getGeometry
|
* Method: getGeometry
|
||||||
* Signature: ()Lorg/bimserver/plugins/ifcengine/IfcEngineGeometry;
|
* Signature: ()Lorg/ifcopenshell/IfcGeomObject;
|
||||||
*/
|
*/
|
||||||
JNIEXPORT jobject JNICALL Java_org_ifcopenshell_IfcOpenShellModel_getGeometry
|
JNIEXPORT jobject JNICALL Java_org_ifcopenshell_IfcOpenShellModel_getGeometry
|
||||||
(JNIEnv *, jobject);
|
(JNIEnv *, jobject);
|
||||||
@@ -18,9 +18,9 @@ JNIEXPORT jobject JNICALL Java_org_ifcopenshell_IfcOpenShellModel_getGeometry
|
|||||||
/*
|
/*
|
||||||
* Class: org_ifcopenshell_IfcOpenShellModel
|
* Class: org_ifcopenshell_IfcOpenShellModel
|
||||||
* Method: setIfcData
|
* Method: setIfcData
|
||||||
* Signature: ([B)V
|
* Signature: ([B)Z
|
||||||
*/
|
*/
|
||||||
JNIEXPORT bool JNICALL Java_org_ifcopenshell_IfcOpenShellModel_setIfcData
|
JNIEXPORT jboolean JNICALL Java_org_ifcopenshell_IfcOpenShellModel_setIfcData
|
||||||
(JNIEnv *, jobject, jbyteArray);
|
(JNIEnv *, jobject, jbyteArray);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
Reference in New Issue
Block a user