public void Execute(IPlatformFactory factory, ITestLogger logger) { var build = new GeomBuild(); MgCurveRing geom1 = build.CreateCurveRing(2.0); MgCurveRing geom2 = build.CreateCurveRing(12.0); MgCurveRing geom3 = build.CreateCurveRing(2.0); MgCurveRingCollection coll = new MgCurveRingCollection(); coll.Add(geom1); coll.Add(geom2); coll.Add(geom3); Assert.AreEqual(3, coll.Count); Assert.IsTrue(geom1.Envelope().Contains(coll[0].Envelope())); Assert.IsTrue(coll[0].Envelope().Contains(coll[2].Envelope())); Assert.IsFalse(coll[0].Envelope().Contains(coll[1].Envelope())); coll[0] = coll[1]; Assert.IsTrue(coll[0].Envelope().Contains(coll[1].Envelope())); double width = 0.0; foreach (MgCurveRing geom in coll) { width += geom.Envelope().GetWidth(); } Assert.AreEqual(geom1.Envelope().GetWidth() * 3.0, width); }
public MgCurvePolygon CreateCurvePolygon(double offset, int increment) { MgCurveRing extRing = CreateCurveRing(offset + increment); MgCurveRingCollection intRings = new MgCurveRingCollection(); MgCurveRing ring1 = CreateCurveRing(offset + 2 * increment); MgCurveRing ring2 = CreateCurveRing(offset + 3 * increment); intRings.Add(ring1); intRings.Add(ring2); return factory.CreateCurvePolygon(extRing, intRings); }
public MgCurvePolygon CreateCurvePolygon(double offset, int increment) { MgCurveRing extRing = CreateCurveRing(offset + increment); MgCurveRingCollection intRings = new MgCurveRingCollection(); MgCurveRing ring1 = CreateCurveRing(offset + 2 * increment); MgCurveRing ring2 = CreateCurveRing(offset + 3 * increment); intRings.Add(ring1); intRings.Add(ring2); return(factory.CreateCurvePolygon(extRing, intRings)); }
public void CurveRingCollection() { MgCurveRing geom1 = build.CreateCurveRing(2.0); MgCurveRing geom2 = build.CreateCurveRing(12.0); MgCurveRing geom3 = build.CreateCurveRing(2.0); MgCurveRingCollection coll = new MgCurveRingCollection(); coll.Add(geom1); coll.Add(geom2); coll.Add(geom3); Assert.AreEqual(3, coll.Count); Assert.IsTrue(geom1.Envelope().Contains(coll[0].Envelope())); Assert.IsTrue(coll[0].Envelope().Contains(coll[2].Envelope())); Assert.IsFalse(coll[0].Envelope().Contains(coll[1].Envelope())); coll[0] = coll[1]; Assert.IsTrue(coll[0].Envelope().Contains(coll[1].Envelope())); double width = 0.0; foreach (MgCurveRing geom in coll) { width += geom.Envelope().GetWidth(); } Assert.AreEqual(geom1.Envelope().GetWidth() * 3.0, width); }