public VPacket(IPacket packet, IVNode from, IVNode to, IVLink link, IPrimFactory primFactory, IAsynchQueue queue, View view) : base(primFactory, from.Pos, packet.Name, packet.Colour, packet.Selected, packet.Parameters) { Prim.Editable = false; _packet = packet; _from = from; _to = to; _link = link; _step = 0; _view = view; Selected = packet.Selected; Configure(); _deleteListener = id => Dropped("Visualisation layer dropped " + Name + "."); _from.OnWorldMove += (id, oldPos, newPos) => Reconfigure(); _to.OnWorldMove += (id, oldPos, newPos) => Reconfigure(); _from.OnAPIMove += (id, oldPos, newPos) => Reconfigure(); _to.OnAPIMove += (id, oldPos, newPos) => Reconfigure(); link.OnWeightChanged += (id, weight) => Reconfigure(); link.OnWorldDelete += _deleteListener; link.OnSystemDelete += _deleteListener; //_tickListener = () => queue.QueueWorkItem(state => UpdatePosition()); _tickListener = () => queue.QWork("Move Packet", () => UpdatePosition()); view.OnTick += _tickListener; }
private static Vector3 GetScale(IVLink link) { return new Vector3(link.Scale.X + ExtraWidth, link.Scale.Y + ExtraWidth, Length); }
private static Vector3 GetScale(IVLink link) { return(new Vector3(link.Scale.X + ExtraWidth, link.Scale.Y + ExtraWidth, Length)); }