示例#1
0
 public StringDictionaryBuilder Clear()
 {
     Entries.Clear();
     IndicesBuffer.Clear();
     NullBitmap.Clear();
     NextIndex = 0;
     return(this);
 }
示例#2
0
        public void Dispose()
        {
            VerticesBuffer.Dispose();
            IndicesBuffer.Dispose();

            VerticesBuffer = null;
            IndicesBuffer  = null;
        }
示例#3
0
        public TBuilder Append(TFrom value)
        {
            var convertedVal = ConvertTo(value);
            var temp         = new DictionaryEntry(convertedVal, Comparer, HashFunction);

            if (!Entries.TryGetValue(temp, out var index))
            {
                index = NextIndex++;
                Entries.Add(temp, index);
                ValuesBuffer.Append(convertedVal);
            }

            IndicesBuffer.Append(index);
            return(Instance);
        }
示例#4
0
        public Cubo()
        {
            cantidadDeVertices = GetVertices().Length / 5;
            cantidadDeIndices  = GetIndices().Length;

            bufferDeVertices = new VerticesBuffer(GetVertices(), GetVertices().Length *sizeof(float));
            bufferDeIndices  = new IndicesBuffer(GetIndices(), GetIndices().Length);

            SetShader();

            textura = new Textura("d:/ginno/Documents/Visual Studio 2017/Projects/Tarea1Grafica/Tarea1Grafica/Recursos/wall.png");
            textura.Use();

            arregloDeVertices = new VerticesArreglo();
            arregloDeVertices.enlazar();

            bufferDeVertices.enlazar();
            bufferDeIndices.enlazar();

            arregloDeVertices.añadirBuffer(bufferDeVertices, shader);

            CalcularMatrizModelo();
        }
示例#5
0
            /// <inheritdoc />
            public StringDictionaryBuilder Append(string value)
            {
                if (value == null)
                {
                    NullBitmap.Append(0);
                    IndicesBuffer.Append(-1); // need something in the indices buffer to make sure it makes sense
                    NullCount++;
                    return(this);
                }


                var temp = new DictionaryEntry(value, Comparer, HashFunction);

                if (!Entries.TryGetValue(temp, out var index))
                {
                    index = NextIndex++;
                    Entries.Add(temp, index);
                    AppendStringToBuffer(value);
                }

                NullBitmap.Append(1);
                IndicesBuffer.Append(index);
                return(this);
            }
示例#6
0
 public void Rebuild()
 {
     VerticesBuffer.UpdateBuffer(vertices);
     IndicesBuffer.UpdateBuffer(indices);
 }
示例#7
0
            public override FloatDictionaryArray Build(MemoryAllocator allocator)
            {
                allocator = allocator ?? MemoryAllocator.Default.Value;

                return(new FloatDictionaryArray(IndicesBuffer.Length, ValuesBuffer.Length, IndicesBuffer.Build(allocator), ValuesBuffer.Build(allocator),
                                                ArrowBuffer.Empty));
            }
示例#8
0
 public StringDictionaryBuilder Resize(int length)
 {
     IndicesBuffer.Reserve(length);
     return(this);
 }
示例#9
0
 public StringDictionaryBuilder Reserve(int capacity)
 {
     IndicesBuffer.Reserve(capacity);
     return(this);
 }
示例#10
0
 public StringDictionaryArray Build(MemoryAllocator allocator)
 {
     ValueOffsets.Append(Offset);
     return(new StringDictionaryArray(IndicesBuffer.Length, Entries.Count, NullBitmap.Build(allocator), IndicesBuffer.Build(allocator),
                                      ValueBuffer.Build(allocator), ValueOffsets.Build(allocator), NullCount));
 }