|
|
|
|
|
using GeoSigma.SigmaDrawerUtil;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
using System.Runtime.InteropServices.ComTypes;
|
|
|
|
|
|
using System.Security.Policy;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using static GeoSigmaDrawLib.GeoSigmaLib;
|
|
|
|
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeoSigmaDrawLib
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Vtk 三维配置信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 8)]
|
|
|
|
|
|
public struct KevVtkSceneParameter
|
|
|
|
|
|
{
|
|
|
|
|
|
#pragma warning disable CS1591 // 缺少对公共可见类型或成员的 XML 注释
|
|
|
|
|
|
//general
|
|
|
|
|
|
public byte m_showAxies;
|
|
|
|
|
|
public byte m_showScalarBar;
|
|
|
|
|
|
public byte m_showMeshLinearExtrusion;
|
|
|
|
|
|
public byte m_ShowCoordinateGridLine;
|
|
|
|
|
|
public byte m_ShowMeshEdgeColorGradient;
|
|
|
|
|
|
public int m_zScale;
|
|
|
|
|
|
|
|
|
|
|
|
//background
|
|
|
|
|
|
public double m_background_color_r;
|
|
|
|
|
|
public double m_background_color_g;
|
|
|
|
|
|
public double m_background_color_b;
|
|
|
|
|
|
|
|
|
|
|
|
//camera
|
|
|
|
|
|
public double m_camera_distance;
|
|
|
|
|
|
public double m_camera_position_x;
|
|
|
|
|
|
public double m_camera_position_y;
|
|
|
|
|
|
public double m_camera_position_z;
|
|
|
|
|
|
public double m_camera_focalPoint_x;
|
|
|
|
|
|
public double m_camera_focalPoint_y;
|
|
|
|
|
|
public double m_camera_focalPoint_z;
|
|
|
|
|
|
public double m_camera_viewUp_x;
|
|
|
|
|
|
public double m_camera_viewUp_y;
|
|
|
|
|
|
public double m_camera_viewUp_z;
|
|
|
|
|
|
public double m_camera_azimuth;
|
|
|
|
|
|
public double m_camera_elevation;
|
|
|
|
|
|
public double m_camera_roll;
|
|
|
|
|
|
public double m_camera_viewAngle;
|
|
|
|
|
|
public double m_camera_clippingRange_0;
|
|
|
|
|
|
public double m_camera_clippingRange_1;
|
|
|
|
|
|
|
|
|
|
|
|
//actor
|
|
|
|
|
|
public double m_actor_ambientColor_r;
|
|
|
|
|
|
public double m_actor_ambientColor_g;
|
|
|
|
|
|
public double m_actor_ambientColor_b;
|
|
|
|
|
|
public double m_actor_diffuseColor_r;
|
|
|
|
|
|
public double m_actor_diffuseColor_g;
|
|
|
|
|
|
public double m_actor_diffuseColor_b;
|
|
|
|
|
|
public double m_actor_specularColor_r;
|
|
|
|
|
|
public double m_actor_specularColor_g;
|
|
|
|
|
|
public double m_actor_specularColor_b;
|
|
|
|
|
|
public double m_actor_ambient;
|
|
|
|
|
|
public double m_actor_diffuse;
|
|
|
|
|
|
public double m_actor_specular;
|
|
|
|
|
|
|
|
|
|
|
|
//light
|
|
|
|
|
|
public int m_light_mode;
|
|
|
|
|
|
public double m_light_intensity;
|
|
|
|
|
|
public double m_light_color_r;
|
|
|
|
|
|
public double m_light_color_g;
|
|
|
|
|
|
public double m_light_color_b;
|
|
|
|
|
|
public double m_light_ambientColor_r;
|
|
|
|
|
|
public double m_light_ambientColor_g;
|
|
|
|
|
|
public double m_light_ambientColor_b;
|
|
|
|
|
|
public double m_light_diffuseColor_r;
|
|
|
|
|
|
public double m_light_diffuseColor_g;
|
|
|
|
|
|
public double m_light_diffuseColor_b;
|
|
|
|
|
|
public double m_light_specularColor_r;
|
|
|
|
|
|
public double m_light_specularColor_g;
|
|
|
|
|
|
public double m_light_specularColor_b;
|
|
|
|
|
|
public double m_light_position_x;
|
|
|
|
|
|
public double m_light_position_y;
|
|
|
|
|
|
public double m_light_position_z;
|
|
|
|
|
|
public double m_light_focalPoint_x;
|
|
|
|
|
|
public double m_light_focalPoint_y;
|
|
|
|
|
|
public double m_light_focalPoint_z;
|
|
|
|
|
|
public double m_light_azimuth;
|
|
|
|
|
|
public double m_light_elevation;
|
|
|
|
|
|
|
|
|
|
|
|
// edge
|
|
|
|
|
|
public double m_mesh_edge_color_r;
|
|
|
|
|
|
public double m_mesh_edge_color_g;
|
|
|
|
|
|
public double m_mesh_edge_color_b;
|
|
|
|
|
|
public int m_mesh_edge_mode;
|
|
|
|
|
|
|
|
|
|
|
|
public byte m_singularValueFilterFlag;
|
|
|
|
|
|
public int m_singularThreshold;
|
|
|
|
|
|
|
|
|
|
|
|
public double m_zMaxScale;
|
|
|
|
|
|
|
|
|
|
|
|
// 业务参数
|
|
|
|
|
|
public int m_thickness;
|
|
|
|
|
|
|
|
|
|
|
|
public int m_wellMode;
|
|
|
|
|
|
public double m_wellColumnHeight;
|
|
|
|
|
|
public double m_wellColumnRadius;
|
|
|
|
|
|
public uint m_wellColumnColor;
|
|
|
|
|
|
public uint m_wellColumnNameColor;
|
|
|
|
|
|
public int m_wellColumnNameSize;
|
|
|
|
|
|
public int m_wellColumnNameGap;
|
|
|
|
|
|
public int m_faultModeEnum;
|
|
|
|
|
|
public int m_wellSymbalRadius;
|
|
|
|
|
|
public byte m_wellColumnThrough;
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr m_wellTypeColors;
|
|
|
|
|
|
|
|
|
|
|
|
#pragma warning restore CS1591 // 缺少对公共可见类型或成员的 XML 注释
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图像转网格 色标
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
|
|
public struct ColorPoint
|
|
|
|
|
|
{
|
|
|
|
|
|
public int R;
|
|
|
|
|
|
public int G;
|
|
|
|
|
|
public int B;
|
|
|
|
|
|
public double ZValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public enum BooleanOp
|
|
|
|
|
|
{
|
|
|
|
|
|
Difference = 0,
|
|
|
|
|
|
Intersect = 1,
|
|
|
|
|
|
Union = 2,
|
|
|
|
|
|
Xor = 3,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
public delegate void Listener(IntPtr ptr);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// C# C++ 沟通的桥梁
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class GeoSigmaXY : IDisposable, ICloneable
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 标识是否要释放资源,一旦将该标识设置为 false,调用方必须手动负责释放
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool AutoReleaseView { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
|
|
protected IntPtr pView = IntPtr.Zero; //在井柱模块中,该view是 井柱WellPoleView
|
|
|
|
|
|
|
|
|
|
|
|
public enum eViewType {
|
|
|
|
|
|
plane,
|
|
|
|
|
|
wellpole,
|
|
|
|
|
|
wellsection
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
protected eViewType mViewType = GeoSigmaXY.eViewType.plane;
|
|
|
|
|
|
public eViewType GetViewType() { return mViewType; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="GeoSigmaXY"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public GeoSigmaXY(GeoSigmaXY.eViewType vType = GeoSigmaXY.eViewType.plane)
|
|
|
|
|
|
{
|
|
|
|
|
|
mViewType = vType;
|
|
|
|
|
|
if (vType == GeoSigmaXY.eViewType.plane)
|
|
|
|
|
|
pView = GeoSigmaLib.CreateView();
|
|
|
|
|
|
else if (vType == GeoSigmaXY.eViewType.wellpole)
|
|
|
|
|
|
{
|
|
|
|
|
|
pView = GeoSigmaLib.CreateWellPoleView();
|
|
|
|
|
|
}
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
FileUtility_SetStartupDirectory(DrawerConfig.StartupPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
// 设置成功与否,我们并不关心
|
|
|
|
|
|
}
|
|
|
|
|
|
// Task.Run(delegate { GetDefaultLibrary(); });
|
|
|
|
|
|
}
|
|
|
|
|
|
public void EnableRotateEdit(bool enable)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.EnableRotateEdit(this.pView, enable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="GeoSigmaXY"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="drawerData"></param>
|
|
|
|
|
|
public GeoSigmaXY(DrawerData drawerData)
|
|
|
|
|
|
{
|
|
|
|
|
|
pView = GeoSigmaLib.CreateViewByXy(drawerData.pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取图形数据指针
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public IntPtr GetDrawerXy()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetDrawerXy(this.pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="GeoSigmaXY"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="hMemDC"></param>
|
|
|
|
|
|
/// <param name="left"></param>
|
|
|
|
|
|
/// <param name="top"></param>
|
|
|
|
|
|
/// <param name="right"></param>
|
|
|
|
|
|
/// <param name="bottom"></param>
|
|
|
|
|
|
public GeoSigmaXY(IntPtr hMemDC, int left, int top, int right, int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
pView = GeoSigmaLib.CreateViewWithDC(hMemDC, left, top, right, bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="GeoSigmaXY"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pXy"></param>
|
|
|
|
|
|
/// <param name="hMemDC"></param>
|
|
|
|
|
|
/// <param name="left"></param>
|
|
|
|
|
|
/// <param name="top"></param>
|
|
|
|
|
|
/// <param name="right"></param>
|
|
|
|
|
|
/// <param name="bottom"></param>
|
|
|
|
|
|
public GeoSigmaXY(IntPtr pXy, IntPtr hMemDC, int left, int top, int right, int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
pView = GeoSigmaLib.CreateViewWithXyDC(pXy, hMemDC, left, top, right, bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Finalizes an instance of the <see cref="GeoSigmaXY"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
~GeoSigmaXY()
|
|
|
|
|
|
{
|
|
|
|
|
|
Dispose();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (AutoReleaseView)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DestroyView(pView);
|
|
|
|
|
|
pView = IntPtr.Zero;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Implement IDisposable.
|
|
|
|
|
|
// Do not make this method virtual.
|
|
|
|
|
|
// A derived class should not be able to override this method.
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
|
{
|
|
|
|
|
|
Dispose(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void SigmaLog(string msg)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SigmaLog(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool OpenDocument(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.OpenDocument(pView, fileName, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool OpenXy(IntPtr pXy, bool bMergeFile = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.OpenXy(this.pView, pXy, bMergeFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void EnableMeshPackage(bool enable, bool force = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.EnableMeshPackage(pView, enable, force);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetFaultLayer()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptrFaultLayer = new IntPtr();
|
|
|
|
|
|
GeoSigmaLib.GetFaultLayer(pView, ref ptrFaultLayer);
|
|
|
|
|
|
string strFaultLayer = Marshal.PtrToStringAuto(ptrFaultLayer);
|
|
|
|
|
|
PointerDelete(ptrFaultLayer);
|
|
|
|
|
|
//Marshal.FreeHGlobal()
|
|
|
|
|
|
return strFaultLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetFaultLayer(string faultLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetFaultLayer(pView, faultLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetBorderLayer()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptrLayer = new IntPtr();
|
|
|
|
|
|
GeoSigmaLib.GetBorderLayer(pView, ref ptrLayer);
|
|
|
|
|
|
string strLayerName = Marshal.PtrToStringAuto(ptrLayer);
|
|
|
|
|
|
PointerDelete(ptrLayer);
|
|
|
|
|
|
return strLayerName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetBorderLayer(string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetBorderLayer(pView, layer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetFaultLayer3D()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptrFaultLayer = new IntPtr();
|
|
|
|
|
|
GeoSigmaLib.GetFaultLayer3D(pView, ref ptrFaultLayer);
|
|
|
|
|
|
string strFaultLayer = Marshal.PtrToStringAuto(ptrFaultLayer);
|
|
|
|
|
|
PointerDelete(ptrFaultLayer);
|
|
|
|
|
|
//Marshal.FreeHGlobal()
|
|
|
|
|
|
return strFaultLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetFaultLayer3D(string faultLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetFaultLayer3D(pView, faultLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetBorderLayer3D()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptrLayer = new IntPtr();
|
|
|
|
|
|
GeoSigmaLib.GetBorderLayer3D(pView, ref ptrLayer);
|
|
|
|
|
|
string strLayerName = Marshal.PtrToStringAuto(ptrLayer);
|
|
|
|
|
|
PointerDelete(ptrLayer);
|
|
|
|
|
|
return strLayerName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetBorderLayer3D(string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetBorderLayer3D(pView, layer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetWellLayer3D()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptrLayer = new IntPtr();
|
|
|
|
|
|
GeoSigmaLib.GetWellLayer3D(pView, ref ptrLayer);
|
|
|
|
|
|
string strLayerName = Marshal.PtrToStringAuto(ptrLayer);
|
|
|
|
|
|
PointerDelete(ptrLayer);
|
|
|
|
|
|
return strLayerName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetWellLayer3D(string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetWellLayer3D(pView, layer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetMainMeshLayer3D()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptrLayer = new IntPtr();
|
|
|
|
|
|
GeoSigmaLib.GetMainMeshLayer3D(pView, ref ptrLayer);
|
|
|
|
|
|
string strLayerName = Marshal.PtrToStringAuto(ptrLayer);
|
|
|
|
|
|
PointerDelete(ptrLayer);
|
|
|
|
|
|
return strLayerName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetMainMeshLayer3D(string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetMainMeshLayer3D(pView, layer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public long GetMainMeshId3D()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GetMainMeshId3D(pView); ;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetMainMeshId3D(long id)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetMainMeshId3D(pView, id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public long GetMainMeshIdByMesh3D(IntPtr pMesh)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetMainMeshIdByMesh3D(pView, pMesh);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr GetMainMeshByMeshId3D(long id)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetMainMeshByMeshId3D(pView, id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetLayerByMainMesh3D(IntPtr pMesh)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptrLayer = new IntPtr();
|
|
|
|
|
|
GeoSigmaLib.GetLayerByMainMesh3D(pView, pMesh, ref ptrLayer);
|
|
|
|
|
|
string strLayerName = Marshal.PtrToStringAuto(ptrLayer);
|
|
|
|
|
|
PointerDelete(ptrLayer);
|
|
|
|
|
|
return strLayerName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr GetMainMeshByLayer3D(string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetMainMeshByLayer3D(pView, layer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void DestroyAndInsertElement(long[] destroyArray, long[] insertArray)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DestroyAndInsertElement(pView, destroyArray, destroyArray.Length, insertArray, insertArray.Length);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 圈出图层曲线交点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名</param>
|
|
|
|
|
|
/// <param name="includeSubLayer">是否包含子层</param>
|
|
|
|
|
|
public void MarkCurveIntersectionsWithSquares(string layerName, bool includeSubLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (layerName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(layerName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.MarkCurveIntersectionsWithSquares(pView, layerName, includeSubLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置画刷,使用一个字符串,以后有更多设置也只走这一个接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView">pView</param>
|
|
|
|
|
|
/// <param name="settings">设置信息,暂时简单使用 "Normal" 和 "Segments"</param>
|
|
|
|
|
|
public void SetEraserSettings(string settings)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (settings == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(settings));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.SetEraserSettings(pView, settings);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 注册通知接口,用于接受 C++ 的消息通知
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="listener"></param>
|
|
|
|
|
|
public void RegisterListener(Listener listener)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.RegisterListener(pView, listener);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取 SigmaView 属性的通用接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="itemName">标识 SigmaView 的哪个对象</param>
|
|
|
|
|
|
/// <param name="property">属性名称</param>
|
|
|
|
|
|
/// <returns>属性值</returns>
|
|
|
|
|
|
/// <exception cref="Exception"></exception>
|
|
|
|
|
|
public string GetSigmaViewItemProperty(string itemName, string property)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuffer = GeoSigmaLib.GetSigmaViewItemProperty(pView, itemName, property);
|
|
|
|
|
|
if (pBuffer == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("获取属性失败");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return MarshalHelper.ToString(pBuffer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// 创建有利区
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">曲线生成的图层</param>
|
|
|
|
|
|
/// <param name="pTargetXy">目标图件指针</param>
|
|
|
|
|
|
/// <param name="zMin">最小 z 值</param>
|
|
|
|
|
|
/// <param name="zMax">最大 z 值</param>
|
|
|
|
|
|
/// <returns>创建的区域数量</returns>
|
|
|
|
|
|
public int CreateFavorableArea(IntPtr pTargetXy, string layerName, double zMin,double zMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pTargetXy == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(pTargetXy));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (layerName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(layerName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (zMin > zMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(zMin));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CreateFavorableArea(pView, pTargetXy, layerName, zMin, zMax);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置 SigmaView 属性的通用接口,如果匹配不上或值的内容有误,我们暂时的策略是忽略掉这次 set
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="itemName">标识 SigmaView 的哪个对象</param>
|
|
|
|
|
|
/// <param name="property">属性名称</param>
|
|
|
|
|
|
/// <param name="value">属性值</param>
|
|
|
|
|
|
public void SetSigmaViewItemProperty(string itemName, string property, string value)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetSigmaViewItemProperty(pView, itemName, property, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//public string SetContour_GetNewName()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// string strNewName = string.Empty;
|
|
|
|
|
|
// GeoSigmaLib.SetContour_GetNewName(pView, ref strNewName);
|
|
|
|
|
|
// return strNewName;
|
|
|
|
|
|
//}
|
|
|
|
|
|
public void SetContour_SetNewName(string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetContour_SetNewName(pView, newName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetContour_OperateSuccess()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SetContour_OperateSuccess(pView) != 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool NewDocument(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.NewDocument(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SaveDocument(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SaveDocument(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SavePdfDocument(string fileName, double leftMargin, double rightMargin,
|
|
|
|
|
|
double topMargin, double bottomMargin, int paperSizeType, int pdfAHType, int pdfPapertDirectionType)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SavePdfDocument(pView, fileName, leftMargin, rightMargin,
|
|
|
|
|
|
topMargin, bottomMargin, paperSizeType, pdfAHType, pdfPapertDirectionType);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SaveActionPosition()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SaveActionPosition(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 启用/禁用吸附
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="enable"></param>
|
|
|
|
|
|
public void EnableSnape(bool enable)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.EnableSnap(pView, enable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool ReloadFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.ReloadFile(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public DrawElementType XyGetElementType(long pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nType = GeoSigmaLib.XyGetElementType(pView, pos);
|
|
|
|
|
|
return (DrawElementType)nType;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 导出图片文件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="outputFile">输出文件的路径</param>
|
|
|
|
|
|
/// <param name="width">宽度</param>
|
|
|
|
|
|
/// <param name="height">高度</param>
|
|
|
|
|
|
/// <param name="bpp">图片调色板</param>
|
|
|
|
|
|
/// <returns>是否导出成功</returns>
|
|
|
|
|
|
public bool ExportImageFile(string outputFile, int width, int height, int bpp = 24)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.ExportImageFile(pView, outputFile, width, height, bpp);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Sigma_IsDocumentModified()
|
|
|
|
|
|
{
|
|
|
|
|
|
int ret = GeoSigmaLib.Sigma_IsDocumentModified(pView);
|
|
|
|
|
|
if (ret == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Sigma_SetDocumentModified(bool isModified)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Sigma_SetDocumentModified(this.pView, isModified);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool InitializeImg(IntPtr hMemDC, int x, int y, int width, int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.InitializeImg(pView, hMemDC, x, y, width, height);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetScreenDC(IntPtr hScreenDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetScreenDC(pView, hScreenDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetImgDC(IntPtr hMemDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetImgDC(pView, hMemDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DrawImageBmp(IntPtr hBitmap)
|
|
|
|
|
|
{
|
|
|
|
|
|
//GeoSigmaLib.DrawImageBmp(pView, hBitmap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将整个图形按当前分辨率输出到指定文件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="outputFile">The output file.</param>
|
|
|
|
|
|
/// <param name="left"></param>
|
|
|
|
|
|
/// <param name="top"></param>
|
|
|
|
|
|
/// <param name="right"></param>
|
|
|
|
|
|
/// <param name="bottom"></param>
|
|
|
|
|
|
public void Draw2Image(string outputFile, double left = 0, double top = 0, double right = 0, double bottom = 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuffer = GeoSigmaLib.DrawImageBmp(pView, left, top, right, bottom);
|
|
|
|
|
|
if (pBuffer == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
Bitmap bmp = Bitmap.FromHbitmap(pBuffer);
|
|
|
|
|
|
DrawerData.DeleteHBITMAP(pBuffer);
|
|
|
|
|
|
bmp.Save(outputFile, System.Drawing.Imaging.ImageFormat.Png);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取图件第一个网格的图片,将生成一张 4k 图片
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>返回 bitmap 句柄</returns>
|
|
|
|
|
|
public IntPtr GetFirstMeshImage()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetFirstMeshImage(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取图件第一个网格的图片,将生成一张 4k 图片
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>返回 bitmap 句柄</returns>
|
|
|
|
|
|
public IntPtr GetKevMeshImage(IntPtr pMesh)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetKevMeshImage(pView, pMesh);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存合并网格
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pMesh"></param>
|
|
|
|
|
|
/// <param name="filename"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool SaveMergeMesh(IntPtr pMesh, string filename)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SaveMergeMesh(pView, pMesh, filename);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Draw2s the image memory.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public IntPtr Draw2ImageMemory(double leftx, double topy, double rightx, double righty)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr pBuffer = GeoSigmaLib.DrawImageBmp(pView, leftx, topy, rightx, righty);
|
|
|
|
|
|
|
|
|
|
|
|
return pBuffer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Deletes the image.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="image">The image.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public void DeleteImage(IntPtr pBitmap)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerData.DeleteHBITMAP(pBitmap);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CombinImg(int x, int y, int width, int height, int screenX, int screenY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CombinImg(pView, x, y, width, height, screenX, screenY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置反走样显示
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="enable">是否进行反走样</param>
|
|
|
|
|
|
public void SetAntiAlias(bool enable)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetAntiAlias(pView, enable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetAntiAlias()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetAntiAlias(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetPrinting(bool isPrinting)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetPrinting(pView, isPrinting);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetIsPriting()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetIsPriting(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawImg(bool symbolViewFlag)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return GeoSigmaLib.DrawImg(pView, symbolViewFlag);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 逆断层(单线)自动调整方向
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="orientation">1 表示从低到高,0 表示从高到低</param>
|
|
|
|
|
|
public void AdjustDirectionAutomatically(int orientation)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.AdjustDirectionAutomatically(pView, orientation);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//public bool DrawSymbolImg()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return GeoSigmaLib.DrawSymbolImg(pView);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawOther(IntPtr hDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DrawOther(pView, hDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Sigma_UndoView()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Sigma_UndoView(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取某一类型的图元列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="elementType">图元类型</param>
|
|
|
|
|
|
/// <returns>图元指针列表</returns>
|
|
|
|
|
|
public long[] SearchElementByType(int elementType)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerData drawer = new DrawerData(this.GetDrawerXy());
|
|
|
|
|
|
return drawer.SearchElementByType(elementType);
|
|
|
|
|
|
}
|
|
|
|
|
|
public long[] SearchElementByLayer(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerData drawer = new DrawerData(this.GetDrawerXy());
|
|
|
|
|
|
return drawer.SearchElementByLayer(layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据名称查找图元
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="searchText">搜索的名字内容</param>
|
|
|
|
|
|
/// <param name="ignoreCase">忽略大小写</param>
|
|
|
|
|
|
/// <param name="matchWholeWord">是否完全匹配</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public List<long> SearchElement(string searchText, bool ignoreCase, bool matchWholeWord)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr result = GeoSigmaLib.SearchElement(pView, searchText, ignoreCase, matchWholeWord);
|
|
|
|
|
|
string positions = MarshalHelper.ToString(result);
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(positions))
|
|
|
|
|
|
{
|
|
|
|
|
|
return new List<long>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return positions.Split(',')
|
|
|
|
|
|
.Select(text => long.Parse(text))
|
|
|
|
|
|
.ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得图元列表的坐标范围
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="lstPos">图元列表</param>
|
|
|
|
|
|
/// <param name="left">左</param>
|
|
|
|
|
|
/// <param name="bottom">下</param>
|
|
|
|
|
|
/// <param name="right">右</param>
|
|
|
|
|
|
/// <param name="top">上</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool GetElementsRange(long[] lstPos, ref double left, ref double bottom, ref double right, ref double top)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerData drawer = new DrawerData(this.GetDrawerXy());
|
|
|
|
|
|
return drawer.GetElementsRange(lstPos, ref left, ref bottom, ref right, ref top);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取实际显示范围
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="left">左上角x坐标</param>
|
|
|
|
|
|
/// <param name="top">左上角y坐标</param>
|
|
|
|
|
|
/// <param name="right">右下角x坐标</param>
|
|
|
|
|
|
/// <param name="bottom">右下角y坐标</param>
|
|
|
|
|
|
public void GetRealViewRect(ref double left, ref double top, ref double right, ref double bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetRealViewRect(pView, ref left, ref top, ref right, ref bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置实际显示范围
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="left">左上角x坐标</param>
|
|
|
|
|
|
/// <param name="top">左上角y坐标</param>
|
|
|
|
|
|
/// <param name="right">右下角x坐标</param>
|
|
|
|
|
|
/// <param name="bottom">右下角y坐标</param>
|
|
|
|
|
|
public void SetRealViewRect(double left, double top, double right, double bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetRealViewRect(pView, left, top, right, bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取缩放比
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>宽和高的缩放比</returns>
|
|
|
|
|
|
public SizeD GetScaleSize()
|
|
|
|
|
|
{
|
|
|
|
|
|
double scaleX = 0;
|
|
|
|
|
|
double scaleY = 0;
|
|
|
|
|
|
GeoSigmaLib.GetScaleSize(pView, ref scaleX, ref scaleY);
|
|
|
|
|
|
return new SizeD(scaleX, scaleY);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void GetViewStatus(ref double left, ref double top, ref double scaleX, ref double scaleY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetViewStatus(pView, ref left, ref top, ref scaleX, ref scaleY);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void SetViewStatus(double left, double top, double scaleX, double scaleY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetViewStatus(pView, left, top, scaleX, scaleY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetViewPrecision(int precision)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetViewPrecision(pView, precision);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置缩放比
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="scaleSize">宽和高的缩放比</param>
|
|
|
|
|
|
public void SetScaleSize(SizeD scaleSize)
|
|
|
|
|
|
{
|
|
|
|
|
|
double scaleX = scaleSize.Width;
|
|
|
|
|
|
double scaleY = scaleSize.Height;
|
|
|
|
|
|
GeoSigmaLib.SetScaleSize(pView, scaleX, scaleY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_GetZoomStackCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_GetZoomStackCount(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Sigma_DrawAssistant(int mouseX, int mouseY, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Sigma_DrawAssistant(pView, mouseX, mouseY, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Initialize(IntPtr hMemDC, int x, int y, int width, int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Initialize(pView, hMemDC, x, y, width, height);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetImgDCAndSize(IntPtr hMemDC, int x, int y, int right, int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetImgDCAndSize(pView, hMemDC, x, y, right, bottom);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetViewRect(int left, int top, int right, int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetViewRect(pView, left, top, right, bottom);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetViewBackcolor(int r, int g, int b)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetViewBackcolor(this.pView, r, g, b);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void GetViewBackcolor(ref int r, ref int g, ref int b)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetViewBackcolor(this.pView, ref r, ref g, ref b);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetSymbolView(bool isSymbolView)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetSymbolView(this.pView, isSymbolView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//public bool Redraw()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return GeoSigmaLib.Redraw(pView);
|
|
|
|
|
|
//}
|
|
|
|
|
|
public void Cutx()//fbw
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Cutx(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Copy()//fbw
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Copy(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Paste(int type)//fbw
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Paste(pView, type);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawMem()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DrawMem(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawDC()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DrawDC(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetDC(IntPtr hMemDC, int left, int top, int right, int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetDC(pView, hMemDC, left, top, right, bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr GetDC()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetDC(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void EnableRedraw(bool enable)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.EnableRedraw(pView, enable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetHWND(IntPtr hwnd)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetHWND(pView, hwnd);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void GetMapRange(ref double left, ref double top, ref double right, ref double bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetMapRange(pView, ref left, ref top, ref right, ref bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void GetScreenReal(int leftS, int topS, int rightS, int bottomS, ref double left, ref double top, ref double right, ref double bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetScreenReal(pView, leftS, topS, rightS, bottomS, ref left, ref top, ref right, ref bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void GetRealScreen(double leftS, double topS, double rightS, double bottomS, ref int left, ref int top, ref int right, ref int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetRealScreen(pView, leftS, topS, rightS, bottomS, ref left, ref top, ref right, ref bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public double GetRealHeight(int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetRealHeight(pView, height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public double GetRealWidth(int width)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetRealWidth(pView, width);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetScreenHeight(double height)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetScreenHeight(pView, height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetScreenWidth(double width)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetScreenWidth(pView, width);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_WorldToScreen(double wx, double wy, out int cx, out int cy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_WorldToScreen(pView, wx, wy, out cx, out cy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_ScreenToWorld(int sx, int sy, out double wx, out double wy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_ScreenToWorld(pView, sx, sy, out wx, out wy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetDrawingWithAndHeightInScreen(out int width, out int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetDrawingWithAndHeightInScreen(pView, out width, out height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 浏览导航
|
|
|
|
|
|
public void SetScrollBar(ref int hMax, ref int vMax, ref int hPage, ref int vPage, ref int hPos, ref int vPos)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.SetScrollBar(pView, ref hMax, ref vMax, ref hPage, ref vPage, ref hPos, ref vPos);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void HScroll(int nSBCode, int nPos, int nScrollMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.HScroll(pView, nSBCode, nPos, nScrollMax);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Scroll(int orientation, double offset)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Scroll(pView, orientation, offset);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewEnlarge()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewEnlarge(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewEnlargeByMousePoint(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewEnlargeByMousePoint(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewReduceByMousePoint(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewReduceByMousePoint(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewReduce()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewReduce(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewReduceForScreenPoint()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewReduceForScreenPoint(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewReduceWithFactor(double factor)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewReduceWithFactor(pView, factor);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OffsetViewportOrigion(int offsetX, int offsetY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.OffsetViewportOrigion(pView, offsetX, offsetY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewExtend(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将显示框控制在这个范围内,这个范围框使用实际坐标
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="locationX">左上角X坐标</param>
|
|
|
|
|
|
/// <param name="locationY">左上角Y坐标</param>
|
|
|
|
|
|
/// <param name="width">宽度</param>
|
|
|
|
|
|
/// <param name="height">高度</param>
|
|
|
|
|
|
/// <param name="mode">0 居左上;1 拉伸;2 居中;3 按高度满屏显示;4 按宽度满屏显示</param>
|
|
|
|
|
|
public void Extend(double locationX, double locationY, double width, double height, int mode)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Extend(this.pView, locationX, locationY, width, height, mode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetViewOperationKind(ViewOperationKind kind)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetViewOperationKind(pView, kind);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewPanTo(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewPanTo(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetViewWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetViewWindow(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FillScreenByStrech()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FillScreenByStrech(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FillScreenToCenter()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FillScreenToCenter(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ToCenterAndFixScale()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ToCenterAndFixScale(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion 浏览导航
|
|
|
|
|
|
|
|
|
|
|
|
public int GetElementCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetElementCount(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetItem(int itemType)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetItem(pView, itemType);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public long GetMaxPositon()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetMaxPositon(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public long AddPoint(Point2D pt, string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.AddPoint(pView, pt, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPoints(Point2D[] points, string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.AddPoints(pView, points, points.Length, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加曲线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="arrayXY">坐标点 x,y x,y ...</param>
|
|
|
|
|
|
/// <param name="curveName">名称</param>
|
|
|
|
|
|
/// <param name="layerName">图层</param>
|
|
|
|
|
|
/// <returns>是否成功</returns>
|
|
|
|
|
|
public int AddCurve(double[] arrayXY, string curveName, string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.AddCurve(pView, arrayXY, arrayXY.Length / 2, curveName, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 图层管理
|
|
|
|
|
|
public string GetLayers(bool withStatus = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
long pData = 0;
|
|
|
|
|
|
int nDesLen = 0;
|
|
|
|
|
|
GeoSigmaLib.GetLayers(pView, ref pData, ref nDesLen, withStatus);
|
|
|
|
|
|
if (nDesLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btDest = new byte[nDesLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pData, btDest, 0, nDesLen);
|
|
|
|
|
|
string strOut = System.Text.Encoding.Default.GetString(btDest);
|
|
|
|
|
|
PointerArrayDelete((IntPtr)pData);
|
|
|
|
|
|
return strOut;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetCurrentLayer()
|
|
|
|
|
|
{
|
|
|
|
|
|
StringBuilder strLayer = new StringBuilder();
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
// Marshal.PtrToStringAuto(strLayer);
|
|
|
|
|
|
byte[] byteOutput = new byte[1024];
|
|
|
|
|
|
int nLen = GeoSigmaLib.GetCurrentLayer(pView, byteOutput);
|
|
|
|
|
|
return System.Text.Encoding.Default.GetString(byteOutput, 0, nLen);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetCurrentLayer(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetCurrentLayer(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置图层状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
/// <param name="status"></param>
|
|
|
|
|
|
public void SetLayerState(string layerName, LayerStatus status)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetLayerState(pView, layerName, (int)status);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取图层状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public LayerStatus GetLayerState(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
int state = GeoSigmaLib.GetLayerState(pView, layerName);
|
|
|
|
|
|
LayerStatus layerStatus = (LayerStatus)state;
|
|
|
|
|
|
return layerStatus;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 批量设置图层状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
/// <param name="status"></param>
|
|
|
|
|
|
public void SetLayersState(string[] layerName, LayerStatus status)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetLayersState(pView, layerName, layerName.Length, (int)status);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FindAddLayer(string layerName, bool doActive)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FindAddLayer(pView, layerName, doActive);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DeleteLayer(string[] layers, bool withSublayer = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DeleteLayer(pView, layers, layers.Length, withSublayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
public bool ClearAll(bool needUndo)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.ClearAll(pView, needUndo);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DeleteLayerEmpty()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DeleteLayerEmpty(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Layer_SeparateTextAndCurve(string layerNameSeprated, string textSubLayerName, string curveSubLayerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Layer_SeparateTextAndCurve(pView, layerNameSeprated, textSubLayerName, curveSubLayerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Layer_DeleteInCurve(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Layer_DeleteInCurve(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Layer_DeleteOutCurve(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Layer_DeleteOutCurve(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Delete_Condition(DeletionCondition condition)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Delete_Condition(pView, condition);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Layer_BreakCurve(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Layer_BreakCurve(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Layer_ExtendCurve(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Layer_ExtendCurve(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Layer_ChangeLayer(string layerNameOld, string layerNameNew)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Layer_ChangeLayer(pView, layerNameOld, layerNameNew);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得图层下的所有曲线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
/// <param name="curveData"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int LayerGetCurves(string layerName, ref string curveData)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr ptData = IntPtr.Zero;
|
|
|
|
|
|
int nDataLen = 0;
|
|
|
|
|
|
int nCount = GeoSigmaLib.Layer_GetCurves(this.pView, layerName, ref ptData, ref nDataLen);
|
|
|
|
|
|
if (nCount == 0 || ptData == IntPtr.Zero || nDataLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btCurve = new byte[nDataLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)ptData, btCurve, 0, nDataLen);
|
|
|
|
|
|
curveData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
GeoSigmaLib.PointerFree(ptData);
|
|
|
|
|
|
return nCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetLayerStyleData(string layerName, ref string curveStyle, ref string pointStyle)
|
|
|
|
|
|
{
|
|
|
|
|
|
long pCurve = 0, pPoint = 0;
|
|
|
|
|
|
int nCurveLen = 0, nPointLen = 0;
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.GetLayerStyleData(pView, layerName, ref pCurve, ref nCurveLen, ref pPoint, ref nPointLen);
|
|
|
|
|
|
if (bSuccess != true) return false;
|
|
|
|
|
|
if (nCurveLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
curveStyle = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] btCurve = new byte[nCurveLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pCurve, btCurve, 0, nCurveLen);
|
|
|
|
|
|
curveStyle = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (nPointLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
pointStyle = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] btPoint = new byte[nPointLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pPoint, btPoint, 0, nPointLen);
|
|
|
|
|
|
pointStyle = System.Text.Encoding.Default.GetString(btPoint);
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool RemoveCurveStyle(string layerName, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.RemoveCurveStyle(pView, layerName, index);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool RemovePointStyle(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.RemovePointStyle(pView, layerName);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetLayerHowtoViewPoint(string layerName, string data, bool replace)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
//textBox2.Text=Marshal.PtrToStringAnsi(outit);
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SetLayerHowtoViewPoint(pView, layerName, pBuff, nLen, replace);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetLayerHowtoViewCurve(string layerName, string data, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SetLayerHowtoViewCurve(pView, layerName, pBuff, nLen, index);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetLayerMoveUpCurveStyle(string layerName, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SetLayerMoveUpCurveStyle(pView, layerName, index);
|
|
|
|
|
|
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetLayerMoveDownCurveStyle(string layerName, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SetLayerMoveDownCurveStyle(pView, layerName, index);
|
|
|
|
|
|
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CreateLayerCurveStyle(string layerName, CurveStyleType type, string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.CreateLayerCurveStyle(pView, layerName, (int)type, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool AddLayerCurveStyle(string layerName, CurveStyleType type, string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.AddLayerCurveStyle(pView, layerName, (int)type, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CreateLayerPointStyle(string layerName, string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.CreateLayerPointStyle(pView, layerName, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取图层数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
/// <param name="bHole">是断层图层</param>
|
|
|
|
|
|
/// <param name="bBoundary">是边界图层</param>
|
|
|
|
|
|
/// <param name="bWell">是井图层</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public IntPtr GetLayerData(string layerName, bool bBoundary, bool bFault, bool bWell)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ret = IntPtr.Zero;
|
|
|
|
|
|
ret = GeoSigmaLib.GetLayerData(pView, layerName, bBoundary, bFault, bWell);
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取图件中第一个网格对象
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>KevVtkMeshData对象指针</returns>
|
|
|
|
|
|
public IntPtr GetFirstMesh()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ret = IntPtr.Zero;
|
|
|
|
|
|
ret = GeoSigmaLib.GetFirstMesh(pView);
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取图件中第一个网格对象
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>KevVtkMeshData对象指针</returns>
|
|
|
|
|
|
public IntPtr GetKevFirstMesh()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ret = IntPtr.Zero;
|
|
|
|
|
|
ret = GeoSigmaLib.GetKevFirstMesh(pView);
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 处理网格数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pMesh"></param>
|
|
|
|
|
|
public void PreProcessMeshData(IntPtr pMesh, string faultLayers, string boundaryLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pMesh == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.PreProcessMeshData(pView, pMesh, faultLayers, boundaryLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Processes the mesh fault area.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pRoot">The p root.</param>
|
|
|
|
|
|
/// <param name="pMainMesh">The p main mesh.</param>
|
|
|
|
|
|
public void ProcessMeshFaultArea(IntPtr pRoot, IntPtr pMainMesh)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ProcessMeshFaultArea(pView, pRoot, pMainMesh);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按边界约束处理网格
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pRoot"></param>
|
|
|
|
|
|
/// <param name="pMainMesh"></param>
|
|
|
|
|
|
public void ProcessMeshBoundary(IntPtr pRoot, IntPtr pMainMesh)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ProcessMeshBoundary(pView, pRoot, pMainMesh);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="isChecked"></param>
|
|
|
|
|
|
public void SetVtkDataNodeChecked(IntPtr pNodeData,bool isChecked)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetVtkDataNodeChecked(pView, pNodeData, isChecked);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetVtkDataNodeHide(IntPtr pNodeData, bool isHide)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetVtkDataNodeHide(pView, pNodeData, isHide);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pParent"></param>
|
|
|
|
|
|
/// <param name="pChild"></param>
|
|
|
|
|
|
public void AddVtkDataNodeChild(IntPtr pParent, IntPtr pChild)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.AddVtkDataNodeChild(pView, pParent, pChild);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 图层管理
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 绘制点
|
|
|
|
|
|
public int GetPoint2DFromItem(out Point2D ptOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
ptOut.pointName = null;
|
|
|
|
|
|
ptOut.x = ptOut.y = ptOut.angle = 0;
|
|
|
|
|
|
ptOut.z = 0;
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.GetPoint2DFromItem(pView, out ptOut);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CancelDisplayPointInItem()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CancelDisplayPointInItem(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ChangePointAddedMode(int mode)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.ChangePointAddedMode(pView, mode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPoint2D_SetPointType(int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.AddPoint2D_SetPointType(pView, type);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPoint2DToDoc(ref Point2D pt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.AddPoint2DToDoc(pView, ref pt);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddFractionPointToDoc(ref FractionPoint pt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.AddFractionPointToDoc(pView, ref pt);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPointNameToItem(IntPtr hDC, string pointName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.AddPointNameToItem(pView, hDC, pointName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddNumeratorNameToItem(IntPtr hDC, string numeratorName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.AddNumeratorNameToItem(pView, hDC, numeratorName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddDenominatorNameToItem(IntPtr hDC, string numeratorName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.AddDenominatorNameToItem(pView, hDC, numeratorName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void PointAdd_UpdateDraw()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.PointAdd_UpdateDraw(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int ChangeAnglgeToItem(double angle)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.ChangeAnglgeToItem(pView, angle);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPointSetAngle(IntPtr hDC, double angle)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
return GeoSigmaLib.AddPointSetAngle(pView, hDC, angle);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddPointSetDefaultName(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.AddPointSetDefaultName(pView, name);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddPointSetDefaultZ(double z)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.AddPointSetDefaultZ(pView, z);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPointSetX(IntPtr hDC, double x)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
return GeoSigmaLib.AddPointSetX(pView, hDC, x);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPointSetY(IntPtr hDC, double y)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
return GeoSigmaLib.AddPointSetY(pView, hDC, y);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddPointSetZ(IntPtr hDC, double z)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
return GeoSigmaLib.AddPointSetZ(pView, hDC, z);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CrossPoint_GetPosition(out CrossPoint2D pt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
pt.name1 = pt.name2 = pt.name3 = pt.name4 = null;
|
|
|
|
|
|
pt.x = pt.y = pt.angle = 0;
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CrossPoint_GetPosition(pView, out pt);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CrossPoint_Add(ref CrossPoint2D pt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CrossPoint_Add(pView, ref pt);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CrossPoint_ChangeMode(int mode)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CrossPoint_ChangeMode(pView, mode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CrossPoint_SetNames(string name1, string name2, string name3, string name4)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CrossPoint_SetNames(pView, name1, name2, name3, name4);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddBufferData(string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
return GeoSigmaLib.AddBufferData(pView, data);
|
|
|
|
|
|
}
|
|
|
|
|
|
public int InsertBufferDataBefore(string data, long posDest)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
return GeoSigmaLib.InsertBufferDataBefore(this.pView, data, posDest);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图件合并
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="fileName">文件地址</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool MergeFile(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
var popView = this.GetDrawerXy();
|
|
|
|
|
|
if (popView == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
return GeoSigmaLib.XyMerge(popView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddWellGroup(string layerName, string wellGroupData)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
if (string.IsNullOrEmpty(layerName))
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(wellGroupData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(wellGroupData);
|
|
|
|
|
|
int nResult = DrawerData.XyWellGroupAdd(this.GetDrawerXy(), layerName, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return nResult;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将数据插入到图形最底层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="drawData">dfd格式的图形数据</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool InsertDataBottom(string drawData, string newLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
DrawerData drawerData = new DrawerData(this.GetDrawerXy());
|
|
|
|
|
|
return drawerData.XyInsertDataBottom(drawData, newLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将数据作为符号添加到文件中.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="data">The data.</param>
|
|
|
|
|
|
/// <param name="symbolName">The symbol name.</param>
|
|
|
|
|
|
/// <param name="overwrite">If true, overwrite.</param>
|
|
|
|
|
|
/// <returns>An int.</returns>
|
|
|
|
|
|
public int AddDataAsSymble(string data, string symbolName, bool overwrite = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return DrawerData.XyAddDataAsSymble(this.GetDrawerXy(), data, symbolName, overwrite);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public double GetCurveLength(long pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
return DrawerData.XyGetCurveLength(this.GetDrawerXy(), pos);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddElementByBuffer(string elementData, int elementType, int dataFormat)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(elementData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(elementData);
|
|
|
|
|
|
int nReturn = GeoSigmaLib.AddElementByBuffer(pView, pBuff, nLen, elementType, dataFormat);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return nReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 响应鼠标键盘
|
|
|
|
|
|
public void OnLButtonDown(int mouseX, int mouseY, IntPtr hdc, Keys key = Keys.None)
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (pView == IntPtr.Zero)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// //pView = tmpPView;
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.OnLButtonDown(pView, mouseX, mouseY, hdc, (int)key);
|
|
|
|
|
|
int code = GeoSigmaLib.GetStatusCode(pView);
|
|
|
|
|
|
if (code > StatusDefine.STATUS_CODE_SUCCESS)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.GetStatusText(pView);
|
|
|
|
|
|
string message = Marshal.PtrToStringAnsi(ptr);
|
|
|
|
|
|
string caption = "提示信息";
|
|
|
|
|
|
MessageBox.Show(message, caption, MessageBoxButtons.OK);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//返回值:-1 出错 0 正在执行命名 1 未选中元素 2 选中了曲线
|
|
|
|
|
|
public int OnLButtonDoubleClick(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.OnLButtonDoubleClick(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnLButtonUp(int mouseX, int mouseY, IntPtr hMemDC, Keys key)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
GeoSigmaLib.OnLButtonUp(pView, mouseX, mouseY, hMemDC, (int)key);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnRButtonDown(int mouseX, int mouseY, IntPtr hMemDC, Keys key)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
GeoSigmaLib.OnRButtonDown(pView, mouseX, mouseY, hMemDC, (int)key);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnRButtonUp(int mouseX, int mouseY, IntPtr hMemDC, Keys key)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
GeoSigmaLib.OnRButtonUp(pView, mouseX, mouseY, hMemDC, (int)key);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void OnMouseWheel(uint button, int clicks, int x, int y, int delta)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.OnMouseWheel(pView, button, clicks, x, y, delta);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//buttonStatus的第一位是鼠标左键的状态 第二位是中键的状态 第三位右键状态
|
|
|
|
|
|
public int ItemMouseMove(IntPtr hMemDC, int mouseX, int mouseY, int buttonStatus)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.ItemMouseMove(pView, hMemDC, mouseX, mouseY, buttonStatus);
|
|
|
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ItemMouseMoveStatus(IntPtr hMemDC, int mouseX, int mouseY, int buttonStatus)
|
|
|
|
|
|
{
|
|
|
|
|
|
long lengthAngleInfo = 0;
|
|
|
|
|
|
int nDesLen = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ItemMouseMoveStatus(pView, hMemDC, mouseX, mouseY, buttonStatus, ref lengthAngleInfo, ref nDesLen);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (nDesLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btDest = new byte[nDesLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)lengthAngleInfo, btDest, 0, nDesLen);
|
|
|
|
|
|
string strOut = System.Text.Encoding.Default.GetString(btDest);
|
|
|
|
|
|
return strOut;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void MouseSelect(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.MouseSelect(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewMouseDown(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewMouseDown(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ViewMouseMove(IntPtr hMemDC, int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewMouseMove(pView, hMemDC, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//public void CanvasMouseMove(IntPtr hdc, int mouseX, int mouseY)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// GeoSigmaLib.CanvasMouseMove(pView, hdc, mouseX, mouseY);
|
|
|
|
|
|
//}
|
|
|
|
|
|
//public void CanvasDrawCrossLine(IntPtr hdc, int mouseX, int mouseY)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// GeoSigmaLib.CanvasDrawCrossLine(pView, hdc, mouseX, mouseY);
|
|
|
|
|
|
//}
|
|
|
|
|
|
public void ViewMouseUp(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ViewMouseUp(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public bool OnKeyDown(int keyValue, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.OnKeyDown(pView, keyValue, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int OnKeyUp(int keyValue, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.OnKeyUp(pView, keyValue, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 绘制曲线接口
|
|
|
|
|
|
//TODO:应该为接头添加上前缀
|
|
|
|
|
|
public int EndCurve()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -10;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.EndCurve(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CancelCurve()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -10;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CancelCurve(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CurveCancelAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -10;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CurveCancelAll(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AutoCloseCurve()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -10;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.AutoCloseCurve(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int ChangeCurveMergeState()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -10;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.ChangeCurveMergeState(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int DrawNextCurve()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.DrawNextCurve(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int ChangeCurveTypeForDrawing(string curveType, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.ChangeCurveTypeForDrawing(pView, curveType, hdc);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion 绘制曲线接口
|
|
|
|
|
|
|
|
|
|
|
|
//0--左下箭头 1--垂直箭头 2--右下箭头 3--水平箭头
|
|
|
|
|
|
//4--旋转箭头 5--水平剪切箭头 6--垂直剪切箭头 7--平移箭头
|
|
|
|
|
|
//-1 出错
|
|
|
|
|
|
public int GetTrackerHandleCursorType(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GetTrackerHandleCursorType(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 曲面处理
|
|
|
|
|
|
|
|
|
|
|
|
private string SurfaceSaveAsDialogFilter()
|
|
|
|
|
|
{
|
|
|
|
|
|
return "KEVisualization Grid File (*.keg)|*.keg|" +
|
|
|
|
|
|
"Surfer Grid6 Ascii File (*.grd)|*.grd|" +
|
|
|
|
|
|
"Surfer Grid6 Binary File (*.grd)|*.grd|" +
|
|
|
|
|
|
"CPS3 Grid File (*.grd)|*.grd|" +
|
|
|
|
|
|
"GeoTiff File (*.tif)|*.tif|" +
|
|
|
|
|
|
"Image File (*.jpg)|*.jpg|" +
|
|
|
|
|
|
"All Files(*.*)|*.*||";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 另存为...
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void SurfaceSaveAs(long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
string strFileName = string.Empty;
|
|
|
|
|
|
SaveFileDialog sfd = new SaveFileDialog();
|
|
|
|
|
|
sfd.Filter = SurfaceSaveAsDialogFilter();
|
|
|
|
|
|
if (sfd.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
strFileName = sfd.FileName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var filterIndex = sfd.FilterIndex - 1;
|
|
|
|
|
|
GeoSigmaLib.SurfaceSaveAs(pView, strFileName, filterIndex, position);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 仅保存有数据的点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void SaveDataPointOnly(long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
string strFileName = string.Empty;
|
|
|
|
|
|
SaveFileDialog sfd = new SaveFileDialog();
|
|
|
|
|
|
sfd.Filter = "XYZ File (*.xyz)|*.xyz|All Files(*.*)|*.*||";
|
|
|
|
|
|
if (sfd.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
strFileName = sfd.FileName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.SaveDataPointOnly(pView, strFileName, position);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 创建等值线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void CreateContour()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
GeoSigmaLib.CreateContour(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置默认颜色模版
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="colors"></param>
|
|
|
|
|
|
/// <param name="Zs"></param>
|
|
|
|
|
|
public static void SetDefaultMeshColorTemplate(int[] colors, double[] Zs)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetDefaultMeshColorTemplate(colors, Zs, colors.Length / 3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_SmoothSurface(double coefficient, int smoothNumber)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_SmoothSurface(pView, coefficient, smoothNumber);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr StatisticsGraph_Create()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.StatisticsGraph_Create(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StatisticsGraph_Draw(IntPtr statisticsGraph, IntPtr hdc, int graphWidth, int graphHeight)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StatisticsGraph_Draw(pView, statisticsGraph, hdc, graphWidth, graphHeight);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StatisticsGraph_Release(IntPtr statisticsGraph)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StatisticsGraph_Release(statisticsGraph);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StatisticsGraph_DrawRangeForMesh(IntPtr statisticsGraphHandle, IntPtr hdcDrawer, double zMin, double zMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StatisticsGraph_DrawRangeForMesh(pView, statisticsGraphHandle, hdcDrawer, zMin, zMax);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool StatisticsGraph_GetSelectedRange(IntPtr graph, int left, int right, out double z1, out double z2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GeoSigmaLib.StatisticsGraph_GetSelectedRange(graph, left, right, out z1, out z2) == -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_Fill()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 读取线段相交延伸长度
|
|
|
|
|
|
DrawerGlobalConfig globalConfig = DrawerGlobalConfig.Instance;
|
|
|
|
|
|
if (globalConfig == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
int extendLen = globalConfig.FillNode.IntersectionExtendLength;
|
|
|
|
|
|
return GeoSigmaLib.Sigma_Fill(pView, extendLen);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_Fill_ResetCrossStatus()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_Fill_SetStatusOfCrossPoint(pView, -1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//函数功能:填充时选择的图元是否有交点
|
|
|
|
|
|
//返回值:-1出错 0没有交点 1有交点
|
|
|
|
|
|
public int Sigma_Fill_GetStatusOfCrossPoint()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_Fill_GetStatusOfCrossPoint(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_Fill_Link()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_Fill_Link(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_Fill_Auto()
|
|
|
|
|
|
{
|
|
|
|
|
|
//// 读取线段相交延伸长度
|
|
|
|
|
|
//DrawerGlobalConfig globalConfig = DrawerGlobalConfig.Instance;
|
|
|
|
|
|
//if (globalConfig == null)
|
|
|
|
|
|
// return 0;
|
|
|
|
|
|
//int extendLen = globalConfig.FillNode.AutoExtendLength;
|
|
|
|
|
|
return GeoSigmaLib.Sigma_Fill_Auto(pView, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_ZPositiveNegativeSign()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_ZPositiveNegativeSign(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StatisticsGraph_CalculateGraphRange(IntPtr graph, double z1, double z2, out int left, out int right)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StatisticsGraph_CalculateGraphRange(graph, z1, z2, out left, out right);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int StatisticsGraph_DeleteRange(IntPtr graph, int left, int right)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.StatisticsGraph_DeleteRange(graph, left, right);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int StatisticsGraph_GetRange(IntPtr graph, out double xMin, out double xMax, out double yMin, out double yMax, out int pointerCount)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.StatisticsGraph_GetRange(graph, out xMin, out xMax, out yMin, out yMax, out pointerCount);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int StatisticsGraph_GetZValue(IntPtr graph, int index, out double v)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.StatisticsGraph_GetZValue(graph, index, out v);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StatisticsGraph_SetZValueOfNodeSelected(IntPtr graph, double v)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StatisticsGraph_SetZValueOfNodeSelected(graph, v);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StatisticsGraph_GetAreaAndValueForSelected(IntPtr graph, double minZ, double maxZ, out double areaOut, out double volumeOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StatisticsGraph_GetAreaAndValueForSelected(graph, minZ, maxZ, out areaOut, out volumeOut);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 编辑网格节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void EditGridNode(IntPtr hdc, long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (position > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.EditGridNode(pView, hdc, position);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 编辑网格节点,鼠标移动事件执行
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void MeshOnMouseMove(IntPtr hdc, long position, int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.MeshOnMouseMove(pView, hdc, position, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得鼠标所在网格节点.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="mouseX">The mouse x.</param>
|
|
|
|
|
|
/// <param name="mouseY">The mouse y.</param>
|
|
|
|
|
|
/// <param name="locationX">The location x.</param>
|
|
|
|
|
|
/// <param name="locationY">The location y.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool MeshFindNodeLocation(IntPtr hdc, int mouseX, int mouseY, ref int locationX, ref int locationY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MeshFindNodeLocation(pView, hdc, mouseX, mouseY, ref locationX, ref locationY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 鼠标是否在网格范围中
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
|
/// <param name="mouseX"></param>
|
|
|
|
|
|
/// <param name="mouseY"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool GridPointNoExist(long position, int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GridPointNoExist(pView, position, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetGridValue(long position, int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] byteOutput = new byte[1024];
|
|
|
|
|
|
int len = GeoSigmaLib.GetGridValue(pView, position, mouseX, mouseY, byteOutput);
|
|
|
|
|
|
return System.Text.Encoding.Default.GetString(byteOutput, 0, len);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SetZOfGridPoint(double z, int row, int column)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SetZOfGridPoint(pView, z, row, column);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetGridPointValue(double ptX, double ptY, ref double ptZ)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetMeshPointValue(pView, ptX, ptY, ref ptZ);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SurfaceGetZRange(long position, ref double zMin, ref double zMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SurfaceGetZRange(pView, position, ref zMin, ref zMax);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Sigma_GetInfoStringForCreatingContour()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr infoBuffer = IntPtr.Zero;
|
|
|
|
|
|
int len = GeoSigmaLib.Sigma_GetInfoStringForCreatingContour(pView, out infoBuffer);
|
|
|
|
|
|
if (len <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string infoStr = ByteToString(infoBuffer, len);
|
|
|
|
|
|
GeoSigmaLib.Sigma_ReleaseInfoStringForCreatingContour(infoBuffer);
|
|
|
|
|
|
return infoStr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_CreateContour(string infomationStrForCreatingContour)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_CreateContour(pView, infomationStrForCreatingContour);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 图层管理
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 最上层显示
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
public void LayerMovetoTop(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerMovetoTop(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 最下层显示
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
public void LayerMovetoBottom(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerMovetoBottom(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图层拖动
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="positionLayer">拖动到了这个图层位置</param>
|
|
|
|
|
|
/// <param name="draggedLayer">被拖动的图层</param>
|
|
|
|
|
|
/// <param name="beChild">是否成为 positionLayer 的子层</param>
|
|
|
|
|
|
public void LayerDragged(string positionLayer, string draggedLayer, bool beChild)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerDragged(pView, positionLayer, draggedLayer, beChild ? 1 : 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清空修饰
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void LayerRemoveEmbellish(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerRemoveEmbellish(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择焦点层元素
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
public void LayerSelectActiveElement(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerSelectActiveElement(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择子层元素
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
public void LayerSelectElements(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerSelectElements(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存焦点层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
/// <param name="filePath">文件路径</param>
|
|
|
|
|
|
/// <returns> 0 和 负值 :失败 </returns>
|
|
|
|
|
|
public int LayerSaveActiveLayer(string layerName, string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.LayerSaveActiveLayer(pView, layerName, filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存图层保存为.kev文件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
/// <param name="filePath">文件路径</param>
|
|
|
|
|
|
/// <returns> 0 和 负值 :失败 </returns>
|
|
|
|
|
|
public int LayerSaveLayerToKev(string layerName, string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nResult = GeoSigmaLib.LayerSaveActiveLayer(pView, layerName, filePath);
|
|
|
|
|
|
return nResult;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存图层保存为.xyz文件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
/// <param name="filePath">文件路径</param>
|
|
|
|
|
|
/// <returns> 0 和 负值 :失败 </returns>
|
|
|
|
|
|
public int LayerSaveLayerToXyz(string layerName, string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nResult = GeoSigmaLib.LayerSaveLayerToXyz(pView, layerName, filePath);
|
|
|
|
|
|
return nResult;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//复制修饰
|
|
|
|
|
|
public void LayerCopyEmbelish(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerCopyEmbellish(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//粘贴修饰
|
|
|
|
|
|
public void PasteLayerEmbellish(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.PasteLayerEmbellish(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统计
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Statisc(string layerName, bool childNode, int statMode, int surfaceType)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.Statisc(pView, layerName, childNode, statMode, surfaceType);
|
|
|
|
|
|
if (ptr == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strData = Marshal.PtrToStringBSTR(ptr);
|
|
|
|
|
|
Marshal.FreeBSTR(ptr);
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
public string StatisticWellInclination(string layerName, bool childNode, double searchRadius, string faultLayer, string borderLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.StatisticWellInclination(this.pView, layerName, childNode, searchRadius, faultLayer, borderLayer);
|
|
|
|
|
|
if (ptr == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strData = Marshal.PtrToStringBSTR(ptr);
|
|
|
|
|
|
Marshal.FreeBSTR(ptr);
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Statics the block wells.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="blockLine">The block line.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string StaticBlockWells(string blockLine)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.StaticBlockWells(pView, blockLine);
|
|
|
|
|
|
if (ptr == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strData = Marshal.PtrToStringBSTR(ptr);
|
|
|
|
|
|
Marshal.FreeBSTR(ptr);
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统计曲线交点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名</param>
|
|
|
|
|
|
/// <param name="includeSubLayer">是否包含子层</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string StaticCurveCorssPoints(string layerName, bool includeSubLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception($"{nameof(pView)} 不能为 IntPtr.Zero");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (layerName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(layerName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr pBuff = StatiscCurveCrossPoints(pView, layerName, includeSubLayer);
|
|
|
|
|
|
return MarshalHelper.ToString(pBuff);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统计范围内的区块.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="blockLine">The block line.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string StaticBlocks(string blockLine)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.StaticBlocks(pView, blockLine);
|
|
|
|
|
|
if (ptr == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strData = Marshal.PtrToStringBSTR(ptr);
|
|
|
|
|
|
Marshal.FreeBSTR(Marshal.StringToBSTR(strData));
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
public string StaticBlocksInfo(string blockLine)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.StaticBlocksInfo(pView, blockLine);
|
|
|
|
|
|
if (ptr == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strData = Marshal.PtrToStringBSTR(ptr);
|
|
|
|
|
|
Marshal.FreeBSTR(Marshal.StringToBSTR(strData));
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
public string CutStaticBlocks(string positionData, string blockLine)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.CutStaticBlocks(pView, positionData, blockLine);
|
|
|
|
|
|
if (ptr == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strData = Marshal.PtrToStringBSTR(ptr);
|
|
|
|
|
|
Marshal.FreeBSTR(Marshal.StringToBSTR(strData));
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
public double CaculateBlockArea(string position)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CaculateBlockArea(pView, Convert.ToInt64(position));
|
|
|
|
|
|
}
|
|
|
|
|
|
public void ResetLayerByOther(string pos, string posRefer, string suffix)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ResetLayerByOther(pView, Convert.ToInt64(pos), Convert.ToInt64(posRefer), suffix);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统计分层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string StatiscLayer(string layerName, ref long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strData = GeoSigmaLib.StatiscLayer(pView, layerName);
|
|
|
|
|
|
Marshal.FreeBSTR(Marshal.StringToBSTR(strData));
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ActiveElements(long[] positions)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr posPtr = Marshal.AllocHGlobal(sizeof(long) * positions.Length);
|
|
|
|
|
|
Marshal.Copy(positions, 0, posPtr, positions.Length);
|
|
|
|
|
|
GeoSigmaLib.ActiveElements(pView, posPtr, positions.Length);
|
|
|
|
|
|
Marshal.FreeHGlobal(posPtr);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ActiveEelement(long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ActiveEelement(pView, position);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void LayerRename(string oldName, string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LayerRename(pView, oldName, newName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 图层管理
|
|
|
|
|
|
|
|
|
|
|
|
#region 校正
|
|
|
|
|
|
public int CalibrateForTwoPoint(ref TwoPoint twoPt, int coordinateMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CalibrateForTwoPoint(pView, ref twoPt, coordinateMode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CalibrateForFourPoint(ref FourPoint fourPt, int coordinateMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CalibrateForFourPoint(pView, ref fourPt, coordinateMode);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 初始化库管理
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pathName">库的存储路径</param>
|
|
|
|
|
|
/// <param name="nodeData">符号节点数据</param>
|
|
|
|
|
|
/// <param name="forceReload">是否强制重新加载</param>
|
|
|
|
|
|
/// <returns>是否成功</returns>
|
|
|
|
|
|
public static bool InitLibrary(string pathName, ref string nodeData, bool forceReload = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptData = IntPtr.Zero;
|
|
|
|
|
|
int nDataLen = 0;
|
|
|
|
|
|
GeoSigmaLib.InitLibrary(pathName, ref ptData, ref nDataLen, forceReload);
|
|
|
|
|
|
if (ptData == IntPtr.Zero || nDataLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btCurve = new byte[nDataLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)ptData, btCurve, 0, nDataLen);
|
|
|
|
|
|
nodeData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
GeoSigmaLib.PointerFree(ptData);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得符号库路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="path"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool GetLibraryPath(ref string path)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptData = IntPtr.Zero;
|
|
|
|
|
|
int nDataLen = 0;
|
|
|
|
|
|
GeoSigmaLib.GetLibraryPath(ref ptData, ref nDataLen);
|
|
|
|
|
|
if (ptData == IntPtr.Zero || nDataLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btCurve = new byte[nDataLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)ptData, btCurve, 0, nDataLen);
|
|
|
|
|
|
path = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
GeoSigmaLib.PointerFree(ptData);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool LibraryAddNewGroup(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.LibraryAddNewGroup(fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void LibraryRemoveGroup(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LibraryRemoveGroup(fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void LibraryReloadGroup(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (fileName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(fileName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.LibraryReloadGroup(fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool LibraryRenameGroup(string oldFileName, string newFileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.LibraryRenameGroup(oldFileName, newFileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool LibarySaveAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.LibrarySaveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool SetDrawXyName(IntPtr pXy, string groupName, string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SetDrawXyName(pXy, groupName, newName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RenameSymble(string oldName, string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.RenameSymble(this.pView, oldName, newName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetDrawXyName(IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pNameData = IntPtr.Zero;
|
|
|
|
|
|
int nDataLen = 0;
|
|
|
|
|
|
GeoSigmaLib.GetDrawXyName(pXy, ref pNameData, ref nDataLen);
|
|
|
|
|
|
byte[] btName = new byte[nDataLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pNameData, btName, 0, nDataLen);
|
|
|
|
|
|
string strName = System.Text.Encoding.Default.GetString(btName);
|
|
|
|
|
|
GeoSigmaLib.PointerFree(pNameData);
|
|
|
|
|
|
return strName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool RemoveLibrarySymbol(string filePath, IntPtr pSymbolXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.RemoveLibrarySymbol(filePath, pSymbolXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool RemoveDrawerSymbol(IntPtr pSymbolXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.RemoveDrawerSymbol(this.pView, pSymbolXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ResetSymbol()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ResetSymbol(this.pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static string WriteXy2DFD(IntPtr pxy)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pNameData = IntPtr.Zero;
|
|
|
|
|
|
int nDataLen = 0;
|
|
|
|
|
|
GeoSigmaLib.WriteXy2DFD(pxy, ref pNameData, ref nDataLen);
|
|
|
|
|
|
byte[] btName = new byte[nDataLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pNameData, btName, 0, nDataLen);
|
|
|
|
|
|
string strData = Encoding.Default.GetString(btName);
|
|
|
|
|
|
GeoSigmaLib.PointerFree(pNameData);
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static IntPtr CreateXyFromDFD(string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
IntPtr pXy = IntPtr.Zero;
|
|
|
|
|
|
GeoSigmaLib.CreateXyFromDFD(pBuff, nLen, ref pXy);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return pXy;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取符号列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pathName">符号路径</param>
|
|
|
|
|
|
/// <param name="namesData">符号名称数据</param>
|
|
|
|
|
|
/// <returns>是否成功</returns>
|
|
|
|
|
|
public static bool GetLibrarySymbolNames(string pathName, ref string namesData)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptData = IntPtr.Zero;
|
|
|
|
|
|
int nDataLen = 0;
|
|
|
|
|
|
GeoSigmaLib.GetLibrarySymbolNames(pathName, ref ptData, ref nDataLen);
|
|
|
|
|
|
if (ptData == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
namesData = string.Empty;
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btCurve = new byte[nDataLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)ptData, btCurve, 0, nDataLen);
|
|
|
|
|
|
namesData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
GeoSigmaLib.PointerFree(ptData);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets 图形符号名称.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="namesData">The names data.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool GetDrawerSymbolNames(ref string namesData)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr ptData = IntPtr.Zero;
|
|
|
|
|
|
int nDataLen = 0;
|
|
|
|
|
|
GeoSigmaLib.GetDrawerSymbolNames(this.pView, ref ptData, ref nDataLen);
|
|
|
|
|
|
if (ptData == IntPtr.Zero || nDataLen == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btCurve = new byte[nDataLen];
|
|
|
|
|
|
Marshal.Copy((IntPtr)ptData, btCurve, 0, nDataLen);
|
|
|
|
|
|
namesData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
GeoSigmaLib.PointerFree(ptData);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据符号库路径和符号名称获得符号.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pathName">Name of the path.</param>
|
|
|
|
|
|
/// <param name="symbolName">Name of the symbol.</param>
|
|
|
|
|
|
/// <param name="hMemDC">The h memory dc.</param>
|
|
|
|
|
|
/// <param name="width">The width.</param>
|
|
|
|
|
|
/// <param name="height">The height.</param>
|
|
|
|
|
|
/// <param name="pXy">The p xy.</param>
|
|
|
|
|
|
/// <returns>是否成功</returns>
|
|
|
|
|
|
public static bool LibaryDrawSymbol(string pathName, string symbolName, IntPtr hMemDC, int width, int height, ref IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.LibaryDrawSymbol(pathName, symbolName, hMemDC, width, height, ref pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawerDrawSymbol(string symbolName, IntPtr hMemDC, int width, int height, ref IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return GeoSigmaLib.DrawerDrawSymbol(this.pView, symbolName, hMemDC, width, height, ref pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool LibaryDrawSymbolFill(string pathName, string symbolName, IntPtr hMemDC, int width, int height, ref IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.LibaryDrawSymbolFill(pathName, symbolName, hMemDC, width, height, ref pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawerDrawSymbolFill(string symbolName, IntPtr hMemDC, int width, int height, ref IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return GeoSigmaLib.DrawerDrawSymbolFill(this.pView, symbolName, hMemDC, width, height, ref pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool XyDrawSymbol(IntPtr pXy, IntPtr hdcMem, int width, int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.XyDrawSymbol(pXy, hdcMem, width, height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool CreateLibrarySymbol(string pathName, string symbolName, ref IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CreateLibrarySymbol(pathName, symbolName, ref pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CreateDrawerSymbol(string symbolName, ref IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return GeoSigmaLib.CreateDrawerSymbol(this.pView, symbolName, ref pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool LibraryCopySymbol(string pathName, IntPtr ptrSource, string symbolName, ref IntPtr pSymbolNew)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.LibraryCopySymbol(pathName, ptrSource, symbolName, ref pSymbolNew);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DrawerCopySymbol(IntPtr ptrSource, string symbolName, ref IntPtr pSymbolNew)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DrawerCopySymbol(this.pView, ptrSource, symbolName, ref pSymbolNew);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool DrawerCopyAllSymbol(IntPtr pXySource, IntPtr pXyDest, bool overwrite)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DrawerCopyAllSymbol(pXySource, pXyDest, overwrite);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr GetDocData()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetDocData(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetMark2Data(string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetMark2Data(pView, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetMarkDataSymbol(string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetMarkDataSymbol(pView, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//public void DocBak()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// GeoSigmaLib.DocBak(pView);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
public void DocBak(string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DocBak(pView, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyCurrentFileXy(IntPtr currXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyCurrentFileXy(currXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void SetDocData(IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetDocData(pView, pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CurrDocEditSymbol(IntPtr pXy, string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CurrDocEditSymbol(pView, pXy, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SymbolDocEdit(IntPtr pXy, string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SymbolDocEdit(pView, pXy, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CreateNewSymbol(string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CreateNewSymbol(pView, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DeleteSymbol(string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DeleteSymbol(pView, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RectangleRange()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.RectangleRange(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RectangleRangeSymbol()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.RectangleRangeSymbol(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RectRangeWhite(IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.RectRangeWhite(pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SaveFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SaveFile(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr DeleteRectangleRange()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DeleteRectangleRange(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr DeleteRectFrameSymbol(IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DeleteRectFrameSymbol(pView, pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DeleteRectRange(IntPtr pXy, string markName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DeleteRectRange(pView, pXy, markName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DeleteDocRectRange(IntPtr pXy, string markName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DeleteDocRectRange(pView, pXy, markName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr DelRectBack(IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DelRectBack(pView, pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr CurrentSymbolWindowShow()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CurrentSymbolWindowShow(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr SymbolWindowShow(IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SymbolWindowShow(pView, pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ResetRectBack(IntPtr pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ResetRectBack(pView, pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DrawCircleCurrent()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DrawCircleCurrent(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DrawCircleSymbol()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.DrawCircleSymbol(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SymbolRename(string oldName, string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SymbolRename(pView, oldName, newName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RemoveSymbolLibXy()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.RemoveSymbolLibXy();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopySymbol(string oldName, string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopySymbol(pView, oldName, newName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void LoadSymbolTree(StringBuilder pathList)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.LoadSymbolTree(pathList, pathList.Capacity + 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetZoomMode(int zoomMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetZoomMode(pView, zoomMode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr SaveSymbolOriginal(string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SaveSymbolOriginal(pView, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ReplaceSymbol(string symbolName, IntPtr originalSymbol)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ReplaceSymbol(pView, symbolName, originalSymbol);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 文件操作
|
|
|
|
|
|
|
|
|
|
|
|
public void FileMerge(string filePath, bool onBottom = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileMerge(pView, filePath, onBottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void WellPoleFileMerge(string filePath, bool onBottom = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.WellPoleFileMerge(pView, filePath, onBottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void MultiWellSectionFileMerge(string filePath, bool onBottom = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.MultiWellSectionFileMerge(pView, filePath, onBottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileMergeAfter(string filePath, string layerAfter)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileMergeAfter(pView, filePath, layerAfter);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileMergeBefore(string filePath, string layerBefore)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileMergeBefore(pView, filePath, layerBefore);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 合并图片文件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="fileName">输入文件</param>
|
|
|
|
|
|
/// <param name="onBottom">是否插入到最底层</param>
|
|
|
|
|
|
/// <param name="locationX">起始坐标X</param>
|
|
|
|
|
|
/// <param name="locationY">起始坐标Y</param>
|
|
|
|
|
|
/// <param name="endX">终止坐标X</param>
|
|
|
|
|
|
/// <param name="endY">终止坐标Y</param>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
public void ImageFileMerge(string fileName, bool onBottom,
|
|
|
|
|
|
double locationX, double locationY, double endX, double endY, string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImageFileMerge(pView, fileName, onBottom,
|
|
|
|
|
|
locationX, locationY, endX, endY, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveView(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveView(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveSelect(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveSelect(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool BtnEnable()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.BtnEnable(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSavePoint(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSavePoint(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveCurve(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveCurve(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveSolid(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveSolid(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveText(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveText(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveCleanCurve(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveCleanCurve(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveToXyz(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveToXyz(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FileSaveToMark(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FileSaveToMark(pView, fileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool OnLButtonUpOther(double firstX, double firstY, double lastX, double lastY, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.OnLButtonUpOther(pView, firstX, firstY, lastX, lastY, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void BtnOkSaveMarkToFile(string fileName, string symbolName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.BtnOkSaveMarkToFile(pView, fileName, symbolName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void BtnCancelSaveMarkToFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.BtnCancelSaveMarkToFile(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string InputFile(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
int arrayLen = 0;
|
|
|
|
|
|
arrayLen = GetFileLength(pView, fileName);
|
|
|
|
|
|
byte[] byteOutput = new byte[arrayLen];
|
|
|
|
|
|
int len = GeoSigmaLib.InputFile(pView, fileName, byteOutput);
|
|
|
|
|
|
string content = System.Text.Encoding.Default.GetString(byteOutput, 0, len);
|
|
|
|
|
|
return content;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string InsertChar(int nCharIndex, int nb)
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] byteOutput = new byte[102400];
|
|
|
|
|
|
int len = GeoSigmaLib.InsertChar(pView, nCharIndex, nb, byteOutput);
|
|
|
|
|
|
string content = System.Text.Encoding.Default.GetString(byteOutput, 0, len);
|
|
|
|
|
|
return content;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void GetCaretPos(out POINT point)
|
|
|
|
|
|
{
|
|
|
|
|
|
var flag = GeoSigmaLib.GetCaretPos(out point);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//public void InitDialog()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// GeoSigmaLib.InitDialog(pView);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportData(string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
GeoSigmaLib.ImportData(pView, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportNormalPoint(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportNormalPoint(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportScatterPoint(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportScatterPoint(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportCrossPoint(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportCrossPoint(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportFractionPoint(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportFractionPoint(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportCurve(string importData, string selectType)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportCurve(pView, pBuff, nLen, selectType);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportOffestMethod(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportOffsetMethod(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportAverageFristMethod(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportAverageFirstMethod(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportAverageSecondMethod(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportAverageSecondMethod(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportWellPosition(string importData)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportWellPosition(pView, pBuff, nLen);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ImportWellPath(string importData, string selectType, int nMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
MarshalHelper.Execute(importData, (pBuff, nLen) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ImportWellPath(pView, pBuff, nLen, selectType, nMode);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ExportFiles(string layerName, int nMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (layerName == null || layerName == string.Empty)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int nLen = GeoSigmaLib.ExportFiles(pView, layerName, nMode);
|
|
|
|
|
|
if (nLen < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte[] xmlByteOutput = new byte[nLen];
|
|
|
|
|
|
GeoSigmaLib.MemoCopyExportXml(xmlByteOutput);
|
|
|
|
|
|
string xml = System.Text.Encoding.Default.GetString(xmlByteOutput, 0, nLen);
|
|
|
|
|
|
return xml;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void GetShowSize(ref int width, ref int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetShowSize(pView, ref width, ref height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void UnitChange(int selectIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.UnitChange(pView, selectIndex);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 状态栏获取鼠标移动的坐标信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="x"></param>
|
|
|
|
|
|
/// <param name="y"></param>
|
|
|
|
|
|
/// <param name="mouseXY"></param>
|
|
|
|
|
|
public void GetMouseMoveXY(int x, int y, ref string mouseXY)
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] byteOutput = new byte[1024];
|
|
|
|
|
|
if (pView == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
pView = GeoSigmaLib.CreateView();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int len = GeoSigmaLib.GetCoordinateXY(pView, x, y, byteOutput);
|
|
|
|
|
|
mouseXY = System.Text.Encoding.Default.GetString(byteOutput, 0, len);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public double GetRealDistance(int x1, int y1, int x2, int y2)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetRealDistance(pView, x1, y1, x2, y2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetCurveAngleAndDistance(ref double angle, ref double distance)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetCurveAngleAndDistance(pView, ref angle, ref distance);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_HighLightGraphItem(int mouseX, int mouseY, IntPtr screenHDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Sigma_HighLightGraphItem(pView, mouseX, mouseY, screenHDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//public void EnableCrossLine(bool bEnable)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// GeoSigmaLib.EnableCrossLine(pView, bEnable);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//public bool GetCrossLineEnabledStatus()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return GeoSigmaLib.GetCrossLineEnabledStatus(pView);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
public void Sigma_EndHighLightGraphItem()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Sigma_EndHighLightGraphItem(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Sigma_GetHighLightTip()
|
|
|
|
|
|
{
|
|
|
|
|
|
//string strReturn = string.Empty;
|
|
|
|
|
|
//string strName = string.Empty;
|
|
|
|
|
|
IntPtr pTipInfo = IntPtr.Zero;
|
|
|
|
|
|
int nLength = GeoSigmaLib.Sigma_GetHighLightTip(pView, out pTipInfo);
|
|
|
|
|
|
string strData = ByteToString(pTipInfo, nLength);
|
|
|
|
|
|
//string[] straData = strData.Split(',');
|
|
|
|
|
|
//if (straData != null && straData.Length > 2)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// string[] straNameData = straData[2].Split('=');
|
|
|
|
|
|
// if (straNameData != null && straNameData.Length > 1)
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string ByteToString(IntPtr name, int len)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (len <= 0 || name == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return String.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
len *= 2;
|
|
|
|
|
|
byte[] ba = new byte[len];
|
|
|
|
|
|
Marshal.Copy((IntPtr)name, ba, 0, len);
|
|
|
|
|
|
return System.Text.Encoding.Unicode.GetString(ba);
|
|
|
|
|
|
}
|
|
|
|
|
|
#region 比例尺
|
|
|
|
|
|
public int CreateProportion()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CreateProportion(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeScale(double length)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeScale(pView, length);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeScaleHeight(double height)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeScaleHeight(pView, height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeNumber(int number)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeNumber(pView, number);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//mode 0--普通式 1--现代式 2--流行式
|
|
|
|
|
|
public int Proportion_ChangeShowMode(int mode)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeShowMode(pView, mode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeUnit(int unit)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeUnit(pView, unit);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeColor(int r, int g, int b)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeColor(pView, r, g, b); ;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeTextScale(double scale)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeTextScale(pView, scale);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeAlign(int align)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeAlign(pView, align);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeTextHeight(int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeTextHeight(pView, height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeTextWidth(int width)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeTextWidth(pView, width);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeTextHeightAlone(int alone)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeTextHeightAlone(pView, alone);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Curve_SetName(string curveName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Curve_SetName(pView, curveName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_ChangeCoordinate(double x, double y)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_ChangeCoordinate(pView, x, y);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_Create()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_Create(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Proportion_SetParameter(ProportionData para)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
GeoSigmaLib.Proportion_SetParameter(pView, ref para);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_GetScale()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Proportion_GetScale(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Proportion_GetData(ref ProportionData data)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Proportion_GetData(pView, ref data);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 直角网
|
|
|
|
|
|
public int RectangularCSGrid_Create(ref RectangularCSGridData data, IntPtr hDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.RectangularCSGrid_Create(pView, ref data, hDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int RectangularCSGrid_GetStepAndRange(ref RectangularCSGridData data)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.RectangularCSGrid_GetStepAndRange(pView, ref data);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据坐标范围自动计算坐标网参数,间隔、步长、文字高度、边框厚度
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="left"></param>
|
|
|
|
|
|
/// <param name="bottom"></param>
|
|
|
|
|
|
/// <param name="right"></param>
|
|
|
|
|
|
/// <param name="top"></param>
|
|
|
|
|
|
/// <param name="data"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int GridGetStepAndRange(double left, double bottom, double right, double top, ref RectangularCSGridData data)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GridGetStepAndRange(left, bottom, right, top, ref data);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 画圆弧
|
|
|
|
|
|
//type:0--圆弧 1--弦 2--扇形
|
|
|
|
|
|
public int Arc_SetType(int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Arc_SetType(pView, type);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 绘制文本
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 计算文字图元的显示范围
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="elementData">图元内容</param>
|
|
|
|
|
|
/// <param name="left">左</param>
|
|
|
|
|
|
/// <param name="top">顶</param>
|
|
|
|
|
|
/// <param name="right">右</param>
|
|
|
|
|
|
/// <param name="bottom">底</param>
|
|
|
|
|
|
/// <returns>是否成功</returns>
|
|
|
|
|
|
public int Text_CalculateScreenRect(string elementData, ref double left, ref double top, ref double right, ref double bottom, ref double fontWidth, ref double fontHeight)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(elementData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(elementData);
|
|
|
|
|
|
int nReturn = GeoSigmaLib.Text_CalculateScreenRect(pView, pBuff, nLen, ref left, ref top, ref right, ref bottom, ref fontWidth, ref fontHeight);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return nReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Text_SetTextInfo(ref TextInformation info, IntPtr hDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Text_SetTextInfo(pView, ref info, hDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Text_SetFont(ref LogFont logFont)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Text_SetFont(pView, ref logFont);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Text_GetFont(ref LogFont logFont)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Text_GetFont(pView, ref logFont);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Text_Create(string xmlData)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(xmlData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(xmlData);
|
|
|
|
|
|
GeoSigmaLib.Text_Create(pView, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Sigma_CalculateTextSizeDisplayed(ref double xOut, ref double yOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Sigma_CalculateTextSizeDisplayed(pView, ref xOut, ref yOut);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Sigma_ShowOrHideCurrentText(bool bShow)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.Sigma_ShowOrHideCurrentText(pView, bShow);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Text_GetTextInfo(ref TextInformation pInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Text_GetTextInfo(pView, ref pInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 曲线打断
|
|
|
|
|
|
public int BreakCurve_IsBreaked()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.BreakCurve_IsBreaked(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int BreakCurve_GetSelectCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.BreakCurve_GetSelectCount(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool BreakCurve_ExtendCurveFinished()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.BreakCurve_ExtendCurveFinished(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void BreakCurveDirect_EreasRubberLine(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.BreakCurveDirect_EreasRubberLine(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 删除
|
|
|
|
|
|
public int Delete_SetType(int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Delete_SetType(pView, type);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Delete_GetCountSelected()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Delete_GetCountSelected(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Delete_IsRegionSelected()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Delete_IsRegionSelected(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Sigma_Delete()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Sigma_Delete(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public int ItemCurveProcess_SetType(int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.ItemCurveProcess_SetType(pView, type);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Curve_GetCurvesOfEmptyName(ref BufferAgency buffer)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Curve_GetCurvesOfEmptyName(pView, ref buffer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int ItemCurveProcess_GetResult()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.ItemCurveProcess_GetResult(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int EditCurve_BeginEdit(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.EditCurve_BeginEdit(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int EditCurve_EndEdit(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.EditCurve_EndEdit(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool EditCurve_IsCurveNameMoved()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.EditCurve_IsCurveNameMoved(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 查看导出曲线坐标
|
|
|
|
|
|
public int CurveSelected_GetCountOfCoordinate()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CurveSelected_GetCountOfCoordinate(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetXy_ProjectionIsEmpty()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GetXy_ProjectionIsEmpty(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CurveXY_EXChangeLatLong(ref double x, ref double y)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.CurveXY_EXChangeLatLong(pView, ref x, ref y);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CurveSelected_GetCurveNode(int nodeIndex, ref CurveNode nodeOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CurveSelected_GetCurveNode(pView, nodeIndex, ref nodeOut);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CurveSelected_SaveNodeToCSVFile(string fileFullPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CurveSelected_SaveNodeToCSVFile(pView, fileFullPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//返回值 -3--写入文件失败 -2--打开文件失败 -1--出错 0--没有选中的元素 1--成功
|
|
|
|
|
|
public int FindReplacement_SaveFindAllResult(string fileFullPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_SaveFindAllResult(pView, fileFullPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion 查看导出曲线坐标
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 复制为图像
|
|
|
|
|
|
public int CopyAsImage_SetRange(int left, int right, int top, int bottom, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImage_SetRange(pView, left, right, top, bottom, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CopyAsImageEx_SetRange(int left, int right, int top, int bottom, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImageEx_SetRange(pView, left, right, top, bottom, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImageEx_GetRange(ref double left, ref double right, ref double top, ref double bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImageEx_GetRange(pView, ref left, ref right, ref top, ref bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CopyAsImageEx_GetTrackerHandleCursorType(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImageEx_GetTrackerHandleCursorType(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImageEx_Clear()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImageEx_Clear(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制拖动时的范围框
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="handleIndex"></param>
|
|
|
|
|
|
/// <param name="mouseX"></param>
|
|
|
|
|
|
/// <param name="mouseY"></param>
|
|
|
|
|
|
/// <param name="hdc"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int CopyAsImageEx_TrackHandle(int handleIndex, int mouseX, int mouseY, IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImageEx_TrackHandle(pView, handleIndex, mouseX, mouseY, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CopyAsImageEx_CopyRectToClipboard(double scale)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImageEx_CopyRectToClipboard(pView, scale);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImageEx_SetProportionVisible(bool visible)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImageEx_SetProportionVisible(pView, visible);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImageEx_SetNetGridVisible(bool visible)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImageEx_SetNetGridVisible(pView, visible);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImageEx_SetNetGridParameter(ref RectangularCSGridData data)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImageEx_SetNetGridParameter(pView, ref data);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImageEx_Refresh(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImageEx_Refresh(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CopyAsImageEx_GetPropotion(ref ProportionData data)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImageEx_GetPropotion(pView, ref data);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImageEx_SetPropotion(ref ProportionData data)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImageEx_SetPropotion(pView, ref data);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImage_EraseTrackerForRange(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImage_EraseTrackerForRange(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//区域截屏是否成功 成功返回1 失败返回-1
|
|
|
|
|
|
public int CopyAsImage_IsSuccess()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImage_IsSuccess(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CopyAsImage_GetTrackerHandleCursorType(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImage_GetTrackerHandleCursorType(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CopyAsImage_CopyWindow(int left, int right, int top, int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImage_CopyWindow(pView, left, right, top, bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CopyAsImage_CopyAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CopyAsImage_CopyAll(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 选择
|
|
|
|
|
|
public int SelectSetCursor(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nHandle = -1;
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
GeoSigmaLib.SelectSetCursor(pView, mouseX, mouseY, ref nHandle);
|
|
|
|
|
|
return nHandle;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_GetKindOfSelectedElement()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Select_GetKindOfSelectedElement(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//public int Select_GetCountSelected()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (pView == null)
|
|
|
|
|
|
// return -1;
|
|
|
|
|
|
|
|
|
|
|
|
// return GeoSigmaLib.Select_GetCountSelected(pView);
|
|
|
|
|
|
//}
|
|
|
|
|
|
public bool SelectIsOnMoving()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectIsOnMoving(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void SelectMoveElementsTo(int x, int y)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SelectMoveElementsTo(this.pView, x, y);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SelectGetTrackerRect(ref int left, ref int top, ref int right, ref int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SelectGetTrackerRect(pView, ref left, ref top, ref right, ref bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SelectDrawTrackPath(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SelectDrawTrackPath(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectStatusChanged()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
return GeoSigmaLib.SelectStatusChanged(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectIsSameType()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
return GeoSigmaLib.SelectIsSameType(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectGetElement(ref string elementData, ref long position, bool allContent = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SelectGetElementInner(pView, ref elementData, ref position, true, allContent);
|
|
|
|
|
|
/* 仅从选中图元中获得数据
|
|
|
|
|
|
long pCurve = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
//Select_GetElementByPosition
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SelectGetElement(pView, ref pCurve, ref dataLength, ref position);
|
|
|
|
|
|
if (bSuccess != true) return false;
|
|
|
|
|
|
if (dataLength == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
elementData = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] btCurve = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pCurve, btCurve, 0, dataLength);
|
|
|
|
|
|
elementData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
*/
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据图元的索引获得图元数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="position">位置索引</param>
|
|
|
|
|
|
/// <returns>图元数据</returns>
|
|
|
|
|
|
public string GetElementByPosition(long position, bool allContent = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (position <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string strElementData = string.Empty;
|
|
|
|
|
|
long lpDataBuffer = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.Select_GetElementByPosition(pView, ref lpDataBuffer, ref dataLength, position, allContent);
|
|
|
|
|
|
if (bSuccess != true)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (dataLength > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] btCurve = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)lpDataBuffer, btCurve, 0, dataLength);
|
|
|
|
|
|
strElementData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
|
|
|
|
|
|
PointerFree((IntPtr)lpDataBuffer);
|
|
|
|
|
|
}
|
|
|
|
|
|
return strElementData;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得范围内的图元
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="borderPos">边界数据指针</param>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
/// <param name="elementType">图元类型</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string GetElementsByRange(long borderPos, string layerName, int elementType)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerData drawer = new DrawerData(this.GetDrawerXy());
|
|
|
|
|
|
return drawer.GetElementsByRange(borderPos, layerName, elementType);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得指定坐标的图元数据.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="locationX">The mouse x.</param>
|
|
|
|
|
|
/// <param name="locationY">The mouse y.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string GetElementByLocation(int locationX, int locationY)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strElementData = string.Empty;
|
|
|
|
|
|
long lpDataBuffer = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.GetElementByLocation(pView, ref lpDataBuffer, ref dataLength, locationX, locationY);
|
|
|
|
|
|
if (bSuccess != true)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (dataLength > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] btCurve = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)lpDataBuffer, btCurve, 0, dataLength);
|
|
|
|
|
|
strElementData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
|
|
|
|
|
|
PointerFree((IntPtr)lpDataBuffer);
|
|
|
|
|
|
}
|
|
|
|
|
|
return strElementData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectGetPointsZRange(ref double zMin, ref double zMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectGetPointsZRange(pView, ref zMin, ref zMax);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectSetPointsColor(string colorData, double dWidth, double dHeight)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectSetPointsColor(this.pView, colorData, dWidth, dHeight);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetPointsZRange(ref double zMin, ref double zMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetPointsZRange(pView, ref zMin, ref zMax);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SetPointsColor(string colorData, double dWidth, double dHeight)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SetPointsColor(this.pView, colorData, dWidth, dHeight);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SelectGetCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectGetCount(this.pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectIsElementLocationChanged()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_IsElementLocationChanged(this.pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得选中图元的类型
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>图元类型</returns>
|
|
|
|
|
|
public int SelectGetElementType()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectGetElementType(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_GetElementByPosition(ref string elementData, long position, bool allContent = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SelectGetElementInner(pView, ref elementData, ref position, false, allContent);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool SelectGetElementInner(IntPtr pView, ref string elementData, ref long position, bool isSelected, bool allContent)
|
|
|
|
|
|
{
|
|
|
|
|
|
long pCurve = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
bool bSuccess = false;
|
|
|
|
|
|
if (isSelected)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 仅从已选中的图元中获得数据
|
|
|
|
|
|
bSuccess = GeoSigmaLib.SelectGetElement(pView, ref pCurve, ref dataLength, ref position, allContent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bSuccess = GeoSigmaLib.Select_GetElementByPosition(pView, ref pCurve, ref dataLength, position, allContent);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (bSuccess != true) return false;
|
|
|
|
|
|
if (dataLength == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
elementData = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] btCurve = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pCurve, btCurve, 0, dataLength);
|
|
|
|
|
|
elementData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
PointerFree((IntPtr)pCurve);
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得所有选择的图元数据.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="elementsData">The elements data.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool SelectGetElements(ref string elementsData)
|
|
|
|
|
|
{
|
|
|
|
|
|
long pData = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.Select_GetElements(pView, ref pData, ref dataLength);
|
|
|
|
|
|
if (dataLength == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btData = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pData, btData, 0, dataLength);
|
|
|
|
|
|
elementsData = System.Text.Encoding.Default.GetString(btData);
|
|
|
|
|
|
PointerFree((IntPtr)pData);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得选中图元的指针.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="positions">The positions.</param>
|
|
|
|
|
|
/// <returns>An int.</returns>
|
|
|
|
|
|
public int SelectGetElementPositions(out long[] positions)
|
|
|
|
|
|
{
|
|
|
|
|
|
int dataLen = 0;
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SelectGetElementPositions(pView, out IntPtr pPos, ref dataLen);
|
|
|
|
|
|
if (bSuccess == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
positions = null;
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
positions = new long[dataLen];
|
|
|
|
|
|
Marshal.Copy(pPos, positions, 0, dataLen);
|
|
|
|
|
|
PointerArrayDelete(pPos);
|
|
|
|
|
|
return dataLen;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择范围内包含的图元
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int SelectInCurveRange()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 读取选取面积百分比因子
|
|
|
|
|
|
//DrawerGlobalConfig globalConfig = DrawerGlobalConfig.Instance;
|
|
|
|
|
|
//if (globalConfig == null)
|
|
|
|
|
|
// return 0;
|
|
|
|
|
|
//double value1 = globalConfig.RangSelectNode.AreaFactor;
|
|
|
|
|
|
//int value2 = 100;
|
|
|
|
|
|
double dExten = DrawerConfig.Instance.FindConfigValue<double>("SelectRange", "Extension", 100);
|
|
|
|
|
|
|
|
|
|
|
|
// 当选项面积因子等于1时,全包含选择
|
|
|
|
|
|
if (Math.Abs(dExten - 100) < 0.01)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectInCurveRange(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
double factor = Math.Round(dExten / 100f, 2);
|
|
|
|
|
|
//面积因子大于1,不正确设置不计算
|
|
|
|
|
|
if (factor > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else //面积因子小于1,按相交面积因子选择
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectInCurveRangeEx(pView, factor);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择范围内包含的图元
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int SelectInCurveRange(DrawElementType elementType)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 读取选取面积百分比因子
|
|
|
|
|
|
DrawerGlobalConfig globalConfig = DrawerGlobalConfig.Instance;
|
|
|
|
|
|
if (globalConfig == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
int value1 = globalConfig.RangSelectNode.AreaFactor;
|
|
|
|
|
|
int value2 = 100;
|
|
|
|
|
|
// 当选项面积因子等于1时,全包含选择
|
|
|
|
|
|
if (value1.Equals(value2))
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectTypeInCurveRange(pView, (int)elementType);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
double factor = Math.Round(globalConfig.RangSelectNode.AreaFactor / 100f, 2);
|
|
|
|
|
|
//面积因子大于1,不正确设置不计算
|
|
|
|
|
|
if (factor > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else //面积因子小于1,按相交面积因子选择
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectTypeInCurveRangeEx(pView, (int)elementType, factor);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SelectSamePropertyElements()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectSamePropertyElements(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SelectSetTypes(int[] types)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Select_SetTypes(pView, types, types.Length);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectWriteTemplate(string outputFile)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_WriteTemplate(pView, outputFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置选中元素的数据和样式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="elementData"></param>
|
|
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool SelectSetElement(string elementData, long position, bool state = true, double zmin = 0, double zmax = 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (position < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(elementData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(elementData);
|
|
|
|
|
|
|
|
|
|
|
|
bool bReturn = GeoSigmaLib.SelectSetElement(pView, pBuff, nLen, position, state, zmin, zmax);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置元素可见性
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="visible">是否可见</param>
|
|
|
|
|
|
/// <param name="position">元素的索引</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool SetElementVisibility(bool visible, long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bReturn = GeoSigmaLib.SetElementVisibility(pView, position, visible);
|
|
|
|
|
|
return bReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectRemoveCurveStyle(long position, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null) return false;
|
|
|
|
|
|
|
|
|
|
|
|
bool bReturn = GeoSigmaLib.SelectRemoveCurveStyle(pView, position, index);
|
|
|
|
|
|
|
|
|
|
|
|
return bReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectRemovePointStyle(long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null) return false;
|
|
|
|
|
|
|
|
|
|
|
|
bool bReturn = GeoSigmaLib.SelectRemovePointStyle(pView, position);
|
|
|
|
|
|
|
|
|
|
|
|
return bReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectMoveUpCurveStyle(long position, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null) return false;
|
|
|
|
|
|
|
|
|
|
|
|
bool bReturn = GeoSigmaLib.SelectMoveUpCurveStyle(pView, position, index);
|
|
|
|
|
|
|
|
|
|
|
|
return bReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectMoveDownCurveStyle(long position, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null) return false;
|
|
|
|
|
|
|
|
|
|
|
|
bool bReturn = GeoSigmaLib.SelectMoveDownCurveStyle(pView, position, index);
|
|
|
|
|
|
|
|
|
|
|
|
return bReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectCreateCurveStyle(long position, CurveStyleType type, string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SelectCreateCurveStyle(pView, position, (int)type, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectCreatePointStyle(long position, string data)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(data);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(data);
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SelectCreatePointStyle(pView, position, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
//public int TransformSelection(int nFlags, int pointX, int pointY, int handle)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return GeoSigmaLib.TransformSelection(pView, nFlags, pointX, pointY, handle);
|
|
|
|
|
|
//}
|
|
|
|
|
|
public bool SelectGetLayerNames(out string layers)
|
|
|
|
|
|
{
|
|
|
|
|
|
long pData = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SelectGetLayerNames(pView, ref pData, ref dataLength);
|
|
|
|
|
|
if (dataLength == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
layers = string.Empty;
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btData = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pData, btData, 0, dataLength);
|
|
|
|
|
|
layers = System.Text.Encoding.Default.GetString(btData);
|
|
|
|
|
|
|
|
|
|
|
|
PointerArrayDelete((IntPtr)pData);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectGetLayerName(long position, out string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
var sb = new StringBuilder(1024);
|
|
|
|
|
|
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.SelectGetLayerName(pView, position, sb, sb.Capacity + 1);
|
|
|
|
|
|
|
|
|
|
|
|
layer = $@"Layer:\{sb}";
|
|
|
|
|
|
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SelectSetLayerByName(long position, string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectSetLayerByName(pView, position, layer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将选中的图元改到新的图层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layer">图层名</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool SelectChangeToLayer(string layer)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectChangeToLayer(pView, layer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择指定名称的图元,可以是多个名称,以逗号分隔
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="nameData">名称数据</param>
|
|
|
|
|
|
/// <returns>选中数量</returns>
|
|
|
|
|
|
public int Select_ByNames(string nameData)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_ByNames(pView, nameData);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_SelectAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Select_SelectAll(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_ClearAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
return GeoSigmaLib.Select_ClearAll(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_SelectAllByKind(int kind)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Select_SelectAllByKind(pView, kind);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统计选中的点数量
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int Select_PointCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Select_PointCount(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Select_ReloadTrack()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Select_ReloadTrack(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_EnableTracker(int bEnable)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_EnableTracker(pView, bEnable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_SelectOneGraph(long position)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_SelectOneGraph(pView, position);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 创建组
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public long Select_CreateGroup()
|
|
|
|
|
|
{
|
|
|
|
|
|
long pos = 0;
|
|
|
|
|
|
GeoSigmaLib.Select_CreateGroup(pView, ref pos);
|
|
|
|
|
|
return pos;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_UngroupAll(ref int layerCount)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_UngroupAll(pView, ref layerCount);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_SaveSelectKml(long position, string path)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_SaveSelectKml(this.pView, position, path);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_DisperseMetaEmf(long position, long timestamp)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_DisperseMetaEmf(pView, position, timestamp);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_ReplaceMesh(string meshFile, long oldMeshPos, ref long newMeshPos)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_ReplaceMesh(pView, meshFile, oldMeshPos, ref newMeshPos);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool HasMeshState(long oldMeshPos)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.HasMeshState(pView, oldMeshPos);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_CreateMeshColorBar([In] ColorPoint[] colorPoints, int length, string colorPath, string xmlPath, double minz, double maxz)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_CreateMeshColorBar(pView, colorPoints, length, colorPath, xmlPath, minz, maxz);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_CreateColorBarData(long oldMeshPos, [Out] ColorPoint[] colorPoints, int numColors,
|
|
|
|
|
|
ref int vSize, double zmin, double zmax, int colorType, int sortType)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_CreateColorBarData(pView, oldMeshPos, colorPoints,
|
|
|
|
|
|
numColors, ref vSize, zmin, zmax, colorType, sortType);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_CreateReplaceMesh(long lstImagePos, ref long newMeshPos, int colorNum, double gridZmin, double gridZmax,
|
|
|
|
|
|
int numX, int numY, double dLocationX, double dLocationY , double dDeltX, double dDeltY, double dMaxX, double dMaxY,
|
|
|
|
|
|
[In] ColorPoint[] colorPoints, [In] ColorPoint[] colorListPoints, int colorListNum)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_CreateReplaceMesh(pView, lstImagePos, ref newMeshPos,
|
|
|
|
|
|
colorNum, gridZmin, gridZmax,
|
|
|
|
|
|
numX, numY, dLocationX, dLocationY, dDeltX, dDeltY, dMaxX, dMaxY, colorPoints, colorListPoints, colorListNum);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Select_ReselectByPosition(long posNew)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Select_ReselectByPosition(pView, posNew);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetSelectedNames()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.GetSelectedNames(pView);
|
|
|
|
|
|
string result = Marshal.PtrToStringUni(ptr);
|
|
|
|
|
|
Marshal.FreeBSTR(ptr);
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 生成龟背图.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>生成块数</returns>
|
|
|
|
|
|
public int CreateVoronoi()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.VoronoiCreateMap(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 生成三角网
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>生成块数</returns>
|
|
|
|
|
|
public int CreateDelaunay()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.DelaunayCreateMap(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 抽稀
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="minSpacing">最小间距</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int SimplifySelectPoints(double minSpacing)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SimplifySelectPoints(pView, minSpacing);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得图层的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName">图层名称</param>
|
|
|
|
|
|
/// <param name="elementsData">图层数据</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool GetDataByLayer(string layerName, ref string elementsData)
|
|
|
|
|
|
{
|
|
|
|
|
|
long pData = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
GeoSigmaLib.GetDataByLayer(pView, layerName, ref pData, ref dataLength);
|
|
|
|
|
|
if (dataLength == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
byte[] btData = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)pData, btData, 0, dataLength);
|
|
|
|
|
|
elementsData = System.Text.Encoding.Default.GetString(btData);
|
|
|
|
|
|
PointerFree((IntPtr)pData);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int RenameElement(string oldName, string newName, string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.RenameElement(pView, oldName, newName, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int ResetCurveStyle(string curveName, string layerName, int type, string styleData)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(styleData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(styleData);
|
|
|
|
|
|
int nCount = GeoSigmaLib.ResetCurveStyle(pView, curveName, layerName, type, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return nCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Alignment_Align(int alignmentType)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Alignment_Align(pView, alignmentType);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int DisplayOrder_Set(int order)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.DisplayOrder_Set(pView, order);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int HorizontalMirror()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.HorizontalMirror(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int VerticalMirror()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.VerticalMirror(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int TestMouseMove(IntPtr hdcMem, int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.TestMouseMove(pView, hdcMem, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int ItemSelectElement_GetCountSelected()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.ItemSelectElement_GetCountSelected(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_HightLightFirstCurve(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Select_HightLightFirstCurve(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 打印
|
|
|
|
|
|
public int GeoSigma_Print(IntPtr hdc, int left, int top, int right, int bottom)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_Print(pView, hdc, left, top, right, bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetViewFactors(ref ViewFactor factorsOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GetViewFactors(pView, ref factorsOut);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SetViewFactor(double offsetX, double offsetY, double zoomFactor)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.SetViewFactors(pView, offsetX, offsetY, zoomFactor);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SetViewScreenFactors(double offsetX, double offsetY, double zoomFactor)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
return GeoSigmaLib.SetViewScreenFactors(pView, offsetX, offsetY, zoomFactor);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_SetPageMargins(int topPageMargin, int bottomPageMargin, int leftPageMargin, int rightPageMargin)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.GeoSigma_SetPageMargins(pView, topPageMargin, bottomPageMargin, leftPageMargin, rightPageMargin);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_GetPageMargins(out int top, out int bottom, out int left, out int right)
|
|
|
|
|
|
{
|
|
|
|
|
|
top = bottom = left = right = 0;
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.GeoSigma_GetPageMargins(pView, out top, out bottom, out left, out right);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int PreviewPrint_Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.PreviewPrint_Start(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int PreviewPrint_End()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.PreviewPrint_End(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Print_ViewMouseDown(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Print_ViewMouseDown(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Print_ViewMouseMove(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Print_ViewMouseMove(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Print_ViewMouseUp(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Print_ViewMouseUp(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Print_ViewAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Print_ViewAll(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Print_SetScreenRect(int width, int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Print_SetScreenRect(pView, width, height);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Print_GetNumberOfPartition(out int row, out int col, int overlapWidth)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Print_GetNumberOfPartition(pView, out row, out col, overlapWidth);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Print_Part(ref PrintPartition partition)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Print_Part(pView, ref partition);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
public int SetCustomDPI(double dpi)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
return GeoSigmaLib.SetCustomDPI(pView, dpi);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int OffsetPix(int offsetX, int offsetY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.OffsetPix(pView, offsetX, offsetX);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetXYScale(out double xsOut, out double ysOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
xsOut = ysOut = 0;
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GetXYScale(pView, out xsOut, out ysOut);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SetXYScale(double xs, double ys)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.SetXYScale(pView, xs, ys);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetXYUnit(out int xUnitOut, out int yUnitOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
xUnitOut = yUnitOut = 0;
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GetXYUnit(pView, out xUnitOut, out yUnitOut);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int SetXYUnit(int xUnit, int yUnit)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.SetXYUnit(pView, xUnit, yUnit);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 符号
|
|
|
|
|
|
|
|
|
|
|
|
public bool MarkLoopName(StringBuilder idList, StringBuilder nameList)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MarkLoopName(pView, idList, idList.Capacity + 1, nameList, nameList.Capacity + 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void MarkLoopName(string markId, string markName)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool MarkLibraryLoopName(StringBuilder pathList)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MarkLibraryLoopName(pathList, pathList.Capacity + 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool MarkLibraryLoopMark(string path, StringBuilder idList, StringBuilder nameList)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MarkLibraryLoopMark(path, idList, idList.Capacity + 1, nameList, nameList.Capacity + 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool MarkCopyLibraryToDocument(string id)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MarkCopyLibraryToDocument(pView, id);
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool MarkLibraryDrawByName(string id, IntPtr dc, int cx, int cy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MarkLibraryDrawByName(id, dc, cx, cy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool MarkDrawByName(string id, IntPtr dc, int cx, int cy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MarkDrawByName(pView, id, dc, cx, cy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static bool MarkLibraryNewSymbol(string id, IntPtr dc, int cx, int cy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.MarkLibraryNewSymbol(id, dc, cx, cy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int Select_EreaseTracker(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Select_EreaseTracker(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 编辑曲线节点
|
|
|
|
|
|
public int CurveEditNode_Draw(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CurveEditNode_Draw(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CurveEditNode_EreaseHandles(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CurveEditNode_EreaseHandles(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//在编辑状态下,返回光标下曲线节点的序号 。出错返回-1。
|
|
|
|
|
|
public int CurveEditNode_GetNodeSelected(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CurveEditNode_GetNodeSelected(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CurveEditNode_AddNode(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CurveEditNode_AddNode(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CurveEditNode_DeleteNode(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CurveEditNode_DeleteNode(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-1出错 1 默认光标 2 添加光标 3 移动光标
|
|
|
|
|
|
public int CurveEditNode_GetCursorTpye(int mouseX, int mouseY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CurveEditNode_GetCursorTpye(pView, mouseX, mouseY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CurveEditNode_GetCountOfNode()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CurveEditNode_GetCountOfNode(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除范围内节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="enable">是否删除范围内节点</param>
|
|
|
|
|
|
public void CurveEditNode_EnableMulDelete(bool enable)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CurveEditNode_EnableMulDelete(pView, enable);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 设置投影参数
|
|
|
|
|
|
public int Projection_GetParameter(ref SigmaProjectionParameter para)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Projection_GetParameter(pView, ref para);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Projection_GetDefaultParameter(ref SigmaProjectionParameter para)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
return GeoSigmaLib.Projection_GetDefaultParameter(pView, ref para);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Projection_SetParameter(SigmaProjectionParameter para)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
return GeoSigmaLib.Projection_SetParameter(pView, para);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Projection_Change(ref SigmaProjectionParameter para)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
return GeoSigmaLib.Projection_Change(pView, ref para);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Projection_GetOtherStr(ref SigmaProjectionParameter para, byte[] other)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Projection_GetOtherStr(pView, ref para, other);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Projection_GetProjectString(ref SigmaProjectionParameter para, byte[] projectByts)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Projection_GetProjectString(pView, ref para, projectByts);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Projection_FillOtherParameter(ref SigmaProjectionParameter para, string otherString)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Projection_FillOtherParameter(pView, ref para, otherString);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Projection_IsEmpty()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (GeoSigmaLib.Projection_IsEmpty(pView) == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_ExchangeXY()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_ExchangeXY(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_ScaleFont(bool bBig)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
int flag = 0;
|
|
|
|
|
|
if (bBig == true)
|
|
|
|
|
|
flag = 1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_ScaleFont(pView, flag);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 曲线处理
|
|
|
|
|
|
public int DrawerCurveConnect(string layerName, bool deleteOrignalCurves)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
return GeoSigmaLib.DrawerCurveConnect(pView, layerName, deleteOrignalCurves);
|
|
|
|
|
|
}
|
|
|
|
|
|
public int Curve_IncreaseDensityNode(int mode, double step, int rounding)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Curve_IncreaseDensityNode(pView, mode, step, rounding);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Curve_Redundance(double tolerance)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Curve_Redundance(pView, tolerance);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Curve_Smooth(int mode, double step)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Curve_Smooth(pView, mode, step);
|
|
|
|
|
|
}
|
|
|
|
|
|
public int Curve_AutoJoin(double maxError, bool onlySameName = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Curve_AutoJoin(pView, maxError, onlySameName);
|
|
|
|
|
|
}
|
|
|
|
|
|
public int Curve_ArcToCurve(double step)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Curve_ArcToCurve(pView, step);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 外切内切
|
|
|
|
|
|
public int Cut_CutOutByRect()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Cut_CutOutByRect(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Cut_CutInByRect()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Cut_CutInByRect(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CutOut_GetCountOfPickup()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CutOut_GetCountOfPickup(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int CutIn_GetCountOfPickup()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CutIn_GetCountOfPickup(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public int Surface_CalculateVolume(int mouseX, int mouseY, int mode, out double z, out double volume)
|
|
|
|
|
|
{
|
|
|
|
|
|
z = volume = 0;
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Surface_CalculateVolume(pView, mouseX, mouseY, mode, out z, out volume);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Surface_SetZValue(int mouseX, int mouseY, int zMode, double zIn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Surface_SetZValue(pView, mouseX, mouseY, zMode, zIn);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SurfaceGetInfo(long elementPtr, ref int numX, ref int numY
|
|
|
|
|
|
, ref double dLocationX, ref double dLocationY, ref double dDeltX, ref double dDeltY, ref double maxX, ref double maxY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SurfaceGetInfo(pView, elementPtr
|
|
|
|
|
|
, ref numX, ref numY, ref dLocationX, ref dLocationY
|
|
|
|
|
|
, ref dDeltX, ref dDeltY, ref maxX, ref maxY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool SurfaceGetImageInfo(long elementPtr, ref int numX, ref int numY
|
|
|
|
|
|
, ref double dLocationX, ref double dLocationY, ref double dDeltX, ref double dDeltY, ref double maxX, ref double maxY)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SurfaceGetImageInfo(pView, elementPtr
|
|
|
|
|
|
, ref numX, ref numY, ref dLocationX, ref dLocationY
|
|
|
|
|
|
, ref dDeltX, ref dDeltY, ref maxX, ref maxY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int Coordinate_ChangeByExpression(int operationObjectKind, string xExpression, string yExpression, string zExpression, string lExpression)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.Coordinate_ChangeByExpression(pView, operationObjectKind, xExpression, yExpression, zExpression, lExpression);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region UndoRedo
|
|
|
|
|
|
public int GeoSigma_Undo(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_Undo(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_Redo(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.pView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_Redo(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GeoSigma_CanUndo()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
if (GeoSigmaLib.GeoSigma_CanUndo(pView) != -1)
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GeoSigma_CanRedo()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
if (GeoSigmaLib.GeoSigma_CanRedo(pView) != -1)
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public void SigmaView_ShowBKGrid(int bShow)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SigmaViewShowBKGrid(pView, bShow);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除重复图元
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="option">去重选项配置,xml 字符串</param>
|
|
|
|
|
|
public void XyDeleteDupElements(string option)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.XyDeleteDupElements(pView, option);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 个性的批量处理方式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="idea">方式</param>
|
|
|
|
|
|
public void PointProcessSetIdea(int idea)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.PointProcessSetIdea(pView, idea);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int PointProcessGetCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.PointProcessGetCount(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void PointProcessSetStyle(string pointStyle)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(pointStyle);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(pointStyle);
|
|
|
|
|
|
GeoSigmaLib.PointProcessSetStyle(pView, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CurveProcessSetStyle(string curveStyle)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(curveStyle);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(curveStyle);
|
|
|
|
|
|
GeoSigmaLib.CurveProcessSetStyle(pView, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool ElementProperty_GetSimpleProperty(out string propertyString)
|
|
|
|
|
|
{
|
|
|
|
|
|
propertyString = "";
|
|
|
|
|
|
IntPtr nativeStr = IntPtr.Zero;
|
|
|
|
|
|
int len = GeoSigmaLib.ElementProperty_GetSimpleProperty(pView, out nativeStr);
|
|
|
|
|
|
if (len <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
len *= 2; //获得字符串是Unicode字符串 而byte的大小为8个bit 所以数组的长度要乘以2
|
|
|
|
|
|
byte[] propertyBuf = new byte[len];
|
|
|
|
|
|
Marshal.Copy(nativeStr, propertyBuf, 0, len);
|
|
|
|
|
|
propertyString = System.Text.Encoding.Unicode.GetString(propertyBuf);
|
|
|
|
|
|
GeoSigmaLib.ElementProperty_ReleaseString(nativeStr);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Sigma_LayerSort(bool enable)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Sigma_LayerSort(pView, enable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 查找和替换
|
|
|
|
|
|
|
|
|
|
|
|
public void FindReplacement_Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FindReplacement_Start(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Finds the replacement find next.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="findContent">Content of the find.</param>
|
|
|
|
|
|
/// <param name="bMatch">The b match.</param>
|
|
|
|
|
|
/// <param name="bCapitalLower">是否区分大小写.</param>
|
|
|
|
|
|
/// <param name="elementType">图元类型,点、线等.</param>
|
|
|
|
|
|
/// <param name="onlyEditable">if set to <c>true</c> [只查找可写图元].</param>
|
|
|
|
|
|
/// <returns>1--出错 0--找到了 1--第一次查找 但没找到 2--已经搜索完了 </returns>
|
|
|
|
|
|
public int FindReplacement_FindNext(string findContent, int bMatch, int bCapitalLower, int elementType = 0, bool onlyEditable = true)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_FindNext(pView, findContent, bMatch, bCapitalLower, elementType, onlyEditable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获得查找到图元的指针.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public long FindReplace_GetCurrentPostion()
|
|
|
|
|
|
{
|
|
|
|
|
|
long lPos = 0;
|
|
|
|
|
|
int nReturn = GeoSigmaLib.FindReplace_GetCurrentPostion(pView, ref lPos);
|
|
|
|
|
|
return lPos;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int FindReplacement_Draw(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_Draw(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int FindReplacement_FindAll(string findContent, int bMatch, int bCapitalLower)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_FindAll(pView, findContent, bMatch, bCapitalLower);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int FindReplacement_ReplaceAll(string strFind, string strReplace, int bMatch, int bCapitalLower)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_ReplaceAll(pView, strFind, strReplace, bMatch, bCapitalLower);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 替换功能.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="strFind">The string find.</param>
|
|
|
|
|
|
/// <param name="strReplace">The string replace.</param>
|
|
|
|
|
|
/// <param name="bMatch">全字匹配.</param>
|
|
|
|
|
|
/// <param name="bCapitalLower">区分大小写.</param>
|
|
|
|
|
|
/// <returns>1--异常 0--替换失败 1--替换成功</returns>
|
|
|
|
|
|
public int FindReplacement_Replace(string strFind, string strReplace, int bMatch, int bCapitalLower)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_Replace(pView, strFind, strReplace, bMatch, bCapitalLower);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int ActiveElementByName(string elementName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.ActiveElementByName(this.pView, elementName, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int FindReplacement_GetCountOfElement()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_GetCountOfElement(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int FindReplacement_GetElementInfo(int index, ref ElementInfo eleInfoOut)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.FindReplacement_GetElementInfo(pView, index, ref eleInfoOut);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void FindReplacement_ReleaseNativeMemoryOfElementInfo(ref ElementInfo eleInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.FindReplacement_ReleaseNativeMemoryOfElementInfo(ref eleInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
//Sigma_MathFind(IntPtr pView, int kind, double step, double remainder, int start, out IntPtr elementsContentBuffer);
|
|
|
|
|
|
public bool Sigma_MathFind(MathFindKind operaKind, double step, double remainder, int start, out string elementsString)
|
|
|
|
|
|
{
|
|
|
|
|
|
elementsString = "";
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr elementsContentBuffer = IntPtr.Zero;
|
|
|
|
|
|
int len = GeoSigmaLib.Sigma_MathFind(pView, (int)operaKind, step, remainder, start, out elementsContentBuffer);
|
|
|
|
|
|
if (len <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
elementsString = ByteDefaultToString(elementsContentBuffer, len);
|
|
|
|
|
|
GeoSigmaLib.Sigma_ReleaseNativeMemory(elementsContentBuffer);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查找点图元.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="elementName">Name of the element.</param>
|
|
|
|
|
|
/// <param name="x">The x.</param>
|
|
|
|
|
|
/// <param name="y">The y.</param>
|
|
|
|
|
|
/// <param name="layerName">图层名称,为空时忽略该条件。</param>
|
|
|
|
|
|
/// <returns>图元的索引</returns>
|
|
|
|
|
|
public long FindPointByInfo(string elementName, double x, double y, string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
long pos = 0;
|
|
|
|
|
|
GeoSigmaLib.FindPointByInfo(pView, ref pos, elementName, x, y, layerName);
|
|
|
|
|
|
return pos;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 全局变量
|
|
|
|
|
|
public double Global_GetExtendLength()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Global_GetExtendLength();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Global_SetExtendLength(double len)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Global_SetExtendLength(len);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void GetGridStep(ref double xStep, ref double yStep)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.GetGridStep(this.pView, ref xStep, ref yStep);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetGridStep(double xStep, double yStep)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetGridStep(this.pView, xStep, yStep);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 批量处理
|
|
|
|
|
|
public void GeoSigma_StartToCutImage(ref CutImageInfo ciInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.GeoSigma_StartToCutImage(pView, ref ciInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_StopCutImage()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_StopCutImage(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_GetIndexOfFileByCutImage()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_GetIndexOfFileByCutImage(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_StartToFileTransformer(ref FileTransformationInfo ftInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_StartToFileTransformer(pView, ref ftInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_StopFileTransformer()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_StopFileTransformer(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GeoSigma_GetIndexOfFileByFileTransformer()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == null)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.GeoSigma_GetIndexOfFileByFileTransformer(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//private string ByteToString(IntPtr byteBuffer, int len)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (len <= 0)
|
|
|
|
|
|
// return "";
|
|
|
|
|
|
|
|
|
|
|
|
// len *= 2;
|
|
|
|
|
|
// byte[] ba = new byte[len];
|
|
|
|
|
|
// Marshal.Copy((IntPtr)byteBuffer, ba, 0, len);
|
|
|
|
|
|
// return System.Text.Encoding.Unicode.GetString(ba);
|
|
|
|
|
|
//}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加地震剖面
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="elementData"></param>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public long SectionAddNew(string elementData, float[] values, string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(elementData);
|
|
|
|
|
|
int nPropLen = Encoding.Default.GetByteCount(elementData);
|
|
|
|
|
|
IntPtr pData = Marshal.UnsafeAddrOfPinnedArrayElement(values, 0);
|
|
|
|
|
|
long pos = GeoSigmaLib.SectionAddNew(pView, pBuff, nPropLen, pData, values.Length, layerName);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return pos;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除一个剖面
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pos"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool SectionDelete(long pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SectionDelete(pView, pos);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除所有地震剖面
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
public void SectiongDeleteAll(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SectionDeleteAll(pView, layerName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据 position 删除元素,这个要比根据层名和图元名更准确一点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="position">position数组</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int DeleteElement(long[] position)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SigmaDeleteElementByPosition(pView, position, position.Length);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除图元
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layerName"></param>
|
|
|
|
|
|
/// <param name="eleName"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int DeleteElement(string layerName, string eleName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SigmaDeleteElement(pView, layerName, eleName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int DeletePoint(string layerName, string eleName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SigmaDeletePoint(pView, layerName, eleName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string ByteDefaultToString(IntPtr byteBuffer, int len)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (len <= 0)
|
|
|
|
|
|
return "";
|
|
|
|
|
|
|
|
|
|
|
|
byte[] ba = new byte[len];
|
|
|
|
|
|
Marshal.Copy((IntPtr)byteBuffer, ba, 0, len);
|
|
|
|
|
|
return System.Text.Encoding.Default.GetString(ba);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaXY geoSig = new GeoSigmaXY();
|
|
|
|
|
|
geoSig.pView = this.pView;
|
|
|
|
|
|
return geoSig;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public long SelectGetPolygon()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectGetPolygon(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CopyAsImagePolygon_SetSelectedPolygon(long polygonPosition)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.CopyAsImagePolygon_SetSelectedPolygon(pView, polygonPosition);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetStatusCode()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetStatusCode(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetStatusText()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr ptr = GeoSigmaLib.GetStatusText(pView);
|
|
|
|
|
|
string message = Marshal.PtrToStringAnsi(ptr);
|
|
|
|
|
|
|
|
|
|
|
|
return message;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CreateFaultStatistic(string statisticFile, string faultLayer, int markType)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.CreateFaultStatistic(this.pView, statisticFile, faultLayer, markType);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string StatiscResourceComment(string layerName)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = GeoSigmaLib.StatiscResourceComment(pView, layerName);
|
|
|
|
|
|
return MarshalHelper.ToString(pBuff);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 反转曲线的网格 z 值,只会反转可见可编辑的
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ReverseCurveAndMeshZValue()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.ReverseCurveAndMeshZValue(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置曲线连接为合并模式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="mergeIdea">合并方式</param>
|
|
|
|
|
|
/// <param name="isDelete">是否删除原来的曲线</param>
|
|
|
|
|
|
/// <returns>如果当前不是连接模式或参数错误,返回 false,否则返回 true</returns>
|
|
|
|
|
|
public bool SetLinkCurveMergeMode(int mergeIdea, bool isDelete)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mergeIdea < 0 || mergeIdea > 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(mergeIdea), "合并模式必须在 [0, 3] 之间");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.SetLinkCurveMergeMode(pView, mergeIdea, isDelete);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 对选中的闭合曲线进行多边形操作
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="op">操作类型</param>
|
|
|
|
|
|
/// <returns>成功,失败</returns>
|
|
|
|
|
|
public bool PolygonBooleanOperation(BooleanOp op)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.PolygonBooleanOperation(pView, (int)op);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IntPtr GetSelectMesh()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SelectGetMesh(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddWellGroupSetWellPointZ(double z)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.AddWellGroupSetWellPointZ(this.pView, z);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetWellGroupPointFromItem(ref double x, ref double y)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.GetWellGroupPointFromItem(this.pView, ref x, ref y);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AddWellGroupSetData(string elementData)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(elementData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(elementData);
|
|
|
|
|
|
int nReturn = GeoSigmaLib.AddWellGroupSetData(pView, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return nReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddWellGroupUpdate(IntPtr hdc)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.AddWellGroup_Update(pView, hdc);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddWellGroup_ApplyData()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.AddWellGroup_ApplyData(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int WellGroupEditSetData(string elementData)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = Marshal.StringToHGlobalAnsi(elementData);
|
|
|
|
|
|
int nLen = Encoding.Default.GetByteCount(elementData);
|
|
|
|
|
|
int nReturn = GeoSigmaLib.WellGroupEditSetData(pView, pBuff, nLen);
|
|
|
|
|
|
Marshal.FreeHGlobal(pBuff);
|
|
|
|
|
|
return nReturn;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string WellGroupEditGetData()
|
|
|
|
|
|
{
|
|
|
|
|
|
string strElementData = string.Empty;
|
|
|
|
|
|
long lpDataBuffer = 0;
|
|
|
|
|
|
int dataLength = 0;
|
|
|
|
|
|
int nDataCount = GeoSigmaLib.WellGroupEditGetData(pView, ref lpDataBuffer, ref dataLength);
|
|
|
|
|
|
if (nDataCount == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (dataLength > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
byte[] btCurve = new byte[dataLength];
|
|
|
|
|
|
Marshal.Copy((IntPtr)lpDataBuffer, btCurve, 0, dataLength);
|
|
|
|
|
|
strElementData = System.Text.Encoding.Default.GetString(btCurve);
|
|
|
|
|
|
|
|
|
|
|
|
PointerFree((IntPtr)lpDataBuffer);
|
|
|
|
|
|
}
|
|
|
|
|
|
return strElementData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int WellGroupEditMovePoint(long pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.WellGroupEditMoveElement(pView, pos);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int WellGroupEditMoveElementS()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.WellGroupEditMoveElementS(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetBranchHorizonLength(double curveLength, long pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SetBranchHorizonLength(this.pView, curveLength, pos);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string WellGroupStatistic()
|
|
|
|
|
|
{
|
|
|
|
|
|
string strData = GeoSigmaLib.WellGroupStatistic(pView);
|
|
|
|
|
|
Marshal.FreeBSTR(Marshal.StringToBSTR(strData));
|
|
|
|
|
|
return strData;
|
|
|
|
|
|
}
|
|
|
|
|
|
public bool WellGroupClone(long posSelect)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bSuccess = GeoSigmaLib.WellGroupClone(pView, posSelect);
|
|
|
|
|
|
return bSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 样式库
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 初始化样式库
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="path">样式库目录路径,目录内的文件会被视为样式文件</param>
|
|
|
|
|
|
/// <param name="notJudgeSamePath">不重新加载相同目录,设置为 true 时可能导致不能及时更新</param>
|
|
|
|
|
|
/// <returns>成功/失败</returns>
|
|
|
|
|
|
/// <exception cref="ArgumentNullException">null 参数异常</exception>
|
|
|
|
|
|
public static bool StyleLibraryInit(string path, bool notJudgeSamePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (path == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(path));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.StyleLibraryInit(path, notJudgeSamePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载所有样式组
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static string[] StyleLibraryListGroup()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr strPtr = GeoSigmaLib.StyleLibraryListGroup();
|
|
|
|
|
|
return MarshalHelper.ToString(strPtr).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 列出样式组下面的所有样式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="group">组名</param>
|
|
|
|
|
|
/// <returns>该组下面所有样式</returns>
|
|
|
|
|
|
public static string[] StyleLibraryListStyle(string group)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (group == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof (group));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr strPtr = GeoSigmaLib.StyleLibraryListStyle(group);
|
|
|
|
|
|
return MarshalHelper.ToString(strPtr).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加新的样式分组
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="group">样式组名称</param>
|
|
|
|
|
|
/// <exception cref="ArgumentNullException">null 参数异常</exception>
|
|
|
|
|
|
public static void StyleLibraryAddNewGroup(string group)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (group == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(group));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.StyleLibraryAddNewGroup(group);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清理整个样式库
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static void StyleLibraryRemoveAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StyleLibraryRemoveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 移除样式分组
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="group">样式组名称</param>
|
|
|
|
|
|
/// <exception cref="ArgumentNullException">null 参数异常</exception>
|
|
|
|
|
|
public static void StyleLibraryRemoveGroup(string group)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (group == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(group));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.StyleLibraryRemoveGroup(group);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 重命名样式组
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="oldName">旧的组名</param>
|
|
|
|
|
|
/// <param name="newName">新的组名</param>
|
|
|
|
|
|
/// <returns>成功/失败</returns>
|
|
|
|
|
|
/// <exception cref="ArgumentNullException">null 参数异常</exception>
|
|
|
|
|
|
public static bool StyleLibraryRenameGroup(string oldName, string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (oldName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(oldName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (newName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(newName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
oldName = oldName.Trim();
|
|
|
|
|
|
newName = newName.Trim();
|
|
|
|
|
|
|
|
|
|
|
|
if (oldName == newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.StyleLibraryRenameGroup(oldName, newName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存所有样式组
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>成功/失败</returns>
|
|
|
|
|
|
public static bool StyleLibrarySaveAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.StyleLibrarySaveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置样式到目标图层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="group">样式组</param>
|
|
|
|
|
|
/// <param name="style">样式</param>
|
|
|
|
|
|
/// <param name="targetLayer">目标图层</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool StyleLibraryApplyStyleTo(string group, string style, string targetLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (group == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof (group));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (style == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException (nameof (style));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (targetLayer == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(targetLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.StyleLibraryApplyStyleTo(pView, group, style, targetLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
public bool StyleLibraryApplyStyleToElement(string group, string style, long posElement)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.StyleLibraryApplyStyleToElement(this.pView, group, style, posElement);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 渲染样式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="group">分组</param>
|
|
|
|
|
|
/// <param name="style">样式</param>
|
|
|
|
|
|
/// <param name="hdc">设备句柄</param>
|
|
|
|
|
|
/// <param name="width">宽</param>
|
|
|
|
|
|
/// <param name="height">高</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
/// <exception cref="ArgumentNullException">group 或style 是 null 参数</exception>
|
|
|
|
|
|
/// <exception cref="ArgumentOutOfRangeException">width 或 height 越界</exception>
|
|
|
|
|
|
public static bool StyleLibraryRenderStyle(string group, string style, IntPtr hdc, int width, int height)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (group == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(group));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (style == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(style));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (width <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(width), "宽度不能 <= 0");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (height <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(height), "高度不能 <= 0");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.StyleLibraryRenderStyle(group, style, hdc, width, height);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion 样式库
|
|
|
|
|
|
|
|
|
|
|
|
#region 断电恢复
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取对应文件的备份 CSigmaDoc 指针
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="filePath"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static bool SigmaDocBackupExists(string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.SigmaDocBackupExists(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 启用 recover 模式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void SigmaDocEnableRecoverMode(bool enable = true)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.SigmaDocEnableRecoverMode(pView, enable);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 断电恢复
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置三维参数
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sceneParameter">参数指针,如果为 IntPtr.Zero 表示清空三维参数</param>
|
|
|
|
|
|
public void VtkSetSceneParameter(IntPtr sceneParameter)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Vtk_SetSceneParameter(pView, sceneParameter);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取三维参数
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>如果存在三维参数,返回参数地址,否则返回 IntPtr.Zero</returns>
|
|
|
|
|
|
public IntPtr VtkGetSceneParameter()
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Vtk_GetSceneParameter(pView);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取三维参数明细
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parameter">参数内容</param>
|
|
|
|
|
|
/// <returns>如果存在配置参数返回 true,否则返回 false</returns>
|
|
|
|
|
|
public bool VtkGetSceneParameterDetails(ref KevVtkSceneParameter parameter)
|
|
|
|
|
|
{
|
|
|
|
|
|
return GeoSigmaLib.Vtk_GetSceneParameterDetails(pView, ref parameter);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置 C++ 那边的启动目录
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="dirPath">目录路径</param>
|
|
|
|
|
|
/// <exception cref="ArgumentNullException">dirPath为空</exception>
|
|
|
|
|
|
/// <exception cref="ArgumentException">dirPath不存在</exception>
|
|
|
|
|
|
public static void FileUtility_SetStartupDirectory(string dirPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dirPath == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(dirPath));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Directory.Exists(dirPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentException($"{dirPath} 不存在", nameof(dirPath));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.FileUtility_SetStartupDirectory(dirPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加图例
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void LegendAdd(double x, double y, double width, int rows, string layerNames)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (rows <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentOutOfRangeException("行数必须大于 0", nameof(rows));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (layerNames == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(layerNames));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeoSigmaLib.LegendAdd(pView, x, y, width, rows, layerNames);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CreateCurveFillZ(string layerName, double x1, double y1, double x2, double y2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pView == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("pView 不能为 IntPtr.Zero");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (layerName == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(layerName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return GeoSigmaLib.CreateCurveFillZ(pView, layerName, x1, y1, x2, y2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Rotation(int x, int y, double angle)
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.Coordinate_Rotation(pView, x, y, angle);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetMeasureInfo()
|
|
|
|
|
|
{
|
|
|
|
|
|
IntPtr pBuff = GeoSigmaLib.GetMeasureInfo(pView);
|
|
|
|
|
|
return MarshalHelper.ToString(pBuff);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private IntPtr p_MapLayer;
|
|
|
|
|
|
public int MapZoom { get; set; } = 0; //地图层级
|
|
|
|
|
|
public bool MapState { get; set; } = false; //是否开启了地图显示
|
|
|
|
|
|
public bool MapIsView { get; set; } = false; //地图全图是否在范围内部 (只要全图显示就设为true)
|
|
|
|
|
|
public string MapUrlString { get; set; } = "https://wprd02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}&scl=2";
|
|
|
|
|
|
public string MapBorderLayer { get; set; } = ""; //地图边界
|
|
|
|
|
|
public int MapTransformType = 1; //1火星坐标系
|
|
|
|
|
|
public int downloadProgress = 0;
|
|
|
|
|
|
public string MapDBName = "GaodeSat.db";
|
|
|
|
|
|
private static MapDownloadProgressCallback _progressCallback; //全局保存,防止 GC 回收
|
|
|
|
|
|
private void ProgressCallback(int done, int total)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (done < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
downloadProgress = done;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (total > 0)
|
|
|
|
|
|
downloadProgress = done * 100 / total;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool DownloadSigmaViewItemMapView(int zoom, string dbPath, string strPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.downloadProgress = 0;
|
|
|
|
|
|
|
|
|
|
|
|
string strLayerName = "";
|
|
|
|
|
|
if (this.MapBorderLayer != null) strLayerName = this.MapBorderLayer;
|
|
|
|
|
|
if (strLayerName.Length > 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
strLayerName = "Layer:\\" + strLayerName.Remove(0, 3);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
strLayerName = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.MapZoom = zoom;
|
|
|
|
|
|
_progressCallback = new MapDownloadProgressCallback(this.ProgressCallback);
|
|
|
|
|
|
this.p_MapLayer = GeoSigmaLib.DownloadSigmaViewItemMapView(this.pView, zoom, this.MapUrlString, strLayerName, dbPath, strPath, this.MapTransformType, _progressCallback);
|
|
|
|
|
|
|
|
|
|
|
|
this.MapIsView = GeoSigmaLib.IsSigmaViewMapView(this.pView, strLayerName);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool AddSigmaViewMapImage(string strPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strLayerName = "";
|
|
|
|
|
|
if (MapBorderLayer != null) strLayerName = MapBorderLayer;
|
|
|
|
|
|
if (strLayerName.Length > 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
strLayerName = "Layer:\\" + strLayerName.Remove(0, 3);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
strLayerName = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
return GeoSigmaLib.AddSigmaViewItemMapImage(pView, strLayerName, strPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void StopDownloadMaplayer()
|
|
|
|
|
|
{
|
|
|
|
|
|
GeoSigmaLib.StopDownloadMaplayer(p_MapLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
|
public class GeoSigmaLib
|
|
|
|
|
|
{
|
|
|
|
|
|
#if DEBUG
|
|
|
|
|
|
const string SIGMALIB = "GeoSigmaDraw.dll";
|
|
|
|
|
|
const string DRAWOPERATELIB = "DrawOperatorD.dll";
|
|
|
|
|
|
#else
|
|
|
|
|
|
const string SIGMALIB = "GeoSigmaDraw.dll";
|
|
|
|
|
|
const string DRAWOPERATELIB = "DrawOperator.dll";
|
|
|
|
|
|
#endif
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 测试 GeoSigmaDraw dll 是否正确加载的函数,如果加载失败,将抛出异常
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigmaLibInit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GeoSigmaLibInit();
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PointerFree", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool PointerFree(IntPtr p);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PointerDelete", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool PointerDelete(IntPtr p);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PointerArrayDelete", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool PointerArrayDelete(IntPtr p);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SigmaLog", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SigmaLog(string msg);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_ReleaseNativeMemory", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Sigma_ReleaseNativeMemory(IntPtr nativeMemory);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Copy", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Copy(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Paste", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Paste(IntPtr pView, int itype);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Cutx", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Cutx(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "TestFunSigma", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int TestFunSigma(string strInput);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateView", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CreateView();
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EnableRotateEdit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void EnableRotateEdit(IntPtr pView, bool enable);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateViewByXy", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CreateViewByXy(IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetDrawerXy", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetDrawerXy(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateViewWithDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CreateViewWithDC(IntPtr hMemDC, int left, int top, int right, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateViewWithXyDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CreateViewWithXyDC(IntPtr pXy, IntPtr hMemDC, int left, int top, int right, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetViewDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetDC(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetDC(IntPtr viewAddress, IntPtr hMemDC, int left, int top, int right, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Initialize", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Initialize(IntPtr viewAddress, IntPtr hMemDC, int x, int y, int right, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetImgDCAndSize", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetImgDCAndSize(IntPtr viewAddress, IntPtr hMemDC, int x, int y, int right, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EnableRedraw", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void EnableRedraw(IntPtr viewAddress, bool enable);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetHWND", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetHWND(IntPtr viewAddress, IntPtr hwnd);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DestroyView", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DestroyView(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "Redraw", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern bool Redraw(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawMem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawMem(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawDC(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "InitializeImg", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void InitializeImg(IntPtr viewAddress, IntPtr hMemDC, int x, int y, int width, int height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetImgDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetImgDC(IntPtr viewAddress, IntPtr hMemDC);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawImageBmp", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr DrawImageBmp(IntPtr viewAddress, double left, double top, double right, double bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetFirstMeshImage", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetFirstMeshImage(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetKevMeshImage", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetKevMeshImage(IntPtr pView, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetKevFirstMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetKevFirstMesh(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SaveMergeMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SaveMergeMesh(IntPtr pView, IntPtr pMesh, string filename);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CombinImgDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CombinImg(IntPtr viewAddress, int x, int y, int width, int height, int worldX, int worldY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetAntiAlias", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetAntiAlias(IntPtr viewAddress, bool enable);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetAntiAlias", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetAntiAlias(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetPrinting", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetPrinting(IntPtr viewAddress, bool isPrinting);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetIsPriting", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetIsPriting(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewRect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetViewRect(IntPtr viewAddress, int left, int top, int right, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewBackcolor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetViewBackcolor(IntPtr viewAddress, int r, int g, int b);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetViewBackcolor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetViewBackcolor(IntPtr viewAddress, ref int r, ref int g, ref int b);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetSymbolView", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetSymbolView(IntPtr pView, bool isSymbolView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawImg", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawImg(IntPtr viewAddress, bool symbolViewFlag);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "DrawSymbolImg", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern bool DrawSymbolImg(IntPtr viewAddress);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawOther", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawOther(IntPtr viewAddress, IntPtr hDC);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_UndoView", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Sigma_UndoView(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_GetZoomStackCount", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_GetZoomStackCount(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_DrawAssistant", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Sigma_DrawAssistant(IntPtr pView, int mouseX, int mouseY, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetScreenDC", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetScreenDC(IntPtr viewAddress, IntPtr hMemDC);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMapRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetMapRange(IntPtr viewAddress, ref double left, ref double top, ref double right, ref double bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetScreenReal", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetScreenReal(IntPtr pView, int leftS, int topS, int rightS, int bottomS, ref double left, ref double top, ref double right, ref double bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetRealScreen", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetRealScreen(IntPtr pView, double leftS, double topS, double rightS, double bottomS, ref int left, ref int top, ref int right, ref int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetScreenHeight", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetScreenHeight(IntPtr pView, double width);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetRealHeight", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern double GetRealHeight(IntPtr pView, int height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetScreenWidth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetScreenWidth(IntPtr pView, double width);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetRealWidth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern double GetRealWidth(IntPtr pView, int width);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_WorldToScreen", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_WorldToScreen(IntPtr pView, double wx, double wy, out int cx, out int cy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_ScreenToWorld", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_ScreenToWorld(IntPtr pView, int sx, int sy, out double wx, out double wy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetDrawingWithAndHeightInScreen", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetDrawingWithAndHeightInScreen(IntPtr pView, out int width, out int height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OpenDocument", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool OpenDocument(IntPtr pView, string lpszFileName, bool bMergeFile);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OpenXy", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool OpenXy(IntPtr pView, IntPtr pXy, bool bMergeFile);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EnableMeshPackage", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void EnableMeshPackage(IntPtr pView, bool bEnable, bool bForce);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetFaultLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetFaultLayer(IntPtr pView, ref IntPtr pFaultLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetFaultLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetFaultLayer(IntPtr pView, string faultLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetBorderLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetBorderLayer(IntPtr pView, ref IntPtr pBorderLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetBorderLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetBorderLayer(IntPtr pView, string borderLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetFaultLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetFaultLayer3D(IntPtr pView, ref IntPtr pFaultLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetFaultLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetFaultLayer3D(IntPtr pView, string faultLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetBorderLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetBorderLayer3D(IntPtr pView, ref IntPtr pBorderLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetBorderLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetBorderLayer3D(IntPtr pView, string borderLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetWellLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetWellLayer3D(IntPtr pView, ref IntPtr pWellLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetWellLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetWellLayer3D(IntPtr pView, string wellLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMainMeshLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetMainMeshLayer3D(IntPtr pView, ref IntPtr pLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetMainMeshLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetMainMeshLayer3D(IntPtr pView, string layer);
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 从文件存储中获取主网格ID
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMainMeshId3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern long GetMainMeshId3D(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetMainMeshId3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetMainMeshId3D(IntPtr pView, long id);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 从Mesh对象中获取主网格ID
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView"></param>
|
|
|
|
|
|
/// <param name="pMesh"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMainMeshIdByMesh3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern long GetMainMeshIdByMesh3D(IntPtr pView, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMainMeshByMeshId3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetMainMeshByMeshId3D(IntPtr pView, long id);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetLayerByMainMesh3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetLayerByMainMesh3D(IntPtr pView, IntPtr pMesh, ref IntPtr pLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMainMeshByLayer3D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetMainMeshByLayer3D(IntPtr pView, string layer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置等值线名称
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetContour_SetNewName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetContour_SetNewName(IntPtr pView, string newName);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "SetContour_GetNewName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void SetContour_GetNewName(IntPtr pView, ref string newName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetContour_OperateSuccess", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SetContour_OperateSuccess(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SaveDocument", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SaveDocument(IntPtr pView, string lpszFileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SavePdfDocument", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SavePdfDocument(IntPtr pView, string lpszFileName, double leftMargin, double rightMargin,
|
|
|
|
|
|
double topMargin, double bottomMargin, int paperSizeType, int pdfAHType, int pdfPapertDirectionType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SaveActionPosition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SaveActionPosition(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "NewDocument", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool NewDocument(IntPtr pView, string lpszFileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EnableSnap", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void EnableSnap(IntPtr pView, bool enable);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_IsDocumentModified", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_IsDocumentModified(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_SetDocumentModified", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Sigma_SetDocumentModified(IntPtr pView, bool modified);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ReloadFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool ReloadFile(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "XyGetElementType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int XyGetElementType(IntPtr pView, long pos);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ExportImageFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool ExportImageFile(IntPtr pView, string outputFile, int width, int height, int bpp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region layer manager
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetElementCount", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetElementCount(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "TestLayersLength", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetLayersLength(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetLayers", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetLayers(IntPtr pView, ref long dataBuff, ref int destLen, bool withLayers);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetCurrentLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetCurrentLayer(IntPtr pView, byte[] layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetCurrentLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetCurrentLayer(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLayerState", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetLayerState(IntPtr pView, string layerName, int status);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetLayerState", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetLayerState(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLayersState", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetLayersState(IntPtr pView, [MarshalAs(UnmanagedType.LPArray)] string[] layers, int length, int status);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindAddLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FindAddLayer(IntPtr pView, string layerName, bool doActive);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteLayer", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DeleteLayer(IntPtr pView, [MarshalAs(UnmanagedType.LPArray)] string[] layers, int length, bool withSublayer);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ClearAll", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool ClearAll(IntPtr pView, bool needUndo);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteLayerEmpty", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DeleteLayerEmpty(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Layer_SeparateTextAndCurve", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Layer_SeparateTextAndCurve(IntPtr pView, string layerNameSeprated, string textSubLayerName, string curveSubLayerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Layer_DeleteInCurve", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Layer_DeleteInCurve(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Layer_DeleteOutCurve", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Layer_DeleteOutCurve(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Delete_Condition", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Delete_Condition(IntPtr pView, DeletionCondition condition);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Layer_BreakCurve", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Layer_BreakCurve(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Layer_ExtendCurve", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Layer_ExtendCurve(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Layer_ChangeLayer", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Layer_ChangeLayer(IntPtr pView, string layerNameOld, string layerNameNew);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Layer_GetCurves", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Layer_GetCurves(IntPtr pView, string layerName, ref IntPtr buffElement, ref int buffLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetLayerStyleData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetLayerStyleData(IntPtr pView, string layerName, ref Int64 bufferCurve, ref int lenCurve, ref Int64 bufferPoint, ref int lenPoint);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RemoveCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool RemoveCurveStyle(IntPtr pView, string layerName, int index);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RemovePointStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool RemovePointStyle(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLayerHowtoViewPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetLayerHowtoViewPoint(IntPtr pView, string layerName, IntPtr buffer, int bufferLen, bool replace);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLayerHowtoViewCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetLayerHowtoViewCurve(IntPtr pView, string layerName, IntPtr buffer, int bufferLen, int index);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLayerMoveUpCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetLayerMoveUpCurveStyle(IntPtr pView, string layerName, int index);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLayerMoveDownCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetLayerMoveDownCurveStyle(IntPtr pView, string layerName, int index);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateLayerCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool CreateLayerCurveStyle(IntPtr pView, string layerName, int type, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddLayerCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool AddLayerCurveStyle(IntPtr pView, string layerName, int type, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateLayerPointStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool CreateLayerPointStyle(IntPtr pView, string layerName, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetLayerData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetLayerData(IntPtr pView, string layerName, bool bHole, bool bBoundary, bool bWell);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetFirstMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetFirstMesh(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PreProcessMeshData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr PreProcessMeshData(IntPtr pView, IntPtr pMesh, string faultLayers, string boundaryLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ProcessMeshFaultArea", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr ProcessMeshFaultArea(IntPtr pView, IntPtr pRoot, IntPtr pMainMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ProcessMeshBoundary", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr ProcessMeshBoundary(IntPtr pView, IntPtr pRoot, IntPtr pMainMesh);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetVtkDataNodeChecked", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetVtkDataNodeChecked(IntPtr pView, IntPtr pNodeData, bool isChecked);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetVtkDataNodeHide", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetVtkDataNodeHide(IntPtr pView, IntPtr pNodeData, bool isHide);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddVtkDataNodeChild", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void AddVtkDataNodeChild(IntPtr pView, IntPtr pParent, IntPtr pChild);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion layer manager
|
|
|
|
|
|
|
|
|
|
|
|
#region 浏览导航
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewEnlarge", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewEnlarge(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewEnlargeByMousePoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewEnlargeByMousePoint(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewReduceByMousePoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewReduceByMousePoint(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewReduce", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewReduce(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewReduceForScreenPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewReduceForScreenPoint(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewReduceWithFactor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewReduceWithFactor(IntPtr pView, double factor);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OffsetViewportOrigion", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void OffsetViewportOrigion(IntPtr pView, int offsetX, int offsetY);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewExtend", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewExtend(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Extend", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Extend(IntPtr pView, double locationX, double locationY, double width, double height, int mode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewOperationKind", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetViewOperationKind(IntPtr pView, ViewOperationKind kind);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewPanTo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewPanTo(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewWindow", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetViewWindow(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FillScreenByStrech", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FillScreenByStrech(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FillScreenToCenter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FillScreenToCenter(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ToCenterAndFixScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ToCenterAndFixScale(IntPtr pView);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 绘制曲线接口
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EndCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int EndCurve(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CancelCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CancelCurve(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveCancelAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveCancelAll(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AutoCloseCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AutoCloseCurve(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ChangeCurveMergeState", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ChangeCurveMergeState(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawNextCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int DrawNextCurve(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ChangeCurveTypeForDrawing", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ChangeCurveTypeForDrawing(IntPtr pView, string curveType, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetTrackerHandleCursorType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetTrackerHandleCursorType(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
#endregion 绘制曲线接口
|
|
|
|
|
|
|
|
|
|
|
|
#region 比例尺
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateProportion", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CreateProportion(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeScale(IntPtr pView, double length);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeScaleHeight", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeScaleHeight(IntPtr pView, double height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeNumber", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeNumber(IntPtr pView, int number);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeShowMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeShowMode(IntPtr pView, int mode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeUnit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeUnit(IntPtr pView, int unit);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeColor(IntPtr pView, int r, int g, int b);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeTextScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeTextScale(IntPtr pView, double scale);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeAlign", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeAlign(IntPtr pView, int align);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeTextHeight", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeTextHeight(IntPtr pView, int height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeTextWidth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeTextWidth(IntPtr pView, int width);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeTextHeightAlone", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeTextHeightAlone(IntPtr pView, int alone);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Curve_SetName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Curve_SetName(IntPtr pView, string curveName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_ChangeCoordinate", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_ChangeCoordinate(IntPtr pView, double x, double y);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_Create", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_Create(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_GetScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_GetScale(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_GetData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_GetData(IntPtr pView, ref ProportionData data);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Proportion_SetParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Proportion_SetParameter(IntPtr pView, ref ProportionData data);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 直角网
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RectangularCSGrid_Create", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int RectangularCSGrid_Create(IntPtr pView, ref RectangularCSGridData data, IntPtr hDC);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RectangularCSGrid_GetStepAndRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int RectangularCSGrid_GetStepAndRange(IntPtr pView, ref RectangularCSGridData data);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GridGetStepAndRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GridGetStepAndRange(double left, double bottom, double right, double top, ref RectangularCSGridData pData);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 绘制圆弧
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Arc_SetType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Arc_SetType(IntPtr pView, int type);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 绘制文本
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Text_CalculateScreenRect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Text_CalculateScreenRect(IntPtr pView, IntPtr buffElement, int buffLen, ref double left, ref double top, ref double right, ref double bottom, ref double fontWidth, ref double fontHeight);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Text_SetTextInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Text_SetTextInfo(IntPtr pView, ref TextInformation info, IntPtr hDC);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Text_SetFont", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Text_SetFont(IntPtr pView, ref LogFont font);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Text_GetFont", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Text_GetFont(IntPtr pView, ref LogFont font);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Text_Create", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Text_Create(IntPtr pView, IntPtr buffElement, int buffLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_CalculateTextSizeDisplayed", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_CalculateTextSizeDisplayed(IntPtr pView, ref double xOut, ref double yOut);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_ShowOrHideCurrentText", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Sigma_ShowOrHideCurrentText(IntPtr pView, bool bShow);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Text_GetTextInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Text_GetTextInfo(IntPtr pView, ref TextInformation info);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 曲线打断
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "BreakCurve_IsBreaked", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int BreakCurve_IsBreaked(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "BreakCurve_GetSelectCount", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int BreakCurve_GetSelectCount(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "BreakCurve_ExtendCurveFinished", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool BreakCurve_ExtendCurveFinished(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "BreakCurveDirect_EreasRubberLine", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int BreakCurveDirect_EreasRubberLine(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 删除
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Delete_SetType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Delete_SetType(IntPtr pView, int type);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Delete_GetCountSelected", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Delete_GetCountSelected(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Delete_IsRegionSelected", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Delete_IsRegionSelected(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_Delete", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Sigma_Delete(IntPtr pView);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 符号库
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "InitLibrary", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool InitLibrary(string path, ref IntPtr outData, ref int dataLength, bool forceReload);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetLibraryPath", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetLibraryPath(ref IntPtr outData, ref int dataLength);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibraryAddNewGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool LibraryAddNewGroup(string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibraryRemoveGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LibraryRemoveGroup(string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibraryRenameGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool LibraryRenameGroup(string fileName, string newFileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibraryReloadGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool LibraryReloadGroup(string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibrarySaveAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool LibrarySaveAll();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetDrawXyName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetDrawXyName(IntPtr pXy, string groupName, string newName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RenameSymble", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void RenameSymble(IntPtr pXy, string oldName, string newName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetDrawXyName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetDrawXyName(IntPtr pXy, ref IntPtr symbolName, ref int buffLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RemoveLibrarySymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool RemoveLibrarySymbol(string path, IntPtr pSymbolXY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RemoveDrawerSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool RemoveDrawerSymbol(IntPtr pView, IntPtr pSymbolXY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ResetSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ResetSymbol(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetLibrarySymbolNames", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetLibrarySymbolNames(string fileName, ref IntPtr symbolNames, ref int buffLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetDrawerSymbolNames", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetDrawerSymbolNames(IntPtr pView, ref IntPtr symbolNames, ref int buffLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibaryDrawSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool LibaryDrawSymbol(string fileName, string symbolName, IntPtr hdcMem, int width, int height, ref IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawerDrawSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawerDrawSymbol(IntPtr pView, string symbolName, IntPtr hdcMem, int width, int height, ref IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibaryDrawSymbolFill", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool LibaryDrawSymbolFill(string fileName, string symbolName, IntPtr hdcMem, int width, int height, ref IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawerDrawSymbolFill", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawerDrawSymbolFill(IntPtr pView, string symbolName, IntPtr hdcMem, int width, int height, ref IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "XyDrawSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool XyDrawSymbol(IntPtr pXy, IntPtr hdcMem, int width, int height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateLibrarySymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool CreateLibrarySymbol(string fileName, string symbolName, ref IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateDrawerSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool CreateDrawerSymbol(IntPtr pView, string symbolName, ref IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LibraryCopySymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool LibraryCopySymbol(string fileName, IntPtr pSourceXy, string symbolName, ref IntPtr pSymbolNew);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawerCopySymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawerCopySymbol(IntPtr pView, IntPtr pSourceXy, string symbolName, ref IntPtr pSymbolNew);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawerCopyAllSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DrawerCopyAllSymbol(IntPtr pXySource, IntPtr pXyDest, bool overwrite);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkLoopName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MarkLoopName(IntPtr pView, StringBuilder id, int idLen, StringBuilder name, int nameLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkLibraryLoopName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MarkLibraryLoopName(StringBuilder path, int pathLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkLibraryLoopMark", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MarkLibraryLoopMark(string path, StringBuilder id, int idLen, StringBuilder name, int nameLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkDrawByName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MarkDrawByName(IntPtr pView, string id, IntPtr hMemDC, int cx, int cy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkLibraryDrawByName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MarkLibraryDrawByName(string id, IntPtr hMemDC, int cx, int cy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkCopyLibraryToDocument", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MarkCopyLibraryToDocument(IntPtr pView, string id);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetDocData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetDocData(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetMark2Data", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetMark2Data(IntPtr pView, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetMarkDataSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetMarkDataSymbol(IntPtr pView, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "DocBak", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void DocBak(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DocBak", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DocBak(IntPtr pView, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyCurrentFileXy", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyCurrentFileXy(IntPtr CurrentXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetDocData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetDocData(IntPtr pView, IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurrDocEditSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CurrDocEditSymbol(IntPtr pView, IntPtr pXy, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SymbolDocEdit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SymbolDocEdit(IntPtr pView, IntPtr pXy, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateNewSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CreateNewSymbol(IntPtr pView, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkLibraryNewSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MarkLibraryNewSymbol(string id, IntPtr hMemDC, int cx, int cy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DeleteSymbol(IntPtr pView, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RectangleRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void RectangleRange(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RectangleRangeSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void RectangleRangeSymbol(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RectRangeWhite", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void RectRangeWhite(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SaveFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SaveFile(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteRectangleRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr DeleteRectangleRange(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteRectFrameSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr DeleteRectFrameSymbol(IntPtr pView, IntPtr pxy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteRectRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DeleteRectRange(IntPtr pView, IntPtr pxy, string markName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteDocRectRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DeleteDocRectRange(IntPtr pView, IntPtr pXy, string markName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DelRectBack", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr DelRectBack(IntPtr pView, IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SymbolWindowShow", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr SymbolWindowShow(IntPtr pView, IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurrentSymbolWindowShow", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CurrentSymbolWindowShow(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ResetRectBack", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ResetRectBack(IntPtr pView, IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawCircleCurrent", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DrawCircleCurrent(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawCircleSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DrawCircleSymbol(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_HighLightGraphItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_HighLightGraphItem(IntPtr pView, int mouseX, int mouseY, IntPtr screenHDC);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "EnableCrossLine", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void EnableCrossLine(IntPtr pView, bool bEnable);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "GetCrossLineEnabledStatus", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern bool GetCrossLineEnabledStatus(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SymbolRename", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SymbolRename(IntPtr pView, string symbolOldName, string symbolNewName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_EndHighLightGraphItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Sigma_EndHighLightGraphItem(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RemoveSymbolLibXy", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void RemoveSymbolLibXy();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_GetHighLightTip", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_GetHighLightTip(IntPtr pView, out IntPtr tipInfo);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopySymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopySymbol(IntPtr pView, string symbolOldName, string symbolNewName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LoadSymbolTree", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LoadSymbolTree(StringBuilder path, int pathLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetZoomMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetZoomMode(IntPtr pView, int zoomMode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SaveSymbolOriginal", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr SaveSymbolOriginal(IntPtr pView, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ReplaceSymbol", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ReplaceSymbol(IntPtr pView, string symbolName, IntPtr originalSymbol);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileMerge", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileMerge(IntPtr pView, string filePath, bool onBottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WellPoleFileMerge", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void WellPoleFileMerge(IntPtr pView, string filePath, bool onBottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MultiWellSectionFileMerge", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void MultiWellSectionFileMerge(IntPtr pView, string filePath, bool onBottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileMergeAfter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileMergeAfter(IntPtr pView, string filePath, string layerAfter);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileMergeBefore", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileMergeBefore(IntPtr pView, string filePath, string layerBefore);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImageFileMerge", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImageFileMerge(IntPtr pView, string fileName, bool onBottom,
|
|
|
|
|
|
double locationX, double locationY, double endX, double endY, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveView", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveView(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveSelect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveSelect(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "BtnEnable", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool BtnEnable(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSavePoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSavePoint(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveCurve(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveSolid", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveSolid(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveText", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveText(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveCleanCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveCleanCurve(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveToXyz", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveToXyz(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileSaveToMark", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileSaveToMark(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnLButtonUpOther", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool OnLButtonUpOther(IntPtr pView, double firstX, double firstY, double lastX, double lastY, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "BtnOkSaveMarkToFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void BtnOkSaveMarkToFile(IntPtr pView, string fileName, string symbolName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "BtnCancelSaveMarkToFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void BtnCancelSaveMarkToFile(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "InputFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int InputFile(IntPtr pView, string fileName, byte[] gridWndValue);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetFileLength", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetFileLength(IntPtr pView, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "InsertChar", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int InsertChar(IntPtr pView, int nCharIndex, int nb, byte[] content);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WriteXy2DFD", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void WriteXy2DFD(IntPtr pXy, ref IntPtr buffData, ref int bufLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateXyFromDFD", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CreateXyFromDFD(IntPtr buffData, int bufLen, ref IntPtr pXy);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportData(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportNormalPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportNormalPoint(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportScatterPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportScatterPoint(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportCrossPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportCrossPoint(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportFractionPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportFractionPoint(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportCurve(IntPtr pView, IntPtr buffer, int bufferLen, string selectType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportOffsetMethod", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportOffsetMethod(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportAverageFirstMethod", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportAverageFirstMethod(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportAverageSecondMethod", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportAverageSecondMethod(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportWellPosition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportWellPosition(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ImportWellPath", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ImportWellPath(IntPtr pView, IntPtr buffer, int bufferLen, string selectType, int nMode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ExportFiles", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ExportFiles(IntPtr pView, string layerName, int nMode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetShowSize", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetShowSize(IntPtr pView, ref int width, ref int height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "UnitChange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void UnitChange(IntPtr pView, int selectIndex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "LoadFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void LoadFile(int selectIndex);
|
|
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
|
|
public struct POINT
|
|
|
|
|
|
{
|
|
|
|
|
|
public int X;
|
|
|
|
|
|
public int Y;
|
|
|
|
|
|
|
|
|
|
|
|
public POINT(int x, int y)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.X = x;
|
|
|
|
|
|
this.Y = y;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return ("X:" + X + ", Y:" + Y);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
|
|
|
|
|
public static extern bool GetCaretPos(out POINT pt);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 曲面处理
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SurfaceSaveAs", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SurfaceSaveAs(IntPtr pView, string filePath, int index, long position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SaveDataPointOnly", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SaveDataPointOnly(IntPtr pView, string filePath, long position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateContour", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CreateContour(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetDefaultMeshColorTemplate", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
// public static extern void SetDefaultMeshColorTemplate([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]int[] colors, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]double[] Zs, int colorCount);
|
|
|
|
|
|
public static extern void SetDefaultMeshColorTemplate(int[] colors, double[] Zs, int colorCount);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_SmoothSurface", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_SmoothSurface(IntPtr pView, double coefficient, int smoothNumber);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_Create", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StatisticsGraph_Create(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_Draw", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StatisticsGraph_Draw(IntPtr pView, IntPtr statisticsGraph, IntPtr hdc, int graphWidth, int graphHeight);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_Release", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StatisticsGraph_Release(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_DrawRangeForMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StatisticsGraph_DrawRangeForMesh(IntPtr pView, IntPtr statisticsGraphHandle, IntPtr hdcDrawer, double zMin, double zMax);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_GetSelectedRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int StatisticsGraph_GetSelectedRange(IntPtr statisticsGraphHandle, int left, int right, out double z1, out double z2);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_Fill", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_Fill(IntPtr pView, int extendLength);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_Fill_SetStatusOfCrossPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_Fill_SetStatusOfCrossPoint(IntPtr pView, int status);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_Fill_GetStatusOfCrossPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_Fill_GetStatusOfCrossPoint(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_Fill_Link", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_Fill_Link(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_Fill_Auto", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_Fill_Auto(IntPtr pView, int extendLength);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_ZPositiveNegativeSign", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_ZPositiveNegativeSign(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_CalculateGraphRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StatisticsGraph_CalculateGraphRange(IntPtr graph, double z1, double z2, out int left, out int right);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_DeleteRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int StatisticsGraph_DeleteRange(IntPtr statisticsGraphHandle, int left, int right);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_GetRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int StatisticsGraph_GetRange(IntPtr graph, out double xMin, out double xMax, out double yMin, out double yMax, out int pointerCount);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_GetZValue", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int StatisticsGraph_GetZValue(IntPtr graph, int index, out double v);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_SetZValueOfNodeSelected", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StatisticsGraph_SetZValueOfNodeSelected(IntPtr graph, double v);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticsGraph_GetAreaAndValueForSelected", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StatisticsGraph_GetAreaAndValueForSelected(IntPtr graph, double minZ, double maxZ, out double areaOut, out double volumeOut);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EditGridNode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void EditGridNode(IntPtr pView, IntPtr hdc, long position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MeshOnMouseMove", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void MeshOnMouseMove(IntPtr pView, IntPtr hdc, long position, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MeshFindNodeLocation", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool MeshFindNodeLocation(IntPtr pView, IntPtr hdc, int mouseX, int mouseY, ref int locationX, ref int locationY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GridPointNoExist", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GridPointNoExist(IntPtr pView, long position, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetGridValue", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetGridValue(IntPtr pView, long position, int mouseX, int mouseY, byte[] gridWndValue);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetZOfGridPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SetZOfGridPoint(IntPtr pView, double z, int row, int column);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMeshPointValue", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetMeshPointValue(IntPtr pView, double ptX, double ptY, ref double ptZ);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取Z值的范围
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView">图件指针</param>
|
|
|
|
|
|
/// <param name="surfacePos">曲面索引</param>
|
|
|
|
|
|
/// <param name="zMin">最小Z值</param>
|
|
|
|
|
|
/// <param name="zMax">最大Z值</param>
|
|
|
|
|
|
/// <returns>结果标识</returns>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Surface_GetZRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SurfaceGetZRange(IntPtr pView, long surfacePos, ref double zMin, ref double zMax);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_GetInfoStringForCreatingContour", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_GetInfoStringForCreatingContour(IntPtr pView, out IntPtr infoBuffer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_ReleaseInfoStringForCreatingContour", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Sigma_ReleaseInfoStringForCreatingContour(IntPtr str);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_CreateContour", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_CreateContour(IntPtr pView, string infomationForCreatingContour);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 图层管理
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerMovetoTop", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LayerMovetoTop(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerMovetoBottom", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LayerMovetoBottom(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerDragged", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
|
|
|
|
|
|
public static extern void LayerDragged(IntPtr pView, string positionLayer, string darggedLayer, int beChild);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerRemoveEmbellish", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LayerRemoveEmbellish(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerSelectActiveElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LayerSelectActiveElement(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerSelectElements", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LayerSelectElements(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerSaveActiveLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int LayerSaveActiveLayer(IntPtr pView, string layerName, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerSaveLayerToXyz", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int LayerSaveLayerToXyz(IntPtr pView, string layerName, string fileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerCopyEmbellish", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LayerCopyEmbellish(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PasteLayerEmbellish", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void PasteLayerEmbellish(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Statisc", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//[return: MarshalAs(UnmanagedType.BStr)]
|
|
|
|
|
|
public static extern IntPtr Statisc(IntPtr pView, string layerName, bool childNode, int nStatMode, int surfaceType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatisticWellInclination", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StatisticWellInclination(IntPtr pView, string layerName, bool childNode, double searchRadius, string faultLayer, string borderLayer);
|
|
|
|
|
|
// 井位统计
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StaticBlockWells", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StaticBlockWells(IntPtr pView, string blockLines);
|
|
|
|
|
|
|
|
|
|
|
|
// 交点统计
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatiscCurveCrossPoints", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StatiscCurveCrossPoints(IntPtr pView, string layerName, bool includeSubLayer);
|
|
|
|
|
|
|
|
|
|
|
|
// 区块统计
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StaticBlocks", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StaticBlocks(IntPtr pView, string blockLines);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StaticBlocksInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StaticBlocksInfo(IntPtr pView, string blockLines);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CutStaticBlocks", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CutStaticBlocks(IntPtr pView, string posData, string blockLines);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CaculateBlockArea", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern double CaculateBlockArea(IntPtr pView, long pos);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ResetLayerByOther", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ResetLayerByOther(IntPtr pView, long pos, long posRefer, string suffix);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatiscLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
[return: MarshalAs(UnmanagedType.BStr)]
|
|
|
|
|
|
public static extern string StatiscLayer(IntPtr pView, string layerName);
|
|
|
|
|
|
// [DllImport(SIGMALIB, EntryPoint = "MemoCopyXml", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
// public static extern int MemoCopyXml(byte[] xml);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MemoCopyExportXml", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int MemoCopyExportXml(byte[] xml);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ActiveEelement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ActiveEelement(IntPtr pView, long position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ActiveElements", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ActiveElements(IntPtr pView, IntPtr positions, int length);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LayerRename", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LayerRename(IntPtr pView, string oldName, string newName);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 校正
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CalibrateForTwoPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CalibrateForTwoPoint(IntPtr pView, ref TwoPoint fourPt, int coordinateMode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CalibrateForFourPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CalibrateForFourPoint(IntPtr pView, ref FourPoint fourPt, int coordinateMode);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 状态栏显示坐标
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetCoordinateXY", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetCoordinateXY(IntPtr pView, int mouseX, int mouseY, byte[] coordinate);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据屏幕坐标获取实际距离
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView"></param>
|
|
|
|
|
|
/// <param name="x1">第一个点的 x 屏幕坐标</param>
|
|
|
|
|
|
/// <param name="y1">第一个点的 y 屏幕坐标</param>
|
|
|
|
|
|
/// <param name="x2">第二个点的 x 屏幕坐标</param>
|
|
|
|
|
|
/// <param name="y2">第二个点的 y 屏幕坐标</param>
|
|
|
|
|
|
/// <returns>实际距离</returns>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetRealDistance", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern double GetRealDistance(IntPtr pView, int x1, int y1, int x2, int y2);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取画线时,线条的角度和距离
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView"></param>
|
|
|
|
|
|
/// <param name="angle">角度</param>
|
|
|
|
|
|
/// <param name="distance">距离 /param>
|
|
|
|
|
|
/// <returns>成功/失败</returns>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetCurveAngleAndDistance", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetCurveAngleAndDistance(IntPtr pView, ref double angle, ref double distance);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 查看导出曲线坐标
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveSelected_GetCountOfCoordinate", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveSelected_GetCountOfCoordinate(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetXy_ProjectionIsEmpty", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetXy_ProjectionIsEmpty(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveXY_EXChangeLatLong", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CurveXY_EXChangeLatLong(IntPtr pView, ref double x, ref double y);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveSelected_GetCurveNode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveSelected_GetCurveNode(IntPtr pView, int nodeIndex, ref CurveNode nodeOut);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveSelected_SaveNodeToCSVFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveSelected_SaveNodeToCSVFile(IntPtr pView, string fileFullPath);
|
|
|
|
|
|
#endregion 查看导出曲线坐标
|
|
|
|
|
|
|
|
|
|
|
|
#region 选择
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectSetCursor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectSetCursor(IntPtr pView, int ptX, int ptY, ref int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_GetKindOfSelectedElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_GetKindOfSelectedElement(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetCount", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SelectGetCount(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_IsElementLocationChanged", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
[return: MarshalAs(UnmanagedType.I1)]
|
|
|
|
|
|
public static extern bool Select_IsElementLocationChanged(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectIsOnMoving", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectIsOnMoving(IntPtr pView);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectMoveElementsTo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SelectMoveElementsTo(IntPtr pView, int x, int y);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectDrawTrackPath", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SelectDrawTrackPath(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetTrackerRect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SelectGetTrackerRect(IntPtr pView, ref int left, ref int top, ref int right, ref int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectStatusChanged", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectStatusChanged(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectIsSameType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectIsSameType(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetPointsZRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectGetPointsZRange(IntPtr pView, ref double zMin, ref double zMax);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectSetPointsColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectSetPointsColor(IntPtr pView, string colorItemsData, double dWidth, double dHeight);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetPointsZRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetPointsZRange(IntPtr pView, ref double zMin, ref double zMax);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetPointsColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetPointsColor(IntPtr pView, string colorItemsData, double dWidth, double dHeight);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_GetElementByPosition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_GetElementByPosition(IntPtr pView, ref Int64 bufferElement, ref int buffLength, long position, bool fullContent);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetElementByLocation", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetElementByLocation(IntPtr pView, ref Int64 bufferElement, ref int buffLength, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_GetElements", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_GetElements(IntPtr pView, ref Int64 buffElement, ref int buffLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetElementPositions", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectGetElementPositions(IntPtr pView, out IntPtr pPositions, ref int count);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectInCurveRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SelectInCurveRange(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectTypeInCurveRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SelectTypeInCurveRange(IntPtr pView, int elementType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectInCurveRangeEx", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SelectInCurveRangeEx(IntPtr pView, double factor);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectTypeInCurveRangeEx", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SelectTypeInCurveRangeEx(IntPtr pView, int elementType, double factor);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_SamePropertyElements", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SelectSamePropertyElements(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_SetTypes", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Select_SetTypes(IntPtr pView, int[] types, int size);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_WriteTemplate", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_WriteTemplate(IntPtr pView, string outputFile);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectGetElement(IntPtr pView, ref Int64 bufferElement, ref int buffLength, ref long position, bool allContent);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetElementType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SelectGetElementType(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr SelectGetMesh(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectSetElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectSetElement(IntPtr pView, IntPtr buffElement, int buffLen, long position, bool state, double zmin, double zmax);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetElementVisibility", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetElementVisibility(IntPtr pView, long elementPtr, bool visible);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectRemoveCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectRemoveCurveStyle(IntPtr pView, long position, int index);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectRemovePointStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectRemovePointStyle(IntPtr pView, long position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectMoveUpCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectMoveUpCurveStyle(IntPtr pView, long position, int index);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectMoveDownCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectMoveDownCurveStyle(IntPtr pView, long position, int index);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectCreateCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectCreateCurveStyle(IntPtr pView, long position, int type, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetPolygon", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern long SelectGetPolygon(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ResetCurveStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ResetCurveStyle(IntPtr pView, string curveName, string layerName, int type, IntPtr buff, int bufLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RenameElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int RenameElement(IntPtr pView, string oldName, string newName, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectCreatePointStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectCreatePointStyle(IntPtr pView, long position, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetLayerNames", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectGetLayerNames(IntPtr pView, ref long buffer, ref int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectGetLayerName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectGetLayerName(IntPtr pView, long position, StringBuilder buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectSetLayerByName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectSetLayerByName(IntPtr pView, long position, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectChangeToLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectChangeToLayer(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_ByNames", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_ByNames(IntPtr pView, string nameData);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_SelectAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_SelectAll(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_ClearAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_ClearAll(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_SelectAllByKind", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_SelectAllByKind(IntPtr pView, int kind);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_PointCount", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_PointCount(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_ReloadTrack", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Select_ReloadTrack(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_EnableTracker", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_EnableTracker(IntPtr pView, int bEnable);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_SelectOneGraph", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_SelectOneGraph(IntPtr pView, long position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_CreateGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Select_CreateGroup(IntPtr pView, ref long position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_UngroupAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_UngroupAll(IntPtr pView, ref int layerCount);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_SaveSelectKml", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_SaveSelectKml(IntPtr pView, long position, string path);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_DisperseMetaEmf", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_DisperseMetaEmf(IntPtr pView, long position, long timestamp);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_ReplaceMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_ReplaceMesh(IntPtr pView, string meshFile, long oldMeshPos, ref long newMeshPos);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "HasMeshState", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool HasMeshState(IntPtr pView, long oldMeshPos);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_CreateMeshColorBar", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_CreateMeshColorBar(IntPtr pView, [In] ColorPoint[] colorPoints, int length, string colorPath, string xmlPath,
|
|
|
|
|
|
double minz, double maxz);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_CreateColorBarData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_CreateColorBarData(IntPtr pView, long oldMeshPos, [Out] ColorPoint[] colorPoints, int numColors, ref int vSize,
|
|
|
|
|
|
double zmin, double zmax, int colorType, int sortType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_CreateReplaceMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_CreateReplaceMesh(IntPtr pView, long lstImagePos, ref long newMeshPos,
|
|
|
|
|
|
int colorNum, double gridZmin, double gridZmax,
|
|
|
|
|
|
int numX, int numY, double dLocationX, double dLocationY
|
|
|
|
|
|
, double dDeltX, double dDeltY, double dMaxX, double dMaxY, [In] ColorPoint[] colorPoints, [In] ColorPoint[] colorListPoints, int colorlistNum);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_ReselectByPosition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Select_ReselectByPosition(IntPtr pView, long posNew);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetSelectedNames", CharSet = CharSet.Unicode)]
|
|
|
|
|
|
public static extern IntPtr GetSelectedNames(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetDataByLayer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetDataByLayer(IntPtr pView, string layerName, ref Int64 bufferElement, ref int buffLengt);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "VoronoiCreateMap", CharSet = CharSet.Unicode)]
|
|
|
|
|
|
public static extern int VoronoiCreateMap(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SimplifySelectPoints", CharSet = CharSet.Unicode)]
|
|
|
|
|
|
public static extern int SimplifySelectPoints(IntPtr pView, double minSpacing);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DelaunayCreateMap", CharSet = CharSet.Unicode)]
|
|
|
|
|
|
public static extern int DelaunayCreateMap(IntPtr pView);
|
|
|
|
|
|
#endregion 选择
|
|
|
|
|
|
|
|
|
|
|
|
#region 复制为图像
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImage_SetRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImage_SetRange(IntPtr pView, int left, int right, int top, int bottom, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImage_EraseTrackerForRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImage_EraseTrackerForRange(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImage_IsSuccess", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImage_IsSuccess(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImage_GetTrackerHandleCursorType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImage_GetTrackerHandleCursorType(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImage_CopyWindow", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImage_CopyWindow(IntPtr pView, int left, int right, int top, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImage_CopyAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImage_CopyAll(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_SetRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImageEx_SetRange(IntPtr pView, int left, int right, int top, int bottom, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_GetRange", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyAsImageEx_GetRange(IntPtr pView, ref double left, ref double right, ref double top, ref double bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_GetTrackerHandleCursorType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImageEx_GetTrackerHandleCursorType(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_TrackHandle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImageEx_TrackHandle(IntPtr pView, int handleIndex, int mouseX, int mouseY, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_Clear", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyAsImageEx_Clear(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_CopyRectToClipboard", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool CopyAsImageEx_CopyRectToClipboard(IntPtr pView, double scale);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_SetProportionVisible", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyAsImageEx_SetProportionVisible(IntPtr pView, bool visible);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_SetNetGridVisible", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyAsImageEx_SetNetGridVisible(IntPtr pView, bool visible);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_SetNetGridParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyAsImageEx_SetNetGridParameter(IntPtr pView, ref RectangularCSGridData data);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_Refresh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyAsImageEx_Refresh(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_GetPropotion", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImageEx_GetPropotion(IntPtr pView, ref ProportionData pData);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImageEx_SetPropotion", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CopyAsImageEx_SetPropotion(IntPtr pView, ref ProportionData pData);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CopyAsImagePolygon_SetSelectedPolygon", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CopyAsImagePolygon_SetSelectedPolygon(IntPtr pView, long polygonPosition);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 绘制点
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetItem(IntPtr pView, int itemType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetPoint2DFromItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetPoint2DFromItem(IntPtr pView, out Point2D pt);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CancelDisplayPointInItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CancelDisplayPointInItem(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ChangePointAddedMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ChangePointAddedMode(IntPtr pView, int mode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPoint2D_SetPointType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPoint2D_SetPointType(IntPtr pView, int type);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPoint2DToDoc", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPoint2DToDoc(IntPtr pView, ref Point2D pt);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddFractionPointToDoc", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddFractionPointToDoc(IntPtr pView, ref FractionPoint pt);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointNameToItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPointNameToItem(IntPtr pView, IntPtr hDC, string pointName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddNumeratorNameToItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddNumeratorNameToItem(IntPtr pView, IntPtr hDC, string numeratorName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddDenominatorNameToItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddDenominatorNameToItem(IntPtr pView, IntPtr hDC, string denominatorName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PointAdd_UpdateDraw", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int PointAdd_UpdateDraw(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointSetDefaultName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void AddPointSetDefaultName(IntPtr pView, string name);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointSetDefaultZ", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPointSetDefaultZ(IntPtr pView, double z);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ChangeAnglgeToItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ChangeAnglgeToItem(IntPtr pView, double angle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointSetAngle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPointSetAngle(IntPtr pView, IntPtr hdc, double angle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointSetX", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPointSetX(IntPtr pView, IntPtr hdc, double x);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointSetY", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPointSetY(IntPtr pView, IntPtr hdc, double y);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointSetZ", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPointSetZ(IntPtr pView, IntPtr hdc, double z);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CrossPoint_GetPosition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CrossPoint_GetPosition(IntPtr pView, out CrossPoint2D pt);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CrossPoint_Add", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CrossPoint_Add(IntPtr pView, ref CrossPoint2D pt);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CrossPoint_ChangeMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CrossPoint_ChangeMode(IntPtr pView, int mode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CrossPoint_SetNames", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CrossPoint_SetNames(IntPtr pView, string name1, string name2, string name3, string name4);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddBufferData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddBufferData(IntPtr pView, string data);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 合并图件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pXy">原图件对象</param>
|
|
|
|
|
|
/// <param name="mergeFile">新的文件地址</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "XyMerge", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool XyMerge(IntPtr pXy, string mergeFile);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "InsertBufferDataBefore", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int InsertBufferDataBefore(IntPtr pView, string data, long posDest);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "Sigma_InsertDataBottom", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern bool InsertDataBottom(IntPtr pView, string drawData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddElementByBuffer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddElementByBuffer(IntPtr pView, IntPtr buffElement, int buffLen, int elementType, int dataFormat);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddWellGroupSetWellPointZ", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddWellGroupSetWellPointZ(IntPtr pView, double z);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetWellGroupPointFromItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetWellGroupPointFromItem(IntPtr pView, ref double x, ref double y);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddWellGroupSetData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddWellGroupSetData(IntPtr pView, IntPtr byteBuffer, int len);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddWellGroup_Update", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void AddWellGroup_Update(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddWellGroup_ApplyData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void AddWellGroup_ApplyData(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WellGroupEditSetData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int WellGroupEditSetData(IntPtr pView, IntPtr buffElement, int buffLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WellGroupEditGetData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int WellGroupEditGetData(IntPtr pView, ref Int64 bufferElement, ref int buffLength);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WellGroupEditMoveElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int WellGroupEditMoveElement(IntPtr pView, Int64 elementPos);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WellGroupEditMoveElementS", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int WellGroupEditMoveElementS(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetBranchHorizonLength", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetBranchHorizonLength(IntPtr pView, double curveLength, Int64 position);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WellGroupStatistic", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
[return: MarshalAs(UnmanagedType.BStr)]
|
|
|
|
|
|
public static extern string WellGroupStatistic(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "WellGroupClone", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool WellGroupClone(IntPtr pView, Int64 posSelect);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 响应鼠标键盘
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnLButtonDown", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void OnLButtonDown(IntPtr pView, int mouseX, int mouseY, IntPtr hdc, int key);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnLButtonDoubleClick", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int OnLButtonDoubleClick(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewMouseDown", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewMouseDown(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "CanvasMouseMove", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void CanvasMouseMove(IntPtr pView, IntPtr hdc, int mouseX, int mouseY);
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "CanvasDrawCrossLine", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void CanvasDrawCrossLine(IntPtr pView, IntPtr hdc, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewMouseMove", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewMouseMove(IntPtr pView, IntPtr hMemDC, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewMouseUp", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewMouseUp(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnKeyDown", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool OnKeyDown(IntPtr pView, int keyValue, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnKeyUp", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int OnKeyUp(IntPtr pView, int keyValue, IntPtr hdc);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetGridStep", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetGridStep(IntPtr pView, double stepX, double stepY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetGridStep", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetGridStep(IntPtr pView, ref double stepX, ref double stepY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMaxPositon", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern long GetMaxPositon(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern long AddPoint(IntPtr pView, Point2D pt, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPoints", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPoints(IntPtr pView, Point2D[] points, int length, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddCurve(IntPtr pView, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] double[] arrayXY, int ptCount, string curveName, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddWell", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void AddWell(string wellName, double locationX, double locationY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetWellStratiUnits", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetWellStratiUnits(string wellName, int count
|
|
|
|
|
|
, string[] stratiNames, double[] tops, double[] bottoms, string[] unitNames);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawBend", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int DrawBend(IntPtr pView, string leftWell
|
|
|
|
|
|
, string leftStrati, string rightWellName, string RightStrati);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MouseSelect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int MouseSelect(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ItemCurveProcess_SetType", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ItemCurveProcess_SetType(IntPtr pView, int type);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ItemCurveProcess_GetResult", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ItemCurveProcess_GetResult(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Curve_GetCurvesOfEmptyName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Curve_GetCurvesOfEmptyName(IntPtr pView, ref BufferAgency bufferr);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EditCurve_BeginEdit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int EditCurve_BeginEdit(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EditCurve_EndEdit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int EditCurve_EndEdit(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "EditCurve_IsCurveNameMoved", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool EditCurve_IsCurveNameMoved(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
//#region 选择相关函数
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetScrollBar", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetScrollBar(IntPtr pView, ref int hMax, ref int vMax, ref int hPage, ref int vPage, ref int hPos, ref int vPos);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "HScroll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void HScroll(IntPtr pView, int nSBCode, int nPos, int nScrollMax);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Scroll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Scroll(IntPtr pView, int orientation, double offset);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnLButtonUp", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void OnLButtonUp(IntPtr pView, int mouseX, int mouseY, IntPtr hMemDC, int vk);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnRButtonDown", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void OnRButtonDown(IntPtr pView, int mouseX, int mouseY, IntPtr hMemDC, int vk);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnRButtonUp", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void OnRButtonUp(IntPtr pView, int mouseX, int mouseY, IntPtr hMemDC, int vk);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OnMouseWheel", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void OnMouseWheel(IntPtr pView, uint button, int clicks, int x, int y, int delta);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ItemMouseMove", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ItemMouseMove(IntPtr pView, IntPtr hMemDC, int mouseX, int mouseY, int buttonStatus);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ItemMouseMoveStatus", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ItemMouseMoveStatus(IntPtr pView, IntPtr hMemDC, int mouseX, int mouseY, int buttonStatus, ref long info, ref int len);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddPointNameToItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int AddPointNameToItem(IntPtr pView, string pointName);
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Alignment_Align", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Alignment_Align(IntPtr pView, int alignmentType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DisplayOrder_Set", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int DisplayOrder_Set(IntPtr pView, int order);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "HorizontalMirror", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int HorizontalMirror(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "VerticalMirror", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int VerticalMirror(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "TestMouseMove", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int TestMouseMove(IntPtr pView, IntPtr hdcMem, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ItemSelectElement_GetCountSelected", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ItemSelectElement_GetCountSelected(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_HightLightFirstCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_HightLightFirstCurve(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AdjustDirectionAutomatically", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void AdjustDirectionAutomatically(IntPtr pView, int orientation);
|
|
|
|
|
|
|
|
|
|
|
|
#region 打印
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_Print", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_Print(IntPtr pView, IntPtr hdc, int left, int top, int right, int bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetViewFactors", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetViewFactors(IntPtr pView, ref ViewFactor factorsOut);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewFactors", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SetViewFactors(IntPtr pView, double offsetX, double offsetY, double zoomFactor);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewScreenFactors", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SetViewScreenFactors(IntPtr pView, double offsetX, double offsetY, double zoomFactor);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_SetPageMargins", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GeoSigma_SetPageMargins(IntPtr pView, int topPageMargin, int bottomPageMargin, int leftPageMargin, int rightPageMargin);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_GetPageMargins", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GeoSigma_GetPageMargins(IntPtr pView, out int top, out int bottom, out int left, out int right);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PreviewPrint_Start", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int PreviewPrint_Start(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PreviewPrint_End", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int PreviewPrint_End(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Print_ViewMouseDown", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Print_ViewMouseDown(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Print_ViewMouseMove", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Print_ViewMouseMove(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Print_ViewMouseUp", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Print_ViewMouseUp(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Print_ViewAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Print_ViewAll(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Print_SetScreenRect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Print_SetScreenRect(IntPtr pView, int width, int height);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Print_GetNumberOfPartition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Print_GetNumberOfPartition(IntPtr pView, out int row, out int col, int overlapWidth);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Print_Part", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Print_Part(IntPtr pView, ref PrintPartition partition);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "OffsetPix", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int OffsetPix(IntPtr pView, int offsetX, int offsetY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetCustomDPI", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SetCustomDPI(IntPtr pView, double dpi);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetXYScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetXYScale(IntPtr pView, out double xsOut, out double ysOut);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetXYScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SetXYScale(IntPtr pView, double xs, double ys);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetXYUnit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetXYUnit(IntPtr pView, out int xUnitOut, out int yUnitOut);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetXYUnit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SetXYUnit(IntPtr pView, int xUnit, int yUnit);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Select_EreaseTracker", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Select_EreaseTracker(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
#region 编辑曲线节点
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_Draw", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_Draw(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_EreaseHandles", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_EreaseHandles(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_GetNodeSelected", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_GetNodeSelected(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_AddNode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_AddNode(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_DeleteNode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_DeleteNode(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_GetCursorTpye", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_GetCursorTpye(IntPtr pView, int mouseX, int mouseY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_GetCountOfNode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_GetCountOfNode(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveEditNode_EnableMulDelete", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CurveEditNode_EnableMulDelete(IntPtr pView, bool enable);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 设置投影参数
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_GetParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_GetParameter(IntPtr pView, ref SigmaProjectionParameter para);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_GetDefaultParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_GetDefaultParameter(IntPtr pView, ref SigmaProjectionParameter para);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_SetParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_SetParameter(IntPtr pView, SigmaProjectionParameter para);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_Change", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_Change(IntPtr pView, ref SigmaProjectionParameter para);
|
|
|
|
|
|
|
|
|
|
|
|
//约定other字节数组的长度为512
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_GetOtherStr", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_GetOtherStr(IntPtr pView, ref SigmaProjectionParameter para, byte[] other);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_GetProjectString", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_GetProjectString(IntPtr pView, ref SigmaProjectionParameter para, byte[] projectByts);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_FillOtherParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_FillOtherParameter(IntPtr pView, ref SigmaProjectionParameter para, string otherString);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Projection_IsEmpty", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Projection_IsEmpty(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 设置投影参数
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_ExchangeXY", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_ExchangeXY(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_ScaleFont", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_ScaleFont(IntPtr pView, int flag);
|
|
|
|
|
|
|
|
|
|
|
|
#region 曲线处理
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DrawerCurveConnect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int DrawerCurveConnect(IntPtr pView, string layerName, bool deleteOrignalCurves);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Curve_IncreaseDensityNode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Curve_IncreaseDensityNode(IntPtr pView, int mode, double step, int rounding);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Curve_Redundance", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Curve_Redundance(IntPtr pView, double tolerance);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Curve_Smooth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Curve_Smooth(IntPtr pView, int mode, double step);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Curve_AutoJoin", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Curve_AutoJoin(IntPtr pView, double maxError, bool onlySameName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Curve_ArcToCurve", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Curve_ArcToCurve(IntPtr pView, double step);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 外切内切
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Cut_CutOutByRect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Cut_CutOutByRect(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Cut_CutInByRect", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Cut_CutInByRect(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CutOut_GetCountOfPickup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CutOut_GetCountOfPickup(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CutIn_GetCountOfPickup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CutIn_GetCountOfPickup(IntPtr pView);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 曲面
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Surface_CalculateVolume", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Surface_CalculateVolume(IntPtr pView, int mouseX, int mouseY, int mode, out double z, out double volume);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Surface_SetZValue", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Surface_SetZValue(IntPtr pView, int mouseX, int mouseY, int zMode, double zIn);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SurfaceGetInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SurfaceGetInfo(IntPtr pView, long elementPtr, ref int numX, ref int numY
|
|
|
|
|
|
, ref double dLocationX, ref double dLocationY, ref double dDeltX, ref double dDeltY
|
|
|
|
|
|
, ref double maxX, ref double maxY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SurfaceGetImageInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SurfaceGetImageInfo(IntPtr pView, long elementPtr, ref int numX, ref int numY
|
|
|
|
|
|
, ref double dLocationX, ref double dLocationY, ref double dDeltX, ref double dDeltY
|
|
|
|
|
|
, ref double maxX, ref double maxY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Coordinate_ChangeByExpression", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Coordinate_ChangeByExpression(IntPtr pView, int operationObjectKind, string xExpression, string yExpression, string zExpression, string lExpression);
|
|
|
|
|
|
#endregion 曲面
|
|
|
|
|
|
|
|
|
|
|
|
#region UndoRedo
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_Undo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_Undo(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_Redo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_Redo(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_CanUndo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_CanUndo(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_CanRedo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_CanRedo(IntPtr pView);
|
|
|
|
|
|
#endregion UndoRedo
|
|
|
|
|
|
|
|
|
|
|
|
#region 删除
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SectionAddNew", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern long SectionAddNew(IntPtr pView, IntPtr buffer, int buffLen, IntPtr values, int valuesLen, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SectionDelete", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SectionDelete(IntPtr pView, long pos);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SectionDeleteAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SectionDeleteAll(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SigmaDeleteElementByPosition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SigmaDeleteElementByPosition(IntPtr pView, long[] position, int count);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SigmaDeleteElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SigmaDeleteElement(IntPtr pView, string layerName, string eleName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SigmaDeletePoint", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int SigmaDeletePoint(IntPtr pView, string layerName, string eleName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SigmaViewShowBKGrid", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SigmaViewShowBKGrid(IntPtr pView, int bShow);
|
|
|
|
|
|
#endregion 删除
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "XyDeleteDupElements", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
|
|
|
|
|
|
public static extern void XyDeleteDupElements(IntPtr pXy, string option);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 个性的批量处理
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PointProcessSetIdea", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int PointProcessSetIdea(IntPtr pView, int idea);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PointProcessGetCount", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int PointProcessGetCount(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PointProcessSetStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void PointProcessSetStyle(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CurveProcessSetStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void CurveProcessSetStyle(IntPtr pView, IntPtr buffer, int bufferLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ElementProperty_GetSimpleProperty", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ElementProperty_GetSimpleProperty(IntPtr pView, out IntPtr propertyString);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_LayerSort", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_LayerSort(IntPtr pView, bool enable);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ElementProperty_ReleaseString", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ElementProperty_ReleaseString(IntPtr pStr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 个性的批量处理
|
|
|
|
|
|
#region 查找和替换
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_Start", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FindReplacement_Start(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_FindNext", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_FindNext(IntPtr pView, string findContent, int bMatch, int bCapitalLower, int elementType, bool onlyEditable);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplace_GetCurrentPostion", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplace_GetCurrentPostion(IntPtr pView, ref long postion);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_Draw", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_Draw(IntPtr pView, IntPtr hdc);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_FindAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_FindAll(IntPtr pView, string findContent, int bMatch, int bCapitalLower);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_ReplaceAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_ReplaceAll(IntPtr pView, string strFind, string strReplace, int bMatch, int bCapitalLower);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_Replace", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_Replace(IntPtr pView, string strFind, string strReplace, int bMatch, int bCapitalLower);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_GetCountOfElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_GetCountOfElement(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_GetElementInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_GetElementInfo(IntPtr pView, int index, ref ElementInfo eleInfoOut);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_ReleaseNativeMemoryOfElementInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FindReplacement_ReleaseNativeMemoryOfElementInfo(ref ElementInfo eleInfoOut);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ActiveElementByName", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ActiveElementByName(IntPtr pView, string elementName, int elementType);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Sigma_MathFind", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Sigma_MathFind(IntPtr pView, int kind, double step, double remainder, int start, out IntPtr elementsContentBuffer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindReplacement_SaveFindAllResult", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int FindReplacement_SaveFindAllResult(IntPtr pView, string fileFullPath);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FindPointByInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool FindPointByInfo(IntPtr pView, ref long pos, string elementName, double x, double y, string layerName);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 状态码与状态消息
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetStatusCode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetStatusCode(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetStatusText", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetStatusText(IntPtr pView);
|
|
|
|
|
|
#endregion 状态码与状态消息
|
|
|
|
|
|
#region 全局变量
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Global_GetExtendLength", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern double Global_GetExtendLength();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Global_SetExtendLength", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Global_SetExtendLength(double len);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "Global_GetGridStep", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void Global_GetGridStep(out double xStep, out double yStep);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_StartToCutImage", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GeoSigma_StartToCutImage(IntPtr pView, ref CutImageInfo ciInfo);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_StopCutImage", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_StopCutImage(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_GetIndexOfFileByCutImage", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_GetIndexOfFileByCutImage(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_StartToFileTransformer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_StartToFileTransformer(IntPtr pView, ref FileTransformationInfo ftInfo);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_StopFileTransformer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_StopFileTransformer(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GeoSigma_GetIndexOfFileByFileTransformer", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GeoSigma_GetIndexOfFileByFileTransformer(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
//[DllImport(SIGMALIB, EntryPoint = "Global_SetGridStep", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
//public static extern void Global_SetGridStep(double xStep, double yStep);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 文件处理
|
|
|
|
|
|
[DllImport(DRAWOPERATELIB, EntryPoint = "EncodeFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool EncodeFile(string inputPath, string outputPath);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DRAWOPERATELIB, EntryPoint = "DecodeFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DecodeFile(string inputPath, string outputPath);
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateFaultStatistic", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool CreateFaultStatistic(IntPtr pView, string statisticFile, string faultLayer, int markType);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询接口,根据图元名字进行查询
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView">pView</param>
|
|
|
|
|
|
/// <param name="searchText">要搜索的内容</param>
|
|
|
|
|
|
/// <param name="ignoreCase">忽略大小写</param>
|
|
|
|
|
|
/// <param name="matchWholeWord">内容全匹配</param>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SearchElement", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr SearchElement(IntPtr pView, string searchText, bool ignoreCase, bool matchWholeWord);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetRealViewRect", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetRealViewRect(IntPtr pView, ref double left, ref double top, ref double right, ref double bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetRealViewRect", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetRealViewRect(IntPtr pView, double left, double top, double right, double bottom);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetScaleSize", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetScaleSize(IntPtr pView, ref double scaleX, ref double scaleY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetViewStatus", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void GetViewStatus(IntPtr pView, ref double left, ref double top, ref double scaleX, ref double scaleY);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewStatus", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetViewStatus(IntPtr pView, double left, double top, double scaleX, double scaleY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetViewPrecision", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetViewPrecision(IntPtr pView, int precision);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetScaleSize", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetScaleSize(IntPtr pView, double scaleX, double scaleY);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StatiscResourceComment", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StatiscResourceComment(IntPtr pView, string layerName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ReverseCurveAndMeshZValue", ExactSpelling = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ReverseCurveAndMeshZValue(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLinkCurveMergeMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetLinkCurveMergeMode(IntPtr pView, int mergeIdea, bool isDelete);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "PolygonBooleanOperation", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool PolygonBooleanOperation(IntPtr pView, int boolenOp);
|
|
|
|
|
|
|
|
|
|
|
|
#region 三维显示
|
|
|
|
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
|
|
|
|
|
public static extern bool SetDllDirectory(string lpszPathName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
|
|
|
|
|
public static extern bool AddDllDirectory(string lpszPathName);
|
|
|
|
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
|
|
const string KEVVTKLIB = "KevVtkLibD.dll";
|
|
|
|
|
|
#else
|
|
|
|
|
|
private const string KEVVTKLIB = "KevVtkLib.dll";
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_Init", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_Init();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_ParseXyzFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_ParseXyzFile(int handle, string lpszFileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_CreateVtkImageData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_CreateVtkImageData(int handle, int spacex, int spacey);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_CreateVtkLookupTable", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_CreateVtkLookupTable(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_RenderVtkIamgeData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_RenderVtkIamgeData(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_ExportImageDataToPNG", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_ExportImageDataToPNG(int handle, string filepath);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_MarchingSquares", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_MarchingSquares(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_RenderRegionalBoundaryLine", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_RenderRegionalBoundaryLine(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_SetParentWndId", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_SetParentWndId(int handle, IntPtr hwnd);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_StartInteractor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_StartInteractor(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_Destory", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_Destory(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVMS_SetWndSize", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVMS_SetWndSize(int handle, int w, int h);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_Init", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_Init();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_Destory", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_Destory(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ParseXyzFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ParseXyzFile(int handle, string lpszFileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ParseMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ParseMesh(int handle, string lpszFileName, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowData", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowData(int handle, IntPtr pData);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetMainIamge", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetMainIamge(int handle, string filePath, double x0, double y0, double w, double h);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_UpdateMeshBitmap", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_UpdateMeshBitmap(int handle, IntPtr hBitmap, double x0, double y0, double w, double h);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_InitScence", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_InitScence(int handle, IntPtr hwnd, int w, int h);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_PCLParseMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_PCLParseMesh(int handle, string lpszFileName, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SimpleTriangles", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SimpleTriangles(int handle, string lpszFileName, IntPtr pMesh);
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_AddMeshes", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_AddMeshes(int handle, string lpszFileName, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_AddIamges", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_AddIamges(int handle, string lpszFileName, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_AddPoints", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_AddPoints(int handle, string lpszFileName, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_AddCurves", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_AddCurves(int handle, string lpszFileName, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetParentWndId", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetParentWndId(int handle, IntPtr hwnd);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_StartInteractor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_StartInteractor(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_Render", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_Render(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_PCLVtkRender", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_PCLVtkRender(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_Delaunay2D", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_Delaunay2D(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWndSize", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWndSize(int handle, int w, int h);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ViewZoomin", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ViewZoomin(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ViewZoomout", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ViewZoomout(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ViewReset", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ViewReset(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ViewPan", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ViewPan(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ViewReal", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ViewReal(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowMesh(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowEdgeSurface", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowEdgeSurface(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowContour", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowContour(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetBackgroundColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetBackgroundColor(int handle, byte red, byte green, byte blue, byte alpha);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowCoordinateGrid", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowCoordinateGrid(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowAxes", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowAxes(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowCoordinateGridLine", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowCoordinateGridLine(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowMeshEdgeColorGradient", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowMeshEdgeColorGradient(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowScalarBar", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowScalarBar(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetSingularValueFilterFlag", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetSingularValueFilterFlag(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetSingularThreshold", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetSingularThreshold(int handle, int value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellMode(int handle, int mode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetFaultMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetFaultMode(int handle, int mode);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellColumnHeight", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellColumnHeight(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellColumnThrough", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellColumnThrough(int handle, bool value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellColumnRadius", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellColumnRadius(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellSymbolRadius", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellSymbolRadius(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellTypeColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellTypeColor(int handle, string layer, int r, int g, int b);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_UpdateWellTypeColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_UpdateWellTypeColor(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellColumnNameSize", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellColumnNameSize(int handle, int value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellColumnNameGap", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellColumnNameGap(int handle, int value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellTypeColorMap", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellTypeColorMap(int handle, string colors);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellColumnColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellColumnColor(int handle, byte red, byte green, byte blue, byte alpha);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellColumnNameColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellColumnNameColor(int handle, byte red, byte green, byte blue, byte alpha);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowCubeAxes", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowCubeAxes(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetCAzimuth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetCAzimuth(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetCElevation", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetCElevation(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLAzimuth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLAzimuth(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLElevation", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLElevation(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetZScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetZScale(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetZMaxScale", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetZMaxScale(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLinearExtrusionValue", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLinearExtrusionValue(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLightMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLightMode(int handle, int value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetMeshEdgeMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetMeshEdgeMode(int handle, int value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLightEColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLightAmbientColor(int handle, byte red, byte green, byte blue);
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLightRColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLightSpecularColor(int handle, byte red, byte green, byte blue);
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLightDColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLightDiffusedCorlor(int handle, byte red, byte green, byte blue);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLightIntensity", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLightIntensity(int handle, double value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLightColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLightColor(int handle, byte red, byte green, byte blue);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_GetTestMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr KVDLN_GetTestMesh(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SimpleTrianglesRender", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SimpleTrianglesRender(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowDataNode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowDataNode(int handle, IntPtr pData);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetMainMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void KVDLN_SetMainMesh(int handle, IntPtr pMesh);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SaveImageFile", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SaveImageFile(int handle, string lpszFileName, int scale, int type);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SaveScene", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SaveScene(int handle, string lpszFileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_OpenScene", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_OpenScene(int handle, string lpszFileName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_ShowLinearExtrusion", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_ShowLinearExtrusion(int handle, Boolean flag);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_CreatMeshColorArray", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr KVDLN_CreatMeshColorArray(int handle, int num);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetMeshColorItem", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetMeshColorItem(int handle, IntPtr pColors, int index, Boolean gradient, double z, int r, int g, int b, int a);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetMeshColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetMeshColor(int handle, IntPtr pColors, int num);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLineWidth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLineWidth(int handle, int width);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetLineColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetLineColor(int handle, int r, int g, int b, int a);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetMeshEdgeColor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetMeshEdgeColor(int handle, int r, int g, int b, int a);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetWellRadius", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetWellRadius(int handle,double r);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetActorProperty", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetActorProperty(int handle, int id, int r, int g, int b, double s);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_GetSceneParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr KVDLN_GetSceneParameter(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetSceneParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int KVDLN_SetSceneParameter(int handle, IntPtr pSceneParameter);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_GetMainMesh", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr KVDLN_GetMainMesh(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_GetMainMeshInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern double KVDLN_GetMainMeshInfo(int handle, IntPtr pKevVtkMeshData, int mask);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_SetOutlierEditMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr KVDLN_SetOutlierEditMode(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(KEVVTKLIB, EntryPoint = "KVDLN_EditOutlier", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr KVDLN_EditOutlier(int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Vtk_SetSceneParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void Vtk_SetSceneParameter(IntPtr pView, IntPtr sceneParameter);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Vtk_GetSceneParameter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr Vtk_GetSceneParameter(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Vtk_GetSceneParameterDetails", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool Vtk_GetSceneParameterDetails(IntPtr pView, ref KevVtkSceneParameter parameter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 三维显示
|
|
|
|
|
|
|
|
|
|
|
|
#region 样式库
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryInit", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool StyleLibraryInit(string path, bool notJudgeSamePath);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryListGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StyleLibraryListGroup();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryListStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr StyleLibraryListStyle(string group);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryAddNewGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StyleLibraryAddNewGroup(string group);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryRemoveAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StyleLibraryRemoveAll();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryRemoveGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StyleLibraryRemoveGroup(string group);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryRenameGroup", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool StyleLibraryRenameGroup(string oldName, string newName);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibrarySaveAll", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool StyleLibrarySaveAll();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryApplyStyleTo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool StyleLibraryApplyStyleTo(IntPtr pView, string group, string style, string targetLayer);
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryApplyStyleToElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool StyleLibraryApplyStyleToElement(IntPtr pView, string group, string style, long posElement);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StyleLibraryRenderStyle", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool StyleLibraryRenderStyle(string group, string style, IntPtr hdc, int width, int height);
|
|
|
|
|
|
#endregion 样式库
|
|
|
|
|
|
|
|
|
|
|
|
#region 断电恢复
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SigmaDocBackupExists", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SigmaDocBackupExists(string filePath);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SigmaDocEnableRecoverMode", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SigmaDocEnableRecoverMode(IntPtr pView, bool enable);
|
|
|
|
|
|
#endregion 断电恢复
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FileUtility_SetStartupDirectory", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FileUtility_SetStartupDirectory(string dirPath);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "LegendAdd", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void LegendAdd(IntPtr pView, double x, double y, double width, int rows, string layerNames);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据网格 z 值填充曲线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pView">图件</param>
|
|
|
|
|
|
/// <param name="layerName">要生成的目标图层名</param>
|
|
|
|
|
|
/// <param name="x1">第一个点 x 坐标</param>
|
|
|
|
|
|
/// <param name="y1">第一个点 y 坐标</param>
|
|
|
|
|
|
/// <param name="x2">第二个点 x 坐标</param>
|
|
|
|
|
|
/// <param name="y2">第二个点 y 坐标</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateCurveFillZ", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool CreateCurveFillZ(IntPtr pView, string layerName, double x1, double y1, double x2, double y2);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetMeasureInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetMeasureInfo(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "Coordinate_Rotation", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int Coordinate_Rotation(IntPtr pView, double x, double y, double angle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DestroyAndInsertElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void DestroyAndInsertElement(IntPtr pView, long[] destroyArray, int destroyLength, long[] insertArray, int insertLength);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MarkCurveIntersectionsWithSquares", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void MarkCurveIntersectionsWithSquares(IntPtr pView, string layerName, bool includeSubLayer);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetEraserSettings", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetEraserSettings(IntPtr pView, string settings);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RegisterListener", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void RegisterListener(IntPtr pView, Listener listener);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetSigmaViewItemProperty", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr GetSigmaViewItemProperty(IntPtr pView, string itemnName, string property);
|
|
|
|
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
public delegate void WellPoleWndCallback(int msgType, int msgValue);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateFavorableArea", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int CreateFavorableArea(IntPtr pView, IntPtr pTargetXy, string layerName, double zMin, double zMax);
|
|
|
|
|
|
|
|
|
|
|
|
#region 地图
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
|
|
|
|
|
public delegate void MapDownloadProgressCallback(int done, int total);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DownloadSigmaViewItemMapView", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr DownloadSigmaViewItemMapView(IntPtr pView, int zoom, string urlStr, string borderLayer, string dirPath, string strPath, int type, MapDownloadProgressCallback progressCallback);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddSigmaViewItemMapImage", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool AddSigmaViewItemMapImage(IntPtr pView, string borderLayer, string strPath);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "StopDownloadMaplayer", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void StopDownloadMaplayer(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "IsSigmaViewMapView", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool IsSigmaViewMapView(IntPtr pView, string borderLayer);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 地图
|
|
|
|
|
|
|
|
|
|
|
|
#region 井柱接口
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "RegisterCallback", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void RegisterCallback(IntPtr pWellView, WellPoleWndCallback callback);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetSigmaViewItemProperty", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetSigmaViewItemProperty(IntPtr pView, string itemnName, string property, string value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateWellPoleView", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CreateWellPoleView();
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "CreateNewWell", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern IntPtr CreateNewWell(IntPtr pWellView,string wellName, double top,double bottom, double ratio,string templateFile);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewExtendCenter", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewExtendCenter(IntPtr pWellView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewExtendWidth", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ViewExtendWidth(IntPtr pWellView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ViewSetItemForSelectedElement", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int ViewSetItemForSelectedElement(IntPtr pWellView,int x, int y);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectWellPoleSetCursor", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectWellPoleSetCursor(IntPtr pView, int ptX, int ptY, ref int handle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetWellPoleViewOperationKind", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetWellPoleViewOperationKind(IntPtr pWellView, ViewOperationKind kind);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "InitWellPosition", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int InitWellPosition(IntPtr pWellView, int lrEdge);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "IsLockWellHead", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool IsLockWellHead(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetLockWellHead", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetLockWellHead(IntPtr pView, bool block);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "MouseWheelForLockWellHead", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void MouseWheelForLockWellHead(IntPtr pView, int nFlags, int zDelta, int x, int y);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "ScrollVForLockWellHead", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void ScrollVForLockWellHead(IntPtr pView, int nFlags, int scrollValue, int pageSize, int lineSize, int scrollMin, int scrollMax);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetScrollBarVRangeForLockWellHead", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void SetScrollBarVRangeForLockWellHead(IntPtr pView, ref int vrange, ref int page, ref int value);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetSelectWellObject", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetSelectWellObject(IntPtr pView, ref int type, ref int mtype, ref UInt64 objHandle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetWellTrackTypeInfo", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern int GetWellTrackTypeInfo(ref IntPtr typeBuff, ref int typeBuffLen, ref IntPtr typeStr, ref int typeStrLen);
|
|
|
|
|
|
|
|
|
|
|
|
// void FreeByteArray(BYTE* pBuff)
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "FreeByteArray", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern void FreeByteArray(IntPtr pBuff);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "DeleteSelectedWellObject", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool DeleteSelectedWellObject(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "AddTrackAfterSelectedWellObject", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool AddTrackAfterSelectedWellObject(IntPtr pView, int[] trackTypes, int trackNum);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectedTrackCombineLeftTrack", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectedTrackCombineLeftTrack(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SelectedTrackCombineRightTrack", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SelectedTrackCombineRightTrack(IntPtr pView);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetSelectedWell", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetSelectedWell(IntPtr pView, ref UInt64 objHandle);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "GetWellTrackDataJson", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool GetWellTrackDataJson(IntPtr pView, UInt64 objHandle, ref IntPtr jsonStr, ref int strLen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetWellTrackDataJson", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetWellTrackDataJson(IntPtr pView, UInt64 objHandle, byte[]jsonBuf,int datalen);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(SIGMALIB, EntryPoint = "SetPictureInWellTrack", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
public static extern bool SetPictureInWellTrack(IntPtr pView, UInt64 objHandle, String filePath);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 井柱接口
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
|
|
|
|
public static extern bool AddClipboardFormatListener(IntPtr hwnd);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
|
|
|
|
public static extern bool RemoveClipboardFormatListener(IntPtr hwnd);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#pragma warning restore CS1591
|