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

268 lines
8.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Construction.BatchCreateMap
{
[StructLayout(LayoutKind.Sequential, Pack = 0)]
public struct StructAnylizeParameter
{
[MarshalAs(UnmanagedType.R8)]
public double MinimumArea;
// Limit Number
[MarshalAs(UnmanagedType.I4)]
public System.Int32 LimitNum;
// Fault Filter
[MarshalAs(UnmanagedType.U1)]
public bool FaultFilter;
// 断层闭合距离
[MarshalAs(UnmanagedType.R8)]
public double FaultCloseDis;
// 最大闭合距离
[MarshalAs(UnmanagedType.R8)]
public double CloseDistance;
// 断层延伸长度
[MarshalAs(UnmanagedType.R8)]
public double ExtendDis;
// Offset Distance
[MarshalAs(UnmanagedType.R8)]
public double OffsetDis;
// 最小角度
[MarshalAs(UnmanagedType.R8)]
public double MiniAngle;
// Redundant
[MarshalAs(UnmanagedType.R8)]
public double Redundant;
// Radius
[MarshalAs(UnmanagedType.R8)]
public double Radius;
[MarshalAs(UnmanagedType.U1)]
public bool Smooth; // 光滑半径
[MarshalAs(UnmanagedType.R8)]
public double Zoomin; // 放大系数
[MarshalAs(UnmanagedType.R8)]
public double UnitSacle; // 鼻状隆起和沟槽重合比
[MarshalAs(UnmanagedType.R8)]
public double MinDepth; // 最小幅度
[MarshalAs(UnmanagedType.R8)]
public double MaxDepth; // 最大幅度
/// <summary>
/// The shape types
/// </summary>
[MarshalAs(UnmanagedType.I4)]
public StructureType ShapeTypes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string CurveLayer;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string FaultageLayer;
public StructAnylizeParameter(double minimumArea, int limitNum
, bool faultFilter, double faultCloseDis
, double m_dCloseDistance, double extendDis
, double offsetDis, double miniAngle, double redundant
, double radius, bool smooth, double zoomIn, double unitScale, double minDepth, double maxDepth, StructureType shapeTypes
, string curveLayer, string faultageLayer)
{
MinimumArea = minimumArea;
LimitNum = limitNum;
FaultFilter = faultFilter;
FaultCloseDis = faultCloseDis;
this.CloseDistance = m_dCloseDistance;
ExtendDis = extendDis;
OffsetDis = offsetDis;
MiniAngle = miniAngle;
Redundant = redundant;
Radius = radius;
Smooth = smooth;
Zoomin = zoomIn;
UnitSacle = unitScale;
MinDepth = minDepth;
this.MaxDepth = maxDepth;
ShapeTypes = shapeTypes;
CurveLayer = curveLayer;
FaultageLayer = faultageLayer;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 0)]
public class AnylizeCalculateParameter
{
[MarshalAs(UnmanagedType.R8)]
public double MinimumArea;
// Limit Number
[MarshalAs(UnmanagedType.I4)]
public System.Int32 LimitNum;
// Fault Filter
[MarshalAs(UnmanagedType.U1)]
public bool FaultFilter;
// 断层闭合距离
[MarshalAs(UnmanagedType.R8)]
public double FaultCloseDis;
// 最大闭合距离
[MarshalAs(UnmanagedType.R8)]
public double CloseDistance;
// 断层延伸长度
[MarshalAs(UnmanagedType.R8)]
public double ExtendDis;
// Offset Distance
[MarshalAs(UnmanagedType.R8)]
public double OffsetDis;
// 最小角度
[MarshalAs(UnmanagedType.R8)]
public double MiniAngle;
// Redundant
[MarshalAs(UnmanagedType.R8)]
public double Redundant;
// Radius
[MarshalAs(UnmanagedType.R8)]
public double Radius;
//// 是否生成高点、低点
//[MarshalAs(UnmanagedType.U1)]
//public bool CloseShape;
//// 是否生成断鼻和断沟
//[MarshalAs(UnmanagedType.U1)]
//public bool FaultShape;
//// 是否生成鼻状、沟槽
//[MarshalAs(UnmanagedType.U1)]
//public bool NoseShape;
// 光滑系数
//[MarshalAs(UnmanagedType.R8)]
//public double Smooth;
[MarshalAs(UnmanagedType.U1)]
public bool Smooth; // 光滑半径
[MarshalAs(UnmanagedType.R8)]
public double Zoomin; // 放大系数
[MarshalAs(UnmanagedType.R8)]
public double UnitSacle; // 鼻状隆起和沟槽重合比
[MarshalAs(UnmanagedType.R8)]
public double MinDepth; // 最小幅度
[MarshalAs(UnmanagedType.R8)]
public double MaxDepth; // 最大幅度
/// <summary>
/// The shape types
/// </summary>
[MarshalAs(UnmanagedType.I4)]
public StructureType ShapeTypes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string CurveLayer;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string FaultageLayer;
public AnylizeCalculateParameter(double minimumArea, int limitNum
, bool faultFilter, double faultCloseDis
, double m_dCloseDistance, double extendDis
, double offsetDis, double miniAngle, double redundant
, double radius, bool smooth, double zoomIn, double unitScale, double minDepth, double maxDepth, StructureType shapeTypes
, string curveLayer, string faultageLayer)
{
MinimumArea = minimumArea;
LimitNum = limitNum;
FaultFilter = faultFilter;
FaultCloseDis = faultCloseDis;
this.CloseDistance = m_dCloseDistance;
ExtendDis = extendDis;
OffsetDis = offsetDis;
MiniAngle = miniAngle;
Redundant = redundant;
Radius = radius;
Smooth = smooth;
Zoomin = zoomIn;
UnitSacle = unitScale;
MinDepth = minDepth;
this.MaxDepth = maxDepth;
ShapeTypes = shapeTypes;
CurveLayer = curveLayer;
FaultageLayer = faultageLayer;
}
public StructAnylizeParameter ToStruct()
{
return new StructAnylizeParameter(
MinimumArea
, LimitNum
, FaultFilter
, FaultCloseDis,
this.CloseDistance,
ExtendDis,
OffsetDis,
MiniAngle,
Redundant,
Radius,
Smooth,
Zoomin,
UnitSacle,
MinDepth,
this.MaxDepth,
ShapeTypes,
CurveLayer,
FaultageLayer);
}
public static AnylizeCalculateParameter CreateDefaultParameter()
{
return new AnylizeCalculateParameter(
800,
4,
true,
30,
30,
100,
30,
80,
0.6,
40,
false,
10,
0.5,
0,
100,
StructureType.StructrueAll
, "等值线"
, "断层");
}
public void CopyTo(ref AnylizeCalculateParameter other)
{
other.MinimumArea = this.MinimumArea;
other.LimitNum = this.LimitNum;
other.FaultFilter = this.FaultFilter;
other.FaultCloseDis = this.FaultCloseDis;
other.CloseDistance = this.CloseDistance;
other.ExtendDis = this.ExtendDis;
other.OffsetDis = this.OffsetDis;
other.MiniAngle = this.MiniAngle;
other.Redundant = this.Redundant;
other.Radius = this.Radius;
other.Smooth = this.Smooth;
other.Zoomin = this.Zoomin;
other.UnitSacle = this.UnitSacle;
other.MinDepth = this.MinDepth;
other.MaxDepth = this.MaxDepth;
other.ShapeTypes = this.ShapeTypes;
}
};
/// <summary>
/// 微构造类型
/// </summary>
[Flags]
public enum StructureType
{
High = 1 << 0,
Low = 1 << 1,
FaultHigh = 1 << 2,
FaultLow = 1 << 3,
NoseHigh = 1 << 4,
NoseLow = 1 << 5,
StructrueAll = High | Low | FaultHigh | FaultLow | NoseHigh | NoseLow,
StructrueNone = 0,
}
}