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.

82 lines
2.4 KiB
C++

This file contains ambiguous Unicode characters!

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文件操作类
//主要功能:
//
//程序编写: 2005-12-07
//
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
class AFX_EXT_CLASS CSectionCube
{
public:
CSectionCube(void);
virtual ~CSectionCube(void);
public:
virtual BOOL Open(void);
virtual void Close(void);
virtual void Clear(void);
virtual BOOL Create(LPCTSTR lpIni3D);
int Create(CString posFile, CString segyFile, int n, double dt, int IsPC, int nFormatCode);
BOOL IsOpen(void);
double A(int k); //根据内部CurrentNo变量获得第K个数据
double A(int i, int j, int k); //根据相对线道号获得该道的第K个数据
double A(int i, int j, double tk);
int GetMN(int& m, int& n); //根据实际线道号获得内部线道号
double RA(int m, int n, int k); //根据实际线道号获得该道的第K个数据
double RA(int m, int n, double tk);
//获得指定区间内的振幅值idea=1求总和2求平均值3求振幅绝对值最大值
virtual BOOL GetRangeSwing(int i, int j,double bt0, double et0, double& swing, int idea);
//根据开始结束时间获得内部开始结束号,当完全在范围外时返回FALSE
BOOL GetIndexInHouse(int &bj, int &ej, double bt0, double et0);
//m,n为内部线道号
int ReadSwing(int i, int j, int beginIndex, int endIndex, double* pv); //获得区间内的振幅值
double ReadOneData(CFileSegy* pFile); //根据当前CurrentNo变量读取CDimension3D文件中的一个数据
void SetCurrentNo(int i, int j); //设置CurrentNo的值
BOOL IsInHouse(int i, int j); //是否在内部线道号范围内
//根据指定的线道号写SEGY文件,m为道号n为线号,nProcessMode(0为拷贝1为导数2为深度剖面)
//nSampleNum与nSampleIntervel的值小于0时按照当前SEGY的参数输出
int Write(CString m_output, int m1, int n1, int m2, int n2, int nSampleNum=-1, int nSampleIntervel=-1, int nProcessMode=0, int nFormatCode=1);
//读取P.F(x,y)文件中的值
__int64 ValueP(int i, int j);
public:
int num[2];
double P0[2];
double delt[2];
int IsPC;
int n; //采样个数
double dt; //采样间隔
int m_nFormatCode; //格式代码
CString m_vFile; //速度场文件
int m_nIdeaV; //速度场
CString m_sx; //x.f(x,y)
CString m_sy; //y.f(x,y)
CString m_posFile;
CString m_segyFile;
CFileSegy::EDataType GetFormatCode(void);
protected:
BOOL InitWithPosition(void);
__int64 Position(void);
CFileSegy *fa;
CFileSegy *fp;
int CurrentNo;
};
inline CFileSegy::EDataType CSectionCube::GetFormatCode(void)
{
return (CFileSegy::EDataType)m_nFormatCode;
}