ConstructBase() public method

public ConstructBase ( int size, float error, List &vertices ) : void
size int
error float
vertices List
return void
Ejemplo 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);
        }
Ejemplo 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;
        }