////////////////////////////////////////////////////////////////////////////// //文件: SegY格式文件操作 //主要功能: // //程序编写: //日期:2005-12-07 // // ///////////////////////////////////////////////////////////////////////////// #pragma once #include "..\DrawLocal\FileSegy.h" #include "format.h" #include "formatitem.h" namespace NMxn { class AFX_EXT_CLASS CMxnBase { public: CMxnBase(void); virtual ~CMxnBase(void); public: CFormatItem item; //当前格式的描述 char * head; //文件头 virtual int Initialize(CString name); virtual void Close(void); __int64 GetTotalTraceNumber() { return m; } int GetSampleNumber() { return n; } double GetSampleInterval() { return m_SampleInterval; } int GetFormatCode(void) { return m_nFormatCode; } int GetSampleByteLength(void) { return sz;} CString GetSegyName(void) { return m_segy; } CFileSegy* GetFile(void) { return &fr; } BOOL OpenSegy(void); BOOL OpenSegyWrite(void); BOOL OpenSegyReadWrite(void); void CloseSegy(void); BOOL IsOpenSegy(void) { return fr.IsOpen(); } void operator=(CMxnBase& mb); __int64 SeekToTrace(__int64 nTraceIndex); //定位到指定道 __int64 GetTracePos(__int64 nTraceIndex); //获得指定道在文件中的位置 double BinaryToDouble(CBinaryPosition &fmt, int origin);//origin=SEEK_SET,SEEK_CUR,SEEK_END double DoubleToBinary(double val, CBinaryPosition &fmt, int origin); public: CString m_segy; CFormat format; CFileSegy fr; long m, n; //m为文件中总的道数,n为每道的采样点个数 int sz; //每个采样点的字节长度 int m_nFormatCode; //振幅数据的格式代码,1=IBM float,5=IEEE float double m_SampleInterval; //采样间隔 }; }//namespace using namespace NMxn;