Пример #1
0
 public Drawing(Layer.Layer layer, ShapeType shapeType, Brush backgroundType, Color outlineColor,
                int outlineWidth, System.Windows.Media.DashStyle outlineType, Point mousePosition)
     : base(layer)
 {
     if (shapeType != ShapeType.None)
     {
         Graphic = Factory.GetGraphic(shapeType, new Point(mousePosition.X, mousePosition.Y),
                                      backgroundType, outlineColor, outlineWidth, outlineType);
         layer.AddGraphic(Graphic);
     }
 }
Пример #2
0
        //private List<float> mean

        public Agent(SyftController _controller, Layer.Layer _model, Optimizer _optimizer)
        {
            controller = _controller;
            model      = _model;
            optimizer  = _optimizer;

            #pragma warning disable 420
            id = System.Threading.Interlocked.Increment(ref nCreated);
            controller.AddAgent(this);

            history = new List <FloatTensor[]>();
        }
Пример #3
0
        public string Drawing(Kernel kernel)
        {
            var layer = new Layer.Layer(kernel._settings.Width, kernel._settings.Height);

            if (_drawer != null)
            {
                layer.Apply(_drawer);
            }

            // apply all entities drawing by layering
            foreach (var entity in _entities ?? Enumerable.Empty <Entity>())
            {
                layer.Apply(entity.Drawer, entity.Position);
            }

            return(layer.ToString());
        }
Пример #4
0
        public Selecting(Layer.Layer layer, Point mousePosition)
            : base(layer)
        {
            bool found = false;
            int  i     = layer.CountGraphics() - 1;

            while (!found && i >= 0)
            {
                if (layer.GetGraphic(i).Intersect(mousePosition))
                {
                    found = true;
                }
                else
                {
                    i--;
                }
            }
            if (found)
            {
                Graphic = layer.GetGraphic(i);
            }
        }
Пример #5
0
 public Deleting(Graphic graphic, Layer.Layer layer)
     : base(layer, graphic)
 {
     layer.DeleteGraphics(Graphic);
 }
Пример #6
0
 protected ActionWithLayer(Layer.Layer layer)
 {
     this.Layer = layer;
 }
Пример #7
0
 protected ActionWithLayer(Layer.Layer layer, Graphic graphic)
     : base(graphic)
 {
     this.Layer = layer;
 }
Пример #8
0
 public Pasting(Graphic graphic, Layer.Layer layer) : base(layer, graphic)
 {
     Layer.AddGraphic(graphic);
 }
Пример #9
0
 public Drawing(Layer.Layer layer, Graphic shape) : base(layer, shape)
 {
     layer.AddGraphic(Graphic);
 }