Bevisuali.Model.Workbench.NetworkLayoutRecord.NetworkLayoutRecord C# (CSharp) Method

NetworkLayoutRecord() public method

public NetworkLayoutRecord ( BayesianNetwork network, NetworkLayout existingLayout, IList interestVertices, NetworkLayoutOptions options ) : System
network BayesianNetwork
existingLayout NetworkLayout
interestVertices IList
options NetworkLayoutOptions
return System
            public NetworkLayoutRecord(
                BayesianNetwork network,
                NetworkLayout existingLayout,
                IList<string> interestVertices,
                NetworkLayoutOptions options)
            {
                Debug.Assert(options != null, "Layout options cannot be null.");

                this.Network = network;
                this.NetworkLayout = existingLayout;
                this.InterestVertices = interestVertices.ToList();
                this.Options = options;

                // Manually specify sizes.
                Dictionary<string, float> sizes = new Dictionary<string, float>();
                foreach (var v in network.Variables)
                {
                    if (!interestVertices.Contains(v.Key))
                    {
                        sizes[v.Key] = Workbench.NetworkLayoutVertexSizeMinimized;
                    }
                    else
                    {
                        sizes[v.Key] = Workbench.NetworkLayoutVertexSizeNormal;
                    }
                }

                this.AlgorithmState = new LayoutAlgorithm(network.Clone(), sizes, options);

                // Copy existing positions over.
                if (existingLayout != null && existingLayout.Positions != null && existingLayout.Positions.Count > 0)
                {
                    foreach (var kvp in existingLayout.Positions)
                    {
                        AlgorithmState.Positions[kvp.Key] = kvp.Value;
                    }
                }
            }

Same methods

Workbench.NetworkLayoutRecord::NetworkLayoutRecord ( BayesianNetwork network, NetworkLayout layout, NetworkLayoutOptions options ) : System
Workbench.NetworkLayoutRecord