void File::write_point(const Point4d &p, FILE *pFile) { double x = p.x(); double y = p.y(); double z = p.z(); double w = p.w(); fwrite(&x, sizeof(double), 1, pFile); fwrite(&y, sizeof(double), 1, pFile); fwrite(&z, sizeof(double), 1, pFile); fwrite(&w, sizeof(double), 1, pFile); }
JNIEXPORT void JNICALL Java_com_mousebird_maply_Point4d_setValue (JNIEnv *env, jobject obj, jdouble x, jdouble y, jdouble z, jdouble w) { try { Point4dClassInfo *classInfo = Point4dClassInfo::getClassInfo(); Point4d *pt = classInfo->getObject(env,obj); if (!pt) return; pt->x() = x; pt->y() = y; pt->z() = z; pt->w() = w; } catch (...) { __android_log_print(ANDROID_LOG_VERBOSE, "Maply", "Crash in Point4d::setValue()"); } }
JNIEXPORT jdouble JNICALL Java_com_mousebird_maply_Point4d_getY (JNIEnv *env, jobject obj) { try { Point4dClassInfo *classInfo = Point4dClassInfo::getClassInfo(); Point4d *pt = classInfo->getObject(env,obj); if (!pt) return 0.0; return pt->y(); } catch (...) { __android_log_print(ANDROID_LOG_VERBOSE, "Maply", "Crash in Point4d::getY()"); } return 0.0; }