You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.8 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Construction.BatchCreateMap
{
public class SurfaceCaculate
{
/// <summary>
/// 计算两个面相减的结果
/// </summary>
/// <param name="topFile">顶界文件</param>
/// <param name="bottomFile">底界文件</param>
/// <param name="resultFile">计算结果文件</param>
/// <param name="resultFormat">输出数据的格式。 0dfg1xyz。</param>
/// <param name="function">计算方法,默认为相减</param>
/// <param name="mode">网格模式,默认为底界区域</param>
/// <returns>1成功0失败。</returns>
public static int Subtract(string topFile, string bottomFile, string resultFile, int resultFormat,
ref double x0, ref double y0, ref double dx, ref double dy, ref int numX, ref int numY,
int function = 2, int mode = 4)
{
return Caculate(topFile, bottomFile, resultFile, resultFormat,
ref x0, ref y0, ref dx, ref dy, ref numX, ref numY,
function, mode);
}
#if DEBUG
const string DLL_FILE = "ISurfaceProcess.dll";
#else
//const string DRAWLIB = "DrawLib.dll";
const string DLL_FILE = "ISurfaceProcess.dll";
#endif
[DllImport(DLL_FILE, EntryPoint = "Caculate", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
private static extern int Caculate(string fileA, string fileB, string fileOut,int outFormat,
ref double x0, ref double y0, ref double dx, ref double dy, ref int numX, ref int numY,
int functionMode, int gridMode);
}
}