示例#1
0
        protected override MergeArgs GetMin()
        {
            List <HeapNode <TriMesh.Vertex> > unMergable = new List <HeapNode <TriMesh.Vertex> >();
            HeapNode <TriMesh.Vertex>         node       = heap.Pull();

            while (node != null)
            {
                foreach (var hf in node.Item.HalfEdges)
                {
                    if (TriMeshModify.IsMergeable(hf.Edge))
                    {
                        foreach (var item in unMergable)
                        {
                            heap.Add(item);
                        }
                        Vector3D pos = hf.ToVertex.Traits.Position;
                        return(new MergeArgs()
                        {
                            Target = hf.Edge, Pos = pos
                        });
                    }
                }
                unMergable.Add(node);
                node = heap.Pull();
            }
            return(null);
        }
示例#2
0
        protected override MergeArgs GetMin()
        {
            List <HeapNode <TriMesh.Edge> > unMergable = new List <HeapNode <TriMesh.Edge> >();
            HeapNode <TriMesh.Edge>         node       = heap.Pull();

            while (node != null && !TriMeshModify.IsMergeable(node.Item))
            {
                unMergable.Add(node);
                node = heap.Pull();
            }

            foreach (var item in unMergable)
            {
                heap.Add(item);
            }

            if (node == null)
            {
                return(null);
            }
            else
            {
                Vector3D pos = this.GetPos(node.Item);
                return(new MergeArgs {
                    Target = node.Item, Pos = pos
                });
            }
        }