ClusterCellBase() public method

public ClusterCellBase ( float error ) : void
error float
return void
Esempio n. 1
0
        public override long Contour(float threshold)
        {
            Stopwatch watch = new Stopwatch();

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

                tree.ConstructBase(Resolution, threshold, ref vs);
                tree.ClusterCellBase(threshold);
                //Vertices = vs.ToList();

                tree.GenerateVertexBuffer(Vertices);

                if (Vertices.Count > 0)
                {
                    VertexBuffer.SetData <VertexPositionColorNormal>(Vertices.ToArray());
                }
                VertexCount = Vertices.Count;
            }

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

            return(watch.ElapsedMilliseconds);
        }
Esempio n. 2
0
        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;
        }