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.

245 lines
6.0 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;
namespace GeoSigma.SigmaDrawerStyle
{
/// <summary>
/// 等值线相关属性
/// </summary>
public class ContourProperty
{
private IContourPropertyChange iChange;
private int contourInterval;
private int contourOnStep;
//private double zValueRange;
private string contourTypeName;
private string contourNoTypeName;
private FaultMethod faultExistMethod;
private string faultFile;
//private string faultType;
private double minValue;
private double maxValue;
/// <summary>
/// 属性类别排序
/// </summary>
private List<string> categorys = new List<string>() { "曲面", "断层", "其他", "杂项" };
/// <summary>
/// Initializes a new instance of the <see cref="ContourProperty"/> class.
/// </summary>
/// <param name="iChange">事件</param>
public ContourProperty(IContourPropertyChange iChange)
{
this.iChange = iChange;
this.contourInterval = 10;
this.contourOnStep = 5;
//this.zValueRange
this.contourTypeName = @"Layer:\Contour\Mark";
this.contourNoTypeName = @"Layer:\Contour\Other";
this.faultExistMethod = FaultMethod.;
this.faultFile = string.Empty;
//this.faultType = string.Empty;
minValue = iChange.GetMeshItemsMinValue();
maxValue = iChange.GetMeshItemsMaxValue();
}
#region 曲面
[XmlIgnore]
[Category("曲面"), DisplayName("\t\t\t等值线间隔")]
public int ContourInterval
{
get
{
return this.contourInterval;
}
set
{
this.contourInterval = value;
}
}
/// <summary>Gets or sets the contour on step.</summary>
/// <value>The contour on step.</value>
[XmlIgnore]
[Category("曲面"), DisplayName("\t\t\t等值线上步长")]
public int ContourOnStep
{
get
{
return this.contourOnStep;
}
set
{
this.contourOnStep = value;
}
}
private ZValue zValue;
[XmlIgnore]
[Category("曲面"), DisplayName("\t\t\tZ值范围")]
[TypeConverter(typeof(SigmaDrawerStyle.Converter.BaseExpandableConverter))]
public ZValue ZValueRange
{
get
{
if (zValue == null)
{
zValue = new ZValue();
}
zValue.Zmin = minValue;
zValue.Zmax = maxValue;
return zValue;
}
set
{
this.zValue = value;
}
}
#endregion
#region 层位
[XmlIgnore]
[Category("层位"), DisplayName("\t\t\t等值线上数类别名")]
public string ContourTypeName
{
get
{
return this.contourTypeName;
}
set
{
this.contourTypeName = value;
}
}
[XmlIgnore]
[Category("层位"), DisplayName("\t\t\t等值线上数类别名")]
public string ContourNoTypeName
{
get
{
return this.contourNoTypeName;
}
set
{
this.contourNoTypeName = value;
}
}
#endregion
#region 断层
[XmlIgnore]
[Category("断层"), DisplayName("\t\t\t断层存在方式")]
public FaultMethod FaultExistMethod
{
get
{
return this.faultExistMethod;
}
set
{
this.faultExistMethod = value;
}
}
[XmlIgnore]
[Category("断层"), DisplayName("\t\t\t断层文件")]
[Editor("UCDraw.PropertyGrids.PropertyGridOpenFile, UCDraw", typeof(UITypeEditor))]
public string FaultFile
{
get
{
return faultFile;
}
set
{
faultFile = value;
}
}
[Category("断层"), DisplayName("\t\t\t断层类别")]
[Editor("UCDraw.Editor.LayerEditor, UCDraw", typeof(UITypeEditor))]
public string FaultType
{
get;
set;
}
#endregion
public enum FaultMethod
{
,
,
}
}
public interface IContourPropertyChange
{
double GetMeshItemsMinValue();
double GetMeshItemsMaxValue();
}
public class ZValue
{
private double maxValue;
private double minValue;
/// <summary>
/// Initializes a new instance of the <see cref="ZValue"/> class.
/// </summary>
public ZValue()
{
}
[DisplayName("\t\t\t最小")]
[XmlIgnore]
[NotifyParentProperty(true)]
public double Zmin
{
get
{
return minValue;
}
set
{
minValue = value;
}
}
[DisplayName("\t\t最大")]
[XmlIgnore]
[NotifyParentProperty(true)]
public double Zmax
{
get
{
return maxValue;
}
set
{
maxValue = value;
}
}
public override string ToString()
{
return $"{minValue},{maxValue}";
}
}
}