/// <summary> /// Initializes a new instance of the <see cref="BalloonTreeLayoutAlgorithm{TVertex,TEdge,TGraph}"/> class. /// </summary> /// <param name="visitedGraph">Graph to layout.</param> /// <param name="selectedVertex">Root vertex.</param> /// <param name="parameters">Optional algorithm parameters.</param> public BalloonTreeLayoutAlgorithm( [NotNull] TGraph visitedGraph, [NotNull] TVertex selectedVertex, [CanBeNull] BalloonTreeLayoutParameters parameters = null) : this(visitedGraph, null, selectedVertex, parameters) { }
/// <summary> /// Initializes a new instance of the <see cref="BalloonTreeLayoutAlgorithm{TVertex,TEdge,TGraph}"/> class. /// </summary> /// <param name="visitedGraph">Graph to layout.</param> /// <param name="verticesPositions">Vertices positions.</param> /// <param name="selectedVertex">Root vertex.</param> /// <param name="parameters">Optional algorithm parameters.</param> public BalloonTreeLayoutAlgorithm( [NotNull] TGraph visitedGraph, [CanBeNull] IDictionary <TVertex, Point> verticesPositions, [NotNull] TVertex selectedVertex, [CanBeNull] BalloonTreeLayoutParameters parameters = null) : base(visitedGraph, verticesPositions, parameters) { if (selectedVertex == null) { throw new ArgumentNullException(nameof(selectedVertex)); } if (!visitedGraph.ContainsVertex(selectedVertex)) { throw new ArgumentException("The provided vertex is not part of the graph.", nameof(selectedVertex)); } _root = selectedVertex; }