Isosurface.ManifoldDC.MDC3D.Contour C# (CSharp) Method

Contour() public method

public Contour ( float threshold ) : long
threshold float
return long
        public override long Contour(float threshold)
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();
            if (tree == null)
            {
                VerticesDN.Clear();
                tree = new OctreeNode();
                List<VertexPositionColorNormalNormal> vs = new List<VertexPositionColorNormalNormal>();

                tree.ConstructBase(Resolution, 0, ref vs);
                tree.ClusterCellBase(0);
                //VerticesDN = vs.ToList();

                tree.GenerateVertexBuffer(VerticesDN);

                if (VerticesDN.Count > 0)
                    VertexBuffer.SetData<VertexPositionColorNormalNormal>(VerticesDN.ToArray());
                VertexCount = VerticesDN.Count;
            }

            OutlineLocation = 0;
            //ConstructTreeGrid(tree);
            CalculateIndexes(threshold);
            watch.Stop();

            return watch.ElapsedMilliseconds;
        }