/// <summary> /// Initializes the data of the simple vertices. /// </summary> /// <param name="vertexSizes">Dictionary of the vertex sizes.</param> private void InitSimpleVertices(IDictionary <TVertex, Size> vertexSizes) { foreach (var vertex in _compoundGraph.SimpleVertices) { Size vertexSize; vertexSizes.TryGetValue(vertex, out vertexSize); var position = new Point(); VertexPositions.TryGetValue(vertex, out position); //create the information container for this simple vertex var dataContainer = new SimpleVertexData(vertex, _rootCompoundVertex, false, position, vertexSize); dataContainer.Parent = _rootCompoundVertex; _simpleVertexDatas[vertex] = dataContainer; _vertexDatas[vertex] = dataContainer; _rootCompoundVertex.Children.Add(dataContainer); } }
/// <summary> /// Initializes the data of the simple vertices. /// </summary> /// <param name="verticesSizes">Dictionary of the vertex sizes.</param> private void InitSimpleVertices([NotNull] IDictionary <TVertex, Size> verticesSizes) { foreach (TVertex vertex in _compoundGraph.SimpleVertices) { verticesSizes.TryGetValue(vertex, out Size vertexSize); VerticesPositions.TryGetValue(vertex, out Point position); // Create the information container for this simple vertex var dataContainer = new SimpleVertexData(vertex, _rootCompoundVertex, false, position, vertexSize) { Parent = _rootCompoundVertex }; _verticesData[vertex] = dataContainer; // ReSharper disable once PossibleNullReferenceException, Justification: root always has children _rootCompoundVertex.Children.Add(dataContainer); } }