public void Build(int size, int min_size, float threshold, int grid_size, List<VertexPositionColorNormal> vertices) { this.size = size; position = Vector2.Zero; leaf = false; TrySplit(min_size, threshold, grid_size, vertices); }
public override long Contour(float threshold) { Stopwatch watch = new Stopwatch(); Vertices.Clear(); Tree = new QuadtreeNode(); OutlineLocation = 0; watch.Start(); Tree.Build(Resolution, 1, threshold, this.Size, Vertices); DualGridCount = Vertices.Count; if (DualGridCount > 0) { DualGridBuffer.SetData <VertexPositionColorNormal>(Vertices.ToArray()); } CalculateIndexes(); watch.Stop(); ConstructTreeGrid(Tree); return(watch.ElapsedMilliseconds); }