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(); } } }
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); }
public C3DFrame ReadNextFrame(C3DParameterDictionary dictionary) { return(this.ReadNextFrame(C3DParameterCache.CreateCache(dictionary))); }