예제 #1
0
파일: BoxLink.cs 프로젝트: fbizuneh/Igor
 public virtual bool IsConnecting(Anchor <EntityType> TestAnchor)
 {
     return(TestAnchor == StartAnchor || TestAnchor == EndAnchor);
 }
예제 #2
0
파일: EntityBox.cs 프로젝트: fbizuneh/Igor
        public virtual void UpdateAnchors()
        {
            if (WrappedInstance != null)
            {
                WrappedInstance.CreateStaticNodesIfNotPresent();
            }

            List <Anchor <EntityType> > DeletedList = new List <Anchor <EntityType> >();

            DeletedList.AddRange(Inputs);

            foreach (EntityLink <EntityType> InputLink in GetInputEvents())
            {
                bool bHasAnchor = false;
                foreach (Anchor <EntityType> CurrentAnchor in Inputs)
                {
                    if (CurrentAnchor.GetLabelText() == InputLink.Name)
                    {
                        bHasAnchor = true;
                        DeletedList.Remove(CurrentAnchor);
                    }
                }
                if (!bHasAnchor)
                {
                    Anchor <EntityType> InputAnchor = new Anchor <EntityType>(InputLink.Name, GetAnchorText(InputLink), new Anchor <EntityType> .AnchorType(true), this);
                    Inputs.Add(InputAnchor);
                }
            }

            foreach (Anchor <EntityType> DeletedItem in DeletedList)
            {
                DeletedItem.CleanupBeforeRemoval();
                Owner.BreakAllConnectionsForAnchor(DeletedItem);
                Inputs.Remove(DeletedItem);
            }

            DeletedList.Clear();
            DeletedList.AddRange(Outputs);

            foreach (EntityLink <EntityType> OutputLink in GetOutputEvents())
            {
                bool bHasAnchor = false;
                foreach (Anchor <EntityType> CurrentAnchor in Outputs)
                {
                    if (CurrentAnchor.GetLabelText() == OutputLink.Name)
                    {
                        bHasAnchor = true;
                        DeletedList.Remove(CurrentAnchor);
                    }
                }
                if (!bHasAnchor)
                {
                    Anchor <EntityType> OutputAnchor = new Anchor <EntityType>(OutputLink.Name, GetAnchorText(OutputLink), new Anchor <EntityType> .AnchorType(false), this);
                    Outputs.Add(OutputAnchor);
                }
            }

            foreach (Anchor <EntityType> DeletedItem in DeletedList)
            {
                DeletedItem.CleanupBeforeRemoval();
                Owner.BreakAllConnectionsForAnchor(DeletedItem);
                Outputs.Remove(DeletedItem);
            }

            DeletedList.Clear();
        }
예제 #3
0
파일: BoxLink.cs 프로젝트: fbizuneh/Igor
 public BoxLink(Anchor <EntityType> FromAnchor)
 {
     StartAnchor = FromAnchor;
     EndAnchor   = null;
 }
예제 #4
0
파일: EntityBox.cs 프로젝트: fbizuneh/Igor
 public virtual void CanConnectNodes(Anchor <EntityType> InputNode, Anchor <EntityType> OutputNode)
 {
 }