You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
//////////////////////////////////////////////////////////////////////////////
//文件: SegY文件操作类
//主要功能:
//
//程序编写: 2011-4-1
//
//
/////////////////////////////////////////////////////////////////////////////
# pragma once
# include "SeisSampleInfo.h"
# include "SeisTraceData.h"
namespace NSeis
{
//地震剖面中一道数据的读取操作
class AFX_EXT_CLASS CSeisTraceReader
{
public :
CSeisTraceReader ( ) ;
~ CSeisTraceReader ( void ) ;
//仅仅设置文件头与道头指针,该函数必须调用*******************
void SetSampleInfo ( unsigned short sn , unsigned short si , CFileSegy : : EDataType type , BOOL bSwap ) ;
void SetSampleInfo ( const CSeisSampleInfo & info ) ;
CSeisTraceData * GetTraceData ( ) { return m_pData ; }
CSeisSampleInfo & GetSampleInfo ( ) { return m_sampleInfo ; }
//根据文件头及道头信息进行内存申请, 如果直接使用Attach时, 不用调用该函数
bool Initialize ( ) ;
void Clear ( ) ;
//读取一道的数据,并根据格式代码进行转换,道定位需要在外部完成
int Read ( CFileSegy & fr ) ;
//根据m_sampleInfo中定义的时间方向范围读取振幅数据, 使用该函数前需要定位到该道开始位置
int ReadRange ( CFileSegy & fr ) ;
//将指定指针进行绑定, 如果不进行Detach则对象销毁时将对该指针进行删除操作
void Attach ( CSeisTraceData * pData ) ;
CSeisTraceData * Detach ( void ) ; //返回数据指针,将内部置空
//获得该道中第nIndex个索引振幅值
inline double GetValue ( int nIndex ) { return m_pData - > GetValue ( nIndex , m_sampleInfo . GetFormatCode ( ) ) ; }
public :
CSeisSampleInfo m_sampleInfo ; //采样点信息定义,需要提前指定
protected :
CSeisTraceData * m_pData ; //道数据
} ;
} //namespace NSeis