Ejemplo n.º 1
0
        public static int AddBuffer(this glTF self, IBytesBuffer bytesBuffer)
        {
            var index = self.buffers.Count;

            self.buffers.Add(new glTFBuffer(bytesBuffer));
            return(index);
        }
Ejemplo n.º 2
0
        public int AddBuffer(IBytesBuffer bytesBuffer)
        {
            var index = buffers.Count;

            buffers.Add(new glTFBuffer(bytesBuffer));
            return(index);
        }
Ejemplo n.º 3
0
        public void StartReadAndWrite(string srcPath, string destPath, int bufferSize)
        {
            double totalLength = new FileInfo(srcPath).Length;

            _cancellationTokenSource = new CancellationTokenSource();

            if (_buffer == null)
            {
                _buffer = _bufferFactory.ConstructWith(bufferSize).Create();
            }
            else
            {
                _buffer.Reset(bufferSize);
            }

            _reader = _readerFactory.ConstructWith(_buffer).And(_cancellationTokenSource).Create();
            _writer = _writerFactory.ConstructWith(_buffer).And(_cancellationTokenSource).Create();

            var readerObs = _reader.GetReadBytesStream(srcPath);
            var writerObs = _writer.GetWriteBytesStream(destPath);

            SubscribeOnProgressChanges(writerObs, totalLength);
            SubscribeOnBufferSizeChanges(readerObs, writerObs, bufferSize);
            SubscribeOnThreadsState();
            SubscribeOnError();
            SubscribeOnComplete();

            readerObs.Connect();
            writerObs.Connect();
        }
Ejemplo n.º 4
0
        protected SuspendableFileWorker(IBytesBuffer buffer, IFile fileWrapper, CancellationTokenSource cancellationTokenSource)
        {
            Buffer = buffer;
            CancellationTokenSource = cancellationTokenSource;
            FileWrapper             = fileWrapper;

            PauseTokenSource = new PauseTokenSource();
            _currentStateObs = new BehaviorSubject <WorkerState>(WorkerState.Unstarted);
            _result          = new AsyncSubject <ResultDto>();
        }
Ejemplo n.º 5
0
        public ExportingGltfData(int reserved = default)
        {
            if (reserved == 0)
            {
                reserved = 50 * 1024 * 1024;
            }

            // buffers[0] is export target
            GLTF.buffers.Add(new glTFBuffer());
            _buffer = new ArrayByteBuffer(new byte[reserved]);
        }
Ejemplo n.º 6
0
 public void OpenStorage(string baseDir, ArraySegment <Byte> glbDataBytes)
 {
     if (string.IsNullOrEmpty(uri))
     {
         Storage = new ArraySegmentByteBuffer(glbDataBytes);
     }
     else
     {
         Storage = new UriByteBuffer(baseDir, uri);
     }
 }
Ejemplo n.º 7
0
        public void OpenStorage(string baseDir, IStorage storage)
        {
            Storage = new ArraySegmentByteBuffer(storage.Get(uri));

            /*
             * if (string.IsNullOrEmpty(uri))
             * {
             *  Storage = (glbDataBytes);
             * }
             * else
             * {
             *  Storage = new UriByteBuffer(baseDir, uri);
             * }
             */
        }
Ejemplo n.º 8
0
 public glTFBuffer(IBytesBuffer storage)
 {
     Storage = storage;
 }
Ejemplo n.º 9
0
 public static glTFBufferView Extend <T>(this IBytesBuffer buffer, T[] array, glBufferTarget target) where T : struct
 {
     return(buffer.Extend(new ArraySegment <T>(array), target));
 }
 public void OpenStorage(IStorage storage)
 {
     Storage = new ArraySegmentByteBuffer(storage.Get(uri));
 }
Ejemplo n.º 11
0
 public FileReader(IBytesBuffer buffer, IFile fileWrapper, CancellationTokenSource cancellationTokenSource)
     : base(buffer, fileWrapper, cancellationTokenSource)
 {
 }
Ejemplo n.º 12
0
 public glTFBuffer(IBytesBuffer storage)
 {
     m_buffer = storage;
 }
Ejemplo n.º 13
0
 public GLTFBuffer(IBytesBuffer storage)
 {
     _storage = storage;
 }