using System.Runtime.Serialization;
|
using System.Text;
|
|
namespace Eventech.Model
|
{
|
//比ThroughCurve多一个参数
|
[Serializable]
|
public class ThroughParaCurve : Yw.Pump.CurveEqualE, ICloneable
|
{
|
public ThroughParaCurve() { }
|
|
public ThroughParaCurve(ThroughParaCurve rhs) {
|
this.DispTension = rhs.DispTension;
|
this.IsClosed = rhs.IsClosed;
|
this.CurvePara = rhs.CurvePara;
|
this.PointInfo = rhs.PointInfo.Clone();
|
}
|
|
public ThroughParaCurve(double para, List<Eventech.Model.FeatPoint> curveInfo, bool isClosed=false, float tension=0.5f)
|
{
|
CurvePara = para;
|
PointInfo = new Eventech.Model.FeatPointList(curveInfo);
|
IsClosed = isClosed;
|
DispTension = tension;
|
}
|
|
|
[DataMember]
|
public double CurvePara { get; set; }
|
|
[DataMember]
|
public bool IsClosed { get; set; }
|
|
|
|
//比较相同:主要用与LIST的Contains方法和Distinct
|
public class EqualComparer : IEqualityComparer<ThroughParaCurve>
|
{
|
private double ignoreDis = 0.001;
|
public EqualComparer()
|
{
|
ignoreDis = 0.001;
|
}
|
public EqualComparer(double dis)
|
{
|
ignoreDis = dis;
|
}
|
|
public bool Equals(ThroughParaCurve lhs, ThroughParaCurve rhs)
|
{
|
|
if (Math.Abs(lhs.CurvePara - rhs.CurvePara) < ignoreDis)
|
return true;
|
else
|
return false;
|
}
|
|
public int GetHashCode(ThroughParaCurve obj)
|
{
|
//return obj.X.GetHashCode() + obj.Y.GetHashCode();
|
return 0;
|
}
|
}
|
|
}
|
|
|
|
}
|