|
|
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">输出数据的格式。 0,dfg;1,xyz。</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);
|
|
|
}
|
|
|
}
|