/// <summary> /// Create a new subnode from a serialized graph /// </summary> /// <param name="buffer"></param> public DaggerSubNode(string name, byte[] buffer) : base() { MemoryStream ms = new MemoryStream(buffer); BinaryFormatter bformatter = new BinaryFormatter(); _subNodeGraph = (DaggerGraph)bformatter.Deserialize(ms); _subNodeName = name; _subNodeGraph._parentSubNode = this; // reflect imported/exported pins to input/output pins foreach (DaggerOutputPin pin in _subNodeGraph.ImportedPins) { DaggerInputPin inpin = new DaggerInputPin(); inpin.Name = pin.Name; inpin.DataType = pin.DataType; InputPins.Add(inpin); } foreach (DaggerInputPin pin in _subNodeGraph.ExportedPins) { DaggerOutputPin outpin = new DaggerOutputPin(); outpin.Name = pin.Name; outpin.DataType = pin.DataType; OutputPins.Add(outpin); } AssociatedUINode = "IDaggerUISubNode"; }
void ParentGraph_AfterPinsConnected(DaggerLib.Core.DaggerOutputPin output, DaggerLib.Core.DaggerInputPin input) { if (_videoWindow != null) { _videoWindow.InitVideoWindow(); } }
public void Remove(DaggerOutputPin Pin) { List.Remove(Pin); if (PinRemoved != null) { PinRemoved(this, Pin); } Pin._parentNode = null; Pin._parentGraph = null; }
public DaggerTypeConstantNode(Type constantType) { inpin = new DaggerInputPin(); inpin.DataType = constantType; inpin.Name = "Constant Input"; InputPins.Add(inpin); outpin = new DaggerOutputPin(); outpin.DataType = constantType; OutputPins.Add(outpin); AssociatedUINode = typeof(TypeConstantNodeUI); DoProcessing += new ProcessHandler(DaggerTypeConstantNode_DoProcessing); }
public int Add(DaggerOutputPin Pin) { int i; i = List.Add(Pin); Pin._parentNode = _parentNode; Pin._parentGraph = _parentGraph; if (PinAdded != null) { PinAdded(this, Pin); } return(i); }
/// <summary> /// Get a pin by it's name /// </summary> /// <param name="name"></param> /// <returns></returns> public DaggerOutputPin this[string name] { get { DaggerOutputPin outpin = null; foreach (DaggerOutputPin pin in List) { if (name == pin.Name) { outpin = pin; break; } } return(outpin); } }
/// <summary> /// Get a pin by it's guid /// </summary> /// <param name="name"></param> /// <returns></returns> internal DaggerOutputPin this[Guid guid] { get { DaggerOutputPin outpin = null; foreach (DaggerOutputPin pin in List) { if (guid == pin.InstanceGuid) { outpin = pin; break; } } return(outpin); } }
/// <summary> /// Deserialization Constructor /// </summary> /// <param name="info"></param> /// <param name="ctxt"></param> protected DaggerTypeConstantNode(SerializationInfo info, StreamingContext ctxt) : base(info, ctxt) { if (info == null) { throw new System.ArgumentNullException("info"); } DataType = (Type)info.GetValue("DataType", typeof(Type)); inpin = (DaggerInputPin)info.GetValue("InPin", typeof(DaggerInputPin)); InputPins.Add(inpin); outpin = (DaggerOutputPin)info.GetValue("OutPin", typeof(DaggerOutputPin)); OutputPins.Add(outpin); AssociatedUINode = typeof(TypeConstantNodeUI); DoProcessing += new ProcessHandler(DaggerTypeConstantNode_DoProcessing); }
public DaggerSubNode(DaggerGraph graph) : base() { _subNodeGraph = graph; _subNodeGraph._parentSubNode = this; AssociatedUINode = "IDaggerUISubNode"; foreach (DaggerOutputPin pin in _subNodeGraph.ImportedPins) { DaggerInputPin inpin = new DaggerInputPin(); inpin.Name = pin.Name; inpin.DataType = pin.DataType; InputPins.Add(inpin); } foreach (DaggerInputPin pin in _subNodeGraph.ExportedPins) { DaggerOutputPin outpin = new DaggerOutputPin(); outpin.Name = pin.Name; outpin.DataType = pin.DataType; OutputPins.Add(outpin); } }
public virtual bool IsCompatibleDataTypes(DaggerInputPin inpin, DaggerOutputPin outpin) { return(IsCompatibleDataTypes(inpin.DataType, outpin.DataType)); }
public DaggerInterfacePin AddOutputPin(DaggerOutputPin pin) { return(AddOutputPin(pin.Name, pin.DataType)); }
public bool Contains(DaggerOutputPin Pin) { return(List.Contains(Pin)); }