⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 etopologymanager.cs

📁 基于ehotgis开发的嵌入式gis最短路径应用源码
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace TopoTest
{
    public class eTopologyManager
    {
        [DllImport("ePath.dll")]
        private static extern int CreateTopo();
        [DllImport("ePath.dll")]
        private static extern void DestroyTopo(int handle);
        [DllImport("ePath.dll")]
        private static extern int Open(int handle, [In] string strPath);
        [DllImport("ePath.dll")]
        private static extern void Close(int handle);
        [DllImport("ePath.dll")]
        private static extern void MinPathAnalyse(int handle, int lStart, int lEnd,ref double cost,[Out] StringBuilder lpBuffer);

        

        private int handle=0;
        public eTopologyManager()
        {
            handle = CreateTopo();
        }
        ~eTopologyManager()
        {
            if(handle!=0)
                DestroyTopo(handle);
        }
        public bool Open(string strPath)
        {
            return Open(handle, strPath) == 1;
        }
        public void Close()
        {
            Close(handle);
        }
        public string MinPathAnalyse(int lStart, int lEnd,ref double cost)
        {
            StringBuilder sb = new StringBuilder(1024);
            MinPathAnalyse(handle, lStart, lEnd,ref cost,sb);
            return sb.ToString();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -