コード例 #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
ファイル: DSFilterNodeUI.cs プロジェクト: manuag/DSGraphEdit
 void ParentGraph_AfterPinsConnected(DaggerLib.Core.DaggerOutputPin output, DaggerLib.Core.DaggerInputPin input)
 {
     if (_videoWindow != null)
     {
         _videoWindow.InitVideoWindow();
     }
 }
コード例 #3
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        /// <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);
            }
        }
コード例 #7
0
        /// <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
ファイル: DaggerBasePin.cs プロジェクト: rocee/DSGraphEdit
 public virtual bool IsCompatibleDataTypes(DaggerInputPin inpin, DaggerOutputPin outpin)
 {
     return(IsCompatibleDataTypes(inpin.DataType, outpin.DataType));
 }
コード例 #11
0
ファイル: DaggerInterface.cs プロジェクト: rocee/DSGraphEdit
 public DaggerInterfacePin AddOutputPin(DaggerOutputPin pin)
 {
     return(AddOutputPin(pin.Name, pin.DataType));
 }
コード例 #12
0
 public bool Contains(DaggerOutputPin Pin)
 {
     return(List.Contains(Pin));
 }