本文整理汇总了C#中BoundingBox.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# BoundingBox.Equals方法的具体用法?C# BoundingBox.Equals怎么用?C# BoundingBox.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundingBox
的用法示例。
在下文中一共展示了BoundingBox.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestVarious
public void TestVarious()
{
BoundingBox b1 = new BoundingBox(20, 30, 40, 55);
Assert.AreEqual(20, b1.Left);
Assert.AreEqual(20, b1.Min.X);
Assert.AreEqual(40, b1.Right);
Assert.AreEqual(40, b1.Max.X);
Assert.AreEqual(30, b1.Bottom);
Assert.AreEqual(30, b1.Min.Y);
Assert.AreEqual(55, b1.Top);
Assert.AreEqual(55, b1.Max.Y);
Assert.AreEqual(20, b1.Width);
Assert.AreEqual(25, b1.Height);
Assert.AreNotSame(b1, b1.Clone());
Assert.IsTrue(b1.Contains(new Point(30, 40)));
Assert.IsTrue(b1.Contains(new Point(20, 40)));
Assert.IsFalse(b1.Contains(new Point(10, 10)));
Assert.IsFalse(b1.Contains(new Point(50, 60)));
Assert.IsFalse(b1.Contains(new Point(30, 60)));
Assert.IsFalse(b1.Contains(new Point(50, 40)));
Assert.IsFalse(b1.Contains(new Point(30, 15)));
Assert.IsTrue(b1.Equals(new BoundingBox(20, 30, 40, 55)));
Assert.AreEqual(new Point(30, 42.5), b1.GetCentroid());
Assert.AreEqual(1, b1.LongestAxis);
Assert.AreEqual(new BoundingBox(19, 29, 41, 56), b1.Grow(1));
Assert.IsFalse(b1.Equals(null));
Assert.IsFalse(b1.Equals((object)new Polygon()));
Assert.AreEqual("20,30 40,55", b1.ToString());
Assert.AreEqual(b1,new BoundingBox(40,55,20,30));
Assert.AreEqual(Math.Sqrt(200), b1.Distance(new BoundingBox(50,65,60,75)));
}
示例2: EqualityTest
public void EqualityTest()
{
BoundingBox b1 = new BoundingBox(20, 30, 40, 55);
BoundingBox b2 = new BoundingBox(20, 30, 40, 55);
BoundingBox b3 = new BoundingBox(21, 31, 39, 54);
Assert.IsFalse(b1.Equals(null));
Assert.IsFalse(b1.Equals(BoundingBox.Empty));
Assert.IsFalse(b1.Equals(new object()));
Assert.IsTrue(b1.Equals(b2));
Assert.IsTrue(b1.Equals(b3, new Tolerance(1.1)));
Assert.IsFalse(b1.Equals(b3, new Tolerance(0.9)));
}
示例3: CheckForExactEquality
public void CheckForExactEquality()
{
var box = new BoundingBox(Vector3D.Zero, Vector3D.One);
var equalBox = new BoundingBox(Vector3D.Zero, Vector3D.One);
Assert.IsTrue(box.Equals((object)equalBox));
}