Esempio n. 1
0
        public double this[int x, int y]
        {
            get
            {
                return(Value[x, y]);
            }
            set
            {
                Value[x, y]    = value;
                HasValue[x, y] = true;

                if (value > MaxZ)
                {
                    MaxZ = value;
                }

                if (value < MinZ)
                {
                    MinZ = value;
                }

                if (OnPointAdded != null)
                {
                    foreach (Action a in OnPointAdded.GetInvocationList())
                    {
                        a();
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor for <see cref="ChaosManager"/>.
        /// </summary>
        public ChaosManager(ChaosField chaosField)
        {
            if (chaosField == null)
            {
                throw new ArgumentNullException(nameof(chaosField));
            }

            _chaosField = chaosField;
            _chaosField.OnPointAdded += (sender, args) => OnPointAdded?.Invoke(sender, args);
        }
Esempio n. 3
0
        private void DrawRandom(Point point)
        {
            _randomPoint?.Clear();
            _randomPoint = new PointData(CanvasRef)
            {
                Point       = point,
                PointVisual = DrawPointObject(point, Brushes.LawnGreen, DotType.Random)
            };

            OnPointAdded?.Invoke(this, new PointArgs(point, DotType.Random));
        }
Esempio n. 4
0
        private void DrawTrack(Point point, Brush color)
        {
            if (_trackPoints.Any(t => t.Point == point))
            {
                return;
            }

            var pointData = new PointData(CanvasRef)
            {
                Point = point,
                Color = color
            };

            _trackPoints.Add(pointData);
            pointData.PointVisual = DrawPointObject(point, color, DotType.Track);
            OnPointAdded?.Invoke(this, new PointArgs(point, DotType.Track));
        }
Esempio n. 5
0
        private void DrawAnchor(Point point)
        {
            if (_anchorPoints.Any(a => a.Point == point))
            {
                return;
            }

            var name      = GetFreePointName(_anchorPoints.Select(data => data.Name));
            var color     = SolidBrushProvider.GetNextColor();
            var pointData = new PointData(CanvasRef)
            {
                Name  = name,
                Point = point,
                Color = color
            };

            _anchorPoints.Add(pointData);
            pointData.PointVisual = DrawPointObject(point, color, DotType.Anchor);
            pointData.NameVisual  = DrawTextObject(point, name, DotType.Anchor);
            OnPointAdded?.Invoke(this, new PointArgs(point, DotType.Anchor));
        }