Ejemplo n.º 1
0
        private C3DFile(Stream stream)
        {
            C3DReader reader = null;

            try
            {
                reader = new C3DReader(stream);

                this._processorType       = reader.CreateProcessorType;
                this._header              = reader.ReadHeader();
                this._parameterDictionary = reader.ReadParameters();
                this._frameCollection     = new C3DFrameCollection();

                try
                {
                    C3DParameterCache paramCache = C3DParameterCache.CreateCache(this);
                    C3DFrame          frame      = null;
                    while ((frame = reader.ReadNextFrame(paramCache)) != null)
                    {
                        this._frameCollection.Add(frame);
                    }
                }
                catch { }
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public void WriteC3DFile(C3DFile file)
        {
            this._dataStartOffset        = 0;
            this._newDataStartBlockIndex = 0;

            this._writer.Write(new Byte[C3DConstants.FILE_SECTION_SIZE]);
            this.WriteParameters(file.Header.FirstParameterSectionID, file.Parameters);

            C3DParameterCache paramCache = C3DParameterCache.CreateCache(file);

            this.WriteFrameCollection(paramCache, file.AllFrames);

            this.UpdateHeaderAndParameters(file);
            this.WriteHeader(file.Header);
        }
Ejemplo n.º 3
0
 public C3DFrame ReadNextFrame(C3DParameterDictionary dictionary)
 {
     return(this.ReadNextFrame(C3DParameterCache.CreateCache(dictionary)));
 }