示例#1
0
        public void Replace(
            EuclideanGraphTriangle <T> oldTriangle1,
            EuclideanGraphTriangle <T> oldTriangle2,
            EuclideanGraphTriangle <T> newTriangle1,
            EuclideanGraphTriangle <T> newTriangle2
            )
        {
            DelaunayTreeNode <T> oldNode1 = FindNode(oldTriangle1);

            oldNode1.Old = true;
            DelaunayTreeNode <T> oldNode2 = FindNode(oldTriangle2);

            oldNode2.Old = true;

            DelaunayTreeNode <T> newNode1 = new DelaunayTreeNode <T>(newTriangle1);
            DelaunayTreeNode <T> newNode2 = new DelaunayTreeNode <T>(newTriangle2);

            Nodes.Add(newNode1);
            Nodes.Add(newNode2);

            oldNode1.Children.Add(newNode1);
            oldNode1.Children.Add(newNode2);
            oldNode2.Children.Add(newNode1);
            oldNode2.Children.Add(newNode2);
        }
示例#2
0
 public DelaunayTree(EuclideanGraphTriangle <T> root)
 {
     Root  = new DelaunayTreeNode <T>(root);
     Nodes = new List <DelaunayTreeNode <T> >
     {
         Root
     };
 }
示例#3
0
        public void Subdivide(EuclideanGraphTriangle <T> parent, EuclideanGraphTriangle <T>[] children)
        {
            DelaunayTreeNode <T> parentNode = FindNode(parent);

            foreach (EuclideanGraphTriangle <T> child in children)
            {
                DelaunayTreeNode <T> newNode = new DelaunayTreeNode <T>(child);
                parentNode.Children.Add(newNode);
                Nodes.Add(newNode);
            }
            parentNode.Old = true;
        }