示例#1
0
 public virtual void TestMultiPoint()
 {
     com.epl.geometry.MultiPoint mp = new com.epl.geometry.MultiPoint();
     mp.Add(new com.epl.geometry.Point(100, 200));
     mp.Add(new com.epl.geometry.Point(101, 201));
     mp.Add(new com.epl.geometry.Point(102, 202));
     NUnit.Framework.Assert.IsFalse(mp.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     mp.AddAttribute(com.epl.geometry.VertexDescription.Semantics.M);
     NUnit.Framework.Assert.IsTrue(mp.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     NUnit.Framework.Assert.IsTrue(double.IsNaN(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 0, 0)));
     NUnit.Framework.Assert.IsTrue(double.IsNaN(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 1, 0)));
     NUnit.Framework.Assert.IsTrue(double.IsNaN(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 2, 0)));
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.M, 0, 0, 1);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.M, 1, 0, 2);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.M, 2, 0, 3);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 0, 0) == 1);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 1, 0) == 2);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 2, 0) == 3);
     NUnit.Framework.Assert.IsFalse(mp.HasAttribute(com.epl.geometry.VertexDescription.Semantics.Z));
     mp.AddAttribute(com.epl.geometry.VertexDescription.Semantics.Z);
     NUnit.Framework.Assert.IsTrue(mp.HasAttribute(com.epl.geometry.VertexDescription.Semantics.Z));
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 0, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 1, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 2, 0) == 0);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.Z, 0, 0, 11);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.Z, 1, 0, 21);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.Z, 2, 0, 31);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 0, 0) == 1);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 1, 0) == 2);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 2, 0) == 3);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 0, 0) == 11);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 1, 0) == 21);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 2, 0) == 31);
     NUnit.Framework.Assert.IsFalse(mp.HasAttribute(com.epl.geometry.VertexDescription.Semantics.ID));
     mp.AddAttribute(com.epl.geometry.VertexDescription.Semantics.ID);
     NUnit.Framework.Assert.IsTrue(mp.HasAttribute(com.epl.geometry.VertexDescription.Semantics.ID));
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 0, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 1, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 2, 0) == 0);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.ID, 0, 0, -11);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.ID, 1, 0, -21);
     mp.SetAttribute(com.epl.geometry.VertexDescription.Semantics.ID, 2, 0, -31);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 0, 0) == 1);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 1, 0) == 2);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 2, 0) == 3);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 0, 0) == 11);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 1, 0) == 21);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 2, 0) == 31);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 0, 0) == -11);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 1, 0) == -21);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 2, 0) == -31);
     mp.DropAttribute(com.epl.geometry.VertexDescription.Semantics.M);
     NUnit.Framework.Assert.IsFalse(mp.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 0, 0) == 11);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 1, 0) == 21);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 2, 0) == 31);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 0, 0) == -11);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 1, 0) == -21);
     NUnit.Framework.Assert.IsTrue(mp.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 2, 0) == -31);
     com.epl.geometry.MultiPoint mp1 = new com.epl.geometry.MultiPoint();
     mp.CopyTo(mp1);
     NUnit.Framework.Assert.IsFalse(mp1.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 0, 0) == 11);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 1, 0) == 21);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 2, 0) == 31);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 0, 0) == -11);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 1, 0) == -21);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 2, 0) == -31);
     mp1.DropAllAttributes();
     mp1.MergeVertexDescription(mp.GetDescription());
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 0, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 1, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.Z, 2, 0) == 0);
     NUnit.Framework.Assert.IsTrue(double.IsNaN(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 0, 0)));
     NUnit.Framework.Assert.IsTrue(double.IsNaN(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 1, 0)));
     NUnit.Framework.Assert.IsTrue(double.IsNaN(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.M, 2, 0)));
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 0, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 1, 0) == 0);
     NUnit.Framework.Assert.IsTrue(mp1.GetAttributeAsDbl(com.epl.geometry.VertexDescription.Semantics.ID, 2, 0) == 0);
 }