public BufferedArray(CountedEnumerable <byte> source, int initialBufferSize)
        {
            Contracts.Requires.That(source.Values != null);
            Contracts.Requires.That(initialBufferSize >= 0);

            this.source      = source.Values.GetEnumerator();
            this.sourceCount = source.Count;
            this.buffer      = new ExpandableArray <byte>(initialBufferSize);
        }
Example #2
0
        /// <inheritdoc />
        public void CopyIn(IDivisibleMesh <TVertex> mesh, VertexWindingOrder winding)
        {
            IMeshDataTransferContracts.CopyIn(this, mesh, winding);

            var triangles = mesh.GetTriangles(winding);

            this.IndicesCount = triangles.Count;
            this.indices.CopyIn(
                CountedEnumerable.New(triangles.Select(index => (ushort)index), triangles.Count));

            this.VerticesCount = mesh.Vertices.Count;
            this.vertices.CopyIn(mesh.Vertices.AsCounted(), this.MaxVertices);
        }
 public BufferedArray(CountedEnumerable <byte> source)
     : this(source, ByteLength.Decimal)
 {
 }