www.pudn.com > Qtwritereadsegy.rar > demo.cpp, change:2013-03-04,size:693b


#include "sgywriter.h" 
 
int main( int argc, char* argv[] ) 
{ 
	SgyWriter porCube("por.sgy", SgyIO::BigEndian | SgyIO::IBMFloat); 
 
	float refStep = 2000; 
	int ns = 5000; 
 
	RollHeader rh; 
	TraceHeader th; 
 
	rh.hdt = refStep; 
	rh.hns = ns; 
 
	porCube.writeRollHeader(rh); 
 
	float* trcData = new float[ns]; 
 
	memset( trcData, 0, ns*sizeof(float) ); 
 
	for( int inl = 100; inl <= 200; inl++ ) 
		for( int crl = 300; crl <= 400; crl++ ) 
		{ 
			th.fldr= inl ; 
			th.cdp = crl ; 
 
			th.sx = inl; 
			th.sy = crl; 
			th.gx = inl; 
			th.gy = crl; 
 
			porCube.writeTraceHeader(th); 
			porCube.writeTraceData(trcData, ns); 
		} 
 
 
		porCube.close(); 
 
	delete [] trcData; 
}