public void AddGCP_Draw() { GeometryOfDrawed geometry = _aoiContainer.FirstAOI as GeometryOfDrawed; if (geometry != null) { if (geometry.RasterPoints.Length <= 0) { return; } CrossLayer drawTool = new CrossLayer(); drawTool.IsMoved = false; drawTool.SetVertext(geometry.RasterPoints[0].X, geometry.RasterPoints[0].Y); if (canvasHost1.Canvas.PrimaryDrawObject != null) { _aoiGCPContainer.AddAOI(drawTool.AddGeometry(true)); } else { _aoiGCPContainer.AddAOI(drawTool.AddGeometry(false)); } //PointF pt = new PointF(screenX, screenY); //drawTool.SetVertext(pt); canvasHost1.Canvas.Refresh(enumRefreshType.All); } }
private void SetAOIGeometry(CoordEnvelope evp) { if (evp == null) { _aoiContainer.Reset(); } else { double prjX1, prjY1, prjX2, prjY2; GeometryOfDrawed geo = new GeometryOfDrawed(); geo.ShapeType = "Rectangle"; geo.IsPrjCoord = true; canvasHost1.Canvas.CoordTransform.Geo2Prj(evp.MinX, evp.MaxY, out prjX1, out prjY1); canvasHost1.Canvas.CoordTransform.Geo2Prj(evp.MaxX, evp.MinY, out prjX2, out prjY2); geo.RasterPoints = new PointF[] { new PointF((float)prjX1, (float)prjY1), new PointF((float)prjX2, (float)prjY1), new PointF((float)prjX2, (float)prjY2), new PointF((float)prjX1, (float)prjY2) }; geo.Types = new byte[] { 1, 1, 1, 129 }; _aoiContainer.AddAOI(geo); } canvasHost1.Canvas.Refresh(enumRefreshType.All); }
internal PencilToolLayer StartAOIDrawing(enumPencilType pencilType) { PencilToolLayer aoiLayer = new PencilToolLayer(); aoiLayer.PencilType = pencilType; aoiLayer.PencilIsFinished = (result) => { _aoiContainer.AddAOI(result); //按住Control键可连续绘制 //if (Control.ModifierKeys != Keys.Control) // _canvas.CurrentViewControl = new DefaultControlLayer(); }; _canvas.CurrentViewControl = aoiLayer; return(aoiLayer); }
private void button15_Click(object sender, EventArgs e) { if (_aoiLayer == null) { _aoiLayer = new AOIContainerLayer(); _aoiLayer.Color = Color.Red; _canvas.LayerContainer.Layers.Add(_aoiLayer as GeoDo.RSS.Core.DrawEngine.ILayer); } IPencilToolLayer layer = new PencilToolLayer(); layer.PencilType = enumPencilType.FreeCurve; layer.PencilIsFinished = (result) => { //ptfs = result.GeoPoints; //pts = result.RasterPoints; _result = result; _aoiLayer.AddAOI(_result); }; _canvas.CurrentViewControl = layer; }
public bool HandleImportAOI() { using (frmStatSubRegionTemplates frm = new frmStatSubRegionTemplates()) { if (frm.ShowDialog() == DialogResult.OK) { Feature[] fets = frm.GetSelectedFeatures(); if (fets == null || fets.Length == 0) { return(false); } foreach (Feature fet in fets) { _aoiContainer.AddAOI(fet); } return(true); } } return(false); }
void item_Click(object sender, EventArgs e) { if (_session.SmartWindowManager.ActiveCanvasViewer == null) { return; } if (_session.SmartWindowManager.ActiveCanvasViewer.AOIContainerLayer == null) { return; } string name = (sender as RadMenuItem).Tag.ToString(); Feature fet = (new AOIShortcutOfAdmin()).GetFeatureByName(name); if (fet == null) { return; } IAOIContainerLayer container = _session.SmartWindowManager.ActiveCanvasViewer.AOIContainerLayer; container.AddAOI(fet); }