Beispiel #1
0
        private void AddStates(NetGraphBuilder builder, SwitchNodeFactory outputSwitch, SwitchNodeFactory inputSwitch,
                               BaseNodeFactory outputNode, BaseNodeFactory inputNode)
        {
            foreach (StateGraphEntry entry in _entries)
            {
                BaseNodeFactory currentInput  = inputSwitch;
                BaseNodeFactory currentOutput = outputSwitch;
                NetGraphFactory graph         = entry.Graph == null?NetGraphBuilder.CreateDefaultProxyGraph(entry.StateName) : entry.Graph.Factory;

                LayerSectionMasterNodeFactory masterNode = new LayerSectionMasterNodeFactory(String.Format("{0} {1}", entry.StateName,
                                                                                                           GetDirection(false)), Guid.NewGuid(), Guid.NewGuid());

                masterNode.DefaultMode = LayerSectionNodeDefaultMode.PassFrame;
                masterNode.Direction   = LayerSectionGraphDirection.ServerToClient;

                builder.AddNode(masterNode);
                builder.AddNode(masterNode.SlaveFactory);

                LayerSectionFilterFactory[] filters = new LayerSectionFilterFactory[1];

                LayerSectionFilterFactory filter = new LayerSectionFilterFactory();

                filter.GraphFactory   = graph;
                filter.LayerFactories = entry.GetLayerFactories();
                filter.SelectionPath  = "";
                filter.FilterFactory  = DataFrameFilterFactory.CreateDummyFactory();
                filter.IsolatedGraph  = false;

                masterNode.LayerFactories = new LayerSectionFilterFactory[1] {
                    filter
                };

                masterNode.SlaveFactory.Hidden = true;

                builder.AddLine(outputSwitch, masterNode, entry.StateName);
                builder.AddLine(inputSwitch, masterNode.SlaveFactory, entry.StateName);

                if (entry.LogPackets)
                {
                    currentOutput = AddLog(builder, entry, masterNode, false);
                    currentInput  = AddLog(builder, entry, masterNode.SlaveFactory, true);
                }
                else
                {
                    currentOutput = masterNode;
                    currentInput  = masterNode.SlaveFactory;
                }

                builder.AddLine(currentOutput, outputNode, null);
                builder.AddLine(currentInput, inputNode, null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Creates a factory
        /// </summary>
        /// <returns></returns>
        protected override BaseNodeFactory OnCreateFactory()
        {
            LayerSectionMasterNodeFactory masterFactory = Master.CreateFactory() as LayerSectionMasterNodeFactory;

            return(masterFactory.SlaveFactory);
        }
Beispiel #3
0
        /// <summary>
        /// Create the linked node factory
        /// </summary>
        /// <param name="linkedNode"></param>
        /// <returns></returns>
        BaseNodeFactory ILinkedNodeConfig.CreateFactory(BaseNodeFactory linkedNode)
        {
            LayerSectionMasterNodeFactory factory = linkedNode as LayerSectionMasterNodeFactory;

            return(factory.SlaveFactory);
        }