public void Execute(IPlatformFactory factory, ITestLogger logger) { MgGeometryFactory gf = new MgGeometryFactory(); MgCoordinate pt1 = gf.CreateCoordinateXY(0, 0); MgCoordinate pt2 = gf.CreateCoordinateXY(0, 10); MgCoordinate pt3 = gf.CreateCoordinateXY(10, 10); MgCoordinate pt4 = gf.CreateCoordinateXY(10, 0); MgCoordinateCollection coordinates = new MgCoordinateCollection(); coordinates.Add(pt1); coordinates.Add(pt2); coordinates.Add(pt3); coordinates.Add(pt4); MgLinearSegment linearSegment = gf.CreateLinearSegment(coordinates); MgCurveSegmentCollection curveSegments = new MgCurveSegmentCollection(); curveSegments.Add(linearSegment); MgCurveString curveString = gf.CreateCurveString(curveSegments); MgCurveStringCollection csc = new MgCurveStringCollection(); csc.Add(curveString); MgMultiCurveString mcs = gf.CreateMultiCurveString(csc); Assert.AreEqual(1, mcs.Count); Assert.AreEqual(MgGeometryType.MultiCurveString, mcs.GeometryType); Assert.AreEqual(1, mcs.Dimension); }
public void Execute(IPlatformFactory factory, ITestLogger logger) { MgGeometryFactory gf = new MgGeometryFactory(); MgCoordinate pt1 = gf.CreateCoordinateXY(0, 0); MgCoordinate pt2 = gf.CreateCoordinateXY(0, 10); MgCoordinate pt3 = gf.CreateCoordinateXY(10, 10); MgCoordinate pt4 = gf.CreateCoordinateXY(10, 0); MgCoordinateCollection coordinates = new MgCoordinateCollection(); coordinates.Add(pt1); coordinates.Add(pt2); coordinates.Add(pt3); coordinates.Add(pt4); MgLinearSegment linearSegment = gf.CreateLinearSegment(coordinates); MgCurveSegmentCollection curveSegments = new MgCurveSegmentCollection(); curveSegments.Add(linearSegment); MgCurveString curveString = gf.CreateCurveString(curveSegments); Assert.AreEqual(1, curveString.Count); Assert.AreEqual(pt1.ToString(), curveString.StartCoordinate.ToString()); Assert.AreEqual(pt4.ToString(), curveString.EndCoordinate.ToString()); Assert.AreEqual(MgGeometryType.CurveString, curveString.GeometryType); Assert.AreEqual(1, curveString.Dimension); }
public void Execute(IPlatformFactory factory, ITestLogger logger) { MgGeometryFactory gf = new MgGeometryFactory(); MgCoordinate pt1 = gf.CreateCoordinateXY(0, 0); MgCoordinate pt2 = gf.CreateCoordinateXY(0, 10); MgCoordinate pt3 = gf.CreateCoordinateXY(10, 10); MgCoordinate pt4 = gf.CreateCoordinateXY(10, 0); MgCoordinateCollection coordinates = new MgCoordinateCollection(); coordinates.Add(pt1); coordinates.Add(pt2); coordinates.Add(pt3); coordinates.Add(pt4); MgLinearSegment linearSegment = gf.CreateLinearSegment(coordinates); MgCurveSegmentCollection curveSegments = new MgCurveSegmentCollection(); MgCurveRing curveRing = gf.CreateCurveRing(curveSegments); MgCurvePolygon cp = gf.CreateCurvePolygon(curveRing, null); MgCurvePolygonCollection cpc = new MgCurvePolygonCollection(); cpc.Add(cp); MgMultiCurvePolygon mcp = gf.CreateMultiCurvePolygon(cpc); Assert.AreEqual(1, mcp.Count); Assert.AreEqual(MgGeometryType.MultiCurvePolygon, mcp.GeometryType); Assert.AreEqual(2, mcp.Dimension); }
public void Execute(IPlatformFactory factory, ITestLogger logger) { MgGeometryFactory gf = new MgGeometryFactory(); MgCoordinate pt1 = gf.CreateCoordinateXY(0, 0); MgCoordinate pt2 = gf.CreateCoordinateXY(0, 10); MgCoordinate pt3 = gf.CreateCoordinateXY(10, 10); MgCoordinate pt4 = gf.CreateCoordinateXY(10, 0); MgCoordinateCollection coordinates = new MgCoordinateCollection(); coordinates.Add(pt1); coordinates.Add(pt2); coordinates.Add(pt3); coordinates.Add(pt4); MgLinearSegment linearSegment = gf.CreateLinearSegment(coordinates); MgCurveSegmentCollection curveSegments = new MgCurveSegmentCollection(); curveSegments.Add(linearSegment); MgCurveRing outerRing = gf.CreateCurveRing(curveSegments); MgCurvePolygon cp = gf.CreateCurvePolygon(outerRing, null); Assert.AreEqual(outerRing.ToString(), cp.ExteriorRing.ToString()); Assert.AreEqual(0, cp.InteriorRingCount); Assert.AreEqual(MgGeometryType.CurvePolygon, cp.GeometryType); Assert.AreEqual(2, cp.Dimension); }
public MgCurveRing CreateCurveRing(double offset) { // Ring is a closed entity. // Create and return a ring consisting of // one circulararc segment and one linearstring segment // arcseg = (0,0), (0,1), (1,2) // lineseg = (1,2), (0,0) // ArcSegment MgCoordinate startPos = factory.CreateCoordinateXY(offset + 0.0, offset + 0.0); MgCoordinate midPos = factory.CreateCoordinateXY(offset + 0.0, offset + 1.0); MgCoordinate endPos = factory.CreateCoordinateXY(offset + 1.0, offset + 2.0); MgArcSegment arcSeg = factory.CreateArcSegment(startPos, endPos, midPos); // Linear Segment MgCoordinateCollection points = new MgCoordinateCollection(); MgCoordinate fromPt = factory.CreateCoordinateXY(offset + 1.0, offset + 2.0); MgCoordinate toPt = factory.CreateCoordinateXY(offset + 0.0, offset + 0.0); points.Add(fromPt); points.Add(toPt); MgLinearSegment lineSeg = factory.CreateLinearSegment(points); // Curve Segment MgCurveSegmentCollection curveSegs = new MgCurveSegmentCollection(); curveSegs.Add(arcSeg); curveSegs.Add(lineSeg); return(factory.CreateCurveRing(curveSegs)); }
public MgCurveString CreateCurveString(double offset) { // Create and return a curvestring consisting of // one circulararc segment and one linearstring segment // arcseg = (0,0), (0,1), (1,2) // lineseg = (1,2), (3,0), (3,2) // ArcSegment MgCoordinate startPos = factory.CreateCoordinateXY(offset + 0.0, offset + 0.0); MgCoordinate midPos = factory.CreateCoordinateXY(offset + 0.0, offset + 1.0); MgCoordinate endPos = factory.CreateCoordinateXY(offset + 1.0, offset + 2.0); MgArcSegment arcSeg = factory.CreateArcSegment(startPos, endPos, midPos); // Linear Segment MgCoordinateCollection points = new MgCoordinateCollection(); MgCoordinate pt1 = factory.CreateCoordinateXY(offset + 1.0, offset + 2.0); MgCoordinate pt2 = factory.CreateCoordinateXY(offset + 3.0, offset + 0.0); MgCoordinate pt3 = factory.CreateCoordinateXY(offset + 3.0, offset + 2.0); points.Add(pt1); points.Add(pt2); points.Add(pt3); MgLinearSegment lineSeg = factory.CreateLinearSegment(points); // CurveSegment MgCurveSegmentCollection curveSegs = new MgCurveSegmentCollection(); curveSegs.Add(arcSeg); curveSegs.Add(lineSeg); return(factory.CreateCurveString(curveSegs)); }
public void Execute(IPlatformFactory factory, ITestLogger logger) { MgGeometryFactory gf = new MgGeometryFactory(); MgCoordinate pt1 = gf.CreateCoordinateXY(0, 0); MgCoordinate pt2 = gf.CreateCoordinateXY(0, 10); MgCoordinate pt3 = gf.CreateCoordinateXY(10, 10); MgCoordinate pt4 = gf.CreateCoordinateXY(10, 0); MgCoordinateCollection coordinates = new MgCoordinateCollection(); coordinates.Add(pt1); coordinates.Add(pt2); coordinates.Add(pt3); coordinates.Add(pt4); MgLinearSegment linearSegment = gf.CreateLinearSegment(coordinates); Assert.AreEqual(MgGeometryComponentType.LinearSegment, linearSegment.ComponentType); Assert.AreEqual(pt1.ToString(), linearSegment.StartCoordinate.ToString()); Assert.AreEqual(pt4.ToString(), linearSegment.EndCoordinate.ToString()); Assert.AreEqual(1, linearSegment.Dimension); }
public void Execute(IPlatformFactory factory, ITestLogger logger) { MgGeometryFactory gf = new MgGeometryFactory(); MgCoordinate pt1 = gf.CreateCoordinateXY(0, 0); MgCoordinate pt2 = gf.CreateCoordinateXY(0, 10); MgCoordinate pt3 = gf.CreateCoordinateXY(10, 10); MgCoordinate pt4 = gf.CreateCoordinateXY(10, 0); MgCoordinateCollection coordinates = new MgCoordinateCollection(); coordinates.Add(pt1); coordinates.Add(pt2); coordinates.Add(pt3); coordinates.Add(pt4); MgLinearSegment linearSegment = gf.CreateLinearSegment(coordinates); MgCurveSegmentCollection curveSegments = new MgCurveSegmentCollection(); curveSegments.Add(linearSegment); MgCurveRing outerRing = gf.CreateCurveRing(curveSegments); Assert.AreEqual(MgGeometryComponentType.CurveRing, outerRing.ComponentType); Assert.AreEqual(1, outerRing.Count); Assert.AreEqual(2, outerRing.Dimension); }