Exemple #1
0
        /// <summary>
        ///    these nodes belong to the same layer and are adjacent positioned from left to right
        /// </summary>
        /// <param name="neighbors"></param>
        public void AddSameLayerNeighbors(IEnumerable <Node> neighbors)
        {
            List <Node> neibs = new List <Node>(neighbors);

            HorizontalConstraints.AddSameLayerNeighbors(neibs);

            for (int i = 0; i < neibs.Count - 1; i++)
            {
                VerticalConstraints.SameLayerConstraints.Insert(new Tuple <Node, Node>(neibs[i], neibs[i + 1]));
            }
        }
Exemple #2
0
 /// <summary>
 /// </summary>
 public void RemoveAllConstraints()
 {
     HorizontalConstraints.Clear();
     VerticalConstraints.Clear();
 }
Exemple #3
0
 /// <summary>
 ///    adds a pair of adjacent neighbors
 /// </summary>
 /// <param name="leftNode"></param>
 /// <param name="rightNode"></param>
 public void AddSameLayerNeighbors(Node leftNode, Node rightNode)
 {
     HorizontalConstraints.AddSameLayerNeighborsPair(leftNode, rightNode);
     VerticalConstraints.SameLayerConstraints.Insert(new Tuple <Node, Node>(leftNode, rightNode));
 }