예제 #1
0
		public virtual void CopyFrom(Rect other)
		{
			Min.CopyFrom(other.Min);
			Max.CopyFrom(other.Max);
			Ps.Clear();
			Ps.AddRange(other.Ps);
			Ls.Clear();
			Ls.AddRange(other.Ls);
			LLs.Clear();
			LLs.AddRange(other.LLs);
		}
예제 #2
0
		public bool Equals(Rect other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			if (Ps.Count != other.Ps.Count)
				return false;
			for(int i = 0; i < Ps.Count; ++i)
			{
				var mine = Ps[i];
				var theirs = other.Ps[i];
				if (!Equals(mine, theirs))
					return false;
			}
			if (Ls.Count != other.Ls.Count)
				return false;
			for(int i = 0; i < Ls.Count; ++i)
			{
				var mine = Ls[i];
				var theirs = other.Ls[i];
				if ((mine == null) != (theirs == null) || (mine != null && Math.Abs((double) mine - (double) theirs) >= 1E-06))
					return false;
			}
			if (LLs.Count != other.LLs.Count)
				return false;
			for(int i = 0; i < LLs.Count; ++i)
			{
				var mine = LLs[i];
				var theirs = other.LLs[i];
				if (Math.Abs(mine - theirs) >= 1E-06)
					return false;
			}
			return Min.Equals(other.Min)
			       && Max.Equals(other.Max)
			       ;
		}
예제 #3
0
파일: Rect.cs 프로젝트: pescuma/modelsharp
		public Rect(Rect other)
		: base(other)
		{
		}