Пример #1
0
        public void Draw(Graphics gr, Constants.HighlightFormat format)
        {
            if (format.HasFlag(Constants.HighlightFormat.Object))
            {
                gr.DrawEllipse(blobHighliter, First.Rectangle);
            }

            if (format.HasFlag(Constants.HighlightFormat.Trace))
            {
                //TODO: out of memory exception is being thrown
                if (items.Count > 1)
                {
                    gr.DrawCurve(blobHighliter, (items.ForEach(blob => new PointF(blob.CenterOfGravity.X, blob.CenterOfGravity.Y))).ToArray());
                }
            }

            if (format.HasFlag(Constants.HighlightFormat.Tag))
            {
                gr.DrawString(Tag, drawFont, drawBrush, First.Rectangle.Location);
            }

            if (format.HasFlag(Constants.HighlightFormat.Prediction))
            {
                gr.DrawEllipse(new Pen(drawBrush), MathFunctions.getRectangleFromRadius(PredictNext.ConverseToPoint(), First.Rectangle.getDiameter()));
            }

            //TODO: direction displayng doesn't work well
            if (format.HasFlag(Constants.HighlightFormat.Direction))
            {
                gr.DrawLine(blobHighliter, First.CenterOfGravity.ConverseToPointF(), (PredictNext + Direction.Multiply(1000)).ConverseToPointF());
            }
        }
Пример #2
0
 public void Draw(Graphics gr, Constants.HighlightFormat format)
 {
     foreach (var blobData in itemsData.Where(dta => dta.Valid))
     {
         blobData.Draw(gr, format);
     }
 }