public static void Run() { //ExStart: CreateCurvePolygon string path = RunExamples.GetDataDir() + "CreateCurvePolygon_out.shp"; using (VectorLayer layer = VectorLayer.Create(path, Drivers.Shapefile)) { var feature = layer.ConstructFeature(); // create a torus with center at (0,0), radius equal to 2 and hole radius equal to 1 var curvePolygon = new CurvePolygon(); var exterior = new CircularString(); exterior.AddPoint(-2, 0); exterior.AddPoint(0, 2); exterior.AddPoint(2, 0); exterior.AddPoint(0, -2); exterior.AddPoint(-2, 0); curvePolygon.ExteriorRing = exterior; var interior = new CircularString(); interior.AddPoint(-1, 0); interior.AddPoint(0, 1); interior.AddPoint(1, 0); interior.AddPoint(0, -1); interior.AddPoint(-1, 0); curvePolygon.AddInteriorRing(interior); feature.Geometry = curvePolygon; layer.Add(feature); } //ExEnd: CreateCurvePolygon }
public ConnectionViewModel(Connection model) { this.model = model; foreach (var point in model.Data.CurvePolygon.Points) { CurvePolygon.Add(new CurvePolygonPointViewModel(CurvePolygonPoint.Of(point))); } }
public CurvePolygonViewModel(CurvePolygon model) { this.model = model; foreach (var point in model.Data.Points) { var pointModel = CurvePolygonPoint.Of(point); var vm = new CurvePolygonPointViewModel(pointModel); Points.Add(vm); } }