|
|
using System;
|
|
|
using System.Runtime.InteropServices;
|
|
|
#pragma warning disable CS1591
|
|
|
namespace GeoSigmaDrawLib
|
|
|
{
|
|
|
#region 数据定义
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct Point2D
|
|
|
{
|
|
|
public string pointName;
|
|
|
public double x;
|
|
|
public double y;
|
|
|
public double z;
|
|
|
public double angle;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct CrossPoint2D
|
|
|
{
|
|
|
public double x;
|
|
|
public double y;
|
|
|
public double angle;
|
|
|
public string name1;
|
|
|
public string name2;
|
|
|
public string name3;
|
|
|
public string name4;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct ProportionData
|
|
|
{
|
|
|
public double x;
|
|
|
public double y;
|
|
|
// double ScaleFactor; // 比例
|
|
|
public double ScaleLength; // 比例长度
|
|
|
public double ScaleHeight; // 比例高度
|
|
|
public int ViewMode; // 显示方式
|
|
|
public int num; // 个数
|
|
|
public int Unit; // 长度单位
|
|
|
public int ColorR; // 颜色 R
|
|
|
public int ColorG; // 颜色 G
|
|
|
public int ColorB; // 颜色 B
|
|
|
|
|
|
public double TextScale; // 文本比例
|
|
|
public int TextSpace; // 文本间隔
|
|
|
public int TextAlign; // 文本对齐
|
|
|
public double TextWidth; // 文本宽度
|
|
|
public double TextHeight; // 文本高度
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct FractionPoint
|
|
|
{
|
|
|
public double x;
|
|
|
public double y;
|
|
|
public double angle;
|
|
|
public string numeratorString;
|
|
|
public string denominatorString;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct RectangularCSGridData
|
|
|
{
|
|
|
public int showMode; // 曲线=0 交点=1 空=2
|
|
|
public double stepX; // 网格步长
|
|
|
public double stepY; // 网格步长
|
|
|
public int gridColorR;
|
|
|
public int gridColorG;
|
|
|
public int gridColorB;
|
|
|
public int textHeight;
|
|
|
public int textScale; // 地理 = 0, 数学=1, 地理1=2, 地理2全部=3
|
|
|
public int notatioinMode; // 所有边=0, 左边上边=1,上边右边=2,右边下边=3,下边左边=4
|
|
|
public double baseX; // 基数x
|
|
|
public double baseY; // 基数y
|
|
|
public double coefficientX; // 系数x
|
|
|
public double coefficientY; // 系数y
|
|
|
public double left; // 坐标范围左
|
|
|
public double top; // 坐标范围上
|
|
|
public double right; // 坐标范围右
|
|
|
public double bottom; // 坐标范围底
|
|
|
public int isShowOutBorder; // 是否显示外边框
|
|
|
public int borderThickness; // 边框厚度
|
|
|
public int blackOutterBorder; // 是否显示为黑边框
|
|
|
public int borderColorR;
|
|
|
public int borderColorG;
|
|
|
public int borderColorB;
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
{
|
|
|
if (!(obj is RectangularCSGridData))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
RectangularCSGridData other = (RectangularCSGridData)obj;
|
|
|
return (showMode == other.showMode
|
|
|
&& stepX == other.stepX
|
|
|
&& stepY == other.stepY
|
|
|
&& gridColorR == other.gridColorR
|
|
|
&& gridColorG == other.gridColorG
|
|
|
&& gridColorB == other.gridColorB
|
|
|
&& textHeight == other.textHeight
|
|
|
&& textScale == other.textScale
|
|
|
&& notatioinMode == other.notatioinMode
|
|
|
&& baseX == other.baseX
|
|
|
&& baseY == other.baseY
|
|
|
&& coefficientX == other.coefficientX
|
|
|
&& coefficientY == other.coefficientY
|
|
|
&& left == other.left
|
|
|
&& top == other.top
|
|
|
&& right == other.right
|
|
|
&& bottom == other.bottom
|
|
|
&& isShowOutBorder == other.isShowOutBorder
|
|
|
&& borderThickness == other.borderThickness
|
|
|
&& blackOutterBorder == other.blackOutterBorder
|
|
|
&& borderColorR == other.borderColorR
|
|
|
&& borderColorG == other.borderColorG
|
|
|
&& borderColorB == other.borderColorB);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct TextInformation
|
|
|
{
|
|
|
public string text;
|
|
|
public double textHeight;
|
|
|
public double textWidth;
|
|
|
public double angle;
|
|
|
public int bUpDown; // 是否按上下角标方式显示
|
|
|
public int r;
|
|
|
public int g;
|
|
|
public int b;
|
|
|
public IntPtr textArr;
|
|
|
public int lenOfTextArr;
|
|
|
public double x;
|
|
|
public double y;
|
|
|
public int textHeightOfDisplayed; // 文字的显示高度
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct CurveNode
|
|
|
{
|
|
|
public double x;
|
|
|
public double y;
|
|
|
public double z;
|
|
|
public double len;
|
|
|
public double realLen;
|
|
|
public double angle;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
public struct BufferAgency
|
|
|
{
|
|
|
public IntPtr buffer;
|
|
|
public int len;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct ViewFactor
|
|
|
{
|
|
|
public double offsetX;
|
|
|
public double offsetY;
|
|
|
public double zoomFactor;
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
|
|
|
public struct ElementInfo
|
|
|
{
|
|
|
public IntPtr name;
|
|
|
public int lenOfName;
|
|
|
public int elementType;
|
|
|
public IntPtr layerName;
|
|
|
public int lenOfLayerName;
|
|
|
public IntPtr markName;
|
|
|
public int lenOfMarkName;
|
|
|
public double length;
|
|
|
public double area;
|
|
|
public double azimuth; // 方位角
|
|
|
public double x;
|
|
|
public double y;
|
|
|
public double z;
|
|
|
};
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct FourPoint
|
|
|
{
|
|
|
// 输入的四个点的坐标
|
|
|
public double cx1;
|
|
|
public double cy1;
|
|
|
public double cx2;
|
|
|
public double cy2;
|
|
|
public double cx3;
|
|
|
public double cy3;
|
|
|
public double cx4;
|
|
|
public double cy4;
|
|
|
// 四个点的世界坐标
|
|
|
public double wx1;
|
|
|
public double wy1;
|
|
|
public double wx2;
|
|
|
public double wy2;
|
|
|
public double wx3;
|
|
|
public double wy3;
|
|
|
public double wx4;
|
|
|
public double wy4;
|
|
|
};
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct TwoPoint
|
|
|
{
|
|
|
// 输入的二个点的坐标
|
|
|
public double cx1;
|
|
|
public double cy1;
|
|
|
public double cx2;
|
|
|
public double cy2;
|
|
|
// 四个点的世界坐标
|
|
|
public double wx1;
|
|
|
public double wy1;
|
|
|
public double wx2;
|
|
|
public double wy2;
|
|
|
};
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct DeletionCondition
|
|
|
{
|
|
|
public int kind; // 删除依据 0--曲线长度 1--曲线名称 2--点类名称
|
|
|
public double threshold; // 门限值
|
|
|
public int method; // 删除方法
|
|
|
// 筛选条件 <门限值
|
|
|
public int ConditionDeletion;
|
|
|
public string layerName; // 层位
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct CutImageInfo
|
|
|
{
|
|
|
public string fileNamesSelected; // 要转换的文件列表。使用分号分割各个文件名。
|
|
|
public string rangeCurveFileName;
|
|
|
public int kindOfoutputDirectory; // 0--源码所在目录 1--指定目录
|
|
|
public string outputDirectorySpecified;
|
|
|
};
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct FileTransformationInfo
|
|
|
{
|
|
|
public string fileNamesSelected; // 要转换的文件列表。使用分号分割各个文件名。
|
|
|
public int kindOfoutputDirectory; // 0--源码所在目录 1--指定目录
|
|
|
public string outputDirectorySpecified;
|
|
|
public int format; // 目标文件格式
|
|
|
public int bMark; // 清除不使用的符号
|
|
|
public int bClassification; // 清除不使用的类别
|
|
|
};
|
|
|
#endregion 数据定义
|
|
|
|
|
|
public enum ViewOperationKind
|
|
|
{
|
|
|
Invalid = 0,
|
|
|
ViewPan = 1,
|
|
|
ViewWindow = 2,
|
|
|
ViewWellPolePan=3,
|
|
|
}
|
|
|
|
|
|
public enum LayerStatus
|
|
|
{
|
|
|
VIEW_EDIT = 10,
|
|
|
VIEW_NOT_EDIT = 11,
|
|
|
NOT_VIEW_NOT_EDIT = 12
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 曲线样式类别
|
|
|
/// </summary>
|
|
|
public enum CurveStyleType
|
|
|
{
|
|
|
CurveArrowHead = 101, // 首箭头
|
|
|
CurveArrowTail = 102, // 尾箭头
|
|
|
CurveScale = 103, // 刻度
|
|
|
CurveRgn = 104, // 符号充填
|
|
|
CurveNameHead = 105, // 首名字
|
|
|
CurveNameTail = 106, // 尾名字
|
|
|
CurveProperties = 107, // 属性
|
|
|
CurveInName = 108, // 曲线内部名字
|
|
|
CurveLocate = 109, // 桩号
|
|
|
CurveTwoMark = 110, // 两个符号
|
|
|
CurveInNameAny = 111, // 任意处上名字
|
|
|
CurveMarkHead = 112, // 首符号
|
|
|
CurveMarkTail = 113, // 尾符号
|
|
|
CurveMarkMove = 114, // 闪烁
|
|
|
CurveEffect = 115, // 渐变充填
|
|
|
CurveCenterName = 116, // 在曲线范围的中心处上名字
|
|
|
//CurveLocation = 1, // 桩号
|
|
|
//CurveScaleSymbol = 2, // 刻度
|
|
|
//CurveName = 3, // 名字
|
|
|
//CurveTwoMark = 4, // 两个符号
|
|
|
//CurveFillSymbol = 5, // 符号填充
|
|
|
//CurveInName = 6, // 内部写名字
|
|
|
//CurveInNameAny = 7, // 任意处写名字
|
|
|
//CurveEffect = 8, // 渐变色
|
|
|
//CurveCenterName = 9, // 中心上名字
|
|
|
}
|
|
|
|
|
|
//椭球体种类
|
|
|
/*
|
|
|
0 China-1954
|
|
|
1 China-1967
|
|
|
2 China-1975
|
|
|
3 China-1980
|
|
|
4 China-1983
|
|
|
5 WGS-60
|
|
|
6 WGS-66
|
|
|
7 WGS-72
|
|
|
8 WGS-84
|
|
|
9 Bessel
|
|
|
10 Hayfard
|
|
|
11 Clarke-1866
|
|
|
12 Krasovsky
|
|
|
13 YouCunYi(China)
|
|
|
14 GRIM-1
|
|
|
15 GRIM-2
|
|
|
16 GEM-8
|
|
|
17 GEM-10
|
|
|
*/
|
|
|
|
|
|
//projection
|
|
|
/*
|
|
|
0 Gauss
|
|
|
1 UTM
|
|
|
2 Lambert
|
|
|
3 mercator
|
|
|
4 Albers
|
|
|
*/
|
|
|
|
|
|
//coordinate_type
|
|
|
/*
|
|
|
0 经度,纬度
|
|
|
1 横坐标X,纵坐标Y
|
|
|
2 纬度,经度
|
|
|
3 横坐标Y,纵坐标X
|
|
|
*/
|
|
|
|
|
|
//coordinate_unit
|
|
|
/*
|
|
|
0 度分秒
|
|
|
1 米
|
|
|
2 度
|
|
|
3 公里
|
|
|
*/
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct SigmaProjectionParameter
|
|
|
{
|
|
|
//for conformal conic projection
|
|
|
public double conic_OriginLongitude; //原点经度
|
|
|
public double conic_OriginLatitude; //原点纬度
|
|
|
public double conic_b1; //标准纬度
|
|
|
public double conic_b2;
|
|
|
//for gauss and utm
|
|
|
public int w; //带宽(6或者3)
|
|
|
public int zone;
|
|
|
public double m_dCustomCenterLongitude; //自定义的中央经线
|
|
|
public double m_dScaleFactor; //比例系数
|
|
|
|
|
|
public int projection; //投影系统
|
|
|
public int coordinate_unit; //坐标单位
|
|
|
public int coordinate_type; //坐标参数
|
|
|
public int ellipsoidKind; //椭球体种类
|
|
|
|
|
|
public int latitude; //0北纬、1南纬
|
|
|
public int longitude; //0东经、1西经
|
|
|
public int bZone; //0 无带号 1 有代号 flags虽然包含是否有代号的信息 但不方便使用 因要用到位运算
|
|
|
public int bCustomCenterLongitude; //0 不是自定义中央经线 1 是
|
|
|
}
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
|
|
|
public struct PrintPartition
|
|
|
{
|
|
|
public int bPartitin; //是否分幅
|
|
|
public int kind; //不使用枚举。便于向C++传递。 0 不分幅 1 全部分幅 2 横向分幅 3 纵向分幅
|
|
|
public int row; //索引从1开始
|
|
|
public int col; //索引从1开始
|
|
|
public int overlapWidth; //重叠宽度 单位为像素
|
|
|
//--------------
|
|
|
//这是打印及打印预览所使用的辅助信息
|
|
|
public int bPreview; //0 打印预览 1 打印 不使用布尔值 防止传递给C++时可能出现的错 误
|
|
|
public int currentPage; //索引从1开始
|
|
|
public int countOfPage; //总页数
|
|
|
}
|
|
|
|
|
|
public enum MathFindKind
|
|
|
{
|
|
|
曲线,
|
|
|
点类,
|
|
|
曲线和点类
|
|
|
}
|
|
|
public enum ActionType
|
|
|
{
|
|
|
ActionTypeLayerRename = 1, // 图层重命名
|
|
|
ActionTypeLayerAdd = 2, // 图层添加
|
|
|
ActionTypeLayerDelete = 3, // 图层删除
|
|
|
ActionTypeLayerDragDrop = 4, // 图层拖拽8
|
|
|
ActionTypeLayerCurveAdd = 5, // 图层添加曲线修饰
|
|
|
ActionTypeLayerCurveDelete = 6, // 图层删除曲线修饰
|
|
|
ActionTypeLayerCurveMoveUp = 7, // 图层删除曲线修饰
|
|
|
ActionTypeLayerCurveMoveDown = 8, // 图层删除曲线修饰
|
|
|
ActionTypeLayerPointAdd = 9, // 图层添加点修饰
|
|
|
ActionTypeLayerPointDelete = 10, // 图层删除点修饰
|
|
|
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 数据统计类型
|
|
|
/// </summary>
|
|
|
public enum StatisticType
|
|
|
{
|
|
|
STAT_MODE_ELEMENTS = 0, // 统计元素(缺省)
|
|
|
STAT_MODE_TRAPS = 1, // 统计圈闭
|
|
|
STAT_MODE_VOLUME = 2, // 统计体积
|
|
|
STAT_MODE_SURVEY = 3, // 统计测线
|
|
|
STAT_MODE_WELL = 4, // 统计井位
|
|
|
STAT_MODE_LAYER = 5, // 层位统计
|
|
|
STAT_MODE_FAULTS = 6, // 统计断层
|
|
|
}
|
|
|
}
|
|
|
#pragma warning restore CS1591 |