예제 #1
0
        /// <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";
        }
예제 #2
0
 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;
        }
예제 #4
0
        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);
            }
        }
예제 #8
0
        /// <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);
        }
예제 #9
0
        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);
            }
        }
예제 #10
0
 public virtual bool IsCompatibleDataTypes(DaggerInputPin inpin, DaggerOutputPin outpin)
 {
     return(IsCompatibleDataTypes(inpin.DataType, outpin.DataType));
 }
예제 #11
0
 public DaggerInterfacePin AddOutputPin(DaggerOutputPin pin)
 {
     return(AddOutputPin(pin.Name, pin.DataType));
 }
예제 #12
0
 public bool Contains(DaggerOutputPin Pin)
 {
     return(List.Contains(Pin));
 }