Exemplo n.º 1
0
        private void DrawErrorPosition(PositionAssociationView pav, DisplayablePosition.ErrorMarker errorMarker,
                                       Pen pen, Brush brush, PaintSpecification e)
        {
            ErrorPosition errorPosition = pav.position.GetErrorPosition(errorMarker);

            if (errorPosition == null)
            {
                return;
            }

            PointF     pointF     = MapPositionToPoint(pav.position.pinPosition.latlon);
            PointF     pointF2    = MapPositionToPoint(errorPosition.latlon);
            RectangleF rectangleF = new RectangleF(e.ClipRectangle.X - e.ClipRectangle.Width * 2,
                                                   e.ClipRectangle.Y - e.ClipRectangle.Height * 2,
                                                   e.ClipRectangle.Width * 5,
                                                   e.ClipRectangle.Height * 5);

            if (!rectangleF.Contains(pointF) || !rectangleF.Contains(pointF2))
            {
                return;
            }

            if (!pav.position.invertError)
            {
                e.Graphics.DrawLine(pen, pointF, pointF2);
                e.Graphics.FillEllipse(brush, pointF2.X - 6f, pointF2.Y - 6f, 12f, 12f);
                return;
            }

            e.Graphics.DrawEllipse(pen, pointF.X - 20f, pointF.Y - 20f, 40f, 40f);
        }
Exemplo n.º 2
0
 private void DrawErrorMarkers(PositionAssociationView pav, PaintSpecification e)
 {
     DrawErrorPosition(pav,
                       DisplayablePosition.ErrorMarker.AsContributor,
                       errorContribPen,
                       errorContribBrush,
                       e);
     DrawErrorPosition(pav,
                       DisplayablePosition.ErrorMarker.AsOutlier,
                       errorOutlierPen,
                       errorOutlierBrush,
                       e);
 }
Exemplo n.º 3
0
        private void DrawMarker(PositionAssociationView pav, PaintSpecification e)
        {
            DrawErrorMarkers(pav, e);
            e.Graphics.CompositingMode = CompositingMode.SourceOver;
            string text = pav.pinId.ToString();

            outlinePen.MiterLimit = 2f;
            SizeF  size   = new SizeF(3f, 3f);
            PointF pointF = MapPositionToPoint(pav.position.pinPosition.latlon);

            if (!RectangleF.Inflate(e.ClipRectangle, 100f, 100f).Contains(pointF))
            {
                return;
            }

            SizeF      sizeF           = e.Graphics.MeasureString(text, pinFont);
            double     num             = 24.0;
            double     num2            = 3.0;
            int        num3            = 3;
            RectangleF layoutRectangle = new RectangleF(pointF.X - sizeF.Width / 2f,
                                                        (float)(pointF.Y - sizeF.Height / 2f - num),
                                                        sizeF.Width,
                                                        sizeF.Height);
            RectangleF rectangleF = new RectangleF(layoutRectangle.Location, layoutRectangle.Size);

            rectangleF.Inflate(size);
            PointF[] points = new[]
            {
                pointF, new PointF((float)(pointF.X - num2), rectangleF.Bottom),
                new PointF(rectangleF.Left + num3, rectangleF.Bottom),
                new PointF(rectangleF.Left, rectangleF.Bottom - num3),
                new PointF(rectangleF.Left, rectangleF.Top + num3),
                new PointF(rectangleF.Left + num3, rectangleF.Top),
                new PointF(rectangleF.Right - num3, rectangleF.Top),
                new PointF(rectangleF.Right, rectangleF.Top + num3),
                new PointF(rectangleF.Right, rectangleF.Bottom - num3),
                new PointF(rectangleF.Right - num3, rectangleF.Bottom),
                new PointF((float)(pointF.X + num2), rectangleF.Bottom)
            };
            e.Graphics.FillPolygon(fillBrush, points);
            e.Graphics.DrawPolygon(outlinePen, points);
            e.Graphics.DrawString(text, pinFont, textBrush, layoutRectangle);
        }
		public PositionAssociationView(PositionAssociation assoc, PositionAssociationView.WhichPosition whichPosition)
		{
			this.assoc = assoc;
			this.whichPosition = whichPosition;
		}
Exemplo n.º 5
0
 private void DrawMarker(PositionAssociationView pav, PaintSpecification e)
 {
     this.DrawErrorMarkers(pav, e);
     e.Graphics.CompositingMode = CompositingMode.SourceOver;
     string text = pav.pinId.ToString();
     this.outlinePen.MiterLimit = 2f;
     SizeF size = new SizeF(3f, 3f);
     PointF pointF = this.MapPositionToPoint(pav.position.pinPosition.latlon);
     if (!RectangleF.Inflate(e.ClipRectangle, 100f, 100f).Contains(pointF))
     {
         return;
     }
     SizeF sizeF = e.Graphics.MeasureString(text, this.pinFont);
     double num = 24.0;
     double num2 = 3.0;
     int num3 = 3;
     RectangleF layoutRectangle = new RectangleF(pointF.X - sizeF.Width / 2f, (float)((double)(pointF.Y - sizeF.Height / 2f) - num), sizeF.Width, sizeF.Height);
     RectangleF rectangleF = new RectangleF(layoutRectangle.Location, layoutRectangle.Size);
     rectangleF.Inflate(size);
     PointF[] points = new PointF[]
     {
         pointF,
         new PointF((float)((double)pointF.X - num2), rectangleF.Bottom),
         new PointF(rectangleF.Left + (float)num3, rectangleF.Bottom),
         new PointF(rectangleF.Left, rectangleF.Bottom - (float)num3),
         new PointF(rectangleF.Left, rectangleF.Top + (float)num3),
         new PointF(rectangleF.Left + (float)num3, rectangleF.Top),
         new PointF(rectangleF.Right - (float)num3, rectangleF.Top),
         new PointF(rectangleF.Right, rectangleF.Top + (float)num3),
         new PointF(rectangleF.Right, rectangleF.Bottom - (float)num3),
         new PointF(rectangleF.Right - (float)num3, rectangleF.Bottom),
         new PointF((float)((double)pointF.X + num2), rectangleF.Bottom)
     };
     e.Graphics.FillPolygon(this.fillBrush, points);
     e.Graphics.DrawPolygon(this.outlinePen, points);
     e.Graphics.DrawString(text, this.pinFont, this.textBrush, layoutRectangle);
 }
Exemplo n.º 6
0
 private void DrawErrorPosition(PositionAssociationView pav, DisplayablePosition.ErrorMarker errorMarker, Pen pen, Brush brush, PaintSpecification e)
 {
     ErrorPosition errorPosition = pav.position.GetErrorPosition(errorMarker);
     if (errorPosition == null)
     {
         return;
     }
     PointF pointF = this.MapPositionToPoint(pav.position.pinPosition.latlon);
     PointF pointF2 = this.MapPositionToPoint(errorPosition.latlon);
     RectangleF rectangleF = new RectangleF((float)(e.ClipRectangle.X - e.ClipRectangle.Width * 2), (float)(e.ClipRectangle.Y - e.ClipRectangle.Height * 2), (float)(e.ClipRectangle.Width * 5), (float)(e.ClipRectangle.Height * 5));
     if (!rectangleF.Contains(pointF) || !rectangleF.Contains(pointF2))
     {
         return;
     }
     if (!pav.position.invertError)
     {
         e.Graphics.DrawLine(pen, pointF, pointF2);
         e.Graphics.FillEllipse(brush, pointF2.X - 6f, pointF2.Y - 6f, 12f, 12f);
         return;
     }
     e.Graphics.DrawEllipse(pen, pointF.X - 20f, pointF.Y - 20f, 40f, 40f);
 }
Exemplo n.º 7
0
 private void DrawErrorMarkers(PositionAssociationView pav, PaintSpecification e)
 {
     this.DrawErrorPosition(pav, DisplayablePosition.ErrorMarker.AsContributor, this.errorContribPen, this.errorContribBrush, e);
     this.DrawErrorPosition(pav, DisplayablePosition.ErrorMarker.AsOutlier, this.errorOutlierPen, this.errorOutlierBrush, e);
 }