PointF CreatePoint(ISpatialDisplay display, IPosition p) { float x = display.EastingToDisplay(p.X); float y = display.NorthingToDisplay(p.Y); return(new PointF(x, y)); }
/// <summary> /// Converts a ground position into screen coordinates. /// </summary> /// <param name="p">The position to convert</param> /// <returns>The corresponding screen position</returns> internal Point GetScreenPoint(IPosition p) { ISpatialDisplay d = ActiveDisplay; int x = (int)d.EastingToDisplay(p.X); int y = (int)d.NorthingToDisplay(p.Y); Control c = d.MapPanel; return(c.PointToScreen(new Point(x, y))); }
/// <summary> /// Draws a circle /// </summary> /// <param name="display">The display to draw to</param> /// <param name="center">The position of the center of the circle</param> /// <param name="radius">The radius of the circle, in meters on the ground</param> public void Render(ISpatialDisplay display, IPosition center, double radius) { float xc = display.EastingToDisplay(center.X); float yc = display.NorthingToDisplay(center.Y); float r = display.LengthToDisplay(radius); float sz = r + r; display.Graphics.DrawEllipse(m_Pen, xc - r, yc - r, sz, sz); }
/// <summary> /// Draws a circular arc /// </summary> /// <param name="display">The display to draw to</param> /// <param name="arc">The circular arc</param> public void Render(ISpatialDisplay display, IClockwiseCircularArcGeometry arc) { ICircleGeometry circle = arc.Circle; IWindow extent = CircleGeometry.GetExtent(circle); float topLeftX = display.EastingToDisplay(extent.Min.X); float topLeftY = display.NorthingToDisplay(extent.Max.Y); float size = 2.0f * display.LengthToDisplay(circle.Radius); float startAngle = (float)(arc.StartBearingInRadians * MathConstants.RADTODEG - 90.0); float sweepAngle = (float)(arc.SweepAngleInRadians * MathConstants.RADTODEG); display.Graphics.DrawArc(m_Pen, topLeftX, topLeftY, size, size, startAngle, sweepAngle); }
PointF[] GetDisplayPoints(ISpatialDisplay display, IPosition[] line) { PointF[] pts = new PointF[line.Length]; for (int i = 0; i < line.Length; i++) { IPosition gp = line[i]; pts[i].X = display.EastingToDisplay(gp.X); pts[i].Y = display.NorthingToDisplay(gp.Y); } return(pts); }
PointF[] GetDisplayPoints(ISpatialDisplay display, IPosition[] line) { PointF[] pts = new PointF[line.Length]; for (int i=0; i<line.Length; i++) { IPosition gp = line[i]; pts[i].X = display.EastingToDisplay(gp.X); pts[i].Y = display.NorthingToDisplay(gp.Y); } return pts; }
PointF CreatePoint(ISpatialDisplay display, IPosition p) { float x = display.EastingToDisplay(p.X); float y = display.NorthingToDisplay(p.Y); return new PointF(x, y); }
/// <summary> /// Draws a circle /// </summary> /// <param name="display">The display to draw to</param> /// <param name="center">The position of the center of the circle</param> /// <param name="radius">The radius of the circle, in meters on the ground</param> public void Render(ISpatialDisplay display, IPosition center, double radius) { float xc = display.EastingToDisplay(center.X); float yc = display.NorthingToDisplay(center.Y); float r = display.LengthToDisplay(radius); float sz = r+r; display.Graphics.DrawEllipse(m_Pen, xc-r, yc-r, sz, sz); }