Isosurface.ManifoldDC.OctreeNode.ConstructBase C# (CSharp) Method

ConstructBase() public method

public ConstructBase ( int size, float error, List &vertices ) : void
size int
error float
vertices List
return void
        public void ConstructBase(int size, float error, ref List<VertexPositionColorNormalNormal> vertices)
        {
            this.index = 0;
            this.position = Vector3.Zero;
            this.size = size;
            this.type = NodeType.Internal;
            this.children = new OctreeNode[8];
            this.vertices = new Vertex[0];
            this.child_index = 0;
            int n_index = 1;
            ConstructNodes(vertices, ref n_index, 4);
        }

Usage Example

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);
        }
All Usage Examples Of Isosurface.ManifoldDC.OctreeNode::ConstructBase