public static unsafe double VectorProduct(double[] p0, double[] p1)
        {
            if (id_vectorProduct_arrayDarrayD == IntPtr.Zero)
            {
                id_vectorProduct_arrayDarrayD = JNIEnv.GetStaticMethodID(class_ref, "vectorProduct", "([D[D)D");
            }
            IntPtr native_p0 = JNIEnv.NewArray(p0);
            IntPtr native_p1 = JNIEnv.NewArray(p1);

            try {
                JValue *__args = stackalloc JValue [2];
                __args [0] = new JValue(native_p0);
                __args [1] = new JValue(native_p1);
                double __ret = JNIEnv.CallStaticDoubleMethod(class_ref, id_vectorProduct_arrayDarrayD, __args);
                return(__ret);
            } finally {
                if (p0 != null)
                {
                    JNIEnv.CopyArray(native_p0, p0);
                    JNIEnv.DeleteLocalRef(native_p0);
                }
                if (p1 != null)
                {
                    JNIEnv.CopyArray(native_p1, p1);
                    JNIEnv.DeleteLocalRef(native_p1);
                }
            }
        }
Esempio n. 2
0
 public static double Tile2lon(int x, int aZoom)
 {
     if (id_tile2lon_II == IntPtr.Zero)
     {
         id_tile2lon_II = JNIEnv.GetStaticMethodID(class_ref, "tile2lon", "(II)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_tile2lon_II, new JValue(x), new JValue(aZoom)));
 }
Esempio n. 3
0
 public static double Magnitude(double p0, double p1, double p2)
 {
     if (id_magnitude_DDD == IntPtr.Zero)
     {
         id_magnitude_DDD = JNIEnv.GetStaticMethodID(class_ref, "magnitude", "(DDD)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_magnitude_DDD, new JValue(p0), new JValue(p1), new JValue(p2)));
 }
 public static double Normalize(short p0)
 {
     if (id_normalize_S == IntPtr.Zero)
     {
         id_normalize_S = JNIEnv.GetStaticMethodID(class_ref, "normalize", "(S)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_normalize_S, new JValue(p0)));
 }
Esempio n. 5
0
 public static double MapScale(double latitude, int levelOfDetail, int screenDpi)
 {
     if (id_MapScale_DII == IntPtr.Zero)
     {
         id_MapScale_DII = JNIEnv.GetStaticMethodID(class_ref, "MapScale", "(DII)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_MapScale_DII, new JValue(latitude), new JValue(levelOfDetail), new JValue(screenDpi)));
 }
 public static double Window(double p0, double p1, double p2)
 {
     if (id_window_DDD == IntPtr.Zero)
     {
         id_window_DDD = JNIEnv.GetStaticMethodID(class_ref, "window", "(DDD)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_window_DDD, new JValue(p0), new JValue(p1), new JValue(p2)));
 }
Esempio n. 7
0
 public static double Gudermann(double y)
 {
     if (id_gudermann_D == IntPtr.Zero)
     {
         id_gudermann_D = JNIEnv.GetStaticMethodID(class_ref, "gudermann", "(D)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_gudermann_D, new JValue(y)));
 }
Esempio n. 8
0
 public static double GroundResolution(double latitude, int levelOfDetail)
 {
     if (id_GroundResolution_DI == IntPtr.Zero)
     {
         id_GroundResolution_DI = JNIEnv.GetStaticMethodID(class_ref, "GroundResolution", "(DI)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_GroundResolution_DI, new JValue(latitude), new JValue(levelOfDetail)));
 }
Esempio n. 9
0
 public static double GudermannInverse(double aLatitude)
 {
     if (id_gudermannInverse_D == IntPtr.Zero)
     {
         id_gudermannInverse_D = JNIEnv.GetStaticMethodID(class_ref, "gudermannInverse", "(D)D");
     }
     return(JNIEnv.CallStaticDoubleMethod(class_ref, id_gudermannInverse_D, new JValue(aLatitude)));
 }
Esempio n. 10
0
        public static double OrthogonalDistance(global::Org.Osmdroid.Util.GeoPoint p0, global::Org.Osmdroid.Util.GeoPoint p1, global::Org.Osmdroid.Util.GeoPoint p2)
        {
            if (id_orthogonalDistance_Lorg_osmdroid_util_GeoPoint_Lorg_osmdroid_util_GeoPoint_Lorg_osmdroid_util_GeoPoint_ == IntPtr.Zero)
            {
                id_orthogonalDistance_Lorg_osmdroid_util_GeoPoint_Lorg_osmdroid_util_GeoPoint_Lorg_osmdroid_util_GeoPoint_ = JNIEnv.GetStaticMethodID(class_ref, "orthogonalDistance", "(Lorg/osmdroid/util/GeoPoint;Lorg/osmdroid/util/GeoPoint;Lorg/osmdroid/util/GeoPoint;)D");
            }
            double __ret = JNIEnv.CallStaticDoubleMethod(class_ref, id_orthogonalDistance_Lorg_osmdroid_util_GeoPoint_Lorg_osmdroid_util_GeoPoint_Lorg_osmdroid_util_GeoPoint_, new JValue(p0), new JValue(p1), new JValue(p2));

            return(__ret);
        }
 public static double Yaw(global::Com.Thalmic.Myo.Quaternion p0)
 {
     if (id_yaw_Lcom_thalmic_myo_Quaternion_ == IntPtr.Zero)
     {
         id_yaw_Lcom_thalmic_myo_Quaternion_ = JNIEnv.GetStaticMethodID(class_ref, "yaw", "(Lcom/thalmic/myo/Quaternion;)D");
     }
     try {
         double __ret = JNIEnv.CallStaticDoubleMethod(class_ref, id_yaw_Lcom_thalmic_myo_Quaternion_, new JValue(p0));
         return(__ret);
     } finally {
     }
 }
 public static unsafe double OrigamiValueFromTension(double p0)
 {
     if (id_origamiValueFromTension_D == IntPtr.Zero)
     {
         id_origamiValueFromTension_D = JNIEnv.GetStaticMethodID(class_ref, "origamiValueFromTension", "(D)D");
     }
     try {
         JValue *__args = stackalloc JValue [1];
         __args [0] = new JValue(p0);
         return(JNIEnv.CallStaticDoubleMethod(class_ref, id_origamiValueFromTension_D, __args));
     } finally {
     }
 }
Esempio n. 13
0
		public static unsafe double Clamp (double p0, double p1, double p2)
		{
			if (id_clamp_DDD == IntPtr.Zero)
				id_clamp_DDD = JNIEnv.GetStaticMethodID (class_ref, "clamp", "(DDD)D");
			try {
				JValue* __args = stackalloc JValue [3];
				__args [0] = new JValue (p0);
				__args [1] = new JValue (p1);
				__args [2] = new JValue (p2);
				return JNIEnv.CallStaticDoubleMethod  (class_ref, id_clamp_DDD, __args);
			} finally {
			}
		}
Esempio n. 14
0
 public static unsafe double GetElapsedMillis(long p0)
 {
     if (id_getElapsedMillis_J == IntPtr.Zero)
     {
         id_getElapsedMillis_J = JNIEnv.GetStaticMethodID(class_ref, "getElapsedMillis", "(J)D");
     }
     try {
         JValue *__args = stackalloc JValue [1];
         __args [0] = new JValue(p0);
         return(JNIEnv.CallStaticDoubleMethod(class_ref, id_getElapsedMillis_J, __args));
     } finally {
     }
 }
 public static unsafe double SwapDouble(double p0)
 {
     if (id_swapDouble_D == IntPtr.Zero)
     {
         id_swapDouble_D = JNIEnv.GetStaticMethodID(class_ref, "swapDouble", "(D)D");
     }
     try {
         JValue *__args = stackalloc JValue [1];
         __args [0] = new JValue(p0);
         return(JNIEnv.CallStaticDoubleMethod(class_ref, id_swapDouble_D, __args));
     } finally {
     }
 }
 public static unsafe double Pow(double p0, double p1)
 {
     if (id_pow_DD == IntPtr.Zero)
     {
         id_pow_DD = JNIEnv.GetStaticMethodID(class_ref, "pow", "(DD)D");
     }
     try {
         JValue *__args = stackalloc JValue [2];
         __args [0] = new JValue(p0);
         __args [1] = new JValue(p1);
         return(JNIEnv.CallStaticDoubleMethod(class_ref, id_pow_DD, __args));
     } finally {
     }
 }
 public static unsafe double Lanczos(double p0, int p1)
 {
     if (id_lanczos_DI == IntPtr.Zero)
     {
         id_lanczos_DI = JNIEnv.GetStaticMethodID(class_ref, "lanczos", "(DI)D");
     }
     try {
         JValue *__args = stackalloc JValue [2];
         __args [0] = new JValue(p0);
         __args [1] = new JValue(p1);
         return(JNIEnv.CallStaticDoubleMethod(class_ref, id_lanczos_DI, __args));
     } finally {
     }
 }
Esempio n. 18
0
 public static unsafe double CalculateArea(global::Com.Baidu.Mapapi.Model.LatLng p0, global::Com.Baidu.Mapapi.Model.LatLng p1)
 {
     if (id_calculateArea_Lcom_baidu_mapapi_model_LatLng_Lcom_baidu_mapapi_model_LatLng_ == IntPtr.Zero)
     {
         id_calculateArea_Lcom_baidu_mapapi_model_LatLng_Lcom_baidu_mapapi_model_LatLng_ = JNIEnv.GetStaticMethodID(class_ref, "calculateArea", "(Lcom/baidu/mapapi/model/LatLng;Lcom/baidu/mapapi/model/LatLng;)D");
     }
     try {
         JValue *__args = stackalloc JValue [2];
         __args [0] = new JValue(p0);
         __args [1] = new JValue(p1);
         double __ret = JNIEnv.CallStaticDoubleMethod(class_ref, id_calculateArea_Lcom_baidu_mapapi_model_LatLng_Lcom_baidu_mapapi_model_LatLng_, __args);
         return(__ret);
     } finally {
     }
 }
Esempio n. 19
0
		public static unsafe double MapValueFromRangeToRange (double p0, double p1, double p2, double p3, double p4)
		{
			if (id_mapValueFromRangeToRange_DDDDD == IntPtr.Zero)
				id_mapValueFromRangeToRange_DDDDD = JNIEnv.GetStaticMethodID (class_ref, "mapValueFromRangeToRange", "(DDDDD)D");
			try {
				JValue* __args = stackalloc JValue [5];
				__args [0] = new JValue (p0);
				__args [1] = new JValue (p1);
				__args [2] = new JValue (p2);
				__args [3] = new JValue (p3);
				__args [4] = new JValue (p4);
				return JNIEnv.CallStaticDoubleMethod  (class_ref, id_mapValueFromRangeToRange_DDDDD, __args);
			} finally {
			}
		}
 public static unsafe double GetGpsSwiftRadius(float p0, double p1, double p2)
 {
     if (id_getGpsSwiftRadius_FDD == IntPtr.Zero)
     {
         id_getGpsSwiftRadius_FDD = JNIEnv.GetStaticMethodID(class_ref, "getGpsSwiftRadius", "(FDD)D");
     }
     try {
         JValue *__args = stackalloc JValue [3];
         __args [0] = new JValue(p0);
         __args [1] = new JValue(p1);
         __args [2] = new JValue(p2);
         return(JNIEnv.CallStaticDoubleMethod(class_ref, id_getGpsSwiftRadius_FDD, __args));
     } finally {
     }
 }
 public static unsafe double GetDistance(global::Com.Baidu.Mapapi.Model.Inner.Point p0, global::Com.Baidu.Mapapi.Model.Inner.Point p1)
 {
     if (id_getDistance_Lcom_baidu_mapapi_model_inner_Point_Lcom_baidu_mapapi_model_inner_Point_ == IntPtr.Zero)
     {
         id_getDistance_Lcom_baidu_mapapi_model_inner_Point_Lcom_baidu_mapapi_model_inner_Point_ = JNIEnv.GetStaticMethodID(class_ref, "getDistance", "(Lcom/baidu/mapapi/model/inner/Point;Lcom/baidu/mapapi/model/inner/Point;)D");
     }
     try {
         JValue *__args = stackalloc JValue [2];
         __args [0] = new JValue(p0);
         __args [1] = new JValue(p1);
         double __ret = JNIEnv.CallStaticDoubleMethod(class_ref, id_getDistance_Lcom_baidu_mapapi_model_inner_Point_Lcom_baidu_mapapi_model_inner_Point_, __args);
         return(__ret);
     } finally {
     }
 }
        //CJW
        public T CallMethod <T>(IntPtr methodId, bool bIsStaticMethod, String sig, List <object> param)
        {
            try
            {
                if (typeof(T) == typeof(byte))
                {
                    // Call the byte method
                    byte res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticByteMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallByteMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(bool))
                {
                    // Call the boolean method
                    bool res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticBooleanMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallBooleanMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                if (typeof(T) == typeof(char))
                {
                    // Call the char method
                    char res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticCharMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallCharMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(short))
                {
                    // Call the short method
                    short res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticShortMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallShortMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(int))
                {
                    // Call the int method
                    int res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticIntMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallIntMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(long))
                {
                    // Call the long method
                    long res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticLongMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallLongMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(float))
                {
                    // Call the float method
                    float res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticFloatMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallFloatMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(double))
                {
                    // Call the double method
                    double res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticDoubleMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallDoubleMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res); // need to fix this
                }
                else if (typeof(T) == typeof(string))
                {
                    // Call the string method
                    IntPtr jstr;
                    if (bIsStaticMethod)
                    {
                        jstr = env.CallStaticObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        jstr = env.CallObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }

                    string res = env.JStringToString(jstr);
                    env.DeleteLocalRef(jstr);
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(byte[]))
                {
                    // Call the byte method
                    IntPtr jobj;
                    if (bIsStaticMethod)
                    {
                        jobj = env.CallStaticObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        jobj = env.CallObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    if (jobj == IntPtr.Zero)
                    {
                        return(default(T));
                    }
                    byte[] res = env.JStringToByte(jobj);
                    env.DeleteLocalRef(jobj);
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(string[]))
                {
                    // Call the string array method
                    IntPtr jobj;
                    if (bIsStaticMethod)
                    {
                        jobj = env.CallStaticObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        jobj = env.CallObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    if (jobj == IntPtr.Zero)
                    {
                        return(default(T));
                    }

                    IntPtr[] objArray = env.GetObjectArray(jobj);
                    string[] res      = new string[objArray.Length];

                    for (int i = 0; i < objArray.Length; i++)
                    {
                        res[i] = env.JStringToString(objArray[i]);
                    }

                    env.DeleteLocalRef(jobj);
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(int[]))
                {
                    // Call the int array method
                    IntPtr jobj;
                    if (bIsStaticMethod)
                    {
                        jobj = env.CallStaticObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        jobj = env.CallObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    if (jobj == IntPtr.Zero)
                    {
                        return(default(T));
                    }
                    int[] res = env.GetIntArray(jobj);
                    env.DeleteLocalRef(jobj);
                    return((T)(object)res);
                }
                else if (typeof(T) == typeof(IntPtr))
                {
                    // Call the object method and deal with whatever comes back in the call code
                    IntPtr res;
                    if (bIsStaticMethod)
                    {
                        res = env.CallStaticObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    else
                    {
                        res = env.CallObjectMethod(javaObject, methodId, ParseParameters(sig, param));
                    }
                    return((T)(object)res);
                }
                return(default(T));
            }
            catch (Exception e)
            {
                throw new Exception("JNICode Error:" + e.Message);
            }
        }