示例#1
0
        protected override void AfterMerge(TriMesh.Vertex v)
        {
            foreach (var edge in this.removed)
            {
                this.heap.Del(this.handle[edge.Index]);
            }

            foreach (TriMesh.Edge edge in v.Edges)
            {
                ErrorPair pair = CalculateError(edge);
                this.edgeError[edge.Index] = pair;
                this.heap.Update(this.handle[edge.Index], pair.Error);
            }
        }
示例#2
0
        protected override void AfterMerge(HalfEdgeMesh.Vertex v)
        {
            foreach (var face in this.removed)
            {
                this.heap.Del(handle[face.Index]);
            }

            this.traits.MergeUpdate(v);
            foreach (var face in v.Faces)
            {
                ErrorPair pair = this.GetErrorPair(face);
                this.faceError[face.Index] = pair;
                this.heap.Update(handle[face.Index], pair.Error);
            }
        }
示例#3
0
        protected override void Init()
        {
            this.heap      = new MinHeapTwo <TriMesh.Face>(this.Mesh.Faces.Count);
            this.handle    = new HeapNode <TriMesh.Face> [this.Mesh.Faces.Count];
            this.faceError = new ErrorPair[this.Mesh.Faces.Count];
            this.traits    = new TriMeshTraits(this.Mesh);
            this.traits.Init();

            foreach (TriMesh.Face face in this.Mesh.Faces)
            {
                ErrorPair pair = this.GetErrorPair(face);
                this.faceError[face.Index] = pair;
                this.handle[face.Index]    = heap.Add(pair.Error, face);
            }
        }
示例#4
0
        protected override void Init()
        {
            this.heap         = new MinHeap <TriMesh.Edge>(this.Mesh.Edges.Count);
            this.handle       = new HeapNode <TriMesh.Edge> [this.Mesh.Edges.Count];
            this.vertexMatrix = new TriMesh.VertexDynamicTrait <Matrix4D>(this.Mesh);
            this.edgeError    = new ErrorPair[this.Mesh.Edges.Count];
            this.traits       = new TriMeshTraits(this.Mesh);
            this.traits.Init();

            this.SimplifyComputeInitQ();

            foreach (TriMesh.Edge edge in this.Mesh.Edges)
            {
                ErrorPair pair = CalculateError(edge);
                this.edgeError[edge.Index] = pair;
                this.handle[edge.Index]    = this.heap.Add(pair.Error, edge);
            }
        }